Re: [Tutor] Unexpected Behavior in unittest

2006-03-01 Thread Carroll, Barry
Danny: I went back and double checked all of my test files, and you were right I was actually running an older version of test3.py. In that, the assignment to the character separator was wrong: lg.sc = 2.5 Having forgotten that Python allows dynamic creation of object attributes at run tim

Re: [Tutor] Non type object?

2006-03-01 Thread Kent Johnson
Max Russell wrote: > None > compStripToTxt is executed > Traceback (most recent call last): > File "HeaderChecker.py", line 182, in ? > diff =checker.compStripToTxt(text, stripped) > File "HeaderChecker.py", line 114, in compStripToTxt > stripped = open(strippedfile, "r") > TypeError: c

[Tutor] Non type object?

2006-03-01 Thread Max Russell
I'm trying to debug a script that takes a load of Python files and  checks them against original text files- it's for checking headers:#script to verify content of a header is what is should be.import difflib, os, re, sys class HeaderChecker(object):    def __init__(self, directoryPy, directoryTxt,

[Tutor] DOUBT -Its urgent!!!! (fwd)

2006-03-01 Thread Danny Yoo
-- Forwarded message -- Date: Wed, 1 Mar 2006 17:12:47 +0100 (CET) From: Joaquin Sanchez Sanchez <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: DOUBT -Its urgent I have a doubt I have some modules in python, and in one of them, i have to dictionarys. In them, i have s

Re: [Tutor] URGENT doubt!!!!

2006-03-01 Thread Hugo González Monteverde
Ok, if it's so urgent. import cPickle mydict = {1:"one", 2:"two"} #Saving fileo = open("mysavedfile", "w") cPickle.dump(mydict, fileo) fileo.close() fileo2 = open("mysavedfile", "r") saved_dict = cPickle.load(fileo2) print saved_dict Hope this one is simple enough Hugo ___

Re: [Tutor] URGENT doubt!!!!

2006-03-01 Thread Kent Johnson
Joaquin Sanchez Sanchez wrote: > I have a doubt > > I have some modules in python, and in one of them, i have to > dictionarys. In them, i have some vars yhat I want to save before > clossing my session, ande then, in a new session, i want to load them. > > I have heard about "pickle" > How d

Re: [Tutor] URGENT doubt!!!!

2006-03-01 Thread Python
On Wed, 2006-03-01 at 17:13 +0100, Joaquin Sanchez Sanchez wrote: > I have a doubt > > I have some modules in python, and in one of them, i have to > dictionarys. In them, i have some vars yhat I want to save before > clossing my session, ande then, in a new session, i want to load them. > > I

[Tutor] URGENT doubt!!!!

2006-03-01 Thread Joaquin Sanchez Sanchez
I have a doubt   I have some modules in python, and in one of them, i have to dictionarys. In them, i have some vars yhat I want to save before clossing my session, ande then, in a new session, i want to load them.   I have heard about "pickle" How does it work?I dont understand the help page

Re: [Tutor] password protection in httplib

2006-03-01 Thread Kent Johnson
Andre Engels wrote: > I am active in pywikipediabot, which is programmed in Python and is > used to edit wikis (based on MediaWiki, such as Wikpedia). It uses > httplib to connect to the site and get the HTML data. > > I now want to use it on another site, but this site is password > protected (we

[Tutor] password protection in httplib

2006-03-01 Thread Andre Engels
I am active in pywikipediabot, which is programmed in Python and is used to edit wikis (based on MediaWiki, such as Wikpedia). It uses httplib to connect to the site and get the HTML data. I now want to use it on another site, but this site is password protected (we want to first improve it before