Re: [Tutor] help with itertools.izip_longest

2013-03-16 Thread Abhishek Pratap
On Sat, Mar 16, 2013 at 2:32 PM, Oscar Benjamin wrote: > On 16 March 2013 21:14, Abhishek Pratap wrote: >> Hey Guys >> >> I am trying to use itertools.izip_longest to read a large file in >> chunks based on the examples I was able to find on the web. However I >> am not able to understand the beh

Re: [Tutor] help with itertools.izip_longest

2013-03-16 Thread Oscar Benjamin
On 16 March 2013 21:14, Abhishek Pratap wrote: > Hey Guys > > I am trying to use itertools.izip_longest to read a large file in > chunks based on the examples I was able to find on the web. However I > am not able to understand the behaviour of the following python code. > (contrived form of examp

[Tutor] help with itertools.izip_longest

2013-03-16 Thread Abhishek Pratap
Hey Guys I am trying to use itertools.izip_longest to read a large file in chunks based on the examples I was able to find on the web. However I am not able to understand the behaviour of the following python code. (contrived form of example) for x in itertools.izip_longest(*[iter([1,2,3])]*2)

Re: [Tutor] Help

2013-03-13 Thread Steven D'Aprano
On 14/03/13 02:12, Joshua Wilkerson wrote: Can you help me with something? This code (it also draws from the text_game file) says it has a syntax error, but I can't seem to find what it is, I think the code is having a fit but I'm not sure. I'm appreciative to all hep. The most valuable help

Re: [Tutor] Help

2013-03-13 Thread Oscar Benjamin
On 13 March 2013 15:12, Joshua Wilkerson wrote: > Can you help me with something? This code (it also draws from the text_game > file) says it has a syntax error, but I can't seem to find what it is, I > think the code is having a fit but I'm not sure. I'm appreciative to all > hep. Could you perh

Re: [Tutor] Help

2013-03-13 Thread Alan Gauld
On 13/03/13 15:12, Joshua Wilkerson wrote: Can you help me with something? This code (it also draws from the text_game file) says it has a syntax error, Don't make us guess, post the error message. It will tell us where. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.u

[Tutor] Help

2013-03-13 Thread Joshua Wilkerson
Can you help me with something? This code (it also draws from the text_game file) says it has a syntax error, but I can't seem to find what it is, I think the code is having a fit but I'm not sure. I'm appreciative to all hep.# Josh Wilkerson's Project 1 Part 3 # 2/25/2013 # Basic layout of text-

Re: [Tutor] help with storing money variable

2013-02-19 Thread Alan Gauld
On 19/02/13 12:36, Ghadir Ghasemi wrote: def printMenu(): print ("|__|") print ("| 2. Insert 10p |") print ("| 3. Insert 20p |") print ("| 4. Insert 50p |") print ("|__|") while True:

Re: [Tutor] help with storing money variable

2013-02-19 Thread Dave Angel
On 02/19/2013 07:36 AM, Ghadir Ghasemi wrote: Hi guys, Iam halfway through my vending machine program that I started earlier. I ran into a problem. When the user inserts some money, The money variable is not stored for until the user buys an item. So what happens is when the users inserts some

[Tutor] help with storing money variable

2013-02-19 Thread Ghadir Ghasemi
Hi guys, Iam halfway through my vending machine program that I started earlier. I ran into a problem. When the user inserts some money, The money variable is not stored for until the user buys an item. So what happens is when the users inserts some coins and then trys to buy an item the money th

Re: [Tutor] help with inch to cms conversion .

2013-02-11 Thread Danny Yoo
On Mon, Feb 11, 2013 at 9:06 AM, Pravya Reddy wrote: > Can you please help me with the code. > > #!/usr/bin/env python > """ > inchtocm.py > > """ > > def Inchtocm(inches): > """Returns 2.54 * inches""" > return (2.54 * float(inches_number1)) I don't know if your curriculum talks about w

Re: [Tutor] help with inch to cms conversion .

2013-02-11 Thread Dave Angel
On 02/11/2013 11:06 AM, Pravya Reddy wrote: Can you please help me with the code. #!/usr/bin/env python """ inchtocm.py """ First, remove that try/except until the code is free of obvious bugs. It's masking where the error actually occurs. Alternatively, include a variable there, and print

[Tutor] help with inch to cms conversion .

2013-02-11 Thread Pravya Reddy
Can you please help me with the code. #!/usr/bin/env python """ inchtocm.py """ def Inchtocm(inches): """Returns 2.54 * inches""" return (2.54 * float(inches_number1)) inches = None while True: try: inches_number1 = input(input("How many inches you want to convert: "))

Re: [Tutor] help with running perl script that writes to a text file

2013-02-06 Thread eryksun
On Wed, Feb 6, 2013 at 12:47 PM, Alan Gauld wrote: > so "the DOS prompt" is both traditional and sufficiently specific making it > the most easily understandable of the likely terms. "DOS prompt" is a common idiom, but it bears mentioning now and then that the OS is NT [1], not DOS. That's all; I

Re: [Tutor] help with running perl script that writes to a text file

2013-02-06 Thread Alan Gauld
On 06/02/13 10:58, eryksun wrote: and pedantic comment about the habit of saying "DOS prompt". The cmd shell is a Win32 console application, unlike DOS command.com. Yes, but the problem is that Windows now has so many command prompts (cscript, cmd, power shell etc) that "the Windows prompt"

Re: [Tutor] help with running perl script that writes to a text file

2013-02-06 Thread eryksun
On Tue, Feb 5, 2013 at 6:44 PM, 3n2 Solutions <3n2soluti...@gmail.com> wrote: > > I want to automate the following manual process from DOS promp: I agree with Peter's answer. I'd just like to add a generally useless and pedantic comment about the habit of saying "DOS prompt". The cmd shell is a Wi

Re: [Tutor] help with running perl script that writes to a text file

2013-02-06 Thread Peter Otten
3n2 Solutions wrote: > Hello, > > I want to automate the following manual process from DOS promp: > > c:/scripts/perl>perl fix.pl base.gtx >base.txt > > Here is my python script: > > path="c:/scripts/perl/" > subprocess.call(['perl','fix.pl','base.gtx >base.txt',path]) > > I also tried this a

Re: [Tutor] help with running perl script that writes to a text file

2013-02-05 Thread Alan Gauld
On 05/02/13 23:44, 3n2 Solutions wrote: I want to automate the following manual process from DOS promp: c:/scripts/perl>perl fix.pl base.gtx >base.txt Use a DOS batch file, that's what they are there for. If you are not doing any other processing Python is inefficient and overkill for this

[Tutor] help with running perl script that writes to a text file

2013-02-05 Thread 3n2 Solutions
Hello, I want to automate the following manual process from DOS promp: c:/scripts/perl>perl fix.pl base.gtx >base.txt Here is my python script: path="c:/scripts/perl/" subprocess.call(['perl','fix.pl','base.gtx >base.txt',path]) I also tried this alternative: subprocess.Popen(['perl','fix.pl'

Re: [Tutor] Help- Regarding python

2013-02-05 Thread Oscar Benjamin
On 5 February 2013 05:08, eryksun wrote: > On Mon, Feb 4, 2013 at 7:21 PM, Oscar Benjamin > wrote: >> eigenvalues, eigenvectors = np.linalg.eig(C) > > First sort by eigenvalue magnitude: > > >>> idx = np.argsort(eigenvalues)[::-1] > >>> print idx > [ 0 1 2 3 8 10 11 12 14 22 20 21

Re: [Tutor] Help- Regarding python

2013-02-04 Thread eryksun
On Mon, Feb 4, 2013 at 7:21 PM, Oscar Benjamin wrote: > eigenvalues, eigenvectors = np.linalg.eig(C) First sort by eigenvalue magnitude: >>> idx = np.argsort(eigenvalues)[::-1] >>> print idx [ 0 1 2 3 8 10 11 12 14 22 20 21 18 19 23 24 17 16 15 13 9 7 5 6 4] >>> eigenva

Re: [Tutor] Help- Regarding python

2013-02-04 Thread Oscar Benjamin
On 4 February 2013 06:24, Gayathri S wrote: > Hi All! > If i have data set like this means... > > 3626,5000,2918,5000,2353,2334,2642,1730,1687,1695,1717,1744,593,502,493,504,449,431,444,444,429,10 > 438,498,3626,3629,5000,2918,5000,2640,2334,2639,1696,1687,1695,1717,1744,592,502,49

Re: [Tutor] Help- Regarding python

2013-02-04 Thread Danny Yoo
> How to do PCA on this data? if it is in array how to do that? and also how > to use princomp() in PCA? Principal component analysis, http://en.wikipedia.org/wiki/Principal_component_analysis may not be "built in". Do you know for sure that it is? According to this blog entry, you can do

Re: [Tutor] Help- Regarding python

2013-02-04 Thread Steven D'Aprano
On 04/02/13 17:24, Gayathri S wrote: Hi All! If i have data set like this means... 3626,5000,2918,5000,2353,2334,2642,[...],496. No need to dump your entire data set on us. Just a few representative values will do. How to do PCA on this data? if it is in array how to do tha

Re: [Tutor] Help- Regarding python

2013-02-04 Thread Alan Gauld
On 04/02/13 06:24, Gayathri S wrote: Hi All! If i have data set like this means... 3626,5000,2918,5000,2353,2334,2642,1730,1687,1695,1717,1744,593,502,493,504,449,431,444,444,429,10 ... 458,5022,3640,3644,5000,2922,5000,2346,2321,2628,1688,1666,1674,1696,744,590,496. How to d

[Tutor] Help- Regarding python

2013-02-03 Thread Gayathri S
Hi All! If i have data set like this means... 3626,5000,2918,5000,2353,2334,2642,1730,1687,1695,1717,1744,593,502,493,504,449,431,444,444,429,10 438,498,3626,3629,5000,2918,5000,2640,2334,2639,1696,1687,1695,1717,1744,592,502,493,504,449,431,444,441,429,10 439,498,3626,3629,5000,29

Re: [Tutor] Help

2013-02-02 Thread Alan Gauld
On 02/02/13 01:47, Jack Little wrote: def simpstart(): global ammo1 global ammo2 global ammo3 global health global tech_parts global exp global radio_parts ammo1=10 ammo2=0 ammo3=0 health=100 tech_parts=0 exp=0 radio_parts=0 This function is completely

Re: [Tutor] Help

2013-02-01 Thread Dave Angel
On 02/01/2013 08:47 PM, Jack Little wrote: I get this error Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", line 56, in path1pt1() NameError: name 'path1pt1' is not defined With this amount of code: def simpstart(): global ammo1 global ammo2 glob

Re: [Tutor] Help

2013-02-01 Thread Brandon
You get the error because you call path1pt1() before it is defined. Define your path1pt1() method at the top of your code before simpstart(). Brandon On Fri, Feb 1, 2013 at 5:47 PM, Jack Little wrote: > I get this error > > Traceback (most recent call last): > File "C:\Users\Jack\Desktop\pyt

[Tutor] Help

2013-02-01 Thread Jack Little
I get this error Traceback (most recent call last):   File "C:\Users\Jack\Desktop\python\g.py", line 56, in     path1pt1() NameError: name 'path1pt1' is not defined With this amount of code: def simpstart():   global ammo1   global ammo2   global ammo3   global health   global tech_parts   glo

Re: [Tutor] HELP-Regarding python

2013-01-30 Thread bob gailer
On 1/30/2013 1:51 AM, Gayathri S wrote: I am sorry that you chose to ignore my request to start a new email with a relevant subject. Please next time do so. The easier you make it for us to help you the more likely we will want to help. -- Bob Gailer 919-636-4239 Chapel Hill NC __

Re: [Tutor] HELP-Regarding python

2013-01-29 Thread spawgi
missed a parenthesis, it should look like - with open(, ) as : //operation with the file. On Wed, Jan 30, 2013 at 12:31 PM, wrote: > A safer approach would be - > with open(, as : > //operation with the file. > > This way, you do not have to remember to close the file explicitly. > > > On Wed,

Re: [Tutor] HELP-Regarding python

2013-01-29 Thread spawgi
A safer approach would be - with open(, as : //operation with the file. This way, you do not have to remember to close the file explicitly. On Wed, Jan 30, 2013 at 12:27 PM, Dave Angel wrote: > On 01/30/2013 01:51 AM, Gayathri S wrote: > >> Hi All! >> I don't know how to

Re: [Tutor] HELP-Regarding python

2013-01-29 Thread Dave Angel
On 01/30/2013 01:51 AM, Gayathri S wrote: Hi All! I don't know how to read text file in python. If the data values are stored in a text file format, for example(1,30,60,90,120...200) means what i would do for reading it in python. could you just explain it. infile = open

[Tutor] HELP-Regarding python

2013-01-29 Thread Gayathri S
Hi All! I don't know how to read text file in python. If the data values are stored in a text file format, for example(1,30,60,90,120...200) means what i would do for reading it in python. could you just explain it. Thanks! Keep Smiling.[?] Regards...

Re: [Tutor] HELP- Regarding working with python

2013-01-29 Thread Gayathri S
Hi all...! I don't know how to import our own data sets in python. its always importing the in built data sets. could you just tell me how to do that...! Thanks...! On Mon, Jan 28, 2013 at 1:50 PM, Steven D'Aprano wrote: > On 28/01/13 18:26, Gayathri S wrote: > >> Hi all..! >>

Re: [Tutor] Help!

2013-01-29 Thread Kwpolska
On Mon, Jan 28, 2013 at 10:22 PM, Ghadir Ghasemi wrote: > Hi guys I wanted to make a program called Binary/decimal converter. That’s easy, int('11', 2) and bin(3) should be enough. > But I want to do it the hard way e.g. not using built in python functions. > Can you give me an idea about how I

Re: [Tutor] Help!

2013-01-28 Thread Joel Goldstick
On Mon, Jan 28, 2013 at 4:51 PM, Danny Yoo wrote: > > Hi guys I wanted to make a program called Binary/decimal converter. But > I want to do it the hard way e.g. not using built in python functions. Can > you give me an idea about how I can do that? > > > See if you can write the steps to do this

Re: [Tutor] Help!

2013-01-28 Thread Danny Yoo
> Hi guys I wanted to make a program called Binary/decimal converter. But I > want to do it the hard way e.g. not using built in python functions. Can you > give me an idea about how I can do that? Do you have an idea of what kind of things would be useful test cases for this converter? Thinki

Re: [Tutor] Help!

2013-01-28 Thread Mark K. Zanfardino
Ghadir, I did a quick google search for how to convert digital to binary. The first link was to http://www.ehow.com/how_5164721_convert-digital-binary.html which gives a pretty clear example of the process for converting digital to binary. Of course, you will need to translate this psuedo-co

[Tutor] Help!

2013-01-28 Thread Ghadir Ghasemi
Hi guys I wanted to make a program called Binary/decimal converter. But I want to do it the hard way e.g. not using built in python functions. Can you give me an idea about how I can do that? Thank you. ___ Tutor maillist - Tutor@python.org To unsubsc

Re: [Tutor] HELP- Regarding working with python

2013-01-28 Thread Steven D'Aprano
On 28/01/13 18:26, Gayathri S wrote: Hi all..! wanna know how to compile python script in python command line, and is there any need for setting path for python like JAVA? whats the difference between .py file and .pyc file? Python is a byte-code compiled language, like Java many y

Re: [Tutor] HELP- Regarding working with python

2013-01-27 Thread Gayathri S
Hi all..! wanna know how to compile python script in python command line, and is there any need for setting path for python like JAVA? whats the difference between .py file and .pyc file? Thanks...! On Sat, Jan 19, 2013 at 8:54 AM, bob gailer wro

Re: [Tutor] Help!

2013-01-26 Thread Russel Winder
Following up on Jos Kerc's answer: On Fri, 2013-01-18 at 07:56 -0500, Carpenter, Steven wrote: […] > print(math.acos(((a**2)+(b**2)-(c**2))/(2(a*b 2(a*b) → 2 * (a * b) > TypeError: 'int' object is not callable Juxtaposition does not imply multiplication in Python as it does in mathemat

Re: [Tutor] Help!

2013-01-26 Thread Jos Kerc
You are missing a multiplication sign. Near the end of your formula. On Fri, Jan 18, 2013 at 1:56 PM, Carpenter, Steven < steven.carpen...@oakland.k12.mi.us> wrote: > To Whom it May Concern, > > I’m trying to get this code working. *Here’s my question:* > > Consider a triangle with side

[Tutor] Help!

2013-01-25 Thread Carpenter, Steven
To Whom it May Concern, I'm trying to get this code working. Here's my question: Consider a triangle with sides of length 3, 7, and 9. The law of cosines states that given three sides of a triangle (a, b, and c) and angle C between sides a and b: Write Python code to calculate the three angles in

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread bob gailer
On 1/18/2013 8:03 AM, eryksun wrote: Yes, it's a mistake in the PCA example from the docs: http://mlpy.sourceforge.net/docs/3.5/dim_red.html#principal-component-analysis-pca There seems to be no way to report a bug in that documentation! Or am I missing something? -- Bob Gailer 919-636-4239 C

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread eryksun
On Fri, Jan 18, 2013 at 3:25 AM, Lie Ryan wrote: > On 18/01/13 17:11, Gayathri S wrote: >> >> >>> import numpy as np >> >>> import matplotlib.pyplot as plt >> >>> import mlpy >> >>> np.random.seed(0) >> >>> mean,cov,n=[0,0],[[1,1],[1,1.5]],100 >> >>> x=np.random.multivariate_normal(mean,cov,

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread Lie Ryan
On 18/01/13 17:11, Gayathri S wrote: hi... I am using principal component analysis for dimensionality reduction in python. am having this following error... >>> import numpy as np >>> import matplotlib.pyplot as plt >>> import mlpy >>> np.random.seed(0) >>> mean,cov,n=[0,0],[[1,1]

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread Marc Tompkins
On Thu, Jan 17, 2013 at 10:11 PM, Gayathri S wrote: > >>> import numpy as np > >>> import matplotlib.pyplot as plt > >>> import mlpy > >>> np.random.seed(0) > >>> mean,cov,n=[0,0],[[1,1],[1,1.5]],100 > >>> x=np.random.multivariate_normal(mean,cov,n) > >>> pca.learn(x) > Traceback (most recent call

Re: [Tutor] HELP- Regarding working with python

2013-01-17 Thread Gayathri S
hi... I am using principal component analysis for dimensionality reduction in python. am having this following error... >>> import numpy as np >>> import matplotlib.pyplot as plt >>> import mlpy >>> np.random.seed(0) >>> mean,cov,n=[0,0],[[1,1],[1,1.5]],100 >>> x=np.random.multivariate_no

Re: [Tutor] help for a beginner

2013-01-11 Thread Graham Dubow
Murail, Check out Udacity.com and the CS101 course. Great video lectures reinforced by "homework" and problems (with answers) that you can do yourself. Also has a very good forum and active user base to ask questions. It is a good starting point for a beginner and teaches the basics behind how to

Re: [Tutor] help for a beginner

2013-01-11 Thread vishwajeet singh
On Sat, Jan 12, 2013 at 12:28 AM, MDB wrote: > Hi, > I am a beginner to progrmming and want to learn basic python. I am a > scientist (with less math background) with absolutely no programming > experience. Are there any web based tutorials/videos/books to learn python. > The best book for begin

[Tutor] help for a beginner

2013-01-11 Thread MDB
Hi, I am a beginner to progrmming and want to learn basic python. I am a scientist (with less math background) with absolutely no programming experience. Are there any web based tutorials/videos/books to learn python. Any help is deeply appreciated, thanks Murail -- Murali Dharan Bashyam, PhD, MN

Re: [Tutor] HELP- Regarding working with python

2013-01-08 Thread Gayathri S
Hi.. I would like to use Principal component analysis independent component analysis in python. Wanna know whether it will support this efficiently or not? On Wed, Jan 2, 2013 at 4:59 PM, Alan Gauld wrote: > On 02/01/13 07:20, Gayathri S wrote: > >> Hi.. >> I am using python 2.7

[Tutor] help

2013-01-08 Thread Mike G
Hi Randy > I am an older newbie teaching myself Python programming. > Me too :) > My problem is I hear no system bell; the enter doesn't respond by quitting > the program; > The problem with the program code the enter key hasn't worked in earlier > programs. > > I appreciate any advice I may r

Re: [Tutor] help about to how many times the function called

2013-01-04 Thread bob gailer
On 1/4/2013 4:25 AM, Steven D'Aprano wrote: On 04/01/13 20:17, lei yang wrote: Hi experts I have a function will print PASS status def print_pass(t_elapsed): """ Print PASS to stdout with PASS (green) color. """ print_stdout(bcolors.PASS + "PASS" + bcolors.ENDC + " (%.2f

Re: [Tutor] help about to how many times the function called

2013-01-04 Thread Steven D'Aprano
On 04/01/13 20:17, lei yang wrote: Hi experts I have a function will print PASS status def print_pass(t_elapsed): """ Print PASS to stdout with PASS (green) color. """ print_stdout(bcolors.PASS + "PASS" + bcolors.ENDC + " (%.2f s)" % t_elapsed) I want to calculate the pa

[Tutor] help about to how many times the function called

2013-01-04 Thread lei yang
Hi experts I have a function will print PASS status def print_pass(t_elapsed): """ Print PASS to stdout with PASS (green) color. """ print_stdout(bcolors.PASS + "PASS" + bcolors.ENDC + " (%.2f s)" % t_elapsed) I want to calculate the pass number, so I want to get " how many tim

Re: [Tutor] HELP- Regarding working with python

2013-01-02 Thread Alan Gauld
On 02/01/13 07:20, Gayathri S wrote: Hi.. I am using python 2.7 and scikit-learn for machine learning. And OS is Windows 7. Wanna know how to import our own data sets in scikit-learn? Further to my last mail there is a gmane group gmane.comp.python.scikit-learn I'd try looking ther

Re: [Tutor] HELP- Regarding working with python

2013-01-02 Thread Alan Gauld
On 02/01/13 07:20, Gayathri S wrote: Hi.. I am using python 2.7 and scikit-learn for machine learning. And OS is Windows 7. Wanna know how to import our own data sets in scikit-learn? Hi, This list is for learning Python and its standard library. Your question looks to be specific

[Tutor] HELP- Regarding working with python

2013-01-01 Thread Gayathri S
Hi.. I am using python 2.7 and scikit-learn for machine learning. And OS is Windows 7. Wanna know how to import our own data sets in scikit-learn? Regards, G

Re: [Tutor] help

2012-12-30 Thread Mike G
Hi Randy > I am an older newbie teaching myself Python programming. > Me too :) > My problem is I hear no system bell; the enter doesn't respond by quitting > the program; > The problem with the program code the enter key hasn't worked in earlier > programs. > > I appreciate any advice I may r

Re: [Tutor] help

2012-12-29 Thread Kwpolska
On Fri, Dec 28, 2012 at 1:30 PM, Evans Anyokwu wrote: > I just tried your code and it worked for me. Like Alan and Steven have > pointed out already, sounding the system bell depends on how you are running > the code and your platform. > > On my computer I have Putty installed which I use to conne

Re: [Tutor] help

2012-12-28 Thread Evans Anyokwu
On Thu, Dec 27, 2012 at 12:07 PM, Randy WhiteWolf wrote: > I am an older newbie teaching myself Python programming. I copied the code > # Emonstrates escape sequences. This exercise is on page 22 of the Phthon > Programming for the Absolute Beginner by Michael Dawson. I have copied the > code verb

Re: [Tutor] help

2012-12-27 Thread Alan Gauld
On 27/12/12 12:07, Randy WhiteWolf wrote: Phthon Programming for the Absolute Beginner by Michael Dawson. I have copied the code verbatim below. # Sound the system bell print "\a" > ... raw_input ("\n\nPress the enter key to exit.") My problem is I hear no system bell; the enter doesn't respon

Re: [Tutor] help

2012-12-27 Thread Steven D'Aprano
On 27/12/12 23:07, Randy WhiteWolf wrote: # Sound the system bell print "\a" That comment is misleading. \a does not necessarily sound the system bell. Whether it does or not depends on the terminal you are using. For example, under Linux I am using the "Konsole" terminal, and I have four sett

[Tutor] help

2012-12-27 Thread Randy WhiteWolf
I am an older newbie teaching myself Python programming. I copied the code # Emonstrates escape sequences. This exercise is on page 22 of the Phthon Programming for the Absolute Beginner by Michael Dawson. I have copied the code verbatim below.       # Sound the system bell print "\a"   print "\

Re: [Tutor] Help please!

2012-12-14 Thread Steven D'Aprano
On 02/12/12 12:37, Jack Little wrote: Hi Tutor, I'm getting this error Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined Names need to be defined before they are used. Code needs to be indented to b

Re: [Tutor] Help please!

2012-12-14 Thread Kwpolska
On Sun, Dec 2, 2012 at 2:37 AM, Jack Little wrote: > Hi Tutor, > I'm getting this error > > Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", > line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined > > With the attached file > > Please get back to me > Than

[Tutor] Help please!

2012-12-14 Thread Jack Little
Hi Tutor, I'm getting this error Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined With the attached file Please get back to me Thank you g.py Description: Binary data ___

Re: [Tutor] Help with web.py error

2012-12-05 Thread eryksun
On Wed, Dec 5, 2012 at 2:13 AM, Erik Martinson wrote: > > File "/usr/lib/python2.7/sqlite3/dbapi2.py", line 63, in convert_date > return datetime.date(*map(int, val.split("-"))) > > ValueError: invalid literal for int() with base 10: '21 01:47:43' > 127.0.0.1:59850 - - [04/Dec/2012 22:47:35] "HTT

[Tutor] Help with web.py error

2012-12-04 Thread Erik Martinson
Hi, I need some help tracking the cause of this error. I have been looking at Python off and on for the last year or so. I write ASP classic and VB6 as my day job (yeah, I know.., it pays the bills). So some of this may be me have to think differently. I have tried the web.py group with no answ

Re: [Tutor] Help with writing a program

2012-12-03 Thread Steven D'Aprano
On 03/12/12 14:59, rajesh mullings wrote: Hello, I am trying to write a program which takes two lines of input, one called "a", and one called "b", which are both strings, then outputs the number of times a is a substring of b. If you could give me an algorithm/pseudo code of what I should do to

Re: [Tutor] Help with writing a program

2012-12-02 Thread Luke Paireepinart
There is an equivalent page in the documentation for Python 3 as well, regarding strings. This sounds a lot like a homework problem so you are unlikely to get a lot of help. You certainly won't get exact code. What have you tried so far? Where are you getting stuck? We're not here to write cod

Re: [Tutor] Help with writing a program

2012-12-02 Thread fantasticrm
The Python version, is Python 3. On Sun, Dec 2, 2012 at 10:59 PM, rajesh mullings wrote: > Hello, I am trying to write a program which takes two lines of input, one > called "a", and one called "b", which are both strings, then outputs the > number of times a is a substring of b. If you could giv

Re: [Tutor] Help with writing a program

2012-12-02 Thread Mark Lawrence
On 03/12/2012 03:59, rajesh mullings wrote: Hello, I am trying to write a program which takes two lines of input, one called "a", and one called "b", which are both strings, then outputs the number of times a is a substring of b. If you could give me an algorithm/pseudo code of what I should do t

[Tutor] Help with writing a program

2012-12-02 Thread rajesh mullings
Hello, I am trying to write a program which takes two lines of input, one called "a", and one called "b", which are both strings, then outputs the number of times a is a substring of b. If you could give me an algorithm/pseudo code of what I should do to create this program, I would greatly appreci

Re: [Tutor] help

2012-11-20 Thread Matthew Ngaha
> Traceback (most recent call last): > File "Match finder GUI.py", line 87, in ? > app = Application(root) > File "\Match finder GUI.py", line 23, in __init__ > self.create_widgets() > File "Match finder GUI.py", line 61, in create_widgets > self.submit_bttn = Button(self, text =

Re: [Tutor] help

2012-11-19 Thread Steven D'Aprano
On 20/11/12 11:33, Mark Lawrence wrote: On 19/11/2012 23:28, Matthew Ngaha wrote: It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. I believe that to be complete nonsense, there was very l

Re: [Tutor] help

2012-11-19 Thread Mark Lawrence
On 19/11/2012 23:28, Matthew Ngaha wrote: It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. I believe that to be complete nonsense, there was very little code to parse. What was missi

Re: [Tutor] help

2012-11-19 Thread Mark Lawrence
On 19/11/2012 18:07, Isaac Parkes wrote: First of all giving a meaningful subject helps everybody, how about "tkinter problems"? hi, I'm quite new to python and have just made a program that makes a GUI but when i open it it says there are some errors. I can't find any :( if you find any pro

Re: [Tutor] help

2012-11-19 Thread Matthew Ngaha
It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

[Tutor] help

2012-11-19 Thread Isaac Parkes
hi, I'm quite new to python and have just made a program that makes a GUI but when i open it it says there are some errors. I can't find any :( if you find any problems could you tell me ASAP # Match finder from TKinter import * import random girls = ['Ellie', 'Maddy', 'Ursula', 'Annie', 'Stel

Re: [Tutor] Help with a SQL Statement

2012-11-18 Thread Alan Gauld
On 18/11/12 11:29, Khalid Al-Ghamdi wrote: The SQL statement below doesn't return anything.. and I don't know why... I've used the parans but still no luck. Any Suggestions? I'll restructure it to how I think you want it... cur.execute(""" select badge, name, stage, tc, major, package

Re: [Tutor] Help with a SQL Statement

2012-11-18 Thread Bod Soutar
On Nov 18, 2012 11:30 AM, "Khalid Al-Ghamdi" wrote: > > Hi, I found one typo in 'Workshop&' which should be 'Workshop%' but it still gives results containing majors with 'Customer%' and 'Warehouse%' in them... > > > On Sun, Nov 18, 2012 at 2:21 PM, Khalid Al-Ghamdi wrote: >> >> Hi All, >> >> The

Re: [Tutor] Help with a SQL Statement

2012-11-18 Thread Khalid Al-Ghamdi
Hi, I found one typo in 'Workshop&' which should be 'Workshop%' but it still gives results containing majors with 'Customer%' and 'Warehouse%' in them... On Sun, Nov 18, 2012 at 2:21 PM, Khalid Al-Ghamdi wrote: > Hi All, > > The SQL statement below doesn't return anything.. and I don't know why.

[Tutor] Help with a SQL Statement

2012-11-18 Thread Khalid Al-Ghamdi
Hi All, The SQL statement below doesn't return anything.. and I don't know why... I've used the parans but still no luck. Any Suggestions? cur.execute("""select badge, name, stage, tc, major, package, subject, course, sb_as from records where sb_as = 0 and (subject like 'Wo

Re: [Tutor] Help with class example

2012-11-06 Thread Prasad, Ramit
Ramit Prasad wrote: > You would be better off trying to run this from the command > line. I just wanted to clarify on this. The reason you will have a better results running this from the command line is that Python will normally give you very good error traceback. An IDE might hide or obscure t

Re: [Tutor] help on dic creation

2012-11-06 Thread Mark Lawrence
On 06/11/2012 14:16, Dave Angel wrote: On 11/06/2012 09:01 AM, Mark Lawrence wrote: On 31/10/2012 01:01, Brayden Zhao wrote: def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=linelist[0]

Re: [Tutor] help on dic creation

2012-11-06 Thread Dave Angel
On 11/06/2012 09:01 AM, Mark Lawrence wrote: > On 31/10/2012 01:01, Brayden Zhao wrote: > >> def fieldict(filename): >>D={} >>with open(filename) as FileObject: >> for lines in FileObject: >>linelist=lines.split('\t') >>Key=linelist[0] >>ValCity=(linelist[12]).s

Re: [Tutor] help on dic creation

2012-11-06 Thread Mark Lawrence
On 31/10/2012 01:01, Brayden Zhao wrote: def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=linelist[0] ValCity=(linelist[12]).strip() ValState=linelist[13] ValOne=linelist[2]

Re: [Tutor] help on dic creation

2012-11-05 Thread Alan Gauld
On 31/10/12 01:01, Brayden Zhao wrote: Here is my code and I dont know why my code is only reading the 500th line of the file. Thanks for your help! def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=l

Re: [Tutor] Help with class example

2012-11-05 Thread Dave Angel
On 11/05/2012 06:07 PM, Prasad, Ramit wrote: > Frank Pontius wrote: >> Sent: Saturday, October 27, 2012 12:27 PM >> To: d...@davea.name; bgai...@gmail.com >> Cc: tutor@python.org >> Subject: Re: [Tutor] Help with class example >> >> Here ya go! >> Can

Re: [Tutor] Help with OOP!

2012-11-05 Thread Steven D'Aprano
On 30/10/12 17:56, Pete wrote: I'm taking this class on python at UCSC. They said this list could help. I don't' understand OOP and I'm having a hard time understanding the "scope" and why the def inside class are not like function But they are like functions. Can you explain in more detail wha

Re: [Tutor] Help with OOP!

2012-11-05 Thread Oscar Benjamin
On 30 October 2012 06:56, Pete wrote: > I’m taking this class on python at UCSC. They said this list could help. I > don’t’ understand OOP and I’m having a hard time understanding the “scope” > and why the def inside class are not like function –plus I can’t get my > c-brain around the implicit ty

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
FYI - Gmail's new "compose" feature makes it WAY too easy to miss trimming the quotes. :( On Mon, Nov 5, 2012 at 3:37 PM, Brett Ritter wrote: (way too much) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
> Here is my code and I dont know why my code is only reading the 500th line of > the file. Thanks for your help! Let me offer you some hints: This sounds like only the last line is getting saved into the dict. Yet your loop is clearly going over each line. Ergo, the problem is probably in the

Re: [Tutor] Help with class example

2012-11-05 Thread Prasad, Ramit
Frank Pontius wrote: > Sent: Saturday, October 27, 2012 12:27 PM > To: d...@davea.name; bgai...@gmail.com > Cc: tutor@python.org > Subject: Re: [Tutor] Help with class example > > Here ya go! > Can't do what you want as this is a programmatic error from interrupter. 

[Tutor] help on dic creation

2012-11-05 Thread Brayden Zhao
hello! I am doing my homework now and I am kinda stuck. Could any of you help me out? Here is the homework problem: fieldict(filename) reads a file in DOT format and returns a dictionary with the DOT CMPLID, converted to an integer, as the key, and a tuple as the corresponding v

<    3   4   5   6   7   8   9   10   11   12   >