How can I launch a python script in the Qt Console with a windows shortcut?

4.5k views Asked by At

I have written a python program designed to run in the IPython qt console with inline graphs. My end users are factory workers running windows and are not technically sophisticated. I am trying hard to reduce complexity for them.

How can I create a shortcut in windows that launches my program for them in the qt console?

Idea 1

Ask the users to open IPython qt console with the desktop icon then enter:

%run G:\my_app\start.ipy

My start.ipy file consists of 2 lines:

%matplotlib inline
%run G:\my_app\my_app.py

The start.ipy file exists to reduce the number of commands they need to enter from two to one. This system works but I want to avoid it because it requires the users to remember and enter a command correctly.

Idea 2

Create a start.bat file with the flowing code:

ipython qtconsole --matplotlib inline -m my_app

Then put a shortcut to the .bat script on the desktop. This has two issues:

  • The print statements in my_app don't work
  • The black CMD.exe box pops up as well as the qt console

Ideally I would like a way to run an arbitrary .ipy file in qt console using a shortcut.

0

There are 0 answers