How can I add a default path to look for python script files in?

后端 未结 4 1127
醉话见心
醉话见心 2020-12-10 13:50

I\'ve always had a bit of trouble figuring out how to get Python set up properly in Windows.

I\'ve already set up path=%path%;C:\\python27 , so I\'m able to open .py

4条回答
  •  悲哀的现实
    2020-12-10 14:31

    Please, follow a tutorial

    sys.path.append(r'C:\Users\Jimmy\Documents\Python') 
    

    You can't randomly put \ in a string.

    When you look at the error message, notice that all of the System-supplied path elements have \\ to escape the meaning of the \.

    A tutorial will show you how to use r" strings to achieve this easily.

提交回复
热议问题