Re: [Tutor] python code error

2014-09-29 Thread Danny Yoo
On Sun, Sep 28, 2014 at 8:26 AM, Madeleine Austen wrote: > Hi > > Here is my code: > > > from datetime import datetime > timeStart = datetime.now().strftime('%Y-%m-%d %H:%M:%S') > numberPlates = 0 > print("There has been {0} number plates since {1}".format (numberPlates, > timeStart)) > > speedLim

Re: [Tutor] python code error

2014-09-29 Thread Dave Angel
Madeleine Austen Wrote in message: > > It says there are no arguements I don't see any print functions with such text, so presumably you're paraphrasing an exception traceback. Please quote the entire traceback, as there is usually lots of information there. And use copy/paste, don't atte

Re: [Tutor] List and dictionary comprehensions

2014-09-29 Thread Peter Otten
Armindo Rodrigues wrote: > Hi everyone, > > This is my first post so I don't know if I am asking the correct way so > let me know if I messed anything up. > > ***Please note. My code contains a list of quotes that has many lines. I > have noted the beginning and end of the quotes list so you can

Re: [Tutor] Python Serial Communication

2014-09-29 Thread Steven D'Aprano
On Sun, Sep 28, 2014 at 05:32:26PM +0800, m.v gautam wrote: > Hi, > I am trying out serial communication between raspberry pi and atmega 32 using > pyserial module . I have tried serial communication between two atmega and it > is working. > But when I try it rpi and atmega I get blank lines as o

Re: [Tutor] Python Serial Communication

2014-09-29 Thread Steven D'Aprano
On Mon, Sep 29, 2014 at 12:58:09PM +0100, Alan Gauld wrote: [...] > How do you know that val is not a blank line? > Remember that a blank line is not necessarily empty, it might be full of > unprintable characters. > > Try this instead: > > while True: > print "try" > val = ser.read(10

Re: [Tutor] code help

2014-09-29 Thread Alan Gauld
On 22/09/14 16:16, itsthewendigo . wrote: from tkinter import* master = Tk(); canvas = Canvas(master, width = simpledialog.askinteger("Canvas size", "Enter width of canvas")) Its generally a bad idea to mix interactivity with widget creation. Better(and much easier to debug) to query the

Re: [Tutor] Trouble with making a chart

2014-09-29 Thread Alan Gauld
On 24/09/14 07:07, Martin Skåreby wrote: Hello!So i'm having trouble with a task i got from my teacher in a book. I'm supposed to create a chart which shows the converted numbers between Celsius and Fahrenheit. They want the Celsius to range from 40 to -40. I also get to know that Fahrenheit =

Re: [Tutor] I've been trying to make this program work so i can transfer it to final user. please do have a look and see if the code can be corrected in anyway.

2014-09-29 Thread Alan Gauld
On 26/09/14 12:58, Brave Heart wrote: File "C:/Python34/cash.py", line 339, in add_func os.chdir(sqlite3_path) FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:/sqlite3/' I assume you have checked that the folder exists? and that you (ie. the user running

Re: [Tutor] Python Serial Communication

2014-09-29 Thread Alan Gauld
On 28/09/14 10:32, m.v gautam wrote: import serial ser = serial.Serial('/dev/ttyAMA0',38400,timeout = 10) while True: print "try" val = ser.read(10) print val There is a blank line being printed every time in place of val. How do you know that val is not a blank l

Re: [Tutor] Problem with pythonw.exe

2014-09-29 Thread Alan Gauld
On 27/09/14 20:32, Gregory Karakeussian wrote: My antivirus has uninstalled pythonw.exe by mistake and now I can`t fix it, deinstall it, reinstall it, I'm stuck.. is there a solution? What happens when you try to reinstall? Turn off the antivirus before doing so of course. Maybe get a new an

Re: [Tutor] List and dictionary comprehensions

2014-09-29 Thread Alan Gauld
On 28/09/14 03:36, Armindo Rodrigues wrote: have noted the beginning and end of the quotes list so you can easily skip and go straight to the code section. *** It would probably have been better to just delete all but a nfew of the quotes. We don't need all of them to evaluate your code. i

[Tutor] Back from vacation

2014-09-29 Thread Alan Gauld
I'm just home from vacation and have flushed the moderation queue so there might be some out of date or repeat messages appearing out of sequence. Apologies, but normal service should now be resumed. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.flickr.c

[Tutor] code help

2014-09-29 Thread itsthewendigo1111 .
I'm taking an online intro to programing class unfortunately the teacher has not be very helpful. well this is the assignment http://burtondsc.pbworks.com/w/file/fetch/84469141/Assignment03.pdf and here is my code so far from tkinter import* master = Tk(); canvas = Canvas(master, width = si

[Tutor] python code error

2014-09-29 Thread Madeleine Austen
Hi Here is my code: from datetime import datetime timeStart = datetime.now().strftime('%Y-%m-%d %H:%M:%S') numberPlates = 0 print("There has been {0} number plates since {1}".format (numberPlates, timeStart)) speedLimit = 25 distance = 1 class NumberPlates: """A class that holds information

[Tutor] Python Serial Communication

2014-09-29 Thread m.v gautam
Hi, I am trying out serial communication between raspberry pi and atmega 32 using pyserial module . I have tried serial communication between two atmega and it is working. But when I try it rpi and atmega I get blank lines as output. My python code is import serial ser = serial.Serial('/dev/tty

[Tutor] Problem with pythonw.exe

2014-09-29 Thread Gregory Karakeussian
Hi there, My antivirus has uninstalled pythonw.exe by mistake and now I can`t fix it, deinstall it, reinstall it, I'm stuck.. is there a solution? thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Python advice about API, JSON

2014-09-29 Thread Patrick Thunstrom
On Mon, Sep 22, 2014 at 4:01 PM, Juan Christian wrote: > I'm trying to make my script the more pythonic possible. How would a good > approach regarding external API and json be? I don't think dealing with a specific API is actually appropriate for this list. I'll try to answer the general element

[Tutor] Trouble with making a chart

2014-09-29 Thread Martin Skåreby
Hello!So i'm having trouble with a task i got from my teacher in a book. I'm supposed to create a chart which shows the converted numbers between Celsius and Fahrenheit. They want the Celsius to range from 40 to -40. I also get to know that Fahrenheit = 32+celsius*9/5. Now I managed to write th

[Tutor] I've been trying to make this program work so i can transfer it to final user. please do have a look and see if the code can be corrected in anyway.

2014-09-29 Thread Brave Heart
Perrsonal Monney Assistance(PMA === 1. ADD Record 2. MODIFY Record 3. DELETE Record 4. SHOW All 5. SHOW Summary 6. Exit Please enter your Choise (1-6): 1 ADD Record == (Key in '-e' to back to main menu) Key in new record .. Date : 09-09-2013 For : sh Total

[Tutor] List and dictionary comprehensions

2014-09-29 Thread Armindo Rodrigues
Hi everyone, This is my first post so I don't know if I am asking the correct way so let me know if I messed anything up. ***Please note. My code contains a list of quotes that has many lines. I have noted the beginning and end of the quotes list so you can easily skip and go straight to the code