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

71
votes
4answers
92k 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 \'+ \ ...
47
votes
5answers
10k 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
6k 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 ?
13
votes
4answers
73k 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? ...
20
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 ...
49
votes
3answers
4k 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 ...
25
votes
2answers
23k 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 ...
8
votes
1answer
352 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 ...
60
votes
3answers
217k 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?
20
votes
2answers
10k 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 ...
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. ...
11
votes
3answers
18k 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 ...
2
votes
2answers
596 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 ...
7
votes
2answers
7k 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 ...
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 ...
3
votes
2answers
12k 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
3answers
484 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 ...
82
votes
8answers
55k 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. ...
4
votes
3answers
1k 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 ...
4
votes
1answer
3k views

How to update ubuntu's python with latest version from source?

I'm using Ubuntu 11.10. The python 2.7.2 provided has a bug that has been corrected in the latest 2.7.2 sources from the python repository. What is the recommended way to replace the ubuntu provided ...
8
votes
1answer
1k 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 ...
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 ...
24
votes
4answers
28k 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?
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 ...
16
votes
5answers
22k 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 ...
18
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
856 views

Quickly template for PyQt?

Because I like Qt and Python, is there a Quickly template for PyQt similar to the PyGTK one?
10
votes
2answers
942 views

Is PyGTK still relevant?

I'm new to Linux but not to app development. I come from a RealBasic on a Mac background. I've accepted that I need to learn a new language to develop for Linux (since RB won't run on 64 bit distros ...
9
votes
3answers
32k 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 ...
6
votes
1answer
5k views

How to create Excel xlsx files from a script?

I'm looking for packages available in Ubuntu main/universe repositories able to create Excel 2007+ xlsx files from a script (python or perl) My requirements: 100% compatible Excel XLSX files. Solid ...
4
votes
1answer
3k 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
3answers
916 views

How to deploy: ubuntu | apache | python | C++ | mysql [closed]

What if you want to make a non trivial web site and/or web service? How to deploy production server Apache with python for frontend and C++ for backend and MySQL for persistance? What glue should ...
3
votes
2answers
276 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 ...
0
votes
4answers
118 views

How do I run Python code as a script? [duplicate]

I need help running python in ubuntu I can run python without a problem in my terminal but when I create a .py file I can't get it to run.
9
votes
2answers
19k 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 ...
4
votes
2answers
6k 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 ...
2
votes
4answers
691 views

Ubuntu Software Center, terminal and other applications don't work after uninstalling Python 3

I am a new Ubuntu user running Ubuntu 13.04. I've been trying to install and use a DeDRM tool, but I've been having problems doing so. I was following some directions that said I needed a version of ...
1
vote
1answer
114 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 ...
24
votes
2answers
26k 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 ...
58
votes
8answers
69k 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 ...
23
votes
5answers
18k 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 ...
19
votes
7answers
75k views

How do I install python imaging library (PIL)?

How do I install the python imaging library (PIL) on Ubuntu? I tried doing sudo apt-get install python-imaging but now when i run python selftest.py (a script I got from somewhere on the ...
22
votes
3answers
6k 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 ...
18
votes
7answers
22k 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 ...
15
votes
1answer
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?
11
votes
4answers
45k 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 ...
10
votes
4answers
446 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?
7
votes
3answers
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. ...