Re: [Tutor] file open error

2007-02-08 Thread Bill Campbell
On Thu, Feb 08, 2007, Jalil wrote: > > Hey guys, > I have this simple code and i cant seem to get it to run. > here is the code. > from os import * > import re > hostname =raw_input("Host name : ") or '' > mac_addr =input("Mac address : ") > filename='/etc/dhcpd.conf' > fh=open(fi

Re: [Tutor] file open error

2007-02-08 Thread John Fouhy
On 09/02/07, Jalil <[EMAIL PROTECTED]> wrote: Hi Jalil, Because you're doing this: > from os import * It means that when you get to this line: > fh=open(filename) You're actually calling os.open, which is lower-level than the standard open() and expects different arguments. Many people recom

[Tutor] file open error

2007-02-08 Thread Jalil
Hey guys, I have this simple code and i cant seem to get it to run. here is the code. from os import * import re hostname =raw_input("Host name : ") or '' mac_addr =input("Mac address : ") filename='/etc/dhcpd.conf' fh=open(filename) m = re.match(hostname,fh.readlines()) if m!=None: m.gro

Re: [Tutor] File open error

2006-09-04 Thread Danny Yoo
On Tue, 5 Sep 2006, John Fouhy wrote: >> When i'm executing it i get this error (runtime) >> >> Traceback (most recent call last): >> File "C:\python\boa\backup\backupwin.py", line 135, in OnStartaButton >>config = open("backup.conf", "r") >> TypeError: an integer is required I agree with

Re: [Tutor] File open error

2006-09-04 Thread John Fouhy
On 05/09/06, Magnus Wirström <[EMAIL PROTECTED]> wrote: > When i'm executing it i get this error (runtime) > > Traceback (most recent call last): > File "C:\python\boa\backup\backupwin.py", line 135, in OnStartaButton >config = open("backup.conf", "r") > TypeError: an integer is required Look

[Tutor] File open error

2006-09-04 Thread Magnus Wirström
Hi I'm trying to open a file with open() but i get this error i cant put my finger how to fix. Code looks like this. ... def OnStartaButton(self, event): print "Startade ", ctime(time()) self.startOP.SetLabel(ctime(time())) self.staticText7.SetLabel("Läser konfigur