简体   繁体   English

使用Python的ABSOLUTE BEGINNER的Python命令行SETUP

[英]Python command line SETUP for ABSOLUTE BEGINNER with Python

I'm "new school" meaning that i've never really used the command prompt(they didn't teach us anything but IDE's in school). 我是“新学校”,这意味着我从未真正使用过命令提示符(除了IDE在学校之外,他们没有教我们任何东西)。 I would like to setup Python using Notepad++ for the editor, and winpdb as my debugger. 我想使用Notepad ++为编辑器设置Python,并将winpdb设置为我的调试器。

I want stuff to work really easy from the cmd prompt but it is not. 我希望从cmd提示符中的内容非常简单,但事实并非如此。

This is what I put in my System Environment: C:\\PYTHON27;C:\\PYTHON27\\DLLs;C:\\PYTHON27\\LIB;C:\\PYTHON27\\LIB\\LIB-TK;C:\\PYTHON27\\LIB\\SITE-PACKAGES; 这就是我在系统环境中放置的内容:C:\\ PYTHON27; C:\\ PYTHON27 \\ DLLs; C:\\ PYTHON27 \\ LIB; C:\\ PYTHON27 \\ LIB \\ LIB-TK; C:\\ PYTHON27 \\ LIB \\ SITE-PACKAGES ;

This is what i want to have happen (but it doesn't work, doesn't load python or the script): python myscript.py Then it should run the interpreter. 这是我想要发生的(但它不起作用,不加载python或脚本):python myscript.py然后它应该运行解释器。 I'd like it to find my script file wherever it may be. 我希望它能找到我的脚本文件,无论它在哪里。

Can someone baby-step me through this command line setup (the docs expect the user to know how to fluently use the cmd prompt) 有人可以帮助我完成这个命令行设置(文档希望用户知道如何流利地使用cmd提示符)

I just don't want to have to manually put in path every single time I want to do something 我只是不想每次想要做某事时手动输入路径

Also I have Console2, I would rather use this than the standard cmd. 我也有Console2,我宁愿使用它而不是标准的cmd。 How do i get it to have the same functionality that i'm looking for? 我如何让它具有我正在寻找的相同功能?

The PATH doesn't affect where data files are found. PATH不会影响数据文件的找到位置。 (And your script is a data file as far as Windows is concerned). (就Windows而言,您的脚本是一个数据文件)。 You should cd C:\\Path\\to\\folder\\with\\your\\scripts when you open your command prompt, and then you'll be able to python myscript.py from there. 当你打开命令提示符时,你应该用cd C:\\Path\\to\\folder\\with\\your\\scripts ,然后你就可以从那里使用python myscript.py了。

(You might like to make a dedicated shortcut to the command prompt with "Start in" set to your script directory, so you don't have to cd every time.) (您可能希望为命令提示符创建一个专用快捷方式,并将“Start in”设置为您的脚本目录,因此您不必每次都使用cd 。)

The same should apply to Console2. 这同样适用于Console2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM