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

69
votes
4answers
82k views

How do I sudo a command in a script without being asked for a password?

I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time: os.system('sudo sh -c "echo date \'+%s\' -d \'+ \ ...
41
votes
5answers
9k 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 ...
20
votes
4answers
5k views

Can I develop ubuntu for phones apps in Python? [duplicate]

Does anyone know if we can develop apps for ubuntu for phones in Python ? PyQT / PySide would seem to support also QML. But can we use them on the phones ?
48
votes
3answers
3k views

Is #!/bin/sh read by the interpreter?

In bash or sh, I guess anything which starts with # is a comment. But in bash scripts we write: #!/bin/bash And in Python scripts, there is: #!/bin/python Does this mean that # by itself is a ...
19
votes
3answers
3k views

Is it possible to use Python with the Ubuntu SDK?

David Planella wrote in his answer to a question I posted that: ...the recommended way to develop apps for Ubuntu is the Ubuntu SDK. So I installed it, but looks like the supported programming ...
8
votes
1answer
339 views

Create a quickly app with build dependencies

I am creating a Quickly app in Ubuntu that depends on Python Twisted, which is available in the package python-twisted. How should I add python twisted as a dependency so that it will be installed ...
11
votes
4answers
49k views

run python in terminal

Trying to learn how to run my scripts through Ubuntu's terminal regularly. That being said I am familiar with bash, wget, and awk being called but how do I call python files to run in the terminal? ...
18
votes
2answers
9k views

easy_install/pip or apt-get

As noted in the Ubuntu wiki page on Rails it is recommended that gems manages your Rails/Ruby dependencies. What is the best practise with Python packages like Django? Should I install them through ...
56
votes
5answers
181k 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?
10
votes
1answer
1k views

How to create a new Quickly application template?

Cannot find the answer elsewhere, I'm asking for a documentation of the process to create a new template for quickly. I'm interested in writing a pyside (python + qt4) template like the pygtk one. ...
2
votes
2answers
530 views

Horizon: Apache exceptions at import_module

I've deployed Openstack using juju, and everything looks normal except that I cannot browse to openstack-dashboard. I get error 500 Internal Server Error. I looked through apache2 logs at that node ...
23
votes
2answers
13k views

apt get install vs pip install

I am a bit confused about the cases in which the above commands must be used when downloading python packages. I was trying to download a package named pyudev in accordance with an answer with this ...
21
votes
2answers
2k views

What is the black header widget in some programs?

In some of the ubuntu programs (ubuntu control panel, system settings), but not e.g. in banshee, the top part of the window contains elements in dark tone (with the Ambience theme). But I cant find a ...
10
votes
3answers
15k views

How do I make the terminal run python 3.1?

Currently, when I type "python" at the terminal I get v2.6 which is all fine and dandy but how can I set it to use v3.1 instead? Is there a "path" variable out there somewhere that I can change like ...
7
votes
1answer
6k views

How do I set IDLE as the default editor for Python scripts?

I would like to set IDLE as the default editor for python scripts, but when I click on "open with application" and hit the dropdown to show more applications it isn't an option. Here's exactly what ...
4
votes
3answers
951 views

Keyboard shortcut to toggle auto-hide unity launcher

I would like to create a keyboard shortcut to toggle the auto-hide option for the unit launcher. Based on the answer on How to programmatically change the launcher's hide behaviour I tried to make a ...
8
votes
1answer
988 views

What is python3mu?

I'm setting up PyDev for Eclipse, and I have to choose a version of Python for the interpretor. I want to use Python3, and I've been using python3 as my interpretor, so I thought /usr/bin/python3 ...
3
votes
3answers
408 views

Python 3 error when running the print command

All I wrote in the interpreter was as follows: >>> print "Hello, World!" File "<stdin>", line 1 print "Hello, World!" ^ SyntaxError: invalid syntax How ...
77
votes
8answers
43k views

Is there an GUI Designer for python?

Is there a GUI IDE for programming python just like java has netbeans? I wanted one where we could drag & drop test boxes & labels just as we do in swing components using netbeans or eclipse. ...
23
votes
2answers
11k views

What's the best way to get Python 2.5 and 2.7

Ubuntu 10.04 has only two supported Python versions 2.6 and 3.1. Developers often need more, to test that their Python code works on 2.7, 2.5 (and maybe even 2.4 and older ones). What's the best way ...
14
votes
2answers
6k views

How to read dbus-monitor output?

i'm playing around with dbus-monitor to try and understand how dbus is working in Ubuntu environment. I have several questions in this regard: Could you please let me know how to read the following ...
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 ...
14
votes
4answers
17k views

Make default `python` command to use Python 3

I can access Python 3 via python3 command. But I want to make the default interpreter to use python command for Python 3. Simple typing python takes me to Python 2. How to upgrade?
17
votes
1answer
4k views

Dropbox Fails To Start With “VerificationError: importing pylinux…”

Dropbox Fails To Start With "VerificationError: importing pylinux..." . It seems that some recent Python update breaks Dropbox, resulting in the following error: Starting Dropbox...Traceback (most ...
11
votes
2answers
817 views

Quickly template for PyQt?

Because I like Qt and Python, is there a Quickly template for PyQt similar to the PyGTK one?
8
votes
3answers
24k views

Problem installing Python-Dev

I am having trouble installing python-dev. It all started when I tried to install another Python package and got the error: SystemError: Cannot compile 'Python.h'. Perhaps you need to install ...
4
votes
1answer
2k views

Broken dependencies after upgrade

After an apt-get upgrade I got the following error: Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not ...
3
votes
2answers
5k views

How to install pygame?

I am running Ubuntu 13.10. I have python 2.7.5 with anaconda 1.8.0. Whenever I start python and type import pygame it tells me that there is no module named pygame. How can I install pygame?
3
votes
1answer
3k views

Ubuntu Software Center does not open - dbus error [closed]

Ubuntu Software Center does not open, I tried these instructions to fix it but they didn't work https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure When I run software-center ...
3
votes
2answers
264 views

Quickly packaging errors

I'm having some trouble packaging my Quickly (Python/GTK) app. Creating and packaging a new app (created using quickly create test and cd test; quickly package) works just fine, but the actual app ...
9
votes
2answers
12k views

How can I remove python 2.7 after installing python 3.3?

I have successfully installed python 3.3 on Ubuntu 12.10. Since I don’t need multiple versions of python, I want to remove the existing python 2.7. When I try to do that, using sudo apt-get remove ...
3
votes
2answers
5k views

How to install XML parsers with Python

I'd like to use etree, expat or similar, though I understood etree is easier to use. But how do I install that when I already have Python 2.7.2 installed on Ubuntu 11.10? All documentation I can find ...
1
vote
1answer
71 views

AppIndicator documentation for Python

Where has the documentation for the Python bindings to AppIndicator gone? Visiting this official looking page, all the links are broken.
1
vote
1answer
1k views

Update Manager won't open (error related to pythonverbose)

I'm having an issue with update-manager. Last night, my computer restart suddenly during the update process. Now it won't open and it keep appearing on the notifier with a message warning that an ...
56
votes
8answers
63k views

How can I install Python 2.6 on 12.04?

According to https://wiki.ubuntu.com/PrecisePangolin/ReleaseNotes/UbuntuDesktop "Python 2.6 is no longer available for install". I need to support legacy software that runs only on Python 2.6. How ...
20
votes
2answers
19k views

How to set up and use a virtual python environment in Ubuntu?

Python virtual environments are used to create isolated python environments to avoid dependency and version conflicts, and also indirectly takes care of permission issues. But what is the easiest way ...
22
votes
5answers
17k views

Will python2.7 be available for 10.04 in the future?

Since Ubuntu 10.04 is an LTS release will it support python 2.7 as a default package maintainer version or at least have a python2.7 package in future? Since it will be the last major python 2.x ...
20
votes
3answers
5k views

How do I get started creating an Ubuntu Desktop App?

I want to create an Ubuntu desktop app, specifically to replace Gwibber. I can code in Java, Python and a few other technologies. Adobe Flex would have been an option until Adobe decided to suck some ...
14
votes
2answers
2k views

How can I write Nautilus scripts in Python?

I want to write a Nautilus script in Python. Is that possible? If it is possible, how can I do that?
10
votes
4answers
424 views

How do I add a daemon to my Quickly application?

I am building a app with quickly, and I wanted to add a daemon that will run in the background. How do you do this?
9
votes
4answers
33k 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 ...
7
votes
2answers
2k 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. ...
19
votes
1answer
25k views

Upgrading to python 3.2

I want to use new functools that provides with the lrucache, I am currently using python 2.6, which doesn't support this, What is the best way I can upgrade to python 3.2? or is there any other ...
17
votes
7answers
16k views

Python HTTPS requests (urllib2) to some sites fail on Ubuntu 12.04 without proxy

I have an little app I wrote in Python and it used to work... until yesterday, when it suddenly started giving me an error in a HTTPS connection. I don't remember if there was an update, but both ...
14
votes
1answer
1k views

Is there a detailed API documentation on the python binding for appindicator?

I'm getting serous with a project of my own and need a good documentation on the appindicator module for python. What I've found so far: API documentation on dev.ubuntu.com Community wiki entry API ...
7
votes
2answers
5k views

Programmaticaly change lightdm autologin session type

I have problem with lightdm setting autologin session type (using my config tool). Lightdm logs into previously selected session. I see that autologin-session is UNIMPLEMENTED in version 1.2.1. Maybe ...
18
votes
4answers
3k views

How to program a status icon that will display in Ubuntu as well as in other distributions?

The application in question does some action (here connecting audio to network streams) and runs minimized if these actions were successful. Therefore a status icon is needed to display the state of ...
14
votes
5answers
18k views

How to remove a deb without removing its dependencies

I would like to install the most recent version of boto, which I do via python setup.py install Yet when I try to remove the old version the following packages also get removed: apt-get remove ...
3
votes
3answers
2k views

How do I get the names in my icon theme for use with pythons appindicator module?

How do I get the strings I can insert instead of 'gtk-execute'? #!/usr/bin/python import gobject import gtk import appindicator if __name__ == "__main__": ind = ...
24
votes
4answers
7k views

What's the difference between GTK and QT?

Please bear with me as I'm a newcomer to Linux. I've been writing GUI programs in REALbasic on a Mac for several years. I'm trying to learn Python and I want to write GUI apps for Linux (primarily ...