2

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.

David Howlett
  • 89
  • 1
  • 8
  • You can probably set matplotlib inline more easily using a [config file](http://ipython.org/ipython-doc/3/config/intro.html). It can either be in the standard config location in `~/.ipython`, or in the working directory where the Qt console gets started. To avoid the command prompt window, you can start it using `pythonw -m IPython.qt`. I'm not sure how to launch it so it immediately runs a script, though. – Thomas K Jun 16 '15 at 00:18
  • Thanks, I used a config file to inline graphs for a few months. In the end I rewrote the whole program with PyQt5 to give it a more conventional GUI with embedded graphs. This solved the shortcut issue as a side effect. – David Howlett Dec 06 '16 at 16:28

0 Answers0