[Tutor] retrieving httponly cookies on accessing webpage with urllib2

2008-10-16 Thread xbmuncher
I'm trying to mimic my firefox browser in requesting a webpage with python. Here are the headers obtained by wireshark when I accessed it with firefox: GET /dirName/ HTTP/1.1 Host: www.website.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3

[Tutor] Convert a Sequence of Images into an AVI file

2008-10-16 Thread Wayne Watson
Title: Signature.html I have a file of images shot at a frame rate of 1/30th of a second. They are 640 by 480 bytes followed immediately by up to 200 smaller images 128x128 pixels. The software I'm using will convert this into a mov file. I'd like to simply take the large images out of the file

Re: [Tutor] [Edu-sig] school physics/math courses

2008-10-16 Thread michel paul
This would be a great text for a high school math/CS class: Math for the Digital Age . - Michel On Thu, Oct 16, 2008 at 4:15 AM, roberto <[EMAIL PROTECTED]> wrote: > hello > (i am rather new in python ...) > > i am about to start a course of physics and

Re: [Tutor] school physics/math courses

2008-10-16 Thread greg whittier
On Thu, Oct 16, 2008 at 7:15 AM, roberto <[EMAIL PROTECTED]> wrote: > hello > (i am rather new in python ...) > > i am about to start a course of physics and math for students aged > 14-17 (high school) > and i am deeply interested in the possibilty of teaching fundamental > concepts of these subj

Re: [Tutor] school physics/math courses

2008-10-16 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote in message Oops, I see you cross-posted. Apologies to edu-sig! Kent If it makes you feel better I didn't notice either. :-) And I also didn't notice the other emails... Alan G ___ Tutor maillist - Tutor

Re: [Tutor] school physics/math courses

2008-10-16 Thread Alan Gauld
"roberto" <[EMAIL PROTECTED]> wrote i am about to start a course of physics and math for students aged 14-17 (high school) and i am deeply interested in the possibilty of teaching fundamental concepts of these subjects via teaching programming; i chose python (i won't change my mind ...) so i

Re: [Tutor] school physics/math courses

2008-10-16 Thread Wayne Watson
Title: Signature.html I posted a query on sci.physics (newsgroup) on this question. I'll get back if anything useful pops up. Try Amazon with a search on python science, or whatever, as a title. You might try Google and search for high school physics python. There are some pretty advanced HS

Re: [Tutor] Difficult loop?

2008-10-16 Thread bob gailer
Last post for this assignment for now - simplified even more. word = "Almuta$r~id" window = position = 5 shortAndOmit = "aiou+~" rest = "_" * window + "".join(letter for letter in word if letter not in shortAndOmit) + "_" * window word = iter(word) for letter in word: if letter

Re: [Tutor] Difficult loop?

2008-10-16 Thread bob gailer
I just can't leave well enough alone. Down to 14 lines. More names, less magic numbers. word = "Almuta$r~id" window = position = 5 shortAndOmit = "aiou+~" rest = "_" * window + "".join(letter for letter in word if letter not in shortAndOmit) + "_" * window word = iter(word + "+")

Re: [Tutor] Difficult loop?

2008-10-16 Thread bob gailer
How about: word = "Almuta$r~id" predecessors = "_" * 5 successors = "".join(letter for letter in word if letter not in "aiou+~") for index, letter in enumerate(word): if letter not in "aiou~+": next = word[index+1] if index < len(word) - 1 else "" if next in "aiou": tail = next eli

Re: [Tutor] school physics/math courses

2008-10-16 Thread Ken Oliver
For a starting place, you may want to look at "Mathematics for the Digital Age and Programming in Python" by Maria and Gary Litvin. ISBN 978-0-9727055-8-5 Both authors are very helpful and often contribute to math and CS electronic discussion groups. Communications possible through information

Re: [Tutor] school physics/math courses

2008-10-16 Thread Kent Johnson
On Thu, Oct 16, 2008 at 9:07 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > You should ask on the edu-sig list: > http://www.python.org/community/sigs/current/edu-sig/ Oops, I see you cross-posted. Apologies to edu-sig! Kent ___ Tutor maillist - Tutor

Re: [Tutor] school physics/math courses

2008-10-16 Thread Kent Johnson
On Thu, Oct 16, 2008 at 7:15 AM, roberto <[EMAIL PROTECTED]> wrote: > hello > (i am rather new in python ...) > > i am about to start a course of physics and math for students aged > 14-17 (high school) > and i am deeply interested in the possibilty of teaching fundamental > concepts of these subje

[Tutor] school physics/math courses

2008-10-16 Thread roberto
hello (i am rather new in python ...) i am about to start a course of physics and math for students aged 14-17 (high school) and i am deeply interested in the possibilty of teaching fundamental concepts of these subjects via teaching programming; i chose python (i won't change my mind ...) so i a

Re: [Tutor] newbie question about list element manipulation after split()

2008-10-16 Thread Kent Johnson
2008/10/16 Emad Nawfal (عماد نوفل) <[EMAIL PROTECTED]>: > It works fine. It seems that in the file you have there are lines whose > length is less than you should expect Yes, my guess is there is a blank line in the file. Kent ___ Tutor maillist - Tu

Re: [Tutor] newbie question about list element manipulation after split()

2008-10-16 Thread Emad Nawfal (عماد نوفل)
On Thu, Oct 16, 2008 at 4:25 AM, Visvaldas K. <[EMAIL PROTECTED]>wrote: > Hi, > > I feel very stupid, but I am stuck. I could try some workaround, but I want > to understand what I am doing wrong. > > The line: > > for line in open("parameterfile").readlines( ): >print line.split()

Re: [Tutor] newbie question about list element manipulation after split()

2008-10-16 Thread Emad Nawfal (عماد نوفل)
Here is a solution: >>> for line in open('DBAN1001.txt').readlines(): ... line = line.split() ... if len(line) > 1: # This is what makes it work for me. ... print line[1] ... it's have the way that is is prison we It works fine. It seems that in the file you have there are lin

[Tutor] newbie question about list element manipulation after split()

2008-10-16 Thread Visvaldas K.
Hi, I feel very stupid, but I am stuck. I could try some workaround, but I want to understand what I am doing wrong. The line: for line in open("parameterfile").readlines( ): print line.split()# trouble line The "trouble line" works fine in this example. It prints what I w