I’m using the Windows version of Python 2.7 with IDLE. If I run the following code
import os
os.getcwd()
through IDLE (Run module F5), I get no output in the Python shell. If I double-click on test.py in Explorer, however, the current working directory is displayed.
If I do a print command in IDLE, it shows up.
Why doesn’t os.getcwd() have any output in IDLE, while print does?
os.getcwd()returns a string, to print that string useprint.reprversion) of an expression.