You can use the os
module in Python to get the current working directory. Here's an example:
main.py98 chars5 lines
The getcwd
function from os
module returns the current working directory as a string. You can store it in a variable and print it out as shown in the example.
gistlibby LogSnag