[Tutor] List of lists optimization and printing.

2011-07-29 Thread Sergey
Hello. Yes, catb.org and so on. I was searching for some kind of finding max width in a table (a list of two lists) and had found this mailing list. So I want somebody to look at my code and say what can be done better from a programmer point of view. Just SQL like printing and writing. I mean opt

Re: [Tutor] Mainloop conflict

2011-07-29 Thread Peter Otten
Stefan Behnel wrote: > Christopher King, 29.07.2011 17:08: >> On Thursday, July 28, 2011, Dave Angel wrote: >>> On 07/28/2011 08:32 PM, Christopher King wrote: Dear Tutor Dudes, I have a socket Gui program. The only problem is that socket.recv >> waits for a response, whic

Re: [Tutor] Mainloop conflict

2011-07-29 Thread Stefan Behnel
Christopher King, 29.07.2011 17:08: On Thursday, July 28, 2011, Dave Angel wrote: On 07/28/2011 08:32 PM, Christopher King wrote: Dear Tutor Dudes, I have a socket Gui program. The only problem is that socket.recv waits for a response, which totally screws Tkinter I think. I tried makin

Re: [Tutor] Sum files' size

2011-07-29 Thread Susana Iraiis Delgado Rodriguez
Thank you to all of you! After I read your mails I started to modify my code, I applied Ramit suggestion and got the result I wanted: mport os file_list = [] folders = None for root, folders, files in os.walk('C:\\'): file_list.extend(os.path.join( root,fi) for fi in files if (fi.ends

Re: [Tutor] Running files from command prompt

2011-07-29 Thread Alexander Quest
Alexander- thanks for the tip as to sticking with Python 3. Steven, I greatly appreciate that breakdown. You're right about the error: it was a syntax error on that line; I'll make sure to include the descriptions in the future. As far as finding a new tutorial, I am going to see if Google's class

Re: [Tutor] Mainloop conflict

2011-07-29 Thread Dave Angel
On 07/29/2011 11:08 AM, Christopher King wrote: I was afraid of that. Please don't top-post. It's becoming more prevalent on this list, but it makes things very confusing. I need to put my response just after yours, but then the other relevant pieces are out of order. On Thursday, July 28,

Re: [Tutor] Mainloop conflict

2011-07-29 Thread Christopher King
I was afraid of that. On Thursday, July 28, 2011, Dave Angel wrote: > On 07/28/2011 08:32 PM, Christopher King wrote: >> >> Dear Tutor Dudes, >> I have a socket Gui program. The only problem is that socket.recv waits >> for a response, which totally screws Tkinter I think. I tried making the

Re: [Tutor] Reading .gz files

2011-07-29 Thread Steven D'Aprano
Oh, I forgot to say something else... Hanlie Pretorius wrote: f1 = 'GSMaP_MVK+.20050101.00.0.1deg.hourly.v484.gz' f2 = ''text.txt.gz' if1 = gzip.open(f1, 'rb') if2 = gzip.open(f2,'rb') try: print if1.read() print 'done with f1' Once you've read the file once, the file pointer is at the

Re: [Tutor] Reading .gz files

2011-07-29 Thread Steven D'Aprano
Hanlie Pretorius wrote: [code] import gzip f1 = 'GSMaP_MVK+.20050101.00.0.1deg.hourly.v484.gz' f2 = ''text.txt.gz' if1 = gzip.open(f1, 'rb') if2 = gzip.open(f2,'rb') try: print if1.read() print 'done with f1' print if2.read() print 'done with f2' finally: if1.close() if2.close

Re: [Tutor] Urllib Problem

2011-07-29 Thread Steven D'Aprano
George Anonymous wrote: I am trying to make a simple programm with Python 3,that tries to open differnet pages from a wordlist and prints which are alive.Here is the code: from urllib import request fob=open('c:/passwords/pass.txt','r') x = fob.readlines() for i in x: urllib.request.openurl('

Re: [Tutor] Urllib Problem

2011-07-29 Thread Alexander
On Fri, Jul 29, 2011 at 5:58 AM, Karim wrote: > ** > On 07/29/2011 11:52 AM, George Anonymous wrote: > > I am trying to make a simple programm with Python 3,that tries to open > differnet pages from a wordlist and prints which are alive.Here is the code: > from urllib import request > fob=open('c

[Tutor] Reading .gz files

2011-07-29 Thread Hanlie Pretorius
Hi, I'm working on Windows XP with Python 2.6. I need to read and process hundreds of binary files that are in the .gz archive format. I found a site (http://www.doughellmann.com/PyMOTW/gzip/) and tried their code with two files: one of the hundreds of files that I need to process (f1 below) and

Re: [Tutor] Urllib Problem

2011-07-29 Thread Karim
On 07/29/2011 11:52 AM, George Anonymous wrote: I am trying to make a simple programm with Python 3,that tries to open differnet pages from a wordlist and prints which are alive.Here is the code: from urllib import request fob=open('c:/passwords/pass.txt','r') x = fob.readlines() for i in x:

[Tutor] Urllib Problem

2011-07-29 Thread George Anonymous
I am trying to make a simple programm with Python 3,that tries to open differnet pages from a wordlist and prints which are alive.Here is the code: from urllib import request fob=open('c:/passwords/pass.txt','r') x = fob.readlines() for i in x: urllib.request.openurl('www.google.gr/' + i) But

Re: [Tutor] About the Mailing List

2011-07-29 Thread Alan Gauld
Steven D'Aprano wrote: You can see the archives by going to this page here: http://mail.python.org/mailman/listinfo/tutor and following the links to the archives. There are *three* given: two external archives (Activestate and Gmane) and one held by python.org itself. And if you use Gmane