Re: [Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread Jerry Hill
On Fri, Apr 26, 2013 at 8:05 PM, bob gailer wrote: > - Provide some of your program (all of it if not too long) as part of > the email body. > ​And if your program is too long to comfortably post in the body of an email​, there's some great advice about how to trim large amounts of code down to

Re: [Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread bob gailer
On 4/26/2013 6:57 PM, Rajlaxmi Swain wrote: Welcome to the tutor list. You appear to be a first-time visitor. To help us help you: - Tell us: - Which version of Python you are using - How you are entering and executing your program, - Provide some of your program (all of it if not too lon

Re: [Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread Steven D'Aprano
On 27/04/13 08:57, Rajlaxmi Swain wrote: How can I fix this. Don't call float(foo) when foo is not a string or number. To debug this, you need to follow these steps: 1) Look at the error message. It will tell you the line number that fails. 2) Look at that line of code. What are you calling

Re: [Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread Alan Gauld
On 26/04/13 23:57, Rajlaxmi Swain wrote: How can I fix this. Fix what? you've sent (part of) the error message but not what caused it nor the full error text. Don't make us guess, help us to help you. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/

Re: [Tutor] Chapter 4 Help

2013-04-26 Thread Alan Gauld
On 26/04/13 22:02, Mariel Jane Sanchez wrote: program should calculate the number of vowels in the phrase using a for loop. The second time, your program should use a while loop." My code: phrase = raw_input("Please enter a phrase: ") VOWELS = "aeiou" new = "" for letter in phrase: if VO

Re: [Tutor] cant autoincrement

2013-04-26 Thread Lolo Lolo
thanks so much for the code sample eryksun. its working perfectly now:)___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread Dave Angel
On 04/26/2013 06:57 PM, Rajlaxmi Swain wrote: How can I fix this. I don't see any antecedents for the pronoun. Show us some code, tell us the situation, and show us the full traceback. Otherwise we'd just be paraphrasing the error message. Make sure the argument is a string, or an int,

[Tutor] getting TypeError: float() argument must be a string or a number

2013-04-26 Thread Rajlaxmi Swain
How can I fix this. Thanks, test ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Chapter 4 Help :p:

2013-04-26 Thread Paradox
On 04/27/2013 05:02 AM, Mariel Jane Sanchez wrote: I was in Seattle for 4 days for our band trip so i miss some classes. Chapter 4 Project 1 "Write a program that asks for a phrase, and then calculates and displays the number of vowels in the phrase, twice. The first time, your program should

Re: [Tutor] cant autoincrement

2013-04-26 Thread eryksun
On Fri, Apr 26, 2013 at 8:45 AM, Lolo Lolo wrote: > > id INTERGER Primary Key > > the database has a few more fields, but when i insert into it, i leave the > id field empty as it should be done automatically, but sql complains with an > error that i have left the field blank. If i manually put th

[Tutor] Fw: does anyone know a good module for automation

2013-04-26 Thread ALAN GAULD
Forwarding to group for info, please use replyAll on replies.   Alan Gauld Author of the Learn To Program website http://www.alan-g.me.uk/ - Forwarded Message - >From: Frank Schiro >To: Alan Gauld >Sent: Friday, 26 April 2013, 19:17 >Subject: Re: [Tutor] does anyone know a good module

[Tutor] Chapter 4 Help

2013-04-26 Thread Mariel Jane Sanchez
I was in Seattle for 4 days for our band trip so i miss some classes. Chapter 4 Project 1 "Write a program that asks for a phrase, and then calculates and displays the number of vowels in the phrase, twice. The first time, your program should calculate the number of vowels in the phrase using a f

Re: [Tutor] symlinking dirs with spaces

2013-04-26 Thread eryksun
On Fri, Apr 26, 2013 at 8:10 AM, mike wrote: > > def link(): > print "Adding %s to %s..." % (origFul, loadDir) > os.symlink('origFul', 'media') Your arguments for symlink() are string literals. How about this? LOAD_DIR = "/opt/data/music/load" def link(media): src = os.p

Re: [Tutor] cant autoincrement

2013-04-26 Thread Lolo Lolo
what does your insert statement look like? According to the documentation (http://www.sqlite.org/faq.html#q1):  "whenever you insert a NULL into that column of the table, the NULL is automatically converted into (1 + the highest value)." The insert statement should look like:   "INSERT INTO

Re: [Tutor] cant autoincrement

2013-04-26 Thread bob gailer
On 4/26/2013 8:45 AM, Lolo Lolo wrote: I'm doing a test database with sqlite and have run into some problems. in my 1st table i have an id field: id INTERGER Primary Key ... when i insert into it, i leave the id field empty what does your insert statement look like? According to the documentati

Re: [Tutor] does anyone know a good module for automation

2013-04-26 Thread Alan Gauld
On 26/04/13 16:28, Frank Schiro wrote: Pywinauto is not working with this application that opens from the internet via javascript. Its not in a browser, its a complete application thats not installed on the computer just installed on the internet. That sounds very dodgy, it would be a huge gapi

Re: [Tutor] does anyone know a good module for automation

2013-04-26 Thread Frank Schiro
Pywinauto is not working with this application that opens from the internet via javascript. Its not in a browser, its a complete application thats not installed on the computer just installed on the internet. Pywinauto sees the window...but cant find any controls and does not recognize menu items,

Re: [Tutor] symlinking dirs with spaces

2013-04-26 Thread Dave Angel
On 04/26/2013 08:10 AM, mike wrote: Hi all, I wrote a cli script for syncing my music to a USB mass storage device like a phone etc. all it does is it creates a symlink in a dir to whatever folder i pass as an argument via ./addsync DIR . My problem is i'm having trouble dealing with directories

[Tutor] cant autoincrement

2013-04-26 Thread Lolo Lolo
I'm doing a test database with sqlite and have run into some problems. in my 1st table i have an id field:    id INTERGER Primary Key   the database has a few more fields, but when i insert into it, i leave the id field empty as it should be done automatically, but sql complains with an error th

[Tutor] symlinking dirs with spaces

2013-04-26 Thread mike
Hi all, I wrote a cli script for syncing my music to a USB mass storage device like a phone etc. all it does is it creates a symlink in a dir to whatever folder i pass as an argument via ./addsync DIR . My problem is i'm having trouble dealing with directories with spaces. when using os.symli

Re: [Tutor] sha-256 without using hashlib

2013-04-26 Thread Dave Angel
On 04/26/2013 05:08 AM, Arijit Ukil wrote: I like to implement sha-256 without using implement. It is easy using hashlib as: import hashlib m = hashlib.sha256() m.update("hi") print m.hexdigest() If anybody has pointer on sha-256 implemented without using hashlib library, please share. If yo

[Tutor] sha-256 without using hashlib

2013-04-26 Thread Arijit Ukil
I like to implement sha-256 without using implement. It is easy using hashlib as: import hashlib m = hashlib.sha256() m.update("hi") print m.hexdigest() If anybody has pointer on sha-256 implemented without using hashlib library, please share. Regards, Arijit Ukil Tata Consultancy Services Mai