Skip to content Skip to sidebar Skip to footer

Pycharm Opening When I Run .py File From Batch File

I have created a batch file that is opening a Python Code that I programmed in PyCharm. But when I open the batch file that is opening my Python Code, then PyCharm randomly opens a

Solution 1:

I think the reason Pycharm is randomly opening is because on your Windows computer, that's the default application to open for Python files. Running "c:\Users\golle\PycharmProjects\Test\server.py" is essentially the same as double clicking on it from the file explorer.

What you need to do is have python execute the file, instead of trying to run the file directly.

It would look something like this:

python "c:\Users\golle\PycharmProjects\Test\server.py"

This assumes that python is in your PATH.

Post a Comment for "Pycharm Opening When I Run .py File From Batch File"