PDA

View Full Version : Doing Python Right, the Ubunutu way?


moephan
November 7th, 2005, 10:38 PM
Hi all -

Please excuse me if this questions have been answered already.

I picked up Python over the weekend, and wrote an app I am finding fairly useful. It's a GUI app, and I'd like ti behave like a normal Ubuntu application. Being new to Linux and Ubuntu, now that I have a good start on the script, I have a few questions about the normal ways to do things:

1. How is a python application typically distributed? What is the Ubuntu way of sharing the app? Since the app is a set of 3 or 4 .py files, and uses about 5 or 6 images, how do I keep these altogether and create a point of entry for users? For example, if this was a .NET app I would compile all the code into an .exe assembly, including the images, that I would add to the resources for the project. Users would just click on the .exe file.

2. The app runs "iwlist" which requires priveledges to run. How to I make that little box pop up for users to enter their passwords?

3. What if I want to start a shared project? Is there a place where I would post the code, invite people to use it, submit changes, etc...?

TIA.

cheers, Rick

flower
November 9th, 2005, 06:50 AM
check : http://www.ubuntu.com/community/participate

Retrix
November 9th, 2005, 09:05 AM
1. How is a python application typically distributed? What is the Ubuntu way of sharing the app? Since the app is a set of 3 or 4 .py files, and uses about 5 or 6 images, how do I keep these altogether and create a point of entry for users? For example, if this was a .NET app I would compile all the code into an .exe assembly, including the images, that I would add to the resources for the project. Users would just click on the .exe file.

I suggest you have a look at the source and packaging for serpentine. It is in the main distribution and uses python so it is a good example to model off. #apt-get source serpentine to take a look.

2. The app runs "iwlist" which requires priveledges to run. How to I make that little box pop up for users to enter their passwords?

gksudo is what you're after.

3. What if I want to start a shared project? Is there a place where I would post the code, invite people to use it, submit changes, etc...?

Sourceforge, your own site, ..., wherever you want really.

-Sam

majikstreet
November 12th, 2005, 09:15 PM
2) gnome-sudo is the command, not gksudo.
3) I would say sourceforge, too.

kelsey23
November 12th, 2005, 09:33 PM
Well there are .pyc files, which are encrypted I belive. Also when you say "like a normal GNU/Linux application" do you mean with the Human controls instead of the X window that it typically comes in? It would help if you would speciify what extensions you are using to write your GUI (Tkinter, wxWindows), etc. If it is Tkinter, I know that it will always behave like the X way. I do belive there are some python development tools for GTK+/Gnome though.

maubp
November 14th, 2005, 12:54 PM
*.pyc are compiled python files (generated from the *.py files).

You might want to read about the Python DistUtils (which will work on Windows to by the way), but I don't know how that applies to making a Debian style package for Ubuntu...