You can run Python in PowerShell the same way as from the command bar.
Continue readingCategory Archives: Python
Convert string to datetime in Python
When we develop applications, the problem we often face is a string to datetime conversion. We have to deal with different formats and time zones. Sometimes we need to convert dates and times to human-readable format, and vice versa.
Continue readingPassing a list to a function in Python
You can pass a list as an argument of Python function the same way as any other type and it will be the same type inside the function.
Continue readingEnglish dictionary in Python
If you need to check, whether a particular word is a word in the English dictionary, you can do it in Python.
Continue readingRead a file in Python
With a few lines of code, you can read a file in Python.
You have to specify an absolute path to the file you want to read, or you can specify the current working directory.
Continue readingCreate a Python file in terminal
You can create a Python file directly from the terminal. Follow these steps to do it:
Continue readingPrinting subscript and superscript in Python
Subscript and superscript are important when you are dealing with different types of formulas. They are useful in math, chemistry, etc.
Continue readingPickle Module for saving objects in Python
This lesson is about the Python module called pickle. I’ll tell you what is pickle and how you can use it in Python.
Continue readingInsert value at the beginning of the list in Python
The append method adds an element at the end of the list. No function will add an element at the beginning of a list, but there is a method called insert, that you can use to insert an element in any place you want.
Continue readingGet the day of the week from a date in Python
To return the day of the week from a string, you have to import the datetime module and run this code:
Continue reading