Re: [Tutor] Hello again. Still the same problem, different question.

2011-11-11 Thread Andreas Perstinger
On 2011-11-12 05:16, Nathaniel Trujillo wrote: They gave me a website to go and download a version of livewires that would work (www.courseptr.com/downloads) and I went there but I could not find that download anywhere. http://www.delmarlearning.com/companions/content/1435455002/downloads/index

Re: [Tutor] Hello again. Still the same problem, different question.

2011-11-11 Thread Steven D'Aprano
Nathaniel Trujillo wrote: I realize that one of you told me that there is no livewires for python v3.1.1 but the book that I am reading teaches v3.1.1 and the code that is presented in the book has a line that imports a module from the livewires package. Now since the book covers v3.1.1, I would

Re: [Tutor] Hello again. Still the same problem, different question.

2011-11-11 Thread delegbede
Can you kindly mail the author? That might be a better way to have this resolved. Its interesting you are sticking with python v3. Cheers. Sent from my BlackBerry wireless device from MTN -Original Message- From: Nathaniel Trujillo Sender: tutor-bounces+delegbede=dudupay@python.org

[Tutor] Hello again. Still the same problem, different question.

2011-11-11 Thread Nathaniel Trujillo
I realize that one of you told me that there is no livewires for python v3.1.1 but the book that I am reading teaches v3.1.1 and the code that is presented in the book has a line that imports a module from the livewires package. Now since the book covers v3.1.1, I would have to conclude that the co

Re: [Tutor] My program gives no output (was (no subject)

2011-11-11 Thread bob gailer
Welcome to the Tutor list. Please provide a meaningful subbject as we track posts by subject On 11/11/2011 4:40 PM, Nic Jaworski wrote: python: v. 2.7.1 Compiler: WING IDE OS: Windows 7 I am attempting to use a loop to output a 2D array for days and amount of pennies. I have it set to loop t

Re: [Tutor] Suggest Book

2011-11-11 Thread Alan Gauld
On 11/11/11 14:29, Pankaj Jakhar wrote: Please suggest me the best book for Python from which I can learn basics to advanced Python. The "best" book will depend on you, some like informal chatty style with lots of examples other prefer a more formal approach. For me the O'Reilly books get it

Re: [Tutor] (no subject)

2011-11-11 Thread Andreas Perstinger
Please just post plain-text (no html) and use a meaningful subject! On 2011-11-11 22:40, Nic Jaworski wrote: def calc(days): n=0 d=1 while n>days: n+1 d**(n) d*2 You are just calculating some expressions with "n" and "d" but you don't assign the results. Thus "n" and "d" wil

Re: [Tutor] (no subject)

2011-11-11 Thread Joel Goldstick
On Fri, Nov 11, 2011 at 4:40 PM, Nic Jaworski wrote: > python: v. 2.7.1 > Compiler: WING IDE > OS: Windows 7 > > I am attempting to use a loop to output a 2D array for days and amount of > pennies. I have it set to loop to do a penny times the day then to double > the the penny and add a day. (t

Re: [Tutor] longest common substring

2011-11-11 Thread Andreas Perstinger
First, just a little rant :-) It doesn't help to randomly change some lines or introduce some new concepts you don't understand yet and then hope to get the right result. Your chances are very small that this will be succesful. You should try to understand some basic concepts first and build on

[Tutor] (no subject)

2011-11-11 Thread Nic Jaworski
python: v. 2.7.1Compiler: WING IDEOS: Windows 7 I am attempting to use a loop to output a 2D array for days and amount of pennies. I have it set to loop to do a penny times the day then to double the the penny and add a day. (the whole a penny doubles each day problem). However when I run my p

Re: [Tutor] Suggest Book

2011-11-11 Thread Evans Anyokwu
You really don't need a book. There are tons of free materials online including Alan's excellent tutorial. Spend some time working your way through some of these free tutorials, and once you're comfortable enough writing Python programs then buy one or two books as a reference material. Good luck

Re: [Tutor] Find all strings that....

2011-11-11 Thread Albert-Jan Roskam
hi, this page contains interesting info about this topic. The algorithms that are discussed are all implemented in Python. http://cs.anu.edu.au/~Peter.Christen/Febrl/febrl-0.3/febrldoc-0.3/node38.html   Cheers!! Albert-Jan ~~

Re: [Tutor] Find all strings that....

2011-11-11 Thread Alexander
On Fri, Nov 11, 2011 at 1:38 PM, Jerry Hill wrote: > On Fri, Nov 11, 2011 at 1:21 PM, Francesco Loffredo wrote: > >> Anyway, taking for granted the rules contained in the edit distance >> definition (Thank you, Steven!), I think that finding in a given set S all >> words that can be converted in

Re: [Tutor] Find all strings that....

2011-11-11 Thread Jerry Hill
On Fri, Nov 11, 2011 at 1:21 PM, Francesco Loffredo wrote: > Anyway, taking for granted the rules contained in the edit distance > definition (Thank you, Steven!), I think that finding in a given set S all > words that can be converted into some given "target" with at most N such > operations (be

Re: [Tutor] Find all strings that....

2011-11-11 Thread Francesco Loffredo
Alexander Etter wrote: On Nov 10, 2011, at 13:52, Francesco Loffredo wrote: Alexander Etter wrote: Hi. My friend gave me a good wake up exercise ... I'd like to try this exercise too; would you mind defining "operations" more specifically, please? Given a sufficiently broad meaning of "oper

Re: [Tutor] failed to load functions,

2011-11-11 Thread lina
I attached the clumsy one as below: https://docs.google.com/open?id=0B93SVRfpVVg3YTNhNTMwODUtMDkyYi00ZTk4LThiOGYtMzdkNzI1ZmNhOWQ0 #!/usr/bin/python3 import os.path from collections import Counter aList=['55', '34', '77', '43', '58', '34', '77', '34', '76', '34', '77', '76', '32', '72', '34', '

[Tutor] failed to load functions,

2011-11-11 Thread lina
Hi, sorry for the new post: if __name__=="__main__": for i in range(97,100): for j in range(97,100): if i != j: s1=chr(i)+"List" s2=chr(j)+"List" '''print(s1,s2)''' LongestCommonSubstring(s1,s2) I am surpris

Re: [Tutor] longest common substring

2011-11-11 Thread lina
I wrote a crazy one, to find the common group: Please jump to the end part of this code: https://docs.google.com/open?id=0B93SVRfpVVg3MDUzYzI1MDYtNmI5MS00MmZkLTlmMTctNmE3Y2EyYzIyZTk2 Thanks again, ___ Tutor maillist - Tutor@python.org To unsubscrib

Re: [Tutor] how can I save it from "for"

2011-11-11 Thread bodsda
Look into the 'continue' and 'break' statements - both very handy when working with loops Or just increment/decrement the conditional until it evaluates to False Bodsda Sent from my BlackBerry® wireless device -Original Message- From: lina Sender: tutor-bounces+bodsda=googlemail@p

[Tutor] how can I save it from "for"

2011-11-11 Thread lina
Hi, I don't know how to escape the if longest >= 3: subgroup=S1[x_longest-longest:x_longest] print(subgroup) form the loop. xrange = range subgroup=[] def LongestCommonSubstring(S1, S2): M = [[0]*(1+len(S2)) for i in xrange(1+len(S1))] longest, x_longest

Re: [Tutor] Suggest Book

2011-11-11 Thread Alexander Etter
On Nov 11, 2011, at 9:29, Pankaj Jakhar wrote: > Hello > > Please suggest me the best book for Python from which I can learn basics to > advanced Python. > > Thank you. > > PankaJ Jakhar > I'm sure Alan or one of our veteran list members will have something to say, but at my sch

Re: [Tutor] longest common substring

2011-11-11 Thread Jerry Hill
There's nothing wrong with writing your own code to find the longest common substring, but are you aware that python has a module in the standard library that already does this? In the difflib module, the SequenceMatcher class can compare two sequences and extract the longest common sequence of el

Re: [Tutor] longest common substring

2011-11-11 Thread lina
On Fri, Nov 11, 2011 at 9:10 PM, Andreas Perstinger wrote: > On 2011-11-11 05:14, lina wrote: >> >> def LongestCommonSubstring(S1, S2): >>     M = [[0]*(1+len(S2)) for i in xrange(1+len(S1))] ## creat 4*5 matrix >>     longest, x_longest = 0, 0 >>     for x in xrange(1,1+len(S1)):                

Re: [Tutor] Suggest Book

2011-11-11 Thread Troy S
I would recommend: Beginning Python: From Novice to Professional. See attached URL below. Website is also a good resource. http://trizpug.org/up-to-speed On Fri, Nov 11, 2011 at 9:29 AM, Pankaj Jakhar wrote: > Hello > > Please suggest me the best book for Python from which I can learn basics to

[Tutor] Suggest Book

2011-11-11 Thread Pankaj Jakhar
Hello Please suggest me the best book for Python from which I can learn basics to advanced Python. Thank you. * PankaJ **Jakhar** * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

Re: [Tutor] longest common substring

2011-11-11 Thread lina
Based on former advice, I made a correction/modification on the below code. 1] the set and subgroup does not work, here I wish to put all the subgroup in a big set, the set like $ python3 LongestCommonSubstring.py | uniq {"1',"} {"1', "} {"1', '"} {"1', '8"} {"1', '82"} {"1', '82'"} {"1', '82',"

Re: [Tutor] positional output

2011-11-11 Thread Walter Prins
Hi Frankie, On 11 November 2011 12:59, Cranky Frankie wrote: > I'm trying to build a script to parse IBM AIX DB2 DDL to line up the > data types (it drives me crazy when the column data types are not > lined up). For example, typical create table DDL might be hundreds of > lines long but will lo

Re: [Tutor] positional output

2011-11-11 Thread Hugo Arts
On Fri, Nov 11, 2011 at 1:59 PM, Cranky Frankie wrote: > Thank you for your help on this. Now for "the rest of the story." > > I'm trying to build a script to parse IBM AIX DB2 DDL to line up the > data types (it drives me crazy when the column data types are not > lined up). For example, typical

Re: [Tutor] positional output

2011-11-11 Thread Christian Witts
On 2011/11/11 02:59 PM, Cranky Frankie wrote: Thank you for your help on this. Now for "the rest of the story." I'm trying to build a script to parse IBM AIX DB2 DDL to line up the data types (it drives me crazy when the column data types are not lined up). For example, typical create table DDL

Re: [Tutor] longest common substring

2011-11-11 Thread lina
On Fri, Nov 11, 2011 at 9:10 PM, Andreas Perstinger wrote: > On 2011-11-11 05:14, lina wrote: >> >> def LongestCommonSubstring(S1, S2): >>     M = [[0]*(1+len(S2)) for i in xrange(1+len(S1))] ## creat 4*5 matrix >>     longest, x_longest = 0, 0 >>     for x in xrange(1,1+len(S1)):                

Re: [Tutor] longest common substring

2011-11-11 Thread Andreas Perstinger
On 2011-11-11 05:14, lina wrote: def LongestCommonSubstring(S1, S2): M = [[0]*(1+len(S2)) for i in xrange(1+len(S1))] ## creat 4*5 matrix longest, x_longest = 0, 0 for x in xrange(1,1+len(S1)): ## read each row for y in xrange(1,1+len(S2)): ## r

[Tutor] positional output

2011-11-11 Thread Cranky Frankie
Thank you for your help on this. Now for "the rest of the story." I'm trying to build a script to parse IBM AIX DB2 DDL to line up the data types (it drives me crazy when the column data types are not lined up). For example, typical create table DDL might be hundreds of lines long but will look li

Re: [Tutor] Okay, this time I tried doing a little research but no luck in solving this one.

2011-11-11 Thread Christian Witts
On 2011/11/11 04:00 AM, Nathaniel Trujillo wrote: Okay, I typed in python -c "import sys; print sys.version" at the command prompt. I didn't see a prompt ending with %. Instead I saw a prompt ending with >. But here is the message I got. Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 M

Re: [Tutor] Okay, this time I tried doing a little research but no luck in solving this one.

2011-11-11 Thread Michael M Mason
On 11 November 2011 at 02:00 Nathaniel Trujillo wrote:- > Okay, I typed in python -c "import sys; print sys.version" at the command > prompt. I didn't see a prompt ending with %. Instead I saw a prompt ending > with >. But here is the message I got. > > Microsoft Windows [Version 6.1.7600] > Copyr

Re: [Tutor] The python implementation of the "class relationship".

2011-11-11 Thread Alan Gauld
On 11/11/11 02:39, Jerry Zhang wrote: Composition implementation: you may need to do 5 job with C++, but only 2 job with python, the other 3 job is done by python implicitly. association implementation: You need 3 job with C++, but 1 with python. it seems python's object's lifecycle handling has