Trying to open a py file inside Pycharm but it opens outside of Pycharm for some reason

Viewed 28
    elif "go online" in result["text"]:
        os.system("clear")
        stream.stop_stream()
        print("Sir: " + result["text"])
        speak("Switching to online mode")
        os.system("open /Users/************/PycharmProjects/K.I.T.T/K"
                  ".I.T.T._online.py")
        quit

Instead of opening a new tab inside Pycharm it just opens 3 windows outside with a different ide? what am i doing wrong?

1 Answers

The .py being inside a PycharmProjects folder doesn't mean that it will open in PyCharm. You can either go into your default program settings and set .py files to always open in PyCharm, or you could open the file from terminal by setting the location of PyCharm as a path variable and calling:

pycharm.sh ~/MyProject
Related