Re: [Tutor] numrows returning -1

2013-11-22 Thread Alan Gauld
On 22/11/13 22:08, Paul Steele wrote: I am getting a numrows count of -1 when I print numrows (see line 23 of the code). What does "-1" mean?I think my connection is working and my table has data. I don't know about MySQL but the sqlite3 module documentation says: --- As required by

Re: [Tutor] Using tkinter::ttk::treeview to implement data view.

2013-11-22 Thread Alan Gauld
On 23/11/13 01:19, Davnobezimeni Sasha Balagura wrote: I have to implement parcer for .txt file with special formating. There are a lot of data to display, modify, add. I decided to use tkinter::ttk:treeviev for this. And it really good one, very fast and good looking..but.. But I cant set border

[Tutor] numrows returning -1

2013-11-22 Thread Paul Steele
Hey all... I am getting a numrows count of -1 when I print numrows (see line 23 of the code). What does "-1" mean?I think my connection is working and my table has data. Here's my code... #!/usr/bin/python # -*- coding: utf-8 -*- import mysql.connector from mysql.connector import errorcod

[Tutor] Using tkinter::ttk::treeview to implement data view.

2013-11-22 Thread Davnobezimeni Sasha Balagura
Hello. I have to implement parcer for .txt file with special formating. There are a lot of data to display, modify, add. I decided to use tkinter::ttk:treeviev for this. And it really good one, very fast and good looking..but.. But I cant set borders between cells, like in Excel. Is it real at all

Re: [Tutor] Extarcting data tables from a text file

2013-11-22 Thread Mark Lawrence
On 22/11/2013 16:25, Ruben Guerrero wrote: Dear tutor, I am a beginner in python and I need your guidance to write a python script to extract many nxn data tables of variable nunber of rows from a text file as in the following example Condensed to atoms (all electrons): 1

Re: [Tutor] raw input program is still running.

2013-11-22 Thread Steven D'Aprano
On Fri, Nov 22, 2013 at 01:02:13PM -0800, Imrose Baga wrote: > Hi I've just started using python. I tried to use raw input for name, city > and state. But only my name shows up and then when i try to close the > program, it is showed as still running and asks if I wish to kill the > program. please

Re: [Tutor] raw input program is still running.

2013-11-22 Thread Amit Saha
On Sat, Nov 23, 2013 at 7:02 AM, Imrose Baga wrote: > Hi I've just started using python. I tried to use raw input for name, city > and state. But only my name shows up and then when i try to close the > program, it is showed as still running and asks if I wish to kill the > program. please any hel

[Tutor] Extarcting data tables from a text file

2013-11-22 Thread Ruben Guerrero
Dear tutor, I am a beginner in python and I need your guidance to write a python script to extract many nxn data tables of variable nunber of rows from a text file as in the following example Condensed to atoms (all electrons): 1 2 3 4 5

[Tutor] raw input program is still running.

2013-11-22 Thread Imrose Baga
Hi I've just started using python. I tried to use raw input for name, city and state. But only my name shows up and then when i try to close the program, it is showed as still running and asks if I wish to kill the program. please any help -- Regards, Imrose Baga _

Re: [Tutor] Issue w/ while loops

2013-11-22 Thread Danny Yoo
> Ok, got you! > > print("TIME TRACKING") > > while True: > hours_worked = input("How many hours did you work today? ") > try: > hours_worked = float(hours_worked) > break > except ValueError: > print ("Invalid input") > if hours_worked < 24: > print("You mus

Re: [Tutor] Two subsequent for loops in one function

2013-11-22 Thread Danny Yoo
I agree with Peter Otten. I want to try restating what he said to try to emphasize what I think is the key point. One basic skill that you learn as a programmer is how to handle nesting. One strategy is to give things names. This can have benefits: 1. The name itself might make the code ea

Re: [Tutor] Is there a package to "un-mangle" characters?

2013-11-22 Thread Steven D'Aprano
On Thu, Nov 21, 2013 at 12:04:19PM -0800, Albert-Jan Roskam wrote: > Hi, > > Today I had a csv file in utf-8 encoding, but part of the accented > characters were mangled. The data were scraped from a website and it > turned out that at least some of the data were mangled on the website > alread

Re: [Tutor] Two subsequent for loops in one function

2013-11-22 Thread Don Jennings
On Nov 22, 2013, at 9:24 AM, Rafael Knuth wrote: > Hej there, > > newbie question: I struggle to understand what exactly those two > subsequent for loops in the program below do (Python 3.3.0): > > for x in range(2, 10): >for y in range(2, x): >if x % y == 0: >print(x, "

Re: [Tutor] Sending sensible e-mail

2013-11-22 Thread Mark Lawrence
On 22/11/2013 10:19, Dominik George wrote: Hi, Subject: [Tutor] (no subject) On a side note, please learn how to send e-mail. Thanks, Nik At least Steven D'Aprano and myself love guessing games, let's have some occasionally please :) -- Python is the second best programming language in

Re: [Tutor] Two subsequent for loops in one function

2013-11-22 Thread Steven D'Aprano
On Fri, Nov 22, 2013 at 03:24:31PM +0100, Rafael Knuth wrote: > Hej there, > > newbie question: I struggle to understand what exactly those two > subsequent for loops in the program below do (Python 3.3.0): > > for x in range(2, 10): > for y in range(2, x): > if x % y == 0: >

Re: [Tutor] Two subsequent for loops in one function

2013-11-22 Thread Peter Otten
Rafael Knuth wrote: > Hej there, > > newbie question: I struggle to understand what exactly those two > subsequent for loops in the program below do (Python 3.3.0): > > for x in range(2, 10): > for y in range(2, x): > if x % y == 0: > print(x, "equals", y, "*", x//y) >

[Tutor] Two subsequent for loops in one function

2013-11-22 Thread Rafael Knuth
Hej there, newbie question: I struggle to understand what exactly those two subsequent for loops in the program below do (Python 3.3.0): for x in range(2, 10): for y in range(2, x): if x % y == 0: print(x, "equals", y, "*", x//y) break else: print(x

Re: [Tutor] Is there a package to "un-mangle" characters?

2013-11-22 Thread Albert-Jan Roskam
> Today I had a csv file in utf-8 encoding, but part of the accented > characters were mangled. The data were scraped from a website and it > turned out that at least some of the data were mangled on the website > already. Bits of the text were actually cp1252 (or cp850), I think, > even

Re: [Tutor] Sending sensible e-mail (was: Re: (no subject))

2013-11-22 Thread Peter Otten
Dominik George wrote: >> Subject: [Tutor] (no subject) > > On a side note, please learn how to send e-mail. Nik, this is a beginners' list, so please be more constructive. 久場海人, Nik may be unfriendly, but he is right; in future posts please take the time to pick a subject that gives the read

[Tutor] Sending sensible e-mail (was: Re: (no subject))

2013-11-22 Thread Dominik George
Hi, > Subject: [Tutor] (no subject) On a side note, please learn how to send e-mail. Thanks, Nik -- * mirabilos is handling my post-1990 smartphone * Aaah, it vibrates! Wherefore art thou, demonic device?? PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17 FD26 B79A 3C16 A0C4 F296 signature.asc De

Re: [Tutor] Issue w/ while loops

2013-11-22 Thread Rafael Knuth
>> I'm only stuck at one point: How do I loop back to the beginning in >> case the user input is invalid? > > > Look at Peter's example. He set a variable to false when the input was > wrong. You can check that value in your while loop. Ok, got you! print("TIME TRACKING") while True: hours_w

Re: [Tutor] Reading number x and printing number x+1

2013-11-22 Thread Peter Otten
G. McKinnon Ryall wrote: > I have a script that outputs results to a file (one file, reused.) I would > like to have an output file in this format > > # > (blank line) > (output from program (only one line)) > name > (T/F) > (result iteration, shortened to x.) > #-

Re: [Tutor] (no subject)

2013-11-22 Thread Peter Otten
久場海人 wrote: > Hi. I began programming literally 2 days ago. > > This is a code to setup password and confirms to make sure they both > match, and I need to know what coding I can use to loop back to specific > line to start the code over if the user were to incorrectly typed in the > password. >

[Tutor] Reading number x and printing number x+1

2013-11-22 Thread G. McKinnon Ryall
I have a script that outputs results to a file (one file, reused.) I would like to have an output file in this format # (blank line) (output from program (only one line)) name (T/F) (result iteration, shortened to x.) #- so like this #-

[Tutor] (no subject)

2013-11-22 Thread 久場海人
Hi. I began programming literally 2 days ago. This is a code to setup password and confirms to make sure they both match, and I need to know what coding I can use to loop back to specific line to start the code over if the user were to incorrectly typed in the password. 1. CreatePassword = raw_i