Is there a library or reference around showing how to build a Ribbon menu using PyGTK? - python

Hey there, everyone. A really random question, but I'm looking to get into some GUI programming with Python, specifically with the PyGTK library. I've only ever done GUI programming with Java/Swing, and I'd like to do some independent, personal projects in Python as a way of learning my way around the language, since it's been something that I've wanted to do for a really long time now, and haven't been able to find time for! But I digress...
I'm a fan of the Ribbon Interface introduced by Microsoft. I know that Microsoft introduced recently a library for .NET allowing users to build programs utilizing Ribbon. While I don't really want to learn IronPython yet, it's still an option for the future. These projects would be build on Linux, specifically Ubuntu, if that makes a difference.
So, finally, my question is this: Is there a library or reference point anywhere that can show me how to build a Ribbon GUI interface? Thank you for all of the advice!

There is ribbon like widgets developed as a part of GSC.
http://arstechnica.com/open-source/news/2007/08/mono-developer-brings-the-ribbon-interface-to-linux.ars
http://mono-soc-2007.googlecode.com/svn/trunk/laurent/src/Ribbons/
http://debackerl.wordpress.com/2007/08/25/soc-ribbons-summary/

Related

Which is Easier to create an .exe file ,Vb or python with tkinter?

I'm making an small audio editor interface, it needs to have a dialog box with 3-4 button options along with activate option, when the user clicks on activate,another dialog box will be popped asking him for his Mac address and a code, i heard Visual basic is good for making .exe but does it give me full control over the application?
You have to think about where your strengths lie. If you are a strong Python coder then go in that direction. if you are a strong VB coder then go in that direction. I would argue that neither of the options you are thinking of using would be ideal.
I would actually recommend C# within Visual Studio 2015 community. Python isn't natively compiled to an EXE and there are more hoops to jump though to get a compiled executable.
Recently I used C# and Visual Studio 2015 community to create myself a similar small GUI interface for the work I was doing. I have previously used Python with QT. The extra hoops I had to work through to get an EXE from python definatly made the choice of python at the time a downside.
C# has a large amount of libraries available for it using the NUGET libraries in Visual Studio. VB is quite dated (but still quite usable) compare to C#.
Python also has a large number of currently supported opensource libaries.
As you don't have any experience on C# (As mentioned in a comment) then you should go with VB.Net. I guess it has all the features you described you needed. But I would recommend you to learn C# as soon as possible if you want to become a good Coder because C# language is similar to many other famous/ popular and strong Coding Languages so it will be easier to learn other languages too when you would need them.
I too don't have much knowledge about C# and am trying to learn it. Believe me it's much more convenient than VB.Net as per my few experience.

GUI IDE with PyDev Eclipse

I have 2 weeks to finish my final year project.I need a GUI IDE or a GUI framework compatible with PyDev and Eclipse.
I cannot spend time learning something cause the functionality is yet to be completed.I'm looking for very simple GUI for a simulation game.
PyQt is the fastest GUI toolkit to develop with IMO, partly because you can use Qt Designer to design your GUI instead of coding it by hand.
You may want to also check out pygame - http://www.pygame.org/news.html
I need a GUI IDE or a GUI framework compatible with PyDev and Eclipse.
There is no Eclipse embedded GUI editor for any of the Python GUI frameworks, but it's not so bad. Do you really need for it to be integrated on Eclipse?
The closest you can get is may be use Jython and use some swing GUI editor.
Depending on the framework you want to use (GTK+/QT3/QT4/wxWidgets) you'll get to choose a graphical GUI editor.
I cannot spend time learning something cause the functionality is yet to be completed.
It doesn't matter what tool we give you, you are going to have to learn to use it.
I'm looking for very simple GUI for a simulation game.
If what you want is to develop is a game, you should take a look at PyGame (must read) and Cocos2D, although there a lot more others.
This page http://wiki.python.org/moin/GuiProgramming has a fairly complete list of gui frameworks and gui builders. I don't have too much experience with building gui's, but I've done a little bit with WxPython and PyQt. Both seem fairly easy to get a basic gui going quickly.
I haven't used a gui builder, but hand coding a gui in python is not nearly as painful as it is in other languages in my opinion, so I don't think they are really necessary for a simple gui.
Also, I think either of these frameworks would be compatible with PyDev and Eclipse. You just have to install the library and import them into your existing code.
I just installed mine folowing this tutorial. give it a try

How to get started building a Mac application

I am a Python/web programmer.
Now, I would like to transition to building applications for the Mac.
Please tell me--what do I have to learn to get started?
What books would you recommend?
Assuming that you included the "python" tag after considering that it will be interpreted as applying to the question and not the questioner, you must be interested in writing Python applications for the Mac, right? After all, you didn't include "web" as one of the tags too.
If that's true, I'm not sure what more you need to know already, other than perhaps picking a GUI framework, if you want to write GUI applications.
I use wxPython quite successfully for applications which run on OS X (and Windows). Very few Mac-specific issues have cropped up to cause trouble, primarily because both Python and wxPython are remarkably cross-platform. The few that have come up are by and large documented and have known workarounds, or the resolution is fairly simple to find.
I've needed no books on the subject, and really know very little about Macs. It really hasn't been a problem so far.
The programming language of choice for building OS X gui applications is Objective-C with Cocoa, I would recommend that you check out some books on that. There are python bindings for Cocoa but they are not optimal.
You should check out previous questions looking for books on Obj-C and Cocoa.

Applications of Python

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.

What Python GUI APIs Are Out There? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Simple question:
What Python GUI API's are out there and what are the advantages of any given API?
I'm not looking for a religious war here, I'm just wanting to get a good handle on all that is out there in terms of Python GUI APIs.
Here's a good list.
I've used Tkinter and wxPython. Tkinter is quite basic, and doesn't use native widgets. This means that Tkinter applications will look the same on any platform – this might sound appealing, but in practice, it means they look ugly on any platform :-/ Nevertheless, it's pretty easy to use. I found Thinking in Tkinter very helpful when I was learning, because I'd never done any GUI programming before. If things like frames and layout algorithms and buttons and bindings are familiar to you, though, you can skip that step.
You can augment Tkinter with Tix (but be warned, Tix doesn't play well with py2exe). Also check out Python Megawidgets, which builds some more advanced controls using the Tkinter basics.
Finally, Tkinter plays nice with the shell: you can start the interpreter, do things like 'import tkinter' 'tk = tkinter.Tk()' etc. and build your GUI interactively (and it will be responsive). (I think this doesn't work if you use IDLE, though)
wxPython is much better looking, and ships with a much greater range of controls. It's cross-platform (though it seems a bit finicky on my Mac) and uses native controls on each platform. It's a bit confusing, though. It also ships with a demo application that shows off most of its features, and provides a test-bed for you to experiment. Some specific thoughts on wxPython:
There are three (?) different ways to lay widgets out. Ignore two of them; just use Sizers. And even then, you can do just about any layout using only BoxSizer and GridBagSizer.
All wx widgets have IDs. You don't need to care what the IDs are, but in the old days (I think) you did need to know, so some old code will be littered with explicit ID assignments. And most demo code will have -1 everywhere as the ID parameter (despite the fact that the methods all have ID as a keyword parameter that defaults to -1 anyway).
Make sure you get the standard wxWidgets docs as well as the wxPython Demo – you need them both.
If you want to use wxPython with py2exe and you want it to look good on Windows XP, you need a bit of trickery in your setup.py. See here
PyQt is excellent if you have experience or interest in Qt.
http://www.riverbankcomputing.co.uk/software/pyqt/intro
Most python GUI APIs will be wrappers around the most common c/c++ GUI APIs. You've got a python wrapper for gtk, a python wrapper for qt, a python wrapper for .NET, etc etc.
So really it depends on what your needs are. If you are looking for the easiest way to draw native-looking widgets on Linux, Mac, and Windows, then go with wxPython (python wrapper for WX Widgets). If cross-platform isn't one of your needs though, other libraries might be more useful.
Instead of posting a list of your options I will give my humble opinion:
I am in love with wxPython.
I have used Qt in C++ and Tk way back in the Tcl days but what really makes me like wxPython is the demo that you get with it. In the demo you can browse through all the different widgets frames etc that are part of the framework see the source code and actually see how it looks while it is running.
I had some problems getting the Linux version build and installed but now that I have it available I use it all the time. I have used wxPython for small data analysis applications and I have written several internal tools related to comparing test results, merging source code etc.
I found this link a long time a go: http://www.awaretek.com/toolkits.html. It suggests a tookit based on your criteria. For me it suggests wxPython all the time. Anyway it gives you a bunch of scores on the various toolkits. What is right for me may not be right for you. But it gives you how all the tookits scored according to your criteria, so if you don't like the top toolkit for some reason you can see which ones are closest to your criteria.
QT/GTK/WxWidgets (formerly wxWindows) seem to be among the most mature cross platform GUI toolkits. The only issue is that none is installed with the default installation of Python, so you may have to compile the libraries. If you want something with no installation required that just runs, then go with TKInter because as has been mentioned it is installed by default with Python.
Anyway my criteria were 9 on Ease of Use, 10 on maturity of documentation/widgets, 10 on installed base, 5 on gui code generators, 10 on native look and feel for both windows/linux and 1 and 5 for the last two, I'm not big into Mac OSX (even with a 10 here it suggests wxpython).
PythonCard is really easy to use. That's what I would recommend.
Here's their writeup:
PythonCard is a GUI construction kit
for building cross-platform desktop
applications on Windows, Mac OS X, and
Linux, using the Python language.
The PythonCard motto is "Simple things
should be simple and complex things
should be possible."
PythonCard is for you if you want to
develop graphical applications quickly
and easily with a minimum of effort
and coding. Apple's HyperCard is one
of our inspirations; simple, yet
powerful.
PythonCard uses wxPython. If you are
already familiar with wxPython, just
think of PythonCard as a simpler way
of doing wxPython programs with a
whole lot of samples and tools already
in place for you to copy and subclass
and tools to help you build
cross-platform applications.
EasyGUI is different from other GUIs in that EasyGUI is NOT event-driven. It allows you to program in a traditional linear fashion, and to put up dialogs for simple input and output when you need to. If you have not yet learned the event-driven paradigm for GUI programming, EasyGUI will allow you to be productive with very basic tasks immediately. Later, if you wish to make the transition to an event-driven GUI paradigm, you can do so with a more powerful GUI package such as anygui, PythonCard, Tkinter, wxPython, etc.
EasyGui Website
WX has issues on the Mac.
I had a look here, as I want to get an event driven GUI API to do some stuff in Python. I have wx installed on my mac as part of MatPlotLib, but it does not work properly. It wont take in put from the keyboard. I have installed this three times on three different Mac operating systems, and though it worked the first time, the other two times I had this issue.
This version I am using with Enthought's distribution, so no installation was necessary. When I have installed it separately, there were so many dependent installations, that it was a trial to install.
From what I have read here, I will give Tkinter a go, as this needs to be simple and cross platform, but I thought I would just share the above with you. I like the Mac OS for a number of different reasons, but python tools install far easier on Windows (and probably other Linux). I just thought I would give a Mac perspective here.
I like wxPython or Tk.
Tk comes with the standard Python distribution so you don't need install anything else.
wxPython (wxWigets) seems much more powerful and looks a lot nicer. It also works well cross-platform (though not perfectly because it uses different underlying graphic API's on diff system types)
I prefer PyGTK, because I am a GNOME guy. Using PyGTK feels very pythonic to me. The code organization feels consistent, the documentation is clean and thorough, and it's a very easy toolkit to get used to (except for maybe Treeviews).
An easy to use GUI creator for Python doesn't exist. That's amazing really considering small scripting languages like AutoIt and AutoHotkey have great and very simple to use GUI makers. Come on, Python followers, can't you do better?
I've been working with wxPython for a few years now and I like it quite a bit. The best thing about wxPython is that the UI feels native on the different platforms it runs on (excellent on Windows and Linux though not as good on OS/X).
The API lacks some consistency, but you quickly get used to it.
You can check out Testuff (shameless plug, as it's my own product) to get a feeling of what can be done with wxPython (although I must say, with quite a bit of effort).
wxPython, and I'm assuming PyGTK also, can use wxGlade to help you design most UIs you will create. That is a big plus. You don't have to learn how to hand-code the GUI until you're ready. I made several GUI programs straight from wxGlade before I was comfortable enough in how wxPython worked to take a shot at hand-coding.
PyQt has a similar graphic layout device but I've never had good luck getting PyQt to compile correctly. There was also a lack of tutorials and documentation that showed how to create the final Python code; many of the documents I found referred to the C++ version of Qt.
Tkinter is good for quick and dirty programs but, realistically, if you use wxGlade it may be faster to make the program with wxPython. At a minimum, you can use wxGlade to show a visual representation of the program to a client rather than take the time to hand-code the "dummy" program.
There are python-specific gui-api such as kivy (successor or pymt), pygui (based on pyrex), pyui and nufox, which do not compare with the more robust toolkits like wxpython, pyqt, pygtk and tkinter.
They are just extra optional tools.
The only thing unique about them is these are python-specific api, just like there are prima (perl-specific api) and shoes (ruby-specific api). It helps us to understand that when tk is tcl-based port of api (and others are c and c++ based), then these api are specifically done for the respective three scripting languages.
Out of these, kivy is the most robust, whereas pygui's coding is mentioned to be very python-like, pyui is least robust but worth trying and all of these should be portable wherever python or python-based application goes.
Then there is jpype which is a toolkit usable with jython and pydev, and which is actually java's japi customized under python/jython-interface.

Categories

Resources