Re: [Tutor] Tkinter Geometry Management and Other Basics

2009-03-20 Thread Wayne Watson
I read between the lines. :-) I was just beginning to re-read it as I saw this message pop into my Send box. It looks like there are three choices for words for each option that vary slightly for each state. Only the command-line name appears to have relevance for Tkinter. In the Label case, t

Re: [Tutor] Tkinter Geometry Management and Other Basics

2009-03-20 Thread Alan Gauld
"Alan Gauld" wrote It really is quite easy. Too few Tkinter programmer shy away from the Tcl/Tk sites because they think they need to know Tcl. Ahem, that should have said too *many* of course not too few Sorry, Alan G ___ Tutor maillist

Re: [Tutor] Executing a C Program from RH Linux ... (Cygwin)

2009-03-20 Thread Wayne Watson
Title: Signature.html Sounds right to me. I won't. Kent Johnson wrote: On Fri, Mar 20, 2009 at 1:49 PM, Wayne Watson wrote: First questions about Cygwin is I see a 1.7 Beta download version for it, and references to 1.5 downloads. Where's 1.6? Is it past Beta? Wayne Watson wrote

Re: [Tutor] Trouble parsing email from Outlook

2009-03-20 Thread Tim Golden
Eduardo Vieira wrote: On Fri, Mar 20, 2009 at 2:29 PM, Eduardo Vieira wrote: On Fri, Mar 20, 2009 at 9:04 AM, Tim Golden wrote: Eduardo Vieira wrote: Thank you very much, Tim for the thorough explanation. Much more than I could expect. It will be specially useful for me a newbie python amate

Re: [Tutor] Tkinter Geometry Management and Other Basics

2009-03-20 Thread Alan Gauld
"Wayne Watson" wrote I really don't want to spend weeks learning Tk/Tcl. You shouldn't need to. The Tk documentation is very easy to transfer to Tkinter: Here is a sample from the official reference docs for Label (found at: http://www.tcl.tk/man/tcl8.5/TkCmd/contents.htm): STANDARD

Re: [Tutor] Trouble parsing email from Outlook

2009-03-20 Thread Eduardo Vieira
On Fri, Mar 20, 2009 at 2:29 PM, Eduardo Vieira wrote: > On Fri, Mar 20, 2009 at 9:04 AM, Tim Golden wrote: >> Eduardo Vieira wrote: >>> >>> Thank you very much, Tim for the thorough explanation. Much more than >>> I could expect. It will be specially useful for me a newbie python >>> amateur pro

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html Yes, sounds like you got the code, and I need to go outside this group to a Cygwin forum/NG or Linux under Win. Recently, I was working with a fellow associated with this effort who knows Linux very well. He had some slight difficulty with the Makefiles, but finally got it

Re: [Tutor] Executing a C Program from RH Linux ... (Cygwin)

2009-03-20 Thread Kent Johnson
On Fri, Mar 20, 2009 at 1:49 PM, Wayne Watson wrote: > First questions about Cygwin is I see a 1.7 Beta download version for it, > and references to 1.5 downloads. Where's 1.6? Is it past Beta? > > Wayne Watson wrote: > > That's a lot of text to respond to, but let me see if I can broadly do it. >

Re: [Tutor] adding dictionary values

2009-03-20 Thread Kent Johnson
2009/3/20 Emad Nawfal (عماد نوفل) : > if I want to do this with more than two dictionaries, the obvious solution > for me is to use something like the reduce functions with a list of > dictionary names like: > dictList = [dict1, dict2, dict3] > newDict = reduce(addDicts, dictList) > > Is this a sa

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Michael Farnham
On Fri, 2009-03-20 at 04:35 -0700, Wayne Watson wrote: > Good. Thanks. > > Here's my code. > == > # Executing a Linux program under Win XP > from subprocess import call > myProg = call(["C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]) If I understand your question - A C program which

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread greg whittier
On Fri, Mar 20, 2009 at 1:41 PM, Wayne Watson wrote: > Yes, I'm sure I'll need help. I just posted a message minutes before yours > mentioning I'm willing to try Cygwin. The C program, wolf, is the public > domain If trying to compile the program under Win is what you had in mind, > then I can s

Re: [Tutor] Executing a C Program from RH Linux ... (Cygwin)

2009-03-20 Thread Wayne Watson
Title: Signature.html First questions about Cygwin is I see a 1.7 Beta download version for it, and references to 1.5 downloads. Where's 1.6? Is it past Beta? Wayne Watson wrote: That's a lot of text to respond to, but let me see if I can broadly do it. It appears that the idea of execu

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html Yes, I'm sure I'll need help. I just posted a message minutes before yours mentioning I'm willing to try Cygwin. The C program, wolf, is the public domain  If trying to compile the program under Win is what you had in mind, then I can send you all the necessary files in a

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html That's a lot of text to respond to, but let me see if I can broadly do it. It appears that the idea of executing Linux code under Win XP is d-e-a-d. (Let's ignore VM) I will need to recompile the c-code in some way under Win XP. Probably Cygwin. The python code I'm workin

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread greg whittier
On Fri, Mar 20, 2009 at 1:01 PM, Wayne Watson wrote: > To be clear. The program I'm trying to execute under Win XP was compiled > on a RH Linux machine. It was not compile on a Win OS machine. It may sound > far fetched some facility might be available to do this, but somewhere in my > very, very

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Marc Tompkins
On Fri, Mar 20, 2009 at 10:02 AM, Marc Tompkins wrote: > Neither Python proper nor Popen() are actually executing the program - the > Windows shell/command interpreter does that (command.com or cmd.exe, > depending on your Windows version); Popen() is just a mechanism for making > the request, wai

Re: [Tutor] Tkinter Geometry Management and Other Basics

2009-03-20 Thread Wayne Watson
Title: Signature.html Good ideas. I particularly like the one below about pyw. Never heard of it before. Very nice in this situation. As for Tk/Tcl, I got the highly recommended book from some Python source via an interlibrary loan. My problem with it is that I really don't want to spend weeks

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Elena of Valhalla
On Fri, Mar 20, 2009 at 6:01 PM, Wayne Watson wrote: > To be clear. The program I'm trying to execute under Win XP was compiled on > a RH Linux machine. It was not compile on a Win OS machine. It may sound far > fetched some facility might be available to do this, but somewhere in my > very, very

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Marc Tompkins
On Fri, Mar 20, 2009 at 10:02 AM, Marc Tompkins wrote: > If you want to run a non-Windows executable on Windows, you need to use an > alternate shell - someone mentioned Cygwin - although I'm not certain that > even that will do it for you. What makes an executable OS-specific is not > the langua

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Marc Tompkins
On Fri, Mar 20, 2009 at 8:46 AM, Wayne Watson wrote: > I guess I haven't made clear above. This is a Red Hat Linux compiled C > program. Indications from others above, suggest it is possible to execute it > under Win Python. If that's true, then my guess is that something prior to > the call must

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html To be clear. The program I'm trying to execute under Win XP was compiled on a RH Linux machine. It was not compile on a Win OS machine. It may sound far fetched some facility might be available to do this, but somewhere in my very, very distant past before the small comput

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html You understand it perfectly. Michael Farnham wrote: On Fri, 2009-03-20 at 04:35 -0700, Wayne Watson wrote: Good. Thanks. Here's my code. == # Executing a Linux program under Win XP from subprocess import call myProg = call(["C:\Sandia_Meteors\Various

Re: [Tutor] adding dictionary values

2009-03-20 Thread عماد نوفل
On Fri, Mar 20, 2009 at 12:03 PM, Richard Lovely wrote: > 2009/3/20 Chris Fuller : > > You should iterate over the keys of the dictionary: > > for k in a.keys(): > > because if you iterate over the full dictionary, your items are the > values, > > not the keys. Otherwise your code looks correct,

Re: [Tutor] adding dictionary values

2009-03-20 Thread Richard Lovely
2009/3/20 Chris Fuller : > You should iterate over the keys of the dictionary: > for k in a.keys(): > because if you iterate over the full dictionary, your items are the values, > not the keys.  Otherwise your code looks correct, and I don't think its > terribly bad form.  You could do something in

Re: [Tutor] adding dictionary values

2009-03-20 Thread Kent Johnson
2009/3/20 greg whittier : > This looks like it will work, but you can accomplish this more compactly by > just looping over the items in both dictionaries and making use of the > default argument of the dictionaries get method. > > newDict = {} > for k, v in dict1.items() + dict2.items(): >     ne

Re: [Tutor] adding dictionary values

2009-03-20 Thread Chris Fuller
Oops! The dictionary iterates over keys, not values as I stated (and demonstrated by your working code). Consequently, the example I gave could be more succinctly expressed by: sa = set(a) sb = set(b) Sorry for the error. Cheers ___ Tutor maillist -

Re: [Tutor] adding dictionary values

2009-03-20 Thread Chris Fuller
You should iterate over the keys of the dictionary: for k in a.keys(): because if you iterate over the full dictionary, your items are the values, not the keys. Otherwise your code looks correct, and I don't think its terribly bad form. You could do something interesting with sets: sa = set(a.k

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html I guess I haven't made clear above. This is a Red Hat Linux compiled C program. Indications from others above, suggest it is possible to execute it under Win Python. If that's true, then my guess is that something prior to the call must be done in the way of informing the

Re: [Tutor] adding dictionary values

2009-03-20 Thread greg whittier
2009/3/20 Emad Nawfal (عماد نوفل) > Hi Tutors, > I have two pickled dictionaries containing word counts from two different > corpora. I need to add the values, so that a word count is the sum of both. > If the word "man" has a count of 2 in corpus A and a count of 3 in corpus B, > then I need a n

[Tutor] adding dictionary values

2009-03-20 Thread عماد نوفل
Hi Tutors, I have two pickled dictionaries containing word counts from two different corpora. I need to add the values, so that a word count is the sum of both. If the word "man" has a count of 2 in corpus A and a count of 3 in corpus B, then I need a new dictionary that has "man": 5. Please let m

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread A.T.Hofkamp
Wayne Watson wrote: Yes, good, but I tried myProg = call([r"C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]), and get exactly the same results. So the next step is to find out what is wrong. In other words, experiment with the problem to get an understanding what is not working. Once you ge

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html Yes, good, but I tried myProg = call([r"C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]), and get exactly the same results. A.T.Hofkamp wrote: Wayne Watson wrote: Good. Thanks. Here's my code. == # Executing a Linux program under Win XP

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread A.T.Hofkamp
Wayne Watson wrote: Good. Thanks. Here's my code. == # Executing a Linux program under Win XP from subprocess import call myProg = call(["C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]) You must always escape \ characters in a string. do r"C:\Sandia_Meteors\Various\FuzzyLogic\wolf"

Re: [Tutor] statistics with python

2009-03-20 Thread greg whittier
On Fri, Mar 20, 2009 at 6:45 AM, Bala subramanian wrote: > Dear python friends, > > someone kindly suggest me packages, modules and documentation resources > (especially) to > > i) plot graphs using python. > matplotlib is excellent and probably the most popular > > ii) statistical analysis

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Wayne Watson
Title: Signature.html Good. Thanks. Here's my code. == # Executing a Linux program under Win XP from subprocess import call myProg = call(["C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"]) == But msgs are produced ... Traceback (most recent call last):   File "C:/Sandia_Meteo

[Tutor] statistics with python

2009-03-20 Thread Bala subramanian
Dear python friends, someone kindly suggest me packages, modules and documentation resources (especially) to i) plot graphs using python. ii) statistical analysis using python. Thanks in advance, Bala ___ Tutor maillist - Tutor@python.org http://m

Re: [Tutor] Trouble parsing email from Outlook

2009-03-20 Thread Tim Golden
Eduardo Vieira wrote: Hello, list! I hope it's not too much out of place to ask this question in the Tutor list. I'm trying to process some information from email messages that goes in a folder called: "SysAdmin". I could reproduce the recipe from Python Programming on Win32 sucessfully to read t

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-20 Thread Alan Gauld
"Wayne Watson" wrote What is meant by "The arguments are the same as for the Popen constructor.", in Convenience Functions? In fact, what is such a function? It means that there is a function which takes the same arguments as the __init__() method of the Popen class. They are convenience f

Re: [Tutor] HI, #Include like in python

2009-03-20 Thread A.T.Hofkamp
wesley chun wrote: import listen You can use the __import__ function if you want, but generally you want the import statement as above. The equivalent to 'import listen' is: listen = __import__('listen') See the tutorial here: http://docs.python.org/tutorial/modules.html you also hav