Which console library to use in Python? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have very simple task to accomplish in python. Need to draw textual data (Unicode) as rows on the screen, navigatable and user can select/deselect row. However, this should work on headless Linux, as well as Windows or Mac OS. Curses doesn't have Windows port. Console module from Fredrik Lundh works only on Windows. I could use both libraries and check OS, but then it takes double effort to make/maintain the same functionality on 2 different libraries.
I'm looking for simple multiplatform console library to draw what I've described.

At a lower level you will have to use curses and there are several choices for the underlying curses library on Windows which may or may not work. You won't have any real problems with curses on UNIX so if I were you, I would get it working on Windows first and if a particular feature doesn't work their, program around it. The UNIX port should be painless.
PDCurses for Windows is available as a DLL or source code and it is possible to interface directly to any DLL using the ctypes module. There is a tool which can automatically generate a ctypes wrapper for you called ctypesgen.py http://wavetossed.blogspot.com/2011/07/asynchronous-gnu-readline.html I'm not sure if that works for a Windows DLL quite so automatically, but it does work from header files so it is worth a try.
For more background on ctypes, have a look at some of the questions here like Scheduling function calls in a Python curses UI

I recently had a similar issue for a package I was putting together (https://github.com/peterbrittain/asciimatics). I wasn't very happy with the solutions that required you to install (or worse) build separate binary executables like PDCurses or cygwin, so I created a unified API that provides console colours, cursor positioning and keyboard input for Windows and UNIX platforms.
There is a gallery of sample applications here. In more recent releases, I have also added a set of widget objects to allow you to create TUIs like this:
This is now live and has been tested on CentOS 6/7 and Windows 7/8. You can install it from PYPI using pip and then use the Screen class to do exactly what you want. If not, please post an enhancement request on GitHub and I'll see what I can do.

I use urwid. It's documentation is poor, but on the other hand, its source base is very compact. It supports Unicode well and works fine on Cygwin. Doesn't seem work in native CMD.exe, but it's worth closer investigating seeing how the curses dependency is only optional.
Examples from the project site:
(source: urwid.org)

Related

Recommendations for Python GUI application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What are your recommendations for GUI libraries for Python. My own research has me looking at TKinter, but I am open to suggestions.
FYI, the Python application will serve as a kind of bridge between 2 applications. It will use the third party API to extract data, then move and rename the data into a canonical folder structure, use Robocopy to transfer the exported into our in-house processing environment and make proper entries into our in-house database.
Just googling "GUI libraries for Python" you can get "GUI Programming in Python":
https://wiki.python.org/moin/GuiProgramming
Due to this site -- Python has a huge number of GUI frameworks available for it, from TkInter to a number of other cross-platform solutions ... Please, have a look at them ... and find out a suitable tool :)
Have a look at this for a list of some GUI development platforms.
Tkinter
Standard builds of Python include an object-oriented interface to the Tcl/Tk widget set, called Tkinter. This is probably the easiest to install and use. For more info about Tk, including pointers to the source, see the Tcl/Tk home page at http://www.tcl.tk. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix platforms.
wxWidgets
wxWidgets (http://www.wxwidgets.org) is a free, portable GUI class library written in C++ that provides a native look and feel on a number of platforms, with Windows, Mac OS X, GTK, X11, all listed as current stable targets. Language bindings are available for a number of languages including Python, Perl, Ruby, etc.
wxPython (http://www.wxpython.org) is the Python binding for wxwidgets. While it often lags slightly behind the official wxWidgets releases, it also offers a number of features via pure Python extensions that are not available in other language bindings. There is an active wxPython user and developer community.
Both wxWidgets and wxPython are free, open source, software with permissive licences that allow their use in commercial products as well as in freeware or shareware.
Qt
There are bindings available for the Qt toolkit (using either PyQt or PySide) and for KDE (PyKDE). PyQt is currently more mature than PySide, but you must buy a PyQt license from Riverbank Computing if you want to write proprietary applications. PySide is free for all applications.
Qt 4.5 upwards is licensed under the LGPL license; also, commercial licenses are available from The Qt Company.
These three are probably the most common ones but you can try others if you wish.
Having only used Tkinter and PyQt I would recommend PyQt, however this may not be what you need so I recomend doing some research to find out which will best suit your needs.

Best practices for management of a developer system on Mac OS X for non-developers [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm a designer who writes mostly Sass, Less (CSS pre-processors), HTML, Javascript and usually starts off with static site generators such as Jekyll, Yeoman, etc. While working with developers who code in Python, Ruby, Clojure, I help with the templates. In my free time, I design wordpress themes and write plugins in PHP. I run grunt regularly and bower helps me with components that I need for my designs.
This means my system is littered with Ruby Gems, Python libraries, Node Modules. They are either installed via gem installations, pip, brew or npm. Now you realize that my system is a mess even though it works. I really want to do stuffs in a sane manner, the right way.
So, what are the best practices for installation and management of all the libraries, core tools, etc. for a developer on Mac OS X. Point me to resources that I can read, ponder and practice.
Here is the scenario. You're a seasoned developer and I'm your friend who just got a new Mac OS X system. I'm a designer who will work with Python (mostly with Django), Ruby (with Rails), Clojure, PHP, Sass, Less, Compass, CoffeeScript, Git, NodeJS, Grunt, Bower, Jekyll, Yeoman and alike. As a friend, you know that I'm not a 'programmer' but a developer-friendly 'designer'. How can you help me setup my Mac? And I don't want to come back again when I get a new Mac in future, I should be able to just transition smoothly from my old setup.
Thanking in anticipation.
Github open sourced there developer environment setup tools. You could try that out. http://boxen.github.com/
For python I recommend using virtualenv to setup libraries instead of installing them globally. https://pypi.python.org/pypi/virtualenv
I am not sure what you meant by "How can you help me setup my Mac?". It seems that you are very much comfortable installing all the dependencies(gems and all) for your projects. If you want to automate all these environment installation setup then you may go ahead and write a generic shell script to install ruby, python and other stuff and reuse when you have a new machine :) and it has nothing to do with Mac OSX or any other OS. You just need to put correct package/version to fetch and install/compile accordingly in the script.
Would be great if you can put a specific question here in case you are facing technical problem installing any of the above packages.
If all that you are worried about is quickly setting up a new machine, use a backup software to setup the new machine. You can also try to use a custom time machine setup with just the folders that you are interested it.

Python vs Iron Python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have to make a GUI for some testing teams. I have been asked to do it in Python, but when I Google, all I see is about Iron Python.
I also was asked not to use Visual Studio because it is too expensive for the company. So if you have any idea to avoid that I would be very happy.
I am still new to Python and programming overall so not any to advanced solutions.
If you have any questions just ask.
GUI PART: with would you use when using windows and mac(most windows) I would like some drag and drop so I don't waste to much time making the display part
Python is the name of a programming language, there are various implementations of it:
CPython: the standard Python interpreter, written in C
Jython: Python interpreter for Java
IronPython: Python interpreter for the .NET framework
PyPy: Python interpreter written in Python
All of them are free (in the sense of not having to buy a license to use them), and can be used to create GUI programs. It really depends what you want to do and which OS you use.
There are various GUI frameworks/bindings for Python: Tkinter, PyGtk, PyQt, WinForms/WPF (IronPython) and the Java UI frameworks.
You also don't have to use Visual Studio for compiling .NET languages, there are open source alternatives like MonoDevelop.
IronPython is a implementation of Python running on .NET - however it is not the implementation that is in general referred to when someone mentions Python - that would be cPython: Website for (normal) cPython.
Now as to creating a UI - there are many ways that you can use to create a UI in Python.
If you only want to use what is available in a normal installation you could use the TK bindings: TKInter. This wiki entry holds a wealth of information about getting started with TKInter.
Apart from TKInter there are bindings to many popular frameworks like QT, GTK and more (see here for a list).
If cost is your concern, you can use a free version of visual studio together with PTVS: https://pytools.codeplex.com/wikipage?title=PTVS%20Installation
If you're just trying to create a GUI that runs on Windows, C# on Visual Studio is the easiest way to go. Their free version, Community (used to be Express) provides all the Windows controls you're used to using with a drag and drop GUI builder.
All implementations can run on Eclipse via PyDev. So it kills the argument of which one to use as it is all the same language, implementations other than this instance are more domain specific. Iron Python targets Microsoft, Jython targets Java, Python targets itself. Each environment naturally has its own complier/library all you are doing is trading environments by choosing one over the other. Each has its positives and negatives but naturally you would want to give Python a try before touching other environments as a beginners rule.

Is there a good IDE for building GUI apps with Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am a beginner programmer and have learned most of what I know thus far from using delphi for the past couple of months. A month or so back I decided to give python a try as I was told it may be easier to learn and I really like the language. I guess I just seem to pick things up easier using it.
The only problem is that I can't seem to find a good IDE for it that works in the way that Delphi does. I want to create desktop apps with nice GUIs so it would be nice to have something similar to Delphi/Visual studio to work with.
I have searched around and could find anything. Was wondering if anyone could lend a hand.
Also, from what I have gathered Ironpython seems to be the same as python coding wise. I don't mind my apps only being able to work on windows. Is Python Tools a good option. I mean is it basically like using visual studio but with python code instead?
Any help is much appreciated.
Thanks.
Boa Constructor is a classic RAD IDE for GUI applications (wxpython, both linux and windows). People is still using it but seems that development stopped some years ago. PythonCard is another RAD IDE I used in the past but also unmaintained right now
Although they are not IDEs, some tools are very helpful for GUI design like:
- wxglade (wxpython, included as a pluging in Stani Python Editor, only python2.x)
- qtdesigner (qt-pyqt or pyside, included in pyqt. Spyder IDE, build on pyqt, has a dedicated link to it. Works also for python 3.x)
I use PyGTK to interact with GTK.
http://www.pygtk.org/docs/pygtk/gtk-class-reference.html
http://www.pygtk.org/pygtk2tutorial/
But there is also QT, and WXpython, that are worthy.
http://thekompany.com/products/blackadder/
I always liked BoaConstructor which is a wxPython GUI Builder.
Doesn't seems to be actively maintained any longer though...
wxpython is very active though...
Python Tools is basically just like using VS but with Python. It's got intellisense, debugging, profiling, etc... When working w/ IronPython the .NET debugger is a little rough (you'll see internal implementation details) but you can still use the pure Python debugger which gives you a Pythonic view.
The intellisense engine is aware of the GUI designer so you'll get completions against the controls defined in XAML. And you'll get auto-definition of handler methods when you do things like double click on buttons in the GUI designer or select to define an event handler in the properties pane. Probably the biggest missing thing is that there's no support for user controls and there's also no designer support for WinForms.

What is a good tutorial on the QuickTime API for MS Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm working on a project that has to read and manipulate QuickTimes on Windows. Unfortunately, all the tutorials and sample code at the Apple site seem to be pretty much Mac specific. Is there a good resource on the web that deals specifically with programming QuickTime for Windows? Yes, I know that I can bludgeon my way (eventually) through the Mac stuff and eventually get something to work, but I would really like to see a treatment of the cleanest and best way to deal with it on Windows and what gotcha's to beware.
For extra points, it would be cool to see how someone might use the QuickTime API from a dynamic language like REBOL or Python (no, the Mac Python QuickTime bindings don't count!).
Thanks!
QuickTime For Windows starts off with the differences between Mac OS and Windows programming and Building QuickTime Capability Into a Windows Application then discusses how to incorporate the capability into Windows platform
There is an official mailing list for QT developers. It has an archive. It would certainly be worth subscribing to it if you are seriously trying to use QT for something, especially if it is the slightest bit off the beaten path.
IMHO, the official docs are more than a little too Apple-centric. Note that the Windows book assumes you already have experience with QT on Macs. At the time I was looking (about a year ago), I had a mandate to deal with QT from .NET, either from C# or managed C++. That was not a well documented way of doing things then.
There is a body of sample code for Windows somewhere at the Apple developer site, which might help if you can find it. I seem to have lost the links I had at one time. Just knowing it does (or did a year ago) exist might be enough to nudge you in the right direction.
Almost all of the sample code available is ordinary C or C++.
I have started a Google code project with my QuickTime for Windows code at code.google.com/p/qtip. The idea is to structure things in a semi-tutorial fashion (as I learn this stuff myself!) so that others can learn from my pain...

Categories