HowTos
Free Video Tutorials
Written Tutorials
💲Paid Courses
Python Shell
Mailing List
About Us
Home/
Top Python How-To Questions
Prettyprint a JSON file.
python
prettyprint
json file
Create a dictionary with list comprehension.
python
dictionary
list comprehension
Profile a script.
python
profile script
Extract extension from filename.
python
filenames
file-extension
Print to stderr in Python.
python
stderr
printing
zen-of-python
Use a pythonic way to create a long multi-line string.
python
string
multilinestring
multiline
Delete a column from a Pandas DataFrame.
pandas
dataframe
column
delete
Read a file line-by-line into a list.
python
string
file
readlines
Rename column names with Pandas.
python
dataframe
pandas replace
rename
Find current directory of a file.
python
directory
file-directory
Change the size of figures drawn with Matplotlib.
python
matplotlib
plot
graph
visualization
Delete a file or folder.
python
directory
delete-file
file-io
Split a list into evenly sized parts.
python
list
split
chunks
Select rows from a DataFrame based on column values with Pandas.
python
pandas
dataframe
Iterate over rows in a DataFrame for Pandas.
python
pandas
dataframe
Copy a file.
python
file
filesystems
file-copying
copy
List all files of a directory.
python
directory
list files
Safely create a nested directory.
python
directory
exception
operating-system
path
Execute a program or call a system command.
subprocess
python shell
terminal
command
Check whether a file exists without exceptions.
python
file
file-exists
Duplicate a file.
python
duplicate file
Append text in a text file.
python
append text
Create a virtual environment.
python
virtual environment
mac
linux
windows
venv
activate venv
Create a new file.
python
create file
write content in file
Merge two lists.
python
lists
add
merge
Extract items from two different lists into one list.
python
zip
lists
extract item
merge lists
Check if a text file is empty.
python
file
check if empty
Create a pandas DataFrame from a dictionary.
python
pandas
dataframe from dictionary
Create a pandas DataFrame from a list.
python
pandas
dataframe from list
Get the last item of a list.
python
list
last item
Top Python What Questions
What is the Python 3 equivalent of “python -m SimpleHTTPServer”
python3
python -m SimpleHTTPServer
Why do Python classes inherit 'object'
python
inheritance
object-class
What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv?
python
venv
virtualenv
pipenv
What ipython
pyenv
virtualenvwrapper
pyvenv
What is the proper way to declare custom exceptions in modern Python?
python
custom-exeptions
declare
How to add an existing venv virtual environment in PyCharm
venv
pycharm
What to do to import files from a different folder in python
python
python-import
importerror
Are static class variables possible in Python?
python
oop
class-variables
static
class
What is __init__.py used for?
python
module
package
python-packaging
What are metaclasses in Python?
python
oop
metaclass
python-class
python-datamodel
Python Classes and OOP Explained
oop
object oriented programming
classes
What is the difference between a staticmethod and a classmethod in Python?
python
classmethod vs staticmethod
static method
instance method
class method
What does "yield" do in a Python function?
python
yield
generator
What is the best virtual environment for Python
python
virtual environment
venv
best
What is if __name__ == "__main__" in Python?
python
__main__
__name__==
Go to Top
Become a Patron
Do you like my work and would want to contribute? You can become a patron on my Patreon below!
Become a Patron