PDA

View Full Version : PyQT application start



mejustme
5th June 2008, 23:00
Hello,

I am writing my first PyQt application, a chat client and i need to find a way to run it, other than typing python app.py in the terminal. I am using Linux and I don't know how to make a script to run it.

thanks

jacek
6th June 2008, 00:30
You can add:
#!/usr/bin/env python as the first line of your script and then run "chmod 755 app.py" to make it executable.

mejustme
6th June 2008, 18:15
Thanks, it worked! :)

-> #!usr/bin/env python in my app.py file
-> changed permissions
-> and used this script:
#!/bin/bash
dir_name=$0
if [ -L $dir_name ]; then
dir_name=`readlink $dir_name`
fi
dir_name=`dirname $dir_name`
cd $dir_name
ulimit -s 1024
python intro.pyw
-> created a shortcut (drag and droped my sh file) on desktop and now I can run it with just one click :D