I'm using IntelliJ IDEA 14 Ultimate
and I'd like to run a Python script (in a Tomcat server) from within the IDE.
I did it on Windows but it's not cross platform and I think it's a trick...
This is what I did:
- I defined
C:\Python27\python.exe
as Program - I added my script as a parameter :
initDB.py
Screenshot: New external tools
It works well on Windows but I have to redefine this path on my other computers and my collaborators must do it too.
So my question is: can I use a Python script as an external tool without specifying my script as a parameter
?
Thanks for the help.
There are a few things you can do to improve the situation a bit.
As described in Single script to run in both Windows batch and Linux Bash?, it is possible to create a single script that you can run as a Windows batch file and as a Linux bash file. You could for example create a file
/Freek/Scripts/initDB.cmd
with the following contents:The definition of you external tool is stored in a well readable xml file. For example, on my Windows laptop it is in the file
C:\Users\Freek\.IdeaIC15\config\tools\External Tools.xml
, which contains:This file could be (partially) copied from one machine to another and does not contain any platform dependencies if you can decide on a common directory/link for all operating systems (like
/Freek/Scripts
, which also works on Windows).