What are good python libraries for the following needs:
MVC
Domain Abstraction
Database Abstraction
Video library (just to create thumbnails)
I already know that SQLAlchemy is really good for Database Abstraction so don't bother with it unless you want to suggest a better one.
Edit: This might seem stupid to mention but I'm talking about MVC for GUI and not for web, just mentioning for clarification
Edit: Also does the MVC part contain GUI part or can I use a separate library for GUI like PyQt
Have you tried wxWidgets (well, wxPython in fact)?
It has nice documentation (which is always a good thing), and allows creating code in MVC manner. It's just the GUI library, but allows some simple image manipulation (if it's not good enough for you try using Python version of ImageMagick). It uses native controls, so the application looks native on the OS it's being ran.
PyQt on the other hand has even better docs than wxWidgets or wxPython, but I could never get used to the look&feel of its GUI (it's custom, so it doesn't look native on any OS). Because riverbankcomputing couldn't agree with nokia on a license nokia started a project called PySide which is a LGPL version of the Qt-bindings. It's supposed to be finished in early 2010.
django is a pretty good mvc framework with an orm
You could go with http://turbogears.org/ . Its like Django, but uses "of the shelves" existing modules.
TurboGears 2 is the built on top of the experience of several next generation web frameworks including TurboGears 1 (of course), Django, and Rails. All of these frameworks had limitations which were frustrating in various ways, and TG2 is an answer to that frustration. We wanted something that had:
Real multi-database support
Horizontal data partitioning (sharding)
Support for a variety of JavaScript toolkits, and new widget system to make building ajax heavy apps easier
Support for multiple data-exchange formats.
Built in extensibility via standard WSGI components
Related
I have looked at a few python GUI frameworks like PyQt, wxPython and Kivy, but have noticed there aren’t many popular (used widely) python applications, from what I can find, that use them.
Blender, which is pretty popular, doesn’t seem to use them. How would one go about doing what they did/what did they do and what are the potential benefits over using the previously mentioned frameworks?
I would say that python isn't a popular choice when it comes to making a GUI application, which is why you don't find many examples of using the GUI frameworks. tkinter, which is part of the python development is another option for GUI's.
Blender isn't really a good example as it isn't a GUI framework, it is a 3D application that integrates python as a means for users to manipulate it's data. It was started over 25 years ago when the choice of cross platform frameworks was limited, so making their own was an easier choice to make. Python support was added to blender about 13 years ago. One of the factors in blender's choice was to make each platform look identical. That goes against most frameworks that aim to implement a native look and feel for each target platform.
So you make your own framework when the work of starting your own framework seems easier than adjusting an existing framework to your needs, or the existing frameworks all fail to meet your needs, one of those needs may be licensing with Qt and wxWidgets both available under (L)GPL, while Qt also sells non-GPL licensing.
The benefit to using an existing framework is the amount of work that is already done, you will find there is more than you first think in a GUI framework, especially when you start supporting multiple operating systems.
I have the following data scheme that I want to turn into an application. A regular desktop GUI would probably the best.
UML Diagram http://img217.imageshack.us/img217/341/56836587.jpg
big version
The whole thing would be developed on a Linux (Ubuntu, Gnome) machine, and then used on a Windows Vista computer. If Windows is a problem, I might be able to just run it in a Linux VM later.
My programming language of choice would be Python. I have only used Qt for a two hour project, I have pretty much no experience with GUI. Would Qt work easily on Windows and not look to out of place there? Is GTK a way better option, or is that merely preference issue?
From talking on the #python channel, I gathered that storing the data in a SQLite database would be a good option, and accessing this data via the SQLAlchemy ORM would be better than writing SQL statements by hand. The latter is my usual approach, I want to use this project to learn something better.
Can I just design the dialogues in Qt Designer and use them with my Python objects?
You might want to check out Dabo.
Dabo is a 3-tier, cross-platform application development framework, written in Python atop the wxPython GUI toolkit
Camelot
If you are set on using Python them I think Qt would be am excellent choice. It's a fantastic framework that looks good and runs on many platforms. You won't be limited to Windows. Qt can be a bit intimidating but you won't be limited in terms of functionality. The Qt designer works well with Python.
SQLAlchemy works on all common desktop platforms, including Windows.
What are some applications for Python that relative amateur programmers can get into?
For example, Ruby has Rails for building web applications. What are some cool applications of Python?
Thanks.
Google App Engine has excellent support for developing -- and especially for deploying -- web applications in Python (with several possible frameworks, of which Django may be the most suitable one for "relative amateurs"). Apart from web apps, Blender lets you use Python for 3D graphics, Poser for apps involving moving human-like figures, SPSS for statistics, scipy and many other tools included in Enthought's distribution support Python use in scientific programming and advanced visualization, etc, etc -- the sky's the limit.
"cool" is a state of mind. Hence cool applications depends on your definition of cool. A Ant colony simulation is cool, if you want to implement the theory.
Python, with its own and 3rd party libraries (batteries) has been applied in possibly all domains of day to day programming. My advise is, decide on the cool app you want to write and then see, what Python has to offer in that domain. If you are sufficiently satisfied, you can start coding. Good Luck!
You can build web applications in Python. See the Django framework.
Besides that, here's a nice list.
Not particularly relevant, but interesting, is the fact that NASA uses Python.
I wasn't a programming amateur at the time, but using pygame was my first intro to Python.
Python is a general purpose programming language much like Ruby. It can be used for systems programming, embedded programming, desktop programming, and web programming. In short, it has about as much potential for "cool" projects as any other general purpose language.
One of the first bits of Python programming I ever did was to hack on the nicotine client for the Soulseek peer-to-peer network to add a '/g [query]' chat command to open the default browser and search Google.
Probably not the most general purpose example, but I learned Python when AutoDesk Maya adopted it as a secondary programming language to complement MEL (Maya Expression Language). By comparison, it was a god-sent.
I like:
Django, for web development
PyQt4 for GUI programming
pygame for games, input management etc
PIL - python imaging library, it's not huge application, but really helpful and library imo
also, Blender is an application scriptable in Python, so if you'd be into some 3D graphics, here you got it.
If you're making applications for windows and want to ship them easily, you can also look at stuff like py2exe.
The background
I'm building a fair-sized web application with a friend in my own time, and we've decided to go with the Django framework on Python. Django provides us with a lot of features we're going to need, so please don't suggest alternative frameworks.
The only decision I'm having trouble with, is whether we use Python or Jython to develop our application. Now I'm pretty familiar with Java and could possibly benefit from the libraries within the JDK. I know minimal Python, but am using this project as an opportunity to learn a new language - so the majority of work will be written in Python.
The attractiveness of Jython is of course the JVM. The number of python/django enabled web-hosts is extremely minimal - whereas I'm assuming I could drop a jython/django application on a huge variety of hosts. This isn't a massive design decision, but still one I think needs to be decided. I'd really prefer jython over python for the jvm accessibility alone.
Questions
Does Jython have many limitations compared to regular python? Will running django on jython cause problems? How quick is the Jython team to release updates alongside Python? Will Django work as advertised on Jython (with very minimal pre-configuration)?
Decision
Thanks for the helpful comments. What I think I'm going to do is develop in Jython for the JVM support - but to try to only use Python code/libraries. Portability isn't a major concern so if I need a library in the JDK (not readily available in python), I'll use it. As long as Django is fully supported, I'm happy.
Django does work on Jython, although you'll need to use the development release of Jython, since technically Jython 2.5 is still in beta. However, Django 1.0 and up should work unmodified.
So as to whether you should use the regular Python implementation or Jython, I'd say it's a matter of whether you prefer having all the Java libraries available or all of the Python libraries. At this point you can expect almost everything in the Python standard library to work with Jython, but there are still plenty of third-party packages which will not work, especially C extension modules. I'd personally recommend going with regular Python, but if you've got a ton of JVM experience and want to stick with what you know, then I can respect that.
As for finding Python hosting, this page might be helpful.
I'd say that if you like Django, you'll also like Python. Don't make the (far too common) mistake of mixing past language's experience while you learn a new one. Only after mastering Python, you'll have the experience to judge if a hybrid language is better than either one.
It's true that very few cheap hostings offer Django preinstalled; but it's quite probable that that will change, given that it's the most similar environment to Google's app engine. (and most GAE projects can be made to run on Django)
I have recently started working on an open source desktop project in my spare time. So this may not apply. I came to the same the question. I decided that I should write as much of the code as possible in python (and Django) and target all the platforms CPython, Jython, and IronPython.
Then, I decided that I would write plugins that would interface with libraries on different implementations (for example, different GUI libraries).
Why? I decided early on that longevity of my code may depend on targeting not only CPython but also virtual machines. For today's purposes CPython is the way to go because of speed, but who knows about tomorrow. If you code is flexible enough, you may not have to decide on targeting one.
The downside to this approach is that you will have more code to create and maintain.
Django is supposed to be jython-compatible sinc version 1.0.
This tutorial is a bit outdated, but from there you can see there are no special issues.
I'm interested in making desktop widgets, similar to Apple's Dashboard or what Vista has. I'd like to make them cross-platform, if possible. Opera's widgets are cross-platform but require the user to have Opera installed, so that's a big limitation.
I know most widgets are made with HTML/XML, CSS, and Javascript. Is there a way to create them using Python?
Update: I did find a site talking about Pyjamas. Does anyone have experience with it and, if so, what are its capabilities/limitations?
You should take a look at what the guys at Digsby are doing. Basically, they've written a port of WebKit to wxWidgets, and then use WebKit to render the interface, and wxPython for writing the rest of the app. Pretty neat, but very alpha at the moment.
Take a look at gDesklets. AFAIK they're UNIX only, but mabybe porting them to other platforms make more sense than starting from scratch?
They use python to create widgets (desklets).
Screenlets is designed for this task.
The Screenlets project is both a Python framework to simplify writing Cairo-drawn desktop widgets, similar to those found in the "Dashboard" feature of OS:X.
Widgets can be written entirely in Python. A collection of widgets using the framework have already been developed.
It is designed to work with Linux desktop. But it should be easy to port to other platforms, since Cairo is cross-platform, in my opinion.
Disadvantages
It's not updated frequently. The latest version, 0.1.6, was released on 2012-01-27
Its home page has been down for some time. Launchpad works though.
Only Python 2 is supported.
You can check out PyGTK, which will allow you to create desktop widgets, but they won't be managed by OSX's Dashboard. If you'd like to develop an OSX widget, you'll want to stick with HTML/CSS/JavaScript.
Take a look at pyqt4. It has webkit integration. I was looking into this myself but haven't really had time to dig into the API.