Re: [Tutor] issues with urllib and loading a webpage

2011-08-24 Thread Sander Sweers
On Wed, 24 Aug 2011, 00:03:23 CEST, Robert Sjoblom wrote: > > > Are you using Python 3 and urllib, and not using httplib2? Because I > > > honestly can't get urllib.request.urlopen to work with > > > http://www.boursorama.com/ -- I only get b'' from there. > > > > Yes, Python 3.2 which version

[Tutor] cPickle and shjelving

2011-08-24 Thread Warren P. Jones
Hi, I am new to python. I am having slight issue in using the cPickle and shelving function. Here is what i want the program need to do: Open an file with employees in it with relevant information like: employee number, surname and department. I also need to add an employee with the relevant

Re: [Tutor] cPickle and shjelving

2011-08-24 Thread Hugo Arts
On Wed, Aug 24, 2011 at 11:26 AM, Warren P. Jones wrote: > Hi, > > I am new to python. I am having slight issue in using the cPickle and > shelving function. > > Here is what i want the program need to do: > > Open an file with employees in it with relevant information like: employee > number, sur

[Tutor] Tutorials on csv module??

2011-08-24 Thread Khalid Al-Ghamdi
Hi everyone, can anyone point me to a good tutorial on using the csv module? also, is there a module that can help me check data in a excel file other than the csv module? thanks a lot khaild ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] Tutorials on csv module??

2011-08-24 Thread Steven D'Aprano
Khalid Al-Ghamdi wrote: Hi everyone, can anyone point me to a good tutorial on using the csv module? Search engines are a wonderful thing. http://duckduckgo.com/?q=python+csv+tutorial also, is there a module that can help me check data in a excel file other than the csv module? http://du

Re: [Tutor] eval func with floating...

2011-08-24 Thread Christopher King
> > If the user ever sees an AssertionError, your code is buggy. > Well you saw that I caught the AssertionError, so the user wouldn't technically see it. For the other stuff, I didn't know the etiquette for assertion statements. ___ Tutor maillist - Tu

Re: [Tutor] Python Speech

2011-08-24 Thread Christopher King
how do you unzip a gz on windows? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Speech

2011-08-24 Thread Alan Gauld
On 24/08/11 18:09, Christopher King wrote: how do you unzip a gz on windows? Pretty much any zip tool (Qzip, Winzip etc) will handle gz files too. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - T

Re: [Tutor] Python Speech

2011-08-24 Thread Christopher King
On Tue, Aug 23, 2011 at 8:46 PM, Alex Hall wrote: > Depending on what you want, you could try accessible_output. It requires platform_utils. Anything else? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://ma

[Tutor] Syntax error with if statement

2011-08-24 Thread Ray Parrish
Hello, I haven't been programming for a while and today I am working on something and have encountered an error I cannot figure out. Here is my code: thisFile = column[6] if thisFile == "/Images/My%20Face.JPG" CallCount += 1 print CallCount

Re: [Tutor] Syntax error with if statement

2011-08-24 Thread Andre Engels
On Wed, Aug 24, 2011 at 7:40 PM, Ray Parrish wrote: > Hello, > > I haven't been programming for a while and today I am working on something > and have encountered an error I cannot figure out. > > Here is my code: > > thisFile = column[6] > if thisFile == "/Images/My%20Face.JPG"

Re: [Tutor] Python Speech

2011-08-24 Thread Jeff Johnson
On 08/24/2011 10:17 AM, Alan Gauld wrote: On 24/08/11 18:09, Christopher King wrote: how do you unzip a gz on windows? Pretty much any zip tool (Qzip, Winzip etc) will handle gz files too. 7 zip works great on Windows for most formats. http://www.7-zip.org/ Jeff ---

[Tutor] help with a class

2011-08-24 Thread John
Hello, I have a class that has an attribute that is a dict which I fill with more dicts. I've created a function to return those dictionaries if a key is provide, otherwise, it returns the 'default' dictionary. I have the following methods (see below), it seems the update_options method is fine, b

Re: [Tutor] help with a class

2011-08-24 Thread Hugo Arts
On Wed, Aug 24, 2011 at 8:34 PM, John wrote: > Hello, I have a class that has an attribute that is a dict which I > fill with more dicts. I've created a function to return those > dictionaries if a key is provide, otherwise, it returns the 'default' > dictionary. > > I have the following methods (

Re: [Tutor] help with a class

2011-08-24 Thread John
Thank you. I've corrected the KeyError, and changed the function to: def overide_options(self, options, run_id=None): """ completely overide the options dict """ assert isinstance(options, dict), "override options requires a dict" if run_id in self.run_queue:

Re: [Tutor] help with a class

2011-08-24 Thread Prasad, Ramit
I was under the impression that asserts are more for testing than for production code (especially since they can be removed when running from python from command line). Instead I removed the assert and replaced it to raise an error. def overide_options(self, options, run_id=None): """

Re: [Tutor] help with a class

2011-08-24 Thread Alan Gauld
On 24/08/11 21:03, Prasad, Ramit wrote: I was under the impression that asserts are more for testing > than for production code That's true. def overide_options(self, options, run_id=None): if not isinstance(options, dict): raise TypeError("override options requires

Re: [Tutor] Python Speech

2011-08-24 Thread Christopher King
I got the speech module to work actually, except for input. Only say works. Here's a traceback on speech.input. Traceback (most recent call last): File "C:\Python26\test.py", line 6, in print speech.input() File "C:\Python26\speech.py", line 162, in input listener = listenforanything(r

[Tutor] Confirmation if command worked

2011-08-24 Thread Johan Geldenhuys
Hi all, I have the following code that uses pexpect to execute a system command. My problem is, I don't know how to identify if the command was successfully executed. The code works as it is to execute the SCP command, but it executes regardless if the SCP session can actually connect to somethin

Re: [Tutor] Confirmation if command worked

2011-08-24 Thread Christian Witts
On 2011/08/25 07:51 AM, Johan Geldenhuys wrote: Hi all, I have the following code that uses pexpect to execute a system command. My problem is, I don't know how to identify if the command was successfully executed. The code works as it is to execute the SCP command, but it executes regardless i

Re: [Tutor] Confirmation if command worked

2011-08-24 Thread Johan Geldenhuys
Hi Christian, Thanks for that. I'll give it a shot and see if I can catch the error. Lekker dag Johan From: Christian Witts [mailto:cwi...@compuscan.co.za] Sent: Thursday, 25 August 2011 4:25 PM To: Johan Geldenhuys Cc: tutor@python.org Subject: Re: [Tutor] Confirmation if comma