Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering what experiences you have and can share in regards to using Python in an Ubuntu environment? I have worked with Ubuntu a bit but is there anything special that can be done with Python code or libraries that can be used that can't in windows?

I have posted parts of what I have learned and used over time from my Python work in Ubuntu but not sure if I need direction in the sense of best practices etc. If you could review and comment about how I am doing, suggestions for improvement, or experience you could share would be great! My existing code blurbs are at

Thanks in advance!

share|improve this question

closed as not a real question by João Pinto, Florian Diesch, hhlp, htorque, bodhi.zazen Mar 31 '12 at 14:20

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I am sorry but sharing experiences and asking for code review is not a real question. There is no such thing as "Python specifics in relation to ubuntu", python is mostly cross-platform with the exception of libraries which only make sense/been developed for platform specific purposes. – João Pinto Oct 25 '11 at 13:57
The snippets are nice. You should probably read about Docstrings. They are the proper way to document functions in python not comments above the definition. – Javier Rivera Oct 25 '11 at 15:25
@JoãoPinto Sorry, I am new and was trying to get a feel if there were more avenues I could try and look into in my current environment. – Christopher Hall Oct 25 '11 at 18:50

It's the computer that decides what can and cannot be done. On the same hardware, anything that's possible in one operating system is possible on the other, unless there are artificial obstacles. In fact, that's what operating systems are there to ensure. As long as you have Python installed on Windows, it can do anything Python can do on GNU+Linux. For almost all applications, you'll use libraries and those libraries can be programmed in other languages, like C, for efficiency.

There are two major differences between Windows and Ubuntu: 1) Ubuntu has built-in support for development in many, many languages. Because of this, everything is designed to be accessible using any language. A good example is Unity, in which everything is done over DBus, meaning that you can use any language to control the environment without having special libraries, though that makes it even easier. On Windows, you will have to install all the requirements manually before you can use the application, but then it works just as well.

2) Ubuntu is free software. This means that nobody has any incentive to say that a library should only be used on Ubuntu. Quite the contrary. The more developers using a library, the more valuable that library becomes. Windows is very different. Not only is it a proprietary operating system, owned by a single entity, but the development tools are also proprietary and sold by that entity. That means they have billions of incentives to make sure the developers write applications using libraries that cannot, or cannot easily, be used on other operating systems. Microsoft has shown som willingness to change, but they still have long ways to go before they can rest on their laurels.

In summary, if you develop on Ubuntu, your application will work on any desktop. You'll have to provide an installer if it should be used on Windows, but there are programs to automate that tasks. If your apps rely on direct system interaction, then you might need to adjust your code slightly, but it's no big deal. This will improve with time. For instance, we've already seen indicator services for Windows, which makes your AppIndicator written for Ubuntu, automatically appear as a Windows systray icon with no effort from the developer. We should have a generic solution for this. If your app depends on DBus for inter-process communication, then that will just work as well, since DBus has already been ported to Windows. We'll want a DesktopCouch service, etc. These are not technically difficult things to do, they just needs to be done, and they will be.

I would actually say that even if, as a developer, your main target is Windows, you should still develop that software on Ubuntu. Not only is it a very comfortable environment with all the tools you need, and a strong community to back you up, but it also ensures that you, as a developer, always have the freedom to expand your audience at any time, with minimal effort. I particularly, and very strongly, recommend using Python with GTK3.

Wow, I'm long winded. :)

share|improve this answer

I haven't seen anything done on the windows side that can't be done on the linux side as far as python is concerned. There may be some issue with compiled code components and the native C API. Other than that, in my experience, it's pretty much the same.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.