简体   繁体   English

如何保存和运行我在 Pycharm 中更改的脚本?

[英]How do I save and run a script I've altered in Pycharm?

I'm trying to learn some basics from an online course here so bear with me please?我正在尝试从这里的在线课程中学习一些基础知识,所以请多多包涵?

I have an example script which i ran and this error;我有一个我运行的示例脚本和这个错误;

the following arguments are required: source_ip, destination_ip需要以下 arguments:source_ip、destination_ip

In my unknowing brain it means i need to actually add the ip addresses yes?在我不知情的大脑中,这意味着我需要实际添加 ip 地址是吗? It's kind of irrelevant really if I'm wrong I'm more interested in how I alter an existing script through Pycharm save it as a different name, then run that that script in my terminal which is gitbash?如果我错了,这真的有点无关紧要我更感兴趣的是如何通过 Pycharm 更改现有脚本,将其保存为不同的名称,然后在我的终端中运行该脚本,即 gitbash?

So I opened the script in Pycharm and added the ip addresses.所以我在 Pycharm 中打开脚本并添加了 ip 地址。 How do I save that script as a different name and then run it through pycharm?如何将该脚本另存为其他名称,然后通过 pycharm 运行它?

If you select Run , Edit Configurations... on Pycharm top menu, you will see a screen to define the arguments used when you run your python script: If you select Run , Edit Configurations... on Pycharm top menu, you will see a screen to define the arguments used when you run your python script: 在此处输入图像描述 In the Parameters box you can enter the actual values of the parameters you want to use.在“ Parameters ”框中,您可以输入要使用的参数的实际值。 I entered names in the example, but you should see the actual parameters values you would pass to the function from the command prompt.我在示例中输入了名称,但您应该会看到从命令提示符传递给 function 的实际参数值。 That will pass the configured parameters to your script every time you run it in Pycharm.每次您在 Pycharm 中运行它时,都会将配置的参数传递给您的脚本。

暂无
暂无

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

相关问题 如何在PyCharm中运行包含同一项目中另一个脚本的脚本? (两个脚本都在PyCharm中) - How do I run a script in PyCharm that incorporates another script from the same project? (both scripts are in PyCharm) 如何使用PyCharm运行doctests? - How do I run doctests with PyCharm? 如何在 Pycharm 上运行 Pygame - How do I run Pygame on Pycharm 如何在PyCharm中运行命令而不必运行整个脚本? - How do I run commands in PyCharm without having to run the whole script? 如何从 Mac 的 Spotlight 运行 Python 脚本(而不必打开终端或 Pycharm)? - How Do I Run a Python Script from Mac's Spotlight (Instead of Having to Open Terminal or Pycharm)? 如何从Pycharm分离运行python脚本以便它继续附加到文件? - How do I detach python script run from Pycharm so it keeps appending to files? 如何在 Pycharm 终端中使用 python-evtx 库运行脚本? - How do I run script with python-evtx library, from with in the Pycharm terminal? 如何像在 PyCharm 中那样快速运行 VSCode 中最后执行的脚本(不是我当前正在查看/编辑的脚本)? - How can I quickly run the last-executed script in VSCode (not the script I'm currently viewing/editing), as one can do in PyCharm? 如何从 pycharm python 脚本运行“pip install”? - How can i run "pip install" from a pycharm python script? 使用PyCharm Professional和Vagrant,如何运行Django服务器? - Using PyCharm Professional and Vagrant, how do I run a Django server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM