Vas23Vewe
Vas23Vewe

Reputation: 101

How to run 'quit command' for terminal from PyCharm? For Mac

How can I run command for terminal from PyCharm?

For example, next command:

osascript -e 'quit app "/Applications/Google Chrome.app"'

No problem to run it from terminal, but because of the quotation marks I receive error in PyCharm. I wrote next:

os.system ('osascript -e 'quit app "/Applications/Google Chrome.app"'')

And failed.

Is there any solution?

Upvotes: 0

Views: 350

Answers (1)

AirKetchup
AirKetchup

Reputation: 198

You can wrap the string in """(3 double quotes)
e.g.

"""osascript -e 'quit app "/Applications/Google Chrome.app"'"""

Upvotes: 2

Related Questions