[Tutor] big numbers

2005-03-14 Thread Robert Storey
Dear all, I'm new to Python, and using Sam's Teach Yourself Python in 24 Hours. The book introduces big numbers, saying that I should expect the following problem: >>> 1 + 99 OverflowError: integer literal too large The "problem" is that this doesn't happen. When I execute this c

Re: [Tutor] How do you use pydoc?

2005-03-14 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-03-14 19:28: I have read but don't under stand how to use pydoc. here what i read can't figer out how to use it. Hi, try this: Fire up IDLE and your web browser of choice. In IDLE's shell, type: import HTMLParser There is nothing special about the

Re: [Tutor] creating a tab delimited filename

2005-03-14 Thread Max Noel
On Mar 15, 2005, at 03:35, jrlen balane wrote: how am i going to change the filename automaticaly? for example: #every 5 minutes, i am going to create a file based on the data above for i in range(100) output_file = file('c:/output' +.join(i) +'.txt', 'w') #guess this won't work

Re: [Tutor] how to read from a txt file

2005-03-14 Thread Liam Clarke
Whoops, golden rule - "Never post untested code" Sorry. On Mon, 14 Mar 2005 21:05:44 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > jrlen balane wrote: > > ok, i've done what sir Kent just said, my fault... > > > > but an error still occurs: > > Traceback (most recent call last): > > File "C:

Re: [Tutor] creating a tab delimited filename

2005-03-14 Thread jrlen balane
so for example, i have 5 arrays, i can do this (is this correct): data1[1,2,3,4,5 (and so on)] data2[1,2,3,4,5 (and so on)] data3[1,2,3,4,5 (and so on)] data4[1,2,3,4,5 (and so on)] data5[1,2,3,4,5 (and so on)] datas = [data1, data2, data3, data4, data5] for data in datas: lines.append('\t'.j

Re: [Tutor] how to read from a txt file

2005-03-14 Thread Kent Johnson
jrlen balane wrote: ok, i've done what sir Kent just said, my fault... but an error still occurs: Traceback (most recent call last): File "C:\Python23\practices\opentxtprintlngnew.py", line 18, in -toplevel- print process(data) File "C:\Python23\practices\opentxtprintlngnew.py", line 10, in

Re: [Tutor] how to read from a txt file

2005-03-14 Thread jrlen balane
ok, i've done what sir Kent just said, my fault... but an error still occurs: Traceback (most recent call last): File "C:\Python23\practices\opentxtprintlngnew.py", line 18, in -toplevel- print process(data) File "C:\Python23\practices\opentxtprintlngnew.py", line 10, in process tempLi

Re: [Tutor] what is the "path browser" used for?

2005-03-14 Thread Max Noel
On Mar 15, 2005, at 00:55, [EMAIL PROTECTED] wrote: What is the path browser for and all the sys.path's for? are these for copying and pasteing to help you on your program? No, sys.path (as explained by pydoc sys ;) ) is the module search path; that is, the list of the folders into which Python

Re: [Tutor] how to read from a txt file

2005-03-14 Thread Kent Johnson
jrlen balane wrote: import sys data_file = open('C:/Documents and Settings/nyer/Desktop/nyer.txt', 'r') data = data_file.readlines() def process(list_of_lines): data_points = [] for line in list_of_lines: try: tempLine = int(line) except TypeError: pr

Re: [Tutor] how to read from a txt file

2005-03-14 Thread jrlen balane
import sys data_file = open('C:/Documents and Settings/nyer/Desktop/nyer.txt', 'r') data = data_file.readlines() def process(list_of_lines): data_points = [] for line in list_of_lines: try: tempLine = int(line) except TypeError: print "Non numeric c

Re: [Tutor] how to read from a txt file

2005-03-14 Thread Kent Johnson
jrlen balane wrote: this is what i get after running this on IDLE: import sys data_file = open('C:/Documents and Settings/nyer/Desktop/nyer.txt', 'r') data = data_file.readlines() def process(list_of_lines): data_points = [] for line in list_of_lines: try: tempLine = i

[Tutor] what is the "path browser" used for?

2005-03-14 Thread Jeff420harris00
What is the path browser for and all the sys.path's for? are these for copying and pasteing to help you on your program? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do you use pydoc?

2005-03-14 Thread Max Noel
On Mar 15, 2005, at 00:28, [EMAIL PROTECTED] wrote:   I have read but don't under stand how to use pydoc. here what i read can't figer out how to use it. pydoc is more or less a help browser. Think of it as "man for Python". If you need documentation on a module, just type "pydoc [module na

Re: [Tutor] how to read from a txt file

2005-03-14 Thread jrlen balane
this is what i get after running this on IDLE: import sys data_file = open('C:/Documents and Settings/nyer/Desktop/nyer.txt', 'r') data = data_file.readlines() def process(list_of_lines): data_points = [] for line in list_of_lines: try: tempLine = int(line)

[Tutor] How do you use pydoc?

2005-03-14 Thread Jeff420harris00
  I have read but don't under stand how to use pydoc. here what i read can't figer out how to use it. 5.1 pydoc -- Documentation generator and online help system New in version 2.1. The pydoc module automatically generates documentation from Python modules. The documentation can be presen

Re: [Tutor] how to read from a txt file

2005-03-14 Thread Liam Clarke
Oops, and I meant try: tempLine = int(line) Silly indent error. On Tue, 15 Mar 2005 12:52:49 +1300, Liam Clarke <[EMAIL PROTECTED]> wrote: > Well, a string "12345" when called through int() will come back as 12345. > > But, a string "foo", called through int(), will raise a TypeError. > >

Re: [Tutor] how to read from a txt file

2005-03-14 Thread Liam Clarke
Well, a string "12345" when called through int() will come back as 12345. But, a string "foo", called through int(), will raise a TypeError. So > import sys > > data_file = open('C:/Documents and Settings/nyer/Desktop/nyer.txt', 'r') > data = data_file.readlines() > > def process(list_of_l

Re: [Tutor] how to read from a txt file

2005-03-14 Thread jrlen balane
say i have the code that reads decimal value from a text file: import sys data_file = open('C:/Documents and Settings/nyer/Desktop/nyer.txt', 'r') data = data_file.readlines() def process(list_of_lines): data_points = [] for line in list_of_lines: data_points.append(int(line))

Re: [Tutor] CGI authentication

2005-03-14 Thread Paul Tremblay
On Mon, Mar 14, 2005 at 08:04:10AM -0500, Kent Johnson wrote: > Date: Mon, 14 Mar 2005 08:04:10 -0500 > From: Kent Johnson <[EMAIL PROTECTED]> > User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) > To: Python Tutor > Subject: [Tutor] CGI authentication > > There was a question on this list re

Re: [Tutor] re help

2005-03-14 Thread Jacob S.
And I wouldn't mind mentioning that re is slightly over kill for the examples given. Try this. ### old_group_delimiter = "\n\n" old_line_delimiter = "\n" new_group_delimiter = "\n" new_line_delimiter = ", " fi = raw_input("Input file to use? ") fi = open(fi,"r"

Re: [Tutor] python>data>sqlite>python>data>paper

2005-03-14 Thread Jan Ekström
For example a balance report for a company. Regards Jan - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Jan EkstrÃm" <[EMAIL PROTECTED]> Cc: Sent: Monday, March 14, 2005 3:14 AM Subject: Re: [Tutor] python>data>sqlite>python>data>paper On Sat, 12 Mar 2005, [iso-8859-1] J

[Tutor] CGI authentication

2005-03-14 Thread Kent Johnson
There was a question on this list recently about how to authenticate users of a web server from a simple CGI script. I just came across a module that might help: http://www.voidspace.org.uk/python/logintools.html Kent ___ Tutor maillist - Tutor@python

Re: [Tutor] re help

2005-03-14 Thread Kent Johnson
Ron Nixon wrote: The following program takes text data like this: Jimi Hendrix 2100 South Ave Seattle, WA 55408 and changes it to this Jimi Hendrix, 2100 South Ave,Seattle,WA,55488 and writes it to a file. Hameed has shown you one solution. I would like to point out that if you plan to read this

Re: [Tutor] funny behaviour

2005-03-14 Thread Kent Johnson
Jacob Abraham wrote: Dear Tutors, A class was created to extend timedelta to add and subtract months. Simple doctests that simply create an instance of the class failed. Could someone please explain this really funny behaviour. timedelta is an immutable class (its instances have fixed values tha

Re: [Tutor] re help

2005-03-14 Thread Hameed U. Khan
Hi, Ron! I am also a newbie in programming. But after reading your problem i decided to solve it as a homework :). But there are few things you didn't mentioned. Does all the addresses in first file have same format. What seperates those addresses in the file. Assuming that all address are on 3 l