Python is an interpreted programming language that is often, but not solely, used as a scripting language. A version of Python is included by default on all Ubuntu distributions.

learn more… | top users | synonyms

2
votes
2answers
1k views

Error trying to run a python program [duplicate]

Hello guys I'm actually new to Terminal and Python. Just started following a Python tuturial on my Ubuntu and I've reached a part where it asks me to save a .py file and open it in Terminal. Only ...
13
votes
2answers
4k views

I have installed python-doc. How can I access it?

Sorry if this is a such an obvious question, but where does Ubuntu put documentation packages for python, node.js, redis, mysql, mongodb, and other applications? And why I cannot access it by typing ...
78
votes
4answers
294k views

How do I install python 2.7.2 on Ubuntu?

I want to install python 2.7.2.tgz on Ubuntu, downloaded from http://python.org/download/. Is this a correct way to install : ./configure make make install If not , how can I do that?
2
votes
0answers
151 views

How can I create an appmenu/DBusmenu using python? [duplicate]

Possible Duplicate: How to add support for the global menu to a python non-gtk, non-qt app? I want to add support for the indicator-appmenu to an application that is not written in one of ...
5
votes
5answers
18k views

How to install Python package pyzmq properly?

How to install Python paackage pyzmq properly? I searched in Synapic package manager in vain.
5
votes
2answers
4k views

What will be the default Python interpreter for 12.04?

I don't even have Python 3 interpreter currently, and was surprised by this Wikipedia article: link while I searched for 12.04 release date. It mentiones Python 3.2 as default Python interpreter in ...
12
votes
3answers
10k views

How to install and configure IPython so it uses Python3.2 on 11.10?

How to install and configure IPython so it uses Python3.2 on 11.10? I've checked that by installing sudo apt-get install ipython will use python2.7. [EDIT1] $ sudo python3 configure.py ...
0
votes
1answer
721 views

Xubuntu pyNeighborhood won't start

I just installed pyNeighborhood on a freshly set up Xubuntu 11.10-machine via apt-get from the official repositories, however it won't start. Error when starting via terminal: user@pc:~$ ...
10
votes
2answers
283 views

How do I use get_media_file() in the latest Quickly?

I am writing a project with Quickly and GTK 3 and I want to use the get_media_file() helper so I can load an icon in my data/media directory. I can't see how I use get_media_file() with the latest ...
5
votes
3answers
1k views

Is there any invariable hardware system identifier in Ubuntu/Linux

At the current I am using ethernet mac address to generate license for my program, but sometimes there is more than one ethernet card (wireless, modem, etc.). So I would like to use something else: ...
21
votes
3answers
3k views

How to add support for the global menu to a python non-gtk, non-qt app?

I'm looking for good documentation (an example, tutorial, or guide) on how to add global menu support to a non-gtk, non-qt application. (In gtk it works 'magically' for the main menu...). The ...
4
votes
1answer
10k views

How to get screen size through python curses

I'm writing a terminal program and need to get the size of the TTY I'm using. The Internet seems to suggest this can be done with curses, but I can't seem to find out how in python. I'm trying to ...
4
votes
1answer
907 views

Creating a Gtk window with input shape mask in python

I am trying to create a Gtk3 Window with a custom input mask, so that the window wouldn't receive any mouse clicks. This is a piece of code that I've came up with: surface = ...
9
votes
3answers
7k views

How can I get pygame for Python3?

There is a package (python-pygame) for Python2 available from the universe repository. However, I want to work through the tutorial in the Invent with Python book. Going through SPM (Synaptic), I ...
31
votes
2answers
8k views

Connect WebKit WebView form to a Python callback?

I am writing a small Python and WebKit app; I am using WebKit as the UI for my app. What I want to do is to create an interactive element in WebKit (namely a combo box or a set of clickable regions) ...
8
votes
2answers
8k views

Why can't I import “pygtk” with Python 3.2 from PyDev?

I have installed Eclipse + PyDev + Python 3.2. Now I have two Python interpreters in PyDev: Python 2.7 and Python 3.2. If I try to execute command import pygtk with 2.7 interpreter it works fine, but ...
5
votes
1answer
391 views

How do I prevent webpages from stealing focus in Webkit?

I use a gtk TreeView to display different websites in my Python program. When the selected rows change, the web page is updated to the url field in the store. This works nicely, but a lot of web pages ...
0
votes
1answer
1k views

Python script to check if current IP address is from DHCP or static

How to check if eth address is taken from DHCP or set manually (static) using Python?
3
votes
1answer
655 views

Error when installing “python-nautilus”

When I try to install python-nautilus using the Ubuntu Software Center I get an error message titled "Package dependencies cannot be resolved". The following output is displayed in the details ...
4
votes
1answer
290 views

Detect GTK theme change in runtime

I am using this code to set appropriate appindicator icon for my application. Basically I set separate mono dark/light icon for Ambiance and Radiance theme in order to integrate my app into Unity ...
18
votes
4answers
68k views

What is the best way to install python packages?

What is the best way to install python packages in Ubuntu 11? I am a recent convert to Ubuntu and want to learn best practices. For context, I am looking to install the tweeststream package, but I ...
3
votes
4answers
3k views

“TypeError: type str dosen't support the buffer API” while configuring gconf

"A problem occurred while checking for updates" I have noticed the red circle with white line for at least a week. Not sure if it is due to a python version I changed to or and update that was cut in ...
1
vote
1answer
320 views

List python class properties [closed]

I would like to get list of Python class properties. So I could make base class with function to get dict with all class properties name and value but without specifying exact properties.
3
votes
2answers
4k views

Parse network configuration file (/etc/network/interfaces) with Python

I need to write script in Python to read/write /etc/network/interfaces file. It is not parse-able with builtin module ConfigParser because there are no sections. Is there any parser for such files? ...
1
vote
1answer
1k views

How do I install a .crt file in Firefox for Windmill Testing Framework?

I am trying to use the Windmill Testing Framework over https. When I run windmill firefox http://www.example.com the Windmill IDE comes up fine. When I run windmill firefox https://www.example.com the ...
5
votes
1answer
200 views

Customize Ubuntu Control Center and add Web and text interface

I am working on my own ehmmm... sorry my company own live distribution based on Ubuntu. I would like to write something like control center with text, gui and web interface accessed by admin only: ...
0
votes
1answer
3k views

use kinect camera as a webcam in ubuntu

I have a python openCV program that uses a webcam to track an image target. I switched computers, but this new computer does not have a webcam. I hooked up my kinect, installed stome stuff from ...
3
votes
1answer
727 views

Installing (or getting working) ironpython

Why has package with ironpython disappeared from repository? I expected, that I would be there. Is there any way to get running ironpython clearly, without compilation from source?
6
votes
1answer
6k views

Making Gtk.Window Transparent?

Here's my code and I simply cannot figure out why my top level window doesn't become transparent. xwininfo says that windows has 32 Bit depth. I am running Ubuntu 11.10 and if I call .set_opacity(.5) ...
2
votes
1answer
1k views

Is there a difference between using setuid()/setgid() within a program and invoking it with sudo -u xxx -g xxx?

Consider this python script, which invokes HandBrakeCLI, a program that attempts to read from the dvd drive: invoke.py #!/usr/bin/python import sys import os import subprocess as subp import ...
7
votes
2answers
2k views

Using GIO in Python 3

How can I access the gio module for Python 3.2? (I want to interface with GVFS.) I did sudo apt-get install python3-gobject but this does not allow me to do import gio as it did in Python 2.7. ...
3
votes
1answer
912 views

Load configuration from XML (Xfconf)

I'm trying to make an app to switch your XFCE4-Panel's layout between 3 layouts. I applied those layouts and copied the XML file where Xfconf stores its configuration for the panel. The general idea ...
0
votes
1answer
915 views

I need wxpython on Ubuntu 11.10, how do i get it

I have a program that requires wxpython, but the site for wxpython only covers Ubuntu upto 11.04. It requires u to list the name or your distribution in the command for the installation (ie. ...
2
votes
1answer
410 views

How to run normal session from user script after passing init=MY_SCRIPT in grub entry

I have entry in grub to start my configuration script written in Python. I would like to give user option to start normal session after the work is done. But I've found that /sbin/init needs to have ...
2
votes
2answers
804 views

How to run interactive python script after boot as user USER

I want to run my system configuration script (written in python) after boot. System should ask for password for user USER and run my script. After that system should reboot, eventually run gui. I ...
6
votes
1answer
898 views

PyGTK Application Icon Blurred in Unity

I have 128x128 icon referenced in main window glade file like <property name="icon">../media/my-icon.svg</property>. I tried, with both svg and png, but it is always very blurred in ...
1
vote
2answers
562 views

Appindicator Theme Dependent Icons

I am developing PyGTK app with appindicator. I create my appindicator similar like in this example. In this example "indicator-messages" stock icon is used. So, I can: use stock icon (from existing ...
54
votes
5answers
14k views

How do I create a deb package for a single python script?

I have a single python script that I want to distribute as a deb package. It is a indicator which shows local date in Unity panel. I did follow create a .deb Package from scripts or binaries but I ...
0
votes
1answer
2k views

Python - pip module install 2.6 instead of 2.7

I use Django 1.3 with Python 2.7 on Ubuntu 10.04. $ python Python 2.7.1 ... >>> I'm trying to install the python module django-grappelli. $ pip install django-grappelli ...
3
votes
1answer
1k views

Appindicator best practices in PyGTK apps

I have problem adding appindicator to my PyGTK app. When I place this into my init.py, before gtk.main(), it works, but when I put it in my main window finish_initializing() method, it does not get ...
3
votes
2answers
1k views

Installing python-pygments, ImportError

I want tot use pygments in my python app. At first, I installed pygments like this: $sudo python setup.py install --prefix=/usr/local /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown ...
5
votes
1answer
1k views

Why '*.exe's in Python installation?

Just out of curiosity I executed following command and I was surprised to see MS Windows Executables in Python installation directory. 20:36:46 nixlap [~] $ locate -i -r exe$ [snipped] ...
7
votes
3answers
3k views

Listening to incoming libnotify notifications using DBus

I am attempting to filter every notification through espeak. However, I can't seem to find a way to get the notification body from a python script, or even what signal_name to listen to. ...
8
votes
1answer
5k views

Storing passwords with python keyring

I'm using keyring library to store passwords in my python app. import keyring keyring.set_password('My namespace', username, password) keyring.get_password('My namespace', username) And this works ...
5
votes
2answers
975 views

Upstart not executing the exec function in upstart.conf

I have a completed upstart conf file loaded here: http://pastebin.com/5E7J5jEY but I'm having trouble with the upstart not executing the exec function and/or relinquishing the kernel console CLI back ...
6
votes
1answer
2k views

ubuntu upstart script execute a script.py program

I'm creating an upstart script to execute a python program I've written. When the service is starting I want to echo starting service - script.py... and echo the process id of the program once ...
2
votes
1answer
288 views

Using libnotify from a daemon started with upstart

I have a python script that gets messages from an MQTT server and parses them to display using libnotify. This works fine when I run it from a terminal, but when I run it using upstart I get no ...
2
votes
2answers
287 views

Processes and .desktop launchers (Identification)

I have a python application which behaves in two different ways. When started without arguments, it runs in CONFIGMODE and shows a Configuration GUI (pygtk). When started with an argument it runs in ...
0
votes
1answer
598 views

Custom PyGTK dialog with Glade

I'm building simple PyGTK app using Glade UI designer. I followed pattern from default Ubuntu app, where preferences and about dialog are implemented extending gtk.Dialog, so I added new dialog with ...
1
vote
1answer
181 views

quickly run ERROR: run command failed Aborting

I have simple PyGTK app made with quickly. After syncing source files via Ubuntu One and running on other machine I got: $ quickly run Can't execute bin/myapp ERROR: run command failed Aborting ...