file-location

Python Module not found ONLY when .py file is on desktop

Python Module not found ONLY when .py file is on desktop Question: Only for a .py file that is saved on my Desktop, importing some modules (like pandas) fail due to Module not found from an import that happens within the module. This behaviour doesn’t happen when the file is saved to a different location. …

Total answers: 2

How to get the current working directory using python 3?

How can I make my program have a consistent initial current working directory? Question: When I run the following script in IDLE import os print(os.getcwd()) I get output as D:testtool but when I run from cmd prompt, I get c:Python33>python D:testtoolcurrent_dir.py c:Python33 How do I get same result which I got using IDLE ? Asked …

Total answers: 3