Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 4, 2012, 10:04 PM   #1
itsmrjon
macrumors regular
 
Join Date: Jun 2011
Location: Chicago
Questions for Python gurus!

So for those of you very familiar with GUI's in Python, I'd like to ask a few questions about a starting point. I'm attempting to write a rather simple GUI for an F95 CFD code I have. All it really needs is a few checkboxes and some simple prompts which will then either be written to a text file (the bump file as we call it) or I may attempt to use F2PY. Nonetheless, here are the questions:

1) Since the program will be run on both Linux (Redhat) and OSx machines, which GUI framework would you recommend? Ease of use and minimal dependencies are my goal (these codes are run on supercomputers, so I may not have appropriate permissions to install additional software)

2) What are some good reference materials (more than just the tutorials on the host site)? Preferable in depth tutorials as I have very little experience with Python.

3) Does anyone have experience with F2PY? Is it a good option?

4) Anything additional you'd like to throw in? Warnings, recommendations, flaming etc?

Thanks in advance!
__________________
You can have your own opinions, but you can't have your own facts.
itsmrjon is offline   0 Reply With Quote
Old May 5, 2012, 07:27 AM   #2
ytk
macrumors regular
 
Join Date: Jul 2010
I can't answer the rest of your questions (I'm more of a Ruby type) but as for question 1, have you considered using curses? Your interface will be... functional, at best, but it's the only GUI framework I know of that you can pretty much be assured will run—and look the same—damn near anywhere. As an added bonus, you can run it over an ssh connection with very little hassle, which might prove useful if you're running it on a supercomputer.
ytk is offline   0 Reply With Quote
Old May 5, 2012, 09:11 AM   #3
subsonix
macrumors 68040
 
Join Date: Feb 2008
I'm far from a Python guru, but you should check out Tkinter it's installed and ready to go on OS X. http://wiki.python.org/moin/TkInter
subsonix is offline   0 Reply With Quote
Old May 5, 2012, 09:56 AM   #4
blueillusion
macrumors member
 
Join Date: Aug 2008
 
I use PySide : http://www.pyside.org/

It's an officially supported gui toolkit that hooks into the Qt C++ framework.
The documentation section gives you a thorough set of examples to play with, and has an endless amount of written documentation.

Pros:
-Officially supported
-Cross platform
-Look and feel (almost) identical to your running host
-Virtually can take existing Qt C++ code, rewrite it in python syntax, and it will work

Cons:
-Potential steep learning curve (especially if you dont know what Qt is already)
-Can be a pain to get pyside packages on older distro builds (eg Ubuntu lucid 10.04 lts)
-The Modal/View widgets are really over-engineered, so it's not to easy to deal with custom TableViews and grid views.

I use Qt, Python and Obj-C on a daily basis, so transitioning to PySide from Qt C++ literally only took about an hour.

I know you said you are new to python, but im not sure if you already have used some gui toolkits already. If you have, you should be able to use PySide fairly quickly. If not, then you will have a steep learning curve no matter which toolkit you choose.

EDIT:
Just noticed that you said you might not be able to install extra packages on your deployment targets.
If that's the case, then TKinter is probably the safest choice as it is included with python already

Last edited by blueillusion; May 5, 2012 at 10:00 AM. Reason: Missed an important fact
blueillusion is offline   0 Reply With Quote
Old May 5, 2012, 10:51 AM   #5
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
This isn't answering the question directly, but I thought I'd toss this out there. I'd be inclined to drive the configuration of your fortran program using text files. If people want to write scripts themselves, it's easy. If someone wants to make tweaks, no problem. You want to write a GUI? Do it with whatever tool you want, generate the text file, done. You could invoke the fortran program with the file you generate if you'd like to "integrate" the process.

This lets you use any GUI tool, the GUI could be run elsewhere and the file could be copied to your big machine for use, you can copy config files between dev/test/production easily, if there's a problem you can have the user send you the file they ran with, etc.

I don't think tightly integrating a GUI config with an otherwise "headless" app on a supercomputer makes a lot of sense.

-Lee
lee1210 is offline   0 Reply With Quote
Old May 5, 2012, 04:04 PM   #6
itsmrjon
Thread Starter
macrumors regular
 
Join Date: Jun 2011
Location: Chicago
Quote:
Originally Posted by ytk View Post
I can't answer the rest of your questions (I'm more of a Ruby type) but as for question 1, have you considered using curses? Your interface will be... functional, at best, but it's the only GUI framework I know of that you can pretty much be assured will run—and look the same—damn near anywhere. As an added bonus, you can run it over an ssh connection with very little hassle, which might prove useful if you're running it on a supercomputer.
Honestly I never even considered it, but this is a great and potentially genius option! It would prevent us from having to run an xsession on the host machine. I'm going to look into this more.

Quote:
Originally Posted by lee1210 View Post
This isn't answering the question directly, but I thought I'd toss this out there. I'd be inclined to drive the configuration of your fortran program using text files. If people want to write scripts themselves, it's easy. If someone wants to make tweaks, no problem. You want to write a GUI? Do it with whatever tool you want, generate the text file, done. You could invoke the fortran program with the file you generate if you'd like to "integrate" the process.

This lets you use any GUI tool, the GUI could be run elsewhere and the file could be copied to your big machine for use, you can copy config files between dev/test/production easily, if there's a problem you can have the user send you the file they ran with, etc.

I don't think tightly integrating a GUI config with an otherwise "headless" app on a supercomputer makes a lot of sense.

-Lee
This is currently the way we do it for the most part. We hand write our bump files which are read by the program to run the case. I currently have a matlab program that writes the bump files, but running matlab everytime I want to setup a new case is a pain.

You're right, I may stay away from f2py all together just to keep the portability.
__________________
You can have your own opinions, but you can't have your own facts.
itsmrjon is offline   0 Reply With Quote
Old May 5, 2012, 04:21 PM   #7
thundersteele
macrumors 68030
 
Join Date: Oct 2011
I've played a bit with kivy but it's probably overkill for you.
thundersteele is offline   0 Reply With Quote
Old May 5, 2012, 04:52 PM   #8
itsmrjon
Thread Starter
macrumors regular
 
Join Date: Jun 2011
Location: Chicago
Quote:
Originally Posted by thundersteele View Post
I've played a bit with kivy but it's probably overkill for you.
I've also given kivy a shot, rather steep learning curve for a guy who spends most of his time writing FORTRAN
__________________
You can have your own opinions, but you can't have your own facts.
itsmrjon is offline   0 Reply With Quote
Old May 5, 2012, 08:11 PM   #9
thundersteele
macrumors 68030
 
Join Date: Oct 2011
Quote:
Originally Posted by itsmrjon View Post
I've also given kivy a shot, rather steep learning curve for a guy who spends most of his time writing FORTRAN
Well, actually I found it somewhat more straightforward than other python GUI packages. I remember having problems getting Tk/Tkinter to install on Linux, dependencies were always a problem.

My main issue with kivy was that they use OpenGL optimization, which makes a simple hello world program trigger the discrete GPU on OSX.
thundersteele is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Compressor 3 and 4 gurus help rei101 Digital Video 3 Sep 26, 2013 12:28 AM
Any Tranmission Gurus out there iampaulb Mac Applications and Mac App Store 1 Jan 31, 2013 06:27 PM
Help from the Siri gurus lankox iOS 6 3 Oct 16, 2012 06:06 PM
Personal Finance Gurus, Help me out! kilj0y Community Discussion 2 Sep 24, 2012 10:43 AM
for all you iPhone gurus brianecclpark iPhone 0 Jun 10, 2012 06:15 PM

Forum Jump

All times are GMT -5. The time now is 11:22 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC