Re: [Tutor] Help with exercises from learning to program python wikibooks

2010-07-04 Thread Zubin Mithra
On Sun, Jul 4, 2010 at 7:02 PM, Hugo Arts hugo.yo...@gmail.com wrote: On Sun, Jul 4, 2010 at 3:20 PM, John Palmer speederpyt...@gmail.com wrote: Hi I've just decided to try an learn python but i'm already stuck on one of the first exercises, i've given the link below:

Re: [Tutor] Help with exercises from learning to program python wikibooks

2010-07-04 Thread Hugo Arts
CC'd to tutor for completeness On Sun, Jul 4, 2010 at 3:58 PM, John Palmer speederpyt...@gmail.com wrote: yep i'm using version 2.6.5. Would you recommend using the newer version? as on the python website it seems to imply that the different versions have different uses and if in doubt you

Re: [Tutor] Help with exercises from learning to program python wikibooks

2010-07-04 Thread Richard D. Moores
On Sun, Jul 4, 2010 at 07:39, Zubin Mithra zubin.mit...@gmail.com wrote: The Python tutorial for both 2.x and 3.0 is really good. Python 2.x - http://docs.python.org/tutorial/ Python 3.0 - http://docs.python.org/release/3.0.1/tutorial/ The 3.0 link is broken. Try

Re: [Tutor] Help with choices for new database program

2010-07-04 Thread Jim Byrnes
Martin Walsh wrote: On 07/03/2010 10:25 AM, Jim Byrnes wrote: Jeff Johnson wrote: [snip] http://dabodev.com/ Please check it out. And go to www.leafe.com and subscribe to the dabo-user email list. I would like to try out Dabo, but I don't see it in the Ubuntu repositories and I would

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Jeff Johnson
able to get help from the Dabo mailing list. Thanks again, Chris C. *From:* Jeff Johnson [mailto:j...@dcsoftware.com] *Sent:* Friday, July 02, 2010 2:09 PM *To:* Chris C. *Subject:* Re: [Tutor] Help with choices for new database program On 07/02/2010 11:40 AM, Chris C. wrote: I'm writing

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Jeff Johnson
On 07/02/2010 06:14 PM, David Hutto wrote: Stick to the main python libraries(python with sqllite, and for the standalone exe know it's somewhere, and I've seen it in the past few days, but didn't pay attention because it wasn't important to what I was doing at the time) going anywhere else is

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Jeff Johnson
On 07/02/2010 06:32 PM, David Hutto wrote: On Fri, Jul 2, 2010 at 9:31 PM, David Huttosmokefl...@gmail.com wrote: Well, it was mainly that he said he was a beginner and was only using this for a single banking project, I do believe. Not that learning a new package would wouldn't be

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Jeff Johnson
On 07/02/2010 06:51 PM, David Hutto wrote: In the end, there might be so many packages, I might not be able to handle it all(for my own uses). But, I would think, you would agree that a simple account balance app, would be no more than tkinter with a few functions to write and retrieve data from

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Jeff Johnson
On 07/02/2010 08:19 PM, bob gailer wrote: On 7/2/2010 5:56 PM, Jeff Johnson wrote: [snip] Visual FoxPro ... is very similar to Access I differ. Access and FoxPro are very different. Yes they both use tables, relationships, indexes and SQL. Yes they both have visual designers for forms and

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread John
On Friday 02 July 2010 08:19:24 pm bob gailer wrote: On 7/2/2010 5:56 PM, Jeff Johnson wrote: [snip] Visual FoxPro ... is very similar to Access I differ. Access and FoxPro are very different. Yes they both use tables, relationships, indexes and SQL. Yes they both have visual designers

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Jim Byrnes
Jeff Johnson wrote: On 07/02/2010 11:40 AM, Chris C. wrote: I'm writing this question because I want, for my own satisfaction, to rewrite one of my Access dbs (one that does our finances) into a stand-alone Python database program using SQLite. I know I'll be learning as I go, but that'll work,

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread bob gailer
On 7/2/2010 9:44 PM, Jeff Johnson wrote: On 07/02/2010 08:19 PM, bob gailer wrote: On 7/2/2010 5:56 PM, Jeff Johnson wrote: [snip] Visual FoxPro ... is very similar to Access I differ. Access and FoxPro are very different. Yes they both use tables, relationships, indexes and SQL. Yes they

Re: [Tutor] Help with choices for new database program

2010-07-03 Thread Martin Walsh
On 07/03/2010 10:25 AM, Jim Byrnes wrote: Jeff Johnson wrote: [snip] http://dabodev.com/ Please check it out. And go to www.leafe.com and subscribe to the dabo-user email list. I would like to try out Dabo, but I don't see it in the Ubuntu repositories and I would like to avoid using

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread Jeff Johnson
On 07/02/2010 11:40 AM, Chris C. wrote: I'm writing this question because I want, for my own satisfaction, to rewrite one of my Access dbs (one that does our finances) into a stand-alone Python database program using SQLite. I know I'll be learning as I go, but that'll work, I'm not in a big

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread Alan Gauld
Chris C. filt...@gmail.com wrote rewrite one of my Access dbs (one that does our finances) into a stand-alone Python database program using SQLite. I know I'll be learning as I go, but that'll work, I'm not in a big hurry and I'll work on it in my spare time. If its a database focused app

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread Jeff Johnson
able to get help from the Dabo mailing list. Thanks again, Chris C. *From:* Jeff Johnson [mailto:j...@dcsoftware.com] *Sent:* Friday, July 02, 2010 2:09 PM *To:* Chris C. *Subject:* Re: [Tutor] Help with choices for new database program On 07/02/2010 11:40 AM, Chris C. wrote: I'm writing

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
mailing list. Thanks again, Chris C. From: Jeff Johnson [mailto:j...@dcsoftware.com] Sent: Friday, July 02, 2010 2:09 PM To: Chris C. Subject: Re: [Tutor] Help with choices for new database program On 07/02/2010 11:40 AM, Chris C. wrote: I’m writing this question because I want

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread Jeff Johnson
On 07/02/2010 06:14 PM, David Hutto wrote: Stick to the main python libraries(python with sqllite, and for the standalone exe know it's somewhere, and I've seen it in the past few days, but didn't pay attention because it wasn't important to what I was doing at the time) going anywhere else is

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:27 PM, Jeff Johnson j...@san-dc.com wrote: On 07/02/2010 06:14 PM, David Hutto wrote: Stick to the main python libraries(python with sqllite, and for the standalone exe know it's somewhere, and I've seen it in the past few days, but didn't pay attention because it

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:31 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 9:27 PM, Jeff Johnson j...@san-dc.com wrote: On 07/02/2010 06:14 PM, David Hutto wrote: Stick to the main python libraries(python with sqllite, and for the standalone exe know it's somewhere, and

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:44 PM, Jeff Johnson j...@san-dc.com wrote: On 07/02/2010 06:32 PM, David Hutto wrote: On Fri, Jul 2, 2010 at 9:31 PM, David Huttosmokefl...@gmail.com  wrote: Well, it was mainly that he said he was a beginner and was only using this for a single banking project, I

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread Jeff Johnson
On 07/02/2010 06:51 PM, David Hutto wrote: In the end, there might be so many packages, I might not be able to handle it all(for my own uses). But, I would think, you would agree that a simple account balance app, would be no more than tkinter with a few functions to write and retrieve data from

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson j...@dcsoftware.com wrote: On 07/02/2010 06:51 PM, David Hutto wrote: In the end, there might be so many packages, I might not be able to handle it all(for my own uses). But, I would think, you would agree that a simple account balance app, would

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 10:01 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson j...@dcsoftware.com wrote: On 07/02/2010 06:51 PM, David Hutto wrote: In the end, there might be so many packages, I might not be able to handle it all(for my own uses). But,

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 10:07 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 10:01 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson j...@dcsoftware.com wrote: On 07/02/2010 06:51 PM, David Hutto wrote: In the end, there might be so

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 10:10 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 10:07 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 10:01 PM, David Hutto smokefl...@gmail.com wrote: On Fri, Jul 2, 2010 at 9:55 PM, Jeff Johnson j...@dcsoftware.com wrote: On

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread bob gailer
On 7/2/2010 5:56 PM, Jeff Johnson wrote: [snip] Visual FoxPro ... is very similar to Access I differ. Access and FoxPro are very different. Yes they both use tables, relationships, indexes and SQL. Yes they both have visual designers for forms and reports. Yes they both are programmable.

Re: [Tutor] help

2010-06-17 Thread Modulok
Solution: width times height. On 6/17/10, KB SU k24...@gmail.com wrote: help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help

2010-06-17 Thread Steven D'Aprano
On Thu, 17 Jun 2010 05:28:37 pm KB SU wrote: help No no, don't tell us what you need help about! I love guessing games! Let me see now... I'm guessing that your problem is that don't know how to work out the length of a string. Here's one way: string = something count = 1 for char in string:

Re: [Tutor] help

2010-06-17 Thread Mark Lawrence
On 17/06/2010 08:28, KB SU wrote: help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor Help, I need somebody, Help, not just anybody, Help, you know I need

Re: [Tutor] help

2010-06-17 Thread Lowell Tackett
From the virtual desk of Lowell Tackett  --- On Thu, 6/17/10, Mark Lawrence breamore...@yahoo.co.uk wrote: From: Mark Lawrence breamore...@yahoo.co.uk Subject: Re: [Tutor] help To: tutor@python.org Date: Thursday, June 17, 2010, 8:30 AM On 17/06/2010 08:28, KB SU wrote: help

Re: [Tutor] help

2010-06-17 Thread Mark Lawrence
On 17/06/2010 19:22, Lowell Tackett wrote: From the virtual desk of Lowell Tackett --- On Thu, 6/17/10, Mark Lawrencebreamore...@yahoo.co.uk wrote: From: Mark Lawrencebreamore...@yahoo.co.uk Subject: Re: [Tutor] help To: tutor@python.org Date: Thursday, June 17, 2010, 8:30 AM On 17/06

Re: [Tutor] Help

2010-05-15 Thread Dave Angel
she haohao wrote: Hi, I have some questions that I am unable to figure out. Let say I have a file name peaks.txt. Chr17 9 4.5 5.5 chr10 6 9 3.5 4.5 chr1 10 6 2.5 4.4 Question is how can i sort the file so that

Re: [Tutor] Help

2010-05-15 Thread Alan Gauld
she haohao einstein...@hotmail.com wrote Question is how can i sort the file so that it looks like this: Chr17 9 4.5 5.5 chr1 10 6 2.5 4.4 chr10 6 9 3.5 4.5 I have no idea! How would you do it manually? In what

Re: [Tutor] Help

2010-05-15 Thread Dave Angel
all the p values and how do i sort the file and how i open the respective file. Thanks for helping Date: Sat, 15 May 2010 19:58:33 -0400 From: da...@ieee.org To: einstein...@hotmail.com CC: tutor@python.org Subject: Re: [Tutor] Help she haohao wrote: Hi, I have some questions

Re: [Tutor] Help

2010-05-14 Thread Abhishek Mishra
Not sure if I understood the problem exactly, but you could linearize the text by using something like this -- foo = '''ACTGTGTTC ... ACGTCGACC ... AVGTT ... ACGTTaGTC''' foo 'ACTGTGTTC\nACGTCGACC\nAVGTT\nACGTTaGTC' linear1 = ''.join(foo.split('\n')) linear1

Re: [Tutor] Help

2010-05-14 Thread Hugo Arts
On Fri, May 14, 2010 at 9:25 PM, Abhishek Mishra ideam...@gmail.com wrote: linear1 = ''.join(foo.split('\n')) linear2 = foo.replace('\n','') ^^ these are the two ways in which you can linearize the input text by removing all  '\n' +1 for the replace. More obvious, cleaner, more efficient.

Re: [Tutor] Help

2010-05-14 Thread Steven D'Aprano
On Fri, 14 May 2010 06:08:30 pm she haohao wrote: Say I have a .fa file and I want to print a subsequence from the file without the \n how can i do it. Example: Inside the test.fa file I have chromosome 1 ACTGTGTTC ACGTCGACC AVGTT ACGTTaGTC so if I say i wan the subsequence

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-12 Thread Alan Gauld
Dave Angel da...@ieee.org wrote But you have a serious bug in your code, that nobody in the first five responses has addressed. That while loop will loop over the first line repeatedly, till it reaches or exceeds 1000, regardless of the length of subsequent lines. Oooh, good catch, I

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Luke Paireepinart
On Tue, May 11, 2010 at 1:00 PM, ramya natarajan nramy...@gmail.com wrote: Hello, I have to read lines from files exactly upto 1000 characters. But the problem is its reading entire line and not stopping excatly in 1000 characters. Can some one help what mistake i am doing here?.    log =

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread spir ☣
On Tue, 11 May 2010 11:00:20 -0700 ramya natarajan nramy...@gmail.com wrote: Hello, I am very beginner to programming, I got task to Write a loop that reads each line of a file and counts the number of lines that are read until the total length of the lines is 1,000 characters. I have to

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread शंतनू
On 12-May-2010, at 12:32 AM, spir ☣ wrote: On Tue, 11 May 2010 11:00:20 -0700 ramya natarajan nramy...@gmail.com wrote: Hello, I am very beginner to programming, I got task to Write a loop that reads each line of a file and counts the number of lines that are read until the total

Re: [Tutor] Help required to count no of lines that are until 1000characters

2010-05-11 Thread Alan Gauld
ramya natarajan nramy...@gmail.com wrote characters.But the problem is its reading entire line and not stopping excatly in 1000 characters. Do you really need to stop reading the file at 1000 characters rather than the line containing the 1000th character? That seems a very arbitrary sort

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Alan Gauld
spir ☣ denis.s...@gmail.com wrote Either you read line per line, but then you cannot stop exactly at the 1000th character; or you traverse the text char per char, but this is a bit picky. Or you could just read 1000 chars from the file then pick out the lines from that. But that requires

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Dave Angel
ramya natarajan wrote: Hello, I am very beginner to programming, I got task to Write a loop that reads each line of a file and counts the number of lines that are read until the total length of the lines is 1,000 characters. I have to read lines from files exactly upto 1000 characters.

Re: [Tutor] Help with simple text book example that doesn't work!!!

2010-04-04 Thread Steven D'Aprano
On Sun, 4 Apr 2010 03:40:57 pm Brian Drwecki wrote: Hi all... I am working from the Learning Python 3rd edition published by O'Reily... FYI I am trying to learn Python on my own (not for course credit or anything).. I am a psychologist with very limited programming experience.. I am anal, and

Re: [Tutor] Help with simple text book example that doesn't work!!!

2010-04-04 Thread wesley chun
similarly, you get an error if: print int(reply) ** 2 print 'Bye' ... is all a single line and/or if you mixed spaces and TABs. -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Core Python Programming, Prentice Hall, (c)2007,2001 Python Fundamentals, Prentice Hall,

Re: [Tutor] Help with simple text book example that doesn't work!!!

2010-04-04 Thread Brian Drwecki
Python version Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more information As for the exact error codehere it is. while True: reply = raw_input('Enter text:') if reply == 'stop': break

Re: [Tutor] help

2010-03-30 Thread vishwajeet singh
On Mon, Mar 29, 2010 at 7:30 AM, Oshan Modi modi.os...@gmail.com wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? How are you trying to run it ?? -- Vishwajeet Singh +91-9657702154 |

Re: [Tutor] help

2010-03-30 Thread Christian Witts
Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? ___ Tutor

Re: [Tutor] help

2010-03-30 Thread Steven D'Aprano
On Mon, 29 Mar 2010 01:00:45 pm Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? Are you running Linux or Mac? At the command prompt, run: python myfile.py and report any

Re: [Tutor] help

2010-03-30 Thread Christian Witts
Forwarding to the list. Martijn wrote: On Tue, Mar 30, 2010 at 12:15 PM, Christian Witts cwi...@compuscan.co.za mailto:cwi...@compuscan.co.za wrote: Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in

Re: [Tutor] help

2010-03-30 Thread Christian Witts
Oshan Modi wrote: I have Windows 7 and am using python 2.6.. I added python.exe's address in the path option under enviromental variables.. i can run python in command prompt.. its just that i dont know to make it execute a file directly rather than typing the whole program again and again..

Re: [Tutor] help

2010-03-30 Thread Martijn
Simple; just write python program.py in your command line :) On Tue, Mar 30, 2010 at 2:08 PM, Christian Witts cwi...@compuscan.co.zawrote: Oshan Modi wrote: I have Windows 7 and am using python 2.6.. I added python.exe's address in the path option under enviromental variables.. i can run

Re: [Tutor] help

2010-03-30 Thread bob gailer
On 3/28/2010 10:00 PM, Oshan Modi wrote: i am only a novice and just started programming.. i am having trouble running a .py file in the command prompt.. if anyone of you could help? Please learn how to ask questions. In a situation like this we'd like to know what operating system you are

Re: [Tutor] help (Oshan Modi) with command prompt

2010-03-30 Thread Culver, Hunt C
You didn't say what operating system, but in general terms, the python application has to know how to find your python module, say 'foo.py'. This means that the directory where foo.py is located must be on the system path or PYTHONPATH. One simple way to do this is to navigate at the command

Re: [Tutor] help with loops

2010-03-25 Thread bob gailer
On 3/25/2010 11:34 AM, kumar s wrote: Dear group: I need some tips/help from experts. I have two files tab-delimted. One file is 4K lines. The other files is 40K lines. I want to search contents of a file to other and print those lines that satisfy. File 1: chr X Y chr1

Re: [Tutor] help with loops

2010-03-25 Thread Walter Prins
So, am I right that for each X value in file 2, you want to look up to see if you can find a corresponding line in file 1 where the value from file 2 falls between the X and Y value from file 1, and if found, then output the original line from file 2 and the 6th column from the found line from

Re: [Tutor] Help me understand this tkinter related code

2010-02-26 Thread Alan Gauld
Please don't hijack an old message to create a new subject. Those of us using threaded readers might not see it and you lose potential answers. Robert DeLaurentis li...@bobdel.com wrote The local function change_volume(v) requires the argument v to operate properly, but I'm unclear where the

Re: [Tutor] Help with cursors please

2010-02-04 Thread Kent Johnson
On Thu, Feb 4, 2010 at 12:47 PM, Alan Harris-Reid aharrisr...@googlemail.com wrote: Hi, I have a SQLite cursor which I want to traverse more than once, eg... for row in MyCursor:   method1(row)  then later... for row in MyCursor:   method2(row)  Method2 is never run, I guess because the

Re: [Tutor] Help with cursors please

2010-02-04 Thread Alan Harris-Reid
Kent Johnson wrote: On Thu, Feb 4, 2010 at 12:47 PM, Alan Harris-Reid aharrisr...@googlemail.com wrote: Hi, I have a SQLite cursor which I want to traverse more than once, eg... for row in MyCursor: method1(row) then later... for row in MyCursor: method2(row) Method2 is never run, I

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread David
Bob, brilliant stuff -- I am truly awed by this. Create a default-filled matrix and mark combinations used so as to take them out of the game? Wow. This is new to me. On 03/02/10 15:46, bob gailer wrote def askQuestions(): # generate and ask questions: for i in range(NQ): while 1: # loop

Re: [Tutor] help with random.randint

2010-02-03 Thread Hugo Arts
On Wed, Feb 3, 2010 at 8:19 AM, David ld...@gmx.net wrote: Hello Bob, thanks for your comments! On 03/02/10 14:51, bob gailer wrote: or if you seek terseness: terms = [random.randint(1, 99) for i in 'ab'] Do I understand correctly that 'ab' here merely serves to produce a 'dummy

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread Hugo Arts
On Wed, Feb 3, 2010 at 10:06 AM, David ld...@gmx.net wrote: Bob, brilliant stuff -- I am truly awed by this. Create a default-filled matrix and mark combinations used so as to take them out of the game? Wow. This is new to me. On 03/02/10 15:46, bob gailer wrote def askQuestions(): #

Re: [Tutor] help with random.randint

2010-02-03 Thread spir
On Wed, 03 Feb 2010 11:21:56 +0800 David ld...@gmx.net wrote: Hello list, I thought this was easy even for me, but I was wrong, I guess. Here is what I want to do: take two random numbers between 1 and 99, and put them into a list. import random terms = [] for i in range(2):

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread spir
On Wed, 03 Feb 2010 14:12:42 +0800 David ld...@gmx.net wrote: Hello Benno, list, thanks for those clarifications, which, well, clarify things ;-) This is my latest creation: import random def createTerms(): terms = [] for i in range(2):

Re: [Tutor] help with random.randint

2010-02-03 Thread Eike Welk
Hello David! On Wednesday February 3 2010 04:21:56 David wrote: import random terms = [] for i in range(2): terms = random.randint(1, 99) print terms Here is an other solution, which is quite easy to understand and short: import random terms = [] for i in range(2): terms +=

Re: [Tutor] help with random.randint

2010-02-03 Thread David
Hello Eike, thanks for the explanation, all this is really helpful -- I certainly have learned sth. today! I wonder, though, how I would get my number pairs, which I need later on, if I were to follow your solution. I am asking because as I understand your code, the list terms is a list of

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-03 Thread Wayne Werner
On Wed, Feb 3, 2010 at 12:12 AM, David ld...@gmx.net wrote: def createQuestions: generate all multiplication combinations possible append as tuple to pool eliminate 'mirrored doubles' (i.e. 7x12 and 12x7) randomize pool I haven't really looked through most of this stuff - but

Re: [Tutor] help with random.randint

2010-02-03 Thread Wayne Werner
On Wed, Feb 3, 2010 at 5:26 AM, David ld...@gmx.net wrote: Hello Eike, thanks for the explanation, all this is really helpful -- I certainly have learned sth. today! I wonder, though, how I would get my number pairs, which I need later on, if I were to follow your solution. I am asking

Re: [Tutor] help with strings

2010-02-03 Thread vince spicer
On Wed, Feb 3, 2010 at 7:19 AM, NISA BALAKRISHNAN snisa.balakrish...@gmail.com wrote: hi I am very new to python. I have a string for example : 123B new Project i want to separate 123B as a single string and new project as another string . how can i do that. i tried using partition

Re: [Tutor] help with strings

2010-02-03 Thread Darren Worrall
On 03/02/10 13:19, NISA BALAKRISHNAN wrote: hi I am very new to python. I have a string for example : 123B new Project i want to separate 123B as a single string and new project as another string . how can i do that. i tried using partition but couldnt do it pls help. thanks in advance!

Re: [Tutor] help with strings

2010-02-03 Thread Kent Johnson
On Wed, Feb 3, 2010 at 8:19 AM, NISA BALAKRISHNAN snisa.balakrish...@gmail.com wrote: hi I am very new to python. I have a string for example : 123B     new Project i want to separate 123B as a single string and new  project as another string . how can i do that. i tried using partition

Re: [Tutor] help with random.randint

2010-02-03 Thread Eike Welk
On Wednesday February 3 2010 12:26:43 David wrote: thanks for the explanation, all this is really helpful -- I certainly have learned sth. today! I wonder, though, how I would get my number pairs, which I need later on, if I were to follow your solution. I am asking because as I understand

Re: [Tutor] help with random.randint

2010-02-02 Thread Benno Lang
On Wed, Feb 3, 2010 at 12:21 PM, David ld...@gmx.net wrote: Hello list, I thought this was easy even for me, but I was wrong, I guess. Here is what I want to do: take two random numbers between 1 and 99, and put them into a list. import random terms =  [] for i in range(2):        terms

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-02 Thread David
Hello Benno, list, thanks for those clarifications, which, well, clarify things ;-) This is my latest creation: import random def createTerms(): terms = [] for i in range(2): terms.append(random.randint(1, 99)) j = terms[0] k = terms[1] print %3d\nx%2d % (j, k)

Re: [Tutor] help with random.randint

2010-02-02 Thread bob gailer
David wrote: Hello list, I thought this was easy even for me, but I was wrong, I guess. Here is what I want to do: take two random numbers between 1 and 99, and put them into a list. [snip] Or you can use list comprehension: terms = [random.randint(1, 99) for i in range(2)] or if you seek

Re: [Tutor] help with random.randint

2010-02-02 Thread David
Hello Bob, thanks for your comments! On 03/02/10 14:51, bob gailer wrote: or if you seek terseness: terms = [random.randint(1, 99) for i in 'ab'] Do I understand correctly that 'ab' here merely serves to produce a 'dummy sequence' over which I can run the for loop? David

Re: [Tutor] help with random.randint (cont. -- now: pseudo code)

2010-02-02 Thread bob gailer
David wrote: [snip] My suggestion (untested): MAX = 12 NQ = 20 # of questions to ask # create a 2 dimensional array of 1's row = [1]*MAX pool = [row[:] for i in range(MAX)] incorrect = [] # store incorrectly answered combos here def askQuestions(): # generate and ask questions: for i in

Re: [Tutor] Help with a Dictionary

2010-01-11 Thread Garry Bettle
Many thanks to Alan Gauld, Gerard Flanagan, Lie Ryan and spir for your replies. All systems are go! Cheers, Garry ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with a Dictionary

2010-01-08 Thread spir
Garry Bettle dixit: [...series of data with same format...] 2010-01-07 1437 Crayfd H3 380m ... etc. The above are RaceDate + RaceTime + Fixture + RaceDetails, and are output in RaceTime order. What I'd like to do, is output a transposed-like summary of just the Fixture + RaceTime.

Re: [Tutor] Help with a Dictionary

2010-01-08 Thread spir
Garry Bettle dixit: for fixture in FixtureList: print fixture.ljust(6), FixtureList[fixture] ... for fixture, racetimes in FixtureList: print fixture, racetimes Traceback (most recent call last): File pyshell#3, line 1, in module for fixture, racetimes in FixtureList:

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Benno Lang
On Thu, Jan 7, 2010 at 10:51 PM, Garry Bettle garry.bet...@gmail.com wrote: I have a list that I output in the following order: 2010-01-07 1103 Sund A7 450m 2010-01-07 Sheff A7 500m 2010-01-07 1119 Sund A6 450m 2010-01-07 1128 Sheff A6 500m 2010-01-07 1134 Sund A5 450m 2010-01-07 1142

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Garry Bettle
On Thu, Jan 7, 2010 at 15:26, Garry Bettle wrote: Howdy all, I hope this message finds you all well. I have a list that I output in the following order: 2010-01-07 1103 Sund A7 450m 2010-01-07 Sheff A7 500m 2010-01-07 1119 Sund A6 450m 2010-01-07 1128 Sheff A6 500m 2010-01-07

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Alan Gauld
Garry Bettle garry.bet...@gmail.com wrote What I'd like to do, is output a transposed-like summary of just the Fixture + RaceTime. Sund 1103 1119 1134 1148 1204 1218 1232 1247 1304 1319 1333 1351 Sheff 1128 1142 1157 1212 1227 1242 1258 1312 1327 1344 1403 As the races are output, I

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Gerard Flanagan
Garry Bettle wrote: Howdy all, I hope this message finds you all well. I have a list that I output in the following order: 2010-01-07 1103 Sund A7 450m 2010-01-07 Sheff A7 500m 2010-01-07 1119 Sund A6 450m 2010-01-07 1128 Sheff A6 500m 2010-01-07 1134 Sund A5 450m 2010-01-07 1142 Sheff

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Lie Ryan
On 1/8/2010 3:12 AM, Garry Bettle wrote: This is what I've come up with. Sorry, python is something I touch on occasionally: must do more! As the races are output, I build a dictionary of key=FixtureName and value=RaceTimes: RaceTime = marketResp.market.displayTime.time() cRaceTime =

Re: [Tutor] Help on finding the 1000th prime

2009-11-16 Thread christopher . henk
mrhol...@sbcglobal.net wrote on 11/16/2009 10:56:07 AM: I have posted this on other lists, but have just discovered this one. Welcome to the list. I am sure you will find plenty of folks here who will be happy to help you. Can someone give me help on writing the code necessary to

Re: [Tutor] Help on finding the 1000th prime

2009-11-16 Thread Kent Johnson
On Mon, Nov 16, 2009 at 10:56 AM, Ray Holt mrhol...@sbcglobal.net wrote: I have posted this on other lists, but have just discovered this one. Can someone give me help on writing the code necessary to find the 1000th. prime number. I know I will have to use a while loop, but I can't seem to get

Re: [Tutor] Help on finding the 1000th prime

2009-11-16 Thread bob gailer
Ray Holt wrote: find the 1000th. prime number. Break this down into 2 separate problems. (I assume 1 is the first prime number) 1 - determining the next prime number 2 - repeating that 1000 times. A while loop is a way to accomplish 2. How do you determine the next prime number? There are

Re: [Tutor] Help with my program

2009-10-23 Thread Kent Johnson
On Thu, Oct 22, 2009 at 11:59 PM, Kenny Shen little...@gmail.com wrote: Hi tanner, I suppose the following is possible: class A:   def __init__(self):   self.height = 1   self.weight = 7   self.name = tanner   self.grade = A   def getinfo(self):   info = []  

Re: [Tutor] Help with my program

2009-10-22 Thread Kenny Shen
Hi tanner, I suppose the following is possible: class A: def __init__(self): self.height = 1 self.weight = 7 self.name = tanner self.grade = A def getinfo(self): info = [] info.append(self.name) info.append(self.weight) info.append(self.height)

Re: [Tutor] Help with pexpect

2009-10-16 Thread vince spicer
On Fri, Oct 16, 2009 at 1:45 PM, Nathan Farrar nathan.far...@gmail.comwrote: I'm trying to automate the collection of data to remote devices over ssh via pexpect. I had originally attempted (with limited success) to use paramiko, however due to cisco's ssh implimentation I cannot send

Re: [Tutor] Help with pexpect

2009-10-16 Thread Mark K. Zanfardino
Nathan, Depending upon how much control you have over the calling machine you can eliminate the pesky password prompt from ssh altogether by creating a private/public key pair for the client machine and copy the public key to the host machine. This way when you ssh to the host you will be

Re: [Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-14 Thread greg whittier
On Thu, Oct 8, 2009 at 4:29 AM, David Jamieson david.jamie...@gmail.comwrote: Hi All, looking for some advice on using Python with MySQL for test data storage. While not a relational database, you might also look at http://www.pytables.org. It provides a python interface for writing to and

Re: [Tutor] Help on python file extension windows vista recognition

2009-10-13 Thread Tim Golden
Dave Angel wrote: You will also need to get comfortable with the DOS box (Command Prompt, whatever Vista calls it. It's probably in Start-Accessories). In a DOS box, you could do a DIR of that directory, and see exactly what the file is called. You also could invoke python or pythonw

Re: [Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Dave Angel
Victor Binns wrote: Please, I need help. I installed python on my gateway windows vista laptop computer. This is with the latest version of python (Python 2.6.3 Windows installer) Python 2.6.3 Windows installer It's not the latest, but no problem. It's probably a good choice. I have

Re: [Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-08 Thread David
David Jamieson wrote: Hi All, looking for some advice on using Python with MySQL for test data storage. What builds of Python work well with MySQL and what modules allow the connection to the database and data transfer activities. SQLAlchemy is one option;

Re: [Tutor] Help or Advice on MySQL, Python and test data storage

2009-10-08 Thread Serdar Tumgoren
looking for some advice on using Python with MySQL for test data storage. What builds of Python work well with MySQL and what modules allow the connection to the database and data transfer activities. You'll need the MySQLdb module to connect to MySQL from Python.

Re: [Tutor] help with alternate execution

2009-10-02 Thread Patrick Sabin
wrobl...@cmich.edu wrote: Thank you for the reply.. I tried putting the print repr(n) before I defined 'n' with raw_input. My script looks like this-- def divisible(n): if n%3 == 0: print n, is divisible by 3 else: print n, is not divisible by 3 n= raw_input(enter a

<    5   6   7   8   9   10   11   12   13   14   >