[Tutor] Help with Max Number and Min number script
inp = raw_input largest = None smallest = None while True: num = raw_input('Enter a number: ') if num = 'done' : break print num try : num = float(inp) except : print 'Invalid input' continue if largest is None or num > largest : largest = num if smallest is None or num < smallest : smallest = num print 'Maximum is:', largest print 'Minimum is:', smallest ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] [Fwd: Re: Which Designer]
Thankyou for your advice and I will strive to do this. Sharon Original Message Subject:Re: [Tutor] Which Designer Date: Mon, 26 Apr 2010 13:37:15 -0300 From: Ricardo Aráoz Reply-To: rar...@bigfoot.com To: Sharon References: <4bd44500.9060...@gmail.com> <4bd4e2d8.70...@gmail.com> Sharon wrote: I think you are probably right. The only other sort of programming I did before I started on python was really 'VBA' and everything was done with GUI. I think that is what was in my mind. I have started using Tkinter and it isn't so bad. I just like the idea of having the visual side of actually seeing the buttons and whistles on the form ready. I have looked at QT, GTK and wxGlade but it is all more complicated than 'visual basic' and not at all rad like. So, for now I'll stick with my book and use Tkinter to get to grips with binding the widgets to the event handlers. So maybe a bit of advice. Get your app together as a set of functions and/or classes (your business layer) that called appropriately will deliver all the functionality you need. Then whether you call those functions from a console app, Tkinter, Wxpython, web app, or even a test suite, will make no difference at all and porting them will be real easy. Buttons should have no code but a call to a function in your business layer, grids when instantiated or updated should call a function in your business layer that should provide the appropriate data set, etc. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] [Fwd: Re: Which Designer]
Thank you both for your help and insight. It has given me room for thought. Much appeciated, Sharon Original Message Subject:Re: [Tutor] Which Designer Date: Mon, 26 Apr 2010 09:09:59 +0100 From: Alan Gauld To: tutor@python.org References: <4bd44500.9060...@gmail.com> <4bd4e2d8.70...@gmail.com> <20100426013130.ga80...@dragon.alchemy.com> "Steve Willoughby" wrote However, there are some real disadvantages to Tk(inter) as well, chiefly that it is a least-common denominator which does a passable job of running GUIs but they don't look consistent with the native look of Windows or OS/X The new themed widgets in Tk have changed that, they are built on the native widgets and look just like any other GUI. Available in Tkinter from Python 2.7 and 3.1 or whatever. And there is a lot of missing functionality. This is still true although Tix addresses the biggest gaps - but is sadly lacking documentation - you have to use the Tcl/Tk docs :-( (I keep intending to do a write up on Tix but other things get in the way!) And there are other bolt-ons too such as PMW. I'm getting into wxPython at the moment, and I have to say it's at least worth a look. It's also available for every platform (but doesn't come with Python), and is far more complete, and just about as easy to use as Tk, but looks a lot more polished. wxPython is definielt more powerful and in particular has support for things like printing and drag n drop which are missing fromTk. There are other toolkits with their advocates as well, of course, but if someone were just starting out with Python GUI programming, I'd recommend looking around at your options before starting with Tk. I'd still advocate Tk because a) It comes with Python so is standard b) It is also the standard GUI in Ruby, Perl and Tcl so once learned is oportable c) It is best documented with many books etc featuring it d) It is easy to learn the basic GUI principles that are valid in any Framework (a bit like learning Python is good becauise it helps you learn other languages) HTH, -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Which Designer
I think you are probably right. The only other sort of programming I did before I started on python was really 'VBA' and everything was done with GUI. I think that is what was in my mind. I have started using Tkinter and it isn't so bad. I just like the idea of having the visual side of actually seeing the buttons and whistles on the form ready. I have looked at QT, GTK and wxGlade but it is all more complicated than 'visual basic' and not at all rad like. So, for now I'll stick with my book and use Tkinter to get to grips with binding the widgets to the event handlers. Thank you for your advice, Sharon Alan Gauld wrote: "Sharon" wrote I am a newbie to python but would like to use a designer for simplicity. Which would be the easiest to use: WxGlade Qt 4 Designer Glade Interface Designer (Gtk) These are all GUI builders so I assume you want to write GUIs? If so which GUI toolkit are you intending to use because the GUI builders all tend to be specific to one particular tookit, which limits your options. Choose your toolkit and the GUI builder is chosen for you... At this point in time I would be looking at the simplest for a newbie until my programming skills in Python improve. Appreciate a few opinions on this. The simplest toolkit or the simplest tool? Picking the simplest tool may leave you writing code for a complex toolkit? OPne of the simplest GUI tookits is the standard Tkinter that comes with Python. But the tools for building GUIs for Tkinter are not great! But toolkits like Gtk and Qt have better tools but tend to be much more complex than Tkinter (more powerful too of course - it tends to be the case in programming that power and complexity are closely linked!) Maybe you should stick to simple programming first and worry about the GUI stuff later? Or are you already comfortable with command line/console programs and its only the GUI stuff that is new? To really help we need to know more. HTH, ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Which Designer
Hi, I am a newbie to python but would like to use a designer for simplicity. Which would be the easiest to use: WxGlade Qt 4 Designer Glade Interface Designer (Gtk) At this point in time I would be looking at the simplest for a newbie until my programming skills in Python improve. Appreciate a few opinions on this. Regards Sharon ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] A basic question
I have been trying how to get a any python program to run by clicking on the icon. I keep reading on the internet make it executable: chmod a+x try_python.py Where do I actually put the above expression so that it will work everytime. If I then sent this try_python.py to someone else with Ubuntu would it run on their system? Sorry if this is too basic but it is an assumption that seems to be made and I really am a complete beginner. Thanks for any help Sharon ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor