Re: [Tutor] First program

2010-03-12 Thread Ray Parrish
, is not a valid choice'.format(choice)) Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'format' >>> print('{0}, is not a valid choice'format(choice)) File "", line

Re: [Tutor] First program

2010-03-12 Thread Ray Parrish
+ " square feet" The area of a rectangle is 12 x 10 equals 120 square feet. I find that putting the variables on the end like that, when you're not actually applying any special formatting to them makes it less readable when I'm debugging my stuff

Re: [Tutor] Opening a dos exe

2010-03-13 Thread Ray Parrish
ou call it, then remove it after running it to reduce clutter. Hope this is what you're looking for. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareReport.html Ray's Links, a variety of links to usefull things, and ar

[Tutor] Escaping a single quote mark in a triple quoted string.

2010-03-13 Thread Ray Parrish
t;>> NewString = """'""" >>> NewString "'" Hmmm, no back slash this time... >>> String = """http://www.rayslinks.com";>Ray""" + """'""" + """s Links&q

Re: [Tutor] Opening a dos exe

2010-03-13 Thread Ray Parrish
Alan Gauld wrote: "Ray Parrish" wrote but I cannot find a way of getting this information to the dos program from python. Any ideas? You could use os.system("startprogram.bat"), and create startprogram.bat to run the dos program, and feed it the files, either all at onc

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Steven D'Aprano wrote: On Sat, 13 Mar 2010 01:04:42 pm Ray Parrish wrote: print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Hello, Isn't it a little more understandable to use a construct like the following?

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Alan Gauld wrote: "Ray Parrish" wrote print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Isn't it a little more understandable to use a construct like the following? print "The area of a " + Choice + &quo

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Luke Paireepinart wrote: On Sat, Mar 13, 2010 at 3:03 AM, Alan Gauld <mailto:alan.ga...@btinternet.com>> wrote: "Ray Parrish" mailto:c...@cmc.net>> wrote print "A %s with dimensions %sx%s has an area of %s." % (

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Luke Paireepinart wrote: Ray, please reply on-list in the future in case someone else has input. On Fri, Mar 12, 2010 at 8:01 PM, Ray Parrish <mailto:c...@cmc.net>> wrote: Luke Paireepinart wrote: print "A %s with dimensions %sx%s has an area of %s." %

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Andre Engels wrote: On Sat, Mar 13, 2010 at 3:11 AM, Ray Parrish wrote: Andre Engels wrote: On 3/12/10, yd wrote: else: raise Exception('{0}, is not a valid choice'.format(choice)) This will cause the program to stop-with-error if something wrong is

Re: [Tutor] Escaping a single quote mark in a triple quoted string.

2010-03-13 Thread Ray Parrish
Sander Sweers wrote: On 13 March 2010 18:33, Ray Parrish wrote: Hello, I am getting the following - String = """http://www.rayslinks.com";>Ray's Links""" String 'http://www.rayslinks.com";>Ray\'s Links&

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Ken G. wrote: I am using Ubuntu 9.04 and I have versions 2.6.2 and 3.0.1+ installed. Look for IDLE in Add/Remove Applications. Perhaps, you may have a different version of Ubuntu. Ken Ray Parrish wrote: Yes, I'm using 2.45.2 as that is the highest version available in the U

Re: [Tutor] Escaping a single quote mark in a triple quoted string.

2010-03-13 Thread Ray Parrish
Steven D'Aprano wrote: On Sun, 14 Mar 2010 04:33:57 am Ray Parrish wrote: Hello, I am getting the following - >>> String = """http://www.rayslinks.com";>Ray's Links""" >>> String 'http://www.rayslinks.com"

[Tutor] Declaring a compound dictionary structure.

2010-03-13 Thread Ray Parrish
dress indexed server log lines which can then be iterated over to extract daily visit counts, and other extractable data sorted by date, and visitor. The need would not arise if the log files did not contain two dates each, but my service provider rotates their server logs around 2 am, so I

[Tutor] KeyError: '61.135.168.82' with dictionary.

2010-03-25 Thread Ray Parrish
"/home/ray/LogAnalyzer/iis-log-analyze.py", line 2241, in ReadInDaysLog dates[date][thisIPAddress].append(eachLine) KeyError: '61.135.168.82' As you can see, it is tossing a key error on the same ip address that was used in the interactive code successfully, I can not figure o

[Tutor] Speech recognition, and synthesis

2010-04-11 Thread Ray Parrish
Hello, Are there any Python libraries that deal with speech recognition, and speech synthesis? If so, where are they available, and are there any open source versions? Thanks for any help you can be. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com

[Tutor] Declaring methods in modules.

2010-04-11 Thread Ray Parrish
ss within the module? Thanks for any help you can be. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareReport.html Ray's Links, a variety of links to usefull things, and articles by Ray. http://www.rayslinks.com Writings of "The" Sc

[Tutor] Passing headers with httplib

2010-04-15 Thread Ray Parrish
row=1&genre=0&favchan=false&magic=1269|9898&magictype=0&zip=&music=1&ppv=1&24hr=1&HDTVOnly=false; s_cc=true; s_sq=%5B%5BB%5D%5D; wtpgcnt=1; s_vi=[CS]v1|25E3DAD0050118C7-610E60004530[CE]; base_domain_4631b4ff1e53d450c3f9726dd45be7de=tvguide.com; rsi_ct

Re: [Tutor] Passing headers with httplib

2010-04-16 Thread Ray Parrish
Ray Parrish wrote: Hello, I am trying to figure out how to send cookie data with an httplib request command. Here is what the doc says - request( method, url[, body[, headers]]) This will send a request to the server using the HTTP request method method and the selector url. If the

[Tutor] Boa Constructor list control

2010-04-29 Thread Ray Parrish
description of the list control, with no details on what it's properties were even. Thanks, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareReport.html Ray's Links, a variety of links to usefull things, and articles by Ray. http://www.

Re: [Tutor] Boa Constructor list control

2010-04-29 Thread Ray Parrish
Ray Parrish wrote: Hello, I am just learning how to use Boa Constructor to make GUI apps, and am having some problem with understanding the list control. The list control has a property called columns, but I cannot figure out how to add columns, and specify names for them. When I click

[Tutor] Syntax error with if statement

2011-08-24 Thread Ray Parrish
^ SyntaxError: invalid syntax Any help you can be will be much appreciated. Later, Ray Parrish -- The Unknown Lead Player, Ray Parrish http://www.facebook.com/pages/The-Unknown-Lead-Player/123388551041130?sk=wall Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareRe