[Tutor] Determinw Tkinter checkbox state, was Re: question

2011-01-13 Thread Peter Otten
Stinson, Wynn A Civ USAF AFMC 556 SMXS/MXDED wrote: [In the future please take the time to choose a meaningful subject] > Can someone give me some sample code to use to determine if a checkbox > has been selected using Tkinter? thanks Method 1: check the state of the underlying variable: import

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread David
On 5 January 2011 08:50, Patty wrote: > Hi David - I was looking for the book you recomended below - "Python 3 > Object Oriented Programming" by Dusty Phillips - and found it on Amazon for > $43 new on up and $70 for used but maybe that was hardback?  Do you happen > to know of some other way to o

Re: [Tutor] question regarding regular expression compile

2011-01-13 Thread Steven D'Aprano
Luke Paireepinart wrote: No. Did you try that? It doesn't evn look like valid python code to me. You want a single string with the r before it, not 3 separate strings. The line of code in question is: test = re.compile('MAT file (billing|carrier|log|util)' r'\\' '\d{8} deleted') If

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread Brett Ritter
On Tue, Jan 4, 2011 at 4:50 PM, Patty wrote: > Hi David - I was looking for the book you recomended below - "Python 3 > Object Oriented Programming" by Dusty Phillips - and found it on Amazon for > $43 new on up and $70 for used but maybe that was hardback?  Do you happen > to know of some other w

[Tutor] turn a path into nested list

2011-01-13 Thread ingo
Dear all, a probably simple problem I can't get my head around at the moment (old age?), some input would be appreciated. I have a path >>> path = >>> 'Audio/site-packages/pygame/examples/macosx/aliens_app_example/English.lproj' I'd like to turn taht into a list with a certain structure and or

Re: [Tutor] turn a path into nested list

2011-01-13 Thread Christian Witts
On 13/01/2011 14:33, ingo wrote: Dear all, a probably simple problem I can't get my head around at the moment (old age?), some input would be appreciated. I have a path path = 'Audio/site-packages/pygame/examples/macosx/aliens_app_example/English.lproj' I'd like to turn taht i

Re: [Tutor] turn a path into nested list

2011-01-13 Thread ingo
On Thu, Jan 13, 2011 at 1:51 PM, Christian Witts wrote: > First split your path into segments, then iterate over those segments and > build your new list (item one being the current segment, and part two a > joined string of previous segments). > thanks Christian, path = 'Audio/site-packages/py

Re: [Tutor] Command line scripts

2011-01-13 Thread David Hutto
As you can tell, I was excited, and impressed by my own work, and therefore thought you should follow my wise and almighty work. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo

Re: [Tutor] Command line scripts

2011-01-13 Thread David Hutto
On Thu, Jan 13, 2011 at 8:41 AM, David Hutto wrote: > As you can tell, I was excited, and impressed by my own work, and > therefore thought you should follow my wise and almighty work. On the flip side, it's like being an electrician, and seeing the lights come on when you hook the box up. _

Re: [Tutor] How to insert a quit-Button in a Tkinter class?

2011-01-13 Thread Enih Gilead
Hi All ! Thanks a lot for the great help. As a beginner, I was forgetting to see the "Inheritance from Frame", but now it's all runing ok. Thankfull, enihgil On 01/12/2011 06:23 PM, Karim wrote: Hello, Inherit from Frame see below: from Tkinter import * class App(Frame): def __init__(

Re: [Tutor] turn a path into nested list

2011-01-13 Thread Alan Gauld
"ingo" wrote I have a path path = 'Audio/site-packages/pygame/examples/macosx/aliens_app_example/English.lproj' I'd like to turn taht into a list with a certain structure and order: Its not clear what exactly the sort criteria is, however have you looked at the os.walk() function for t

Re: [Tutor] turn a path into nested list

2011-01-13 Thread David Hutto
> Its not clear what exactly the sort criteria is, however have you looked > at the os.walk() function for traversing directory trees? It may be all > you need. it's amazing what the designers of the builtins left for your disposal. ___ Tutor maillist

Re: [Tutor] turn a path into nested list

2011-01-13 Thread David Hutto
It's like the were psychic...or intuitive . ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] creating a text widget

2011-01-13 Thread W S
could someone please provide me some code that would create a text widget that i could open a text file in? much thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listi

Re: [Tutor] creating a text widget

2011-01-13 Thread Wayne Werner
On Thu, Jan 13, 2011 at 12:02 PM, W S wrote: > could someone please provide me some code that would create a text widget > that i could open a text file in? much thanks > Dear Google: Please insert all the results of "simple python GUI text editor" into my brain. Learning is so tiresome! Sinc

[Tutor] How to find a substring within a list of items

2011-01-13 Thread Richard Querin
I have an object that contains about 3500 list items, each list containing various data, some strings and some floats, like so: ['D', 123.4,'This is a project description', 'type', 52.1,'title'] What is the easiest way to search this list for a given string? So I want to find out if this list con

Re: [Tutor] How to find a substring within a list of items

2011-01-13 Thread Wayne Werner
On Thu, Jan 13, 2011 at 12:10 PM, Richard Querin wrote: > I have an object that contains about 3500 list items, each list containing > various data, some strings and some floats, like so: > > ['D', 123.4,'This is a project description', 'type', 52.1,'title'] > > What is the easiest way to search

Re: [Tutor] creating a text widget

2011-01-13 Thread Alan Gauld
"W S" wrote could someone please provide me some code that would create a text widget that i could open a text file in? You don;t open the text file in the widget as such, you open the file in Python as usual and copy its contents into the text widget. When you are done making changes

Re: [Tutor] turn a path into nested list

2011-01-13 Thread ingo
On Thu, Jan 13, 2011 at 6:30 PM, Alan Gauld wrote: > Its not clear what exactly the sort criteria is, sorry Alan, I meant that I want to keep the order as is. > however have you looked > at the os.walk() function for traversing directory trees? It may be all > you need. Yes, but I'm not confid

Re: [Tutor] How to find a substring within a list of items

2011-01-13 Thread Alan Gauld
"Richard Querin" wrote I have an object that contains about 3500 list items, each list containing various data, some strings and some floats, like so: ['D', 123.4,'This is a project description', 'type', 52.1,'title'] What is the easiest way to search this list for a given string? Is th

Re: [Tutor] How to find a substring within a list of items

2011-01-13 Thread Richard Querin
On Thu, Jan 13, 2011 at 2:27 PM, Wayne Werner wrote: > > I don't know if either of these are the best options (they probably > aren't), but they should work, and for 3500 it will probably loop faster > than opening up excel. > > HTH, > Wayne > Thanks Wayne. This would definitely be faster than ge

[Tutor] (no subject)

2011-01-13 Thread lmhosie
Hello All, I am having an issue with lists and am not sure where to go from here any advice appreciated. I colored the areas of concern. blue my comments purple example of output red area area concerned theoretically written not tested Sorry if its messy still a newbie. Thanks in advance! Lynn

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread wesley chun
>> Object Oriented Programming" by Dusty Phillips - and found it on Amazon for >> $43 new on up and $70 for used but maybe that was hardback?  Do you happen >> to know of some other way to obtain it for less than $45? the retail price of the book is $49.99, and Packt books are usually POD (print o

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread Luke Paireepinart
Also check bigwords.com, they aggregate lots of other book sites and will get you a great deal, especially if you are buying multiple books because it smartly combines shipping and all. - Sent from a mobile device. Apologies for brevity and top-posting. --

Re: [Tutor] (no subject)

2011-01-13 Thread Steven D'Aprano
lmho...@jacks.sdstate.edu wrote: Hello All, I am having an issue with lists and am not sure where to go from here any advice appreciated. I colored the areas of concern. blue my comments purple example of output red area area concerned You may have coloured the text before you sent it, but the

Re: [Tutor] (no subject)

2011-01-13 Thread Luke Paireepinart
On Thu, Jan 13, 2011 at 4:53 PM, Steven D'Aprano wrote: > lmho...@jacks.sdstate.edu wrote: >> >> Hello All, >> I am having an issue with lists and am not sure where to go from here any >> advice appreciated. I colored the areas of concern. >> blue my comments >> purple example of output >> red are

Re: [Tutor] turn a path into nested list

2011-01-13 Thread Alan Gauld
"ingo" wrote at the os.walk() function for traversing directory trees? It may be all you need. Yes, but I'm not confident with it (the more reason to use it you will say :) ). Quite. A simple tree printout looks like this: for t in os.walk('Root'): ...print t ... And the result is

Re: [Tutor] creating a text widget

2011-01-13 Thread ALAN GAULD
Forwarding to list... > none of it actually. i am brand new to Tk/Python. Actually, i don't have a >need to do any editing on the file. OK, display is pretty easy. Take a look in my tutorial under Event Driven Programming. There you will see a simple text widget with text being inserted.

[Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Elwin Estle
I am going through the book mentioned in the subject line, and I have found a couple of things that don't seem to work the way the author shows in the book. So, either I am doing something wrong, or what he is saying isn't quite right. I am using Python 2.7.1 on Mac OS X Leopard. The first thi

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Corey Richardson
On 01/13/2011 08:50 PM, Elwin Estle wrote: > I am going through the book mentioned in the subject line, and I have found a > couple of things that don't seem to work the way the author shows in the > book. So, either I am doing something wrong, or what he is saying isn't > quite right. > > I a

[Tutor] module to parse XMLish text?

2011-01-13 Thread Terry Carroll
Does anyone know of a module that can parse out text with XML-like tags as in the example below? I emphasize the "-like" in "XML-like". I don't think I can parse this as XML (can I?). Sample text between the dashed lines:: - Blah, blah, blah SOMETHING ELSE

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Bill Allen
That is correct about the difference between Python 2 and Python 3 syntax. However, I am surprised that with 2.7.1 these do not work. I have found that on my Ubuntu system with Python 2.6.5 these Python 3 syntax items do seem to work properly. I am assuming they were back ported or something. I

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Corey Richardson
On 01/13/2011 10:29 PM, Bill Allen wrote: > That is correct about the difference between Python 2 and Python 3 > syntax. However, I am surprised that with 2.7.1 these do not work. I > have found that on my Ubuntu system with Python 2.6.5 these Python 3 > syntax items do seem to work properly.

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Bill Allen
I will agree that it seems odd, but here is a sample run from my system. I promise I am not pulling anyone's leg! :-)) wallenpb@Ubuntu-D810:~$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Vern Ceder
Bill, Try this: >>> print("hello", "Bill") ('Hello', 'Bill') >>> x = input("Your name?") Your name?Bill Traceback (most recent call last): File "", line 1, in File "", line 1, in NameError: name 'Bill' is not defined and see if those work (my results on 2.6 shown). In Python 3 the results

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Bill Allen
Vern, Quite right! I see what you mean. I quite inadvertently stumbled into examples that would work without realizing it. I typically program in Python 3, so not as familiar with the limitations on Python 2x. I've had quite a chuckle over this! Thanks, Bill On Thu, Jan 13, 2011 at 10:31

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread wesley chun
input() must be avoided at all costs in Python 2.x. if you find any Python (2.x) book which employs that, consider the author uninformed. it is a huge security risk and the main reason why in Python 3 raw_input() is renamed to and replaces input(). cheers, -- wesley - - - - - - - - - - - - - - - -