简体   繁体   English

当 PyCharm 打开时运行 python 文件

[英]Run python file when PyCharm opens

I am trying to run two Python Scripts when PyCharm Professional Opens.当 PyCharm Professional 打开时,我正在尝试运行两个 Python 脚本。 Ideally, the program would not run in the PyCharm console.理想情况下,该程序不会在 PyCharm 控制台中运行。 Any help would be much appreciated.任何帮助将非常感激。

Running two python files on the PyCharm Professional easy.在 PyCharm Professional 上轻松运行两个 python 文件。

For instance:例如:

This is my first main.py file:这是我的第一个main.py文件:

在此处输入图像描述

Then I right-click on the PyCharm Professional, open the 2nd project然后我右击PyCharm Professional,打开第二个项目

在此处输入图像描述

PyCharm asks me: PyCharm 问我:

在此处输入图像描述

Click on the New Window button.单击新建 Window 按钮。 Now you have two windows next to each other:现在您有两个相邻的 windows:

在此处输入图像描述

You can either run or debug both of them at the same time.您可以同时运行或调试它们。

在此处输入图像描述

From above you can see, PyCharm executes both files at the same time.从上面可以看到,PyCharm 同时执行了两个文件。

You can also do this in the same project or you can run or debug multiple projects at the same time您也可以在同一个项目中执行此操作,也可以同时运行或调试多个项目

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

相关问题 当我双击 .py 文件时 GUI 会打开,但当我在 pycharm 中运行它时不会打开 - GUI opens when i double cklick the .py file, but doesn't when i run it in pycharm 无法在 PyCharm 上运行 python 文件 - Cannot run python file on PyCharm PyCharm 运行 Python 文件总是会打开一个新的控制台 - PyCharm running Python file always opens a new console Pycharm:只运行我的 Python 文件的一部分 - Pycharm: run only part of my Python file 如何在pycharm中以管理员权限运行python文件 - How to run python file with admin rights in pycharm 无法在PyCharm中运行python文件 - Can't run python file in PyCharm 当运行单个脚本文件时,Python 2.7 UnitTest可以很好地运行,但是在Pycharm运行/调试配置中运行文件夹时,它会失败 - Python 2.7 UnitTest works well when run the single script file, but it failed when run the folder in Pycharm Run/Debug Configurations 当我运行它的 .py 文件时,无法在 python 中写入文件。 但是当我在pycharm中运行它时,它确实有效 - Can't write files in python when I run it's .py file. But when I run it in pycharm, it actually work .py 文件打开 PyCharm 而不是运行脚本 - .py file opens PyCharm instead of running the script 当我用 python 运行这个 selenium 代码时,谷歌打开一秒钟然后关闭 - When I run this selenium code with python, google opens for a second and then closes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM