1

i just observed the difference in the path for the cmd and idle. I tried this:

(IN IDLE)
>>> import sys
>>> sys.path
['', 'C:\\Python27\\Lib\\idlelib', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
>>> sys.executable
'C:\\Python27\\pythonw.exe'

while:

(IN CMD)
>>> import sys
>>> sys.path
['', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\l
ib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27,
C:\\Python27\\lib\\site-packages']
>>> sys.executable
'C:\\Python27\\python.exe'

My question is that why there is a difference between the python executables of cmd and idle(for idle it is pythonw.exe while for cmd it is python.exe) and how can i permanently make the sys.path point to same paths for cmd as well as idle as using sys.path.append() will do it temporaraily.Also,i want to know what is the difference between PYTHONPATH and system path.I know ; i have asked many questions but answers will very helpful. THANKS.

3
  • 3
    Please restrict your questions to one question per stackoverflow question. If you have multiple questions, well, open multiple stackoverflow questions (don't worry, they're free!). As it stands, I have no idea what your actual problem is - for example, you mention getpass and getopt at first, but the code doesn't feature them at all. The difference between pythonw.exe and python.exe is almost certainly irrelevant here. And while you can set up paths permanently, the pertinent question is why you would want to do that in the first place.
    – phihag
    Oct 15, 2013 at 14:26
  • There seems to be no difference for me. I'm using Python 2.7.5 Oct 15, 2013 at 14:35
  • Sorry,the earlier topic was quite misleading and it was my fault that i had some .py files with the same names of my modules in the current working directory.I'm really sorry for that.
    – darxtrix
    Oct 15, 2013 at 16:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.