简体   繁体   English

在 IDLE 之外运行 Python 脚本

[英]Running Python Scripts Outside of IDLE

1- i want someone to help with this part 1-我希望有人帮助这部分

https://automatetheboringstuff.com/appendixb/ https://automatetheboringstuff.com/appendixb/

about Running Python Scripts Outside of IDLE and sending command line args.关于在 IDLE 之外运行 Python 脚本和发送命令行参数。

2- i converted my code to.exe by pyinstaller; 2-我通过pyinstaller将我的代码转换为.exe; what's the difference between this and running it这和运行它有什么区别

as a script.作为脚本。

3-how scripts are done. 3-脚本是如何完成的。 i see experienced people says:"i made a script to do something for me " how is that done >?我看到有经验的人说:“我制作了一个脚本来为我做一些事情”这是怎么做的>?

*i'm a beginner so try to make answers simple as possible. *我是初学者,所以尽量使答案简单。

If you're wondering about command line arguments, look into the "argparse" library https://docs.python.org/3/library/argparse.html . If you're wondering about command line arguments, look into the "argparse" library https://docs.python.org/3/library/argparse.html .

The difference in the.exe and the normal script is that that the.exe versions (conventionally) are able to be redistributed to other sytems that don't have python installed whilst still being able to run the script. .exe 和普通脚本的区别在于,.exe 版本(通常)能够重新分发到其他没有安装 python 的系统,同时仍然能够运行脚本。 If you're only making the script for yourself the only real benefit is that you dont have to enter your IDE (code editor) every time you want to run the code, however if it's still in development then you'd have to compile the code every time you made a modification if you're wanting to run the code as an executable, which is very impractical.如果您只是为自己编写脚本,唯一真正的好处是您不必每次运行代码时都输入 IDE(代码编辑器),但是如果它仍在开发中,那么您必须编译如果您想将代码作为可执行文件运行,则每次进行修改时都需要代码,这是非常不切实际的。

Your third part is very, very vague.你的第三部分非常非常模糊。 Python can be very versatile and i recommend you continue looking at the automatetheboringstuff.com website if you're interested in making scripts that can complete repetitive activities (although i must strongly advise you against using scripts maliciously). Python 可以非常通用,如果您有兴趣制作可以完成重复活动的脚本(尽管我必须强烈建议您不要恶意使用脚本),我建议您继续查看automatedtheboringstuff.com 网站。

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

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