0

I'm a complete newcomer in Python.

I'm confused about the concept of working directory.

Let's say I have a file in C:\python_basic\my_folder called 'test.py'.

Then, the directory for test.py would be C:\python_basic\my_folder\test.py .

in test.py, I used the code import os print(os.getcwd())

(which I found out that it prints the current working directory)

and it returned C:\python_basic.

I'm confused because the location of file test.py is C:\python_basic\my_folder but python says the current working directory is C:\python_basic

is the location of the file(directory) different from working directory?

Thanks.

kingnum
  • 35
  • 2

0 Answers0