i have an application of text to speech convertor and now want to prepare an graphical interface for it.I did whole of the coding involved in python..i want to know which languages can be used for creating the GUI so that i can connect my python code to it easily..can python be used for creating the gui..
as i have no previous experience of creating the gui,would like to take ur suggestion for making the gui which is attractive not just plain thing such as we get using vb or anything else..
looking for your suggestion plz
There are many GUI toolkits for python:
http://wiki.python.org/moin/GuiProgramming
I would look at PyQT and wxPython first.
Yes, a GUI can be created in Python, I recommend wxPython.
You can find a list of GUI programming packages for Python in this page http://wiki.python.org/moin/GuiProgramming
If you're unfamiliar with Python GUI development, I recommend Glade. It's got a fairly intuitive interface, good documentation, and allows you to get things done quickly.
Related
The question may not have been clear as there was not much of a better way for me to word it but I will do my best here: Most scripting is done raw in the IDE. When coding with Python it simply runs everything through the "console." I was wondering how full-on apps with different screens and all that cool stuff are made with Python as well, other than just being a console with many different commands?
Basically if you want to design cool stuff with colours and nice picture, you can use turtle. Turtle is a cool library which allows you to draw turtles and other cool animations. Useful for beginners like you :)
If you're talking about gui (graphical user interface) applications tkinter module is what you're looking for allowing you to create simple gui applications.
Here is a link to the documentation
https://docs.python.org/3/library/tkinter.html
should be included in python by default.
At the moment I have to develop some python tools, because nearly every software I use (QGIS, FreeCAD, Gimp, probably my toothbrush ...) has a python interface.
I would like to write lazarus applications (with button, edits and all the nice components), that uses my python routines in the background and show the results in lazarus.
Is there a way?
Here's an example at the Lazarus forum how to use the Python for Lazarus package. From Lazarus Online Package Manager it installs automatically.
https://forum.lazarus.freepascal.org/index.php/topic,43557.msg305118.html#msg305118
Set PythonEngine.IO to PythonGUIInputOutput, then choose a control for PythonGUIInputOutput.Output to show data and your good to go.
You could try to use
https://github.com/pyscripter/python4delphi
that is a binding between the two.
There is also always available the possibility of implementing a web server with python and publish its services on http for use from lazarus.
Note however that if what you want is a GUI then Qt (using PyQt or PySide) is a very complete GUI library with a very good binding for Python... it has all the widgets you can imagine, and then some more.
In that case all the code you write is in Python.
For a couple of days, I was trying to find appropriate GUI test tools for toolkits (wxwidgets). The program that am going to test is written in python.I have tried SQUISH but it did not work when using "Verification Point", meaning that object property values were not appearing in squish. The GUI testing tool doesn't have to be free or open source, as long as it meets the above requirements and that you have "first-hand" experience using the framework. I would really appreciate any guidance.
You are probably looking for tools like these:
http://uiautomationverify.codeplex.com/
https://github.com/ldtp/cobra
http://sikuli.org/
wxPython also comes with wx.UIActionSimulator which you could probably use for automated testing.
The squish framework doesn't work with wxwidgets, to my knowledge. It might work with PyQt though and possibly Tkinter
Actually working on a project in python with PyQT, we choose to create widgets that were "unpleasant" or that didn't have a good enough behaviour.
So, we finally found that QToolbox, QDate and some others had a behaviour non acceptable for the project, so we had to adapt these.
We had also to create a complete new widget : A scheduler.
As we were creating these, it has been decided that it took too much time. So we were asked to think about other libraries.
I actually found a project of a scheduler in wxPython, that actually looks like what we want ( but we believe that we'll have to adapt it a lot ). Here it is : http://code.google.com/p/wxscheduler/
So, I ask everyone that have some more experience than me in GUI programming in python : Do we need to start again the project in anything other than PyQT? I know the question is weird, but what you need to know is :
The project has now been going on for 2 months
I know only PyQT, and started working in python 2 month ago
We are currently 3 in the project, and we currently know only PyQT
We have currently managed a lot of the PyQT widgets, and were starting to code these new widgets.
Please help us =)
Thanks
Edit : I should have add that the project is opensource and multi-platform
Feel free to look at other libraries if you like. Robin Dunn, the creator of wxPython, recently started working on PySide and he found it somewhat similar to wx, so you might find that wxPython will fit your brain fairly well too. I certainly think wx's class names are more intuitive than PyQt's. The only way to know for certain is to actually experiment a little and see if it works. I will say that the wxPython community is one of the best Python communities I've dealt with over the years.
One possibility would be to use an HTML scheduler control via QtWebKit. If your UI can accommodate a QWebView in the place where you'd otherwise have a custom scheduler widget, there are probably a number of excellent scheduler widgets (implemented as jQuery plugins, etc.) you could choose from.
we choose to create widgets that were "unpleasant" or that didn't have
a good enough behaviour.
Why don't you create "pleasant" widgets ?
so we had to adapt these.
Yes. It is the solution.
it has been decided that it took too much time
Don't you think it would take much more time if you change the whole GUI API ?
As for i know, there is not such native Scheduler in any Python GUI library, especially one you could use with Qt. I don't think it would be so long to recreate one, unless you have very specific needs, that would confirm you wouldn't find a such existing thing in an existing library.
Concerning wxScheduler, i guess you can have a look to the code, even it uses wxWidget and you're working with Qt, to get an idea how to do it.
I recently did some work modifying a Python gui app that was using wxPython widgets. I've experimented with Python in fits and starts over last six or seven years, but this was the first time I did any work with a gui. I was pretty disappointed at what seems to be the current state of gui programming with Python. I like the Python language itself a lot, it's a fun change from the Delphi/ObjectPascal programming I'm used to, definitely a big productivity increase for general purpose programming tasks. I'd like to move to Python for everything.
But wxPython is a huge step backwards from something like Delphi's VCL or .NET's WinForms. While Python itself offers nice productivity gains from generally programming a higher level of abstraction, wxPython is used at a way lower level of abstraction than the VCL. For example, I wasted a lot fo time trying to get a wxPython list object to behave the way I wanted it to. Just to add sortable columns involved several code-intensive steps, one to create and maintain a shadow-data-structure that provided the actual sort order, another to make it possible to show graphic-sort-direction-triangles in the column header, and there were a couple more I don't remember. All of these error prone steps could be accomplished simply by setting a property value using my Delphi grid component.
My conclusion: while Python provides big productivity gains by raising level of abstraction for a lot of general purpose coding, wxPython is several levels of abstraction lower than the gui tools available for Delphi. Net result: gui programming with Delphi is way faster than gui programming with Python, and the resulting ui with Delphi is still more polished and full-featured. It doesn't seem to me like it's exaggerating to say that Delphi gui programming was more advanced back in 1995 than python gui programming with wxPython is in 2009.
I did some investigating of other python gui frameworks and it didn't look like any were substantially better than wxPython. I also did some minimal investigation of gui formbuilders for wxPython, which would have made things a little bit better. But by most reports those solutions are buggy and even a great formbuilder wouldn't address my main complaints about wxPython, which are simply that it has fewer features and generally requires you to do gui programming at a much lower level of abstraction than I'm used to with Delphi's VCL. Some quick investigating into suggested python gui-dev solutions ( http://wiki.python.org/moin/GuiProgramming ) is honestly somewhat depressing for someone used to Delphi or .NET.
Finally, I've got a couple of questions.
First, am I missing something? Is there some gui-development solution for Python that can compare with VCL or WinForms programming? I don't necessarily care if it doesn't quite measure up to Delphi's VCL. I'm just looking for something that's in the same league.
Second, could IronPython be the direction to go? I've mostly tried to avoid drinking the .NET koolaid, but maybe IronPython gives me a reason to finally give in. Even then, does IronPython fully integrate with WinForms, or would I need to have the forms themselves be backed by c# or vb.net? It looks to me like that definitely is the case with SharpDevelop and MonoDevelop (i.e, IronPython can't be used to do design-time gui building). Does VS.NET fully integrate IronPython with gui-building?
It really seems to me like Python could "take over the world" in a way similar to the way that Visual Basic did back in the early 1990's, if some wonderful new gui-building solution came out for Python. Only this time with Python we'd have a whole new paradigm of fast, cross platform, and open source gui programming. Wouldn't corporations eat that up? Yeah, I know, web apps are the main focus of things these days, so a great Python-gui solution wouldn't create same revolution that VB once did. But I don't see gui programming disappearing and I'd like a nice modern, open source, high level solution.
seems your complains are about wxPython, not about Python itself. try pyQt (or is it qtPython?)
but, both wxPython and pyQt are just Python bindings to a C / C++ (respectively) library, it's just as (conceptually) low level as the originals.
but, Qt is far superior to wx
PyQt is a binding to Qt SDK from Nokia, and PyQt itself is delivered by a company called RiverBank.
If licence is not important for you you can use PyQt under GPL or you 'll pay some money for commercial licence.
PyQt is binding Qt 4.4 right now.
Qt is not just GUI, it's a complete C/C++ SDK that help with networking, xml, media, db and other stuff, and PyQt transfer all this to python.
With PyQt you'll use Qt Designer and you 'll transfer the .ui file to .py file by a simple command line.
You 'll find many resources on the web about PyQt and good support from different communities, and even published books on PyQt.
Many suggestions consider that RiverBank has no choice but to release the next version which 'll depend on Qt 4.5 under LGPL, we are waiting :).
Another solution is Jython with Java Swing, very easy and elegant to write (specially under JDK 6), but not enough resources on internet.
You may want to look at Jython (Python on the Java VM). It is very similar to Iron Python, and you can fore go the .Net koolaid.
dabo puts wxPython programming at a higher level like what you're looking for.
You're probably going to have to use the .net or java pythons, but check this out first and see if it meets your requirements:
Kiwi
Short answer: Don't try Tkinter - it's got all the problems described above.
Long answer: Tkinter is not useful for large programs. Handling the various pieces with it somehow invariably degenerates to juggling (which never happens otherwise) and the resulting output doesn't look native or particularly polished.
You are right, wxPython can definetely be improved. But i think Robin Dunn has done a great job so far, and still is.
Especially the wxPython community is open to improvements, like recent inclusion of the widgets by Andrea, so like many community projects pick the one you like most, and improve it while using it.
We've been quite happy using Python.Net to build our UIs in WinForms and using CPython for Presenter, Model. IronPython is also a good tool if you want to do python on Windows.
There is Wax, whose purpose was to create a more pythonic interface to wxWidgets, but it seems its development has stalled.