Re: TypeError: an integer is required

2009-11-30 Thread Nobody
On Sun, 22 Nov 2009 18:29:25 +, MRAB wrote: >> os.open("C://Users//lutfi//Documents//te//log.txt" , "a" ) > open("C://Users//lutfi//Documents//te//log.txt" , "a" ) Backslashes need to be doubled; forward slashes don't. -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: an integer is required

2009-11-22 Thread Dave Angel
quot;import os" instead. ) This error is caused by binding the wrong kind of open to stdout. os.open() returns a file descriptor (integer), while stdout is expected to be a "file" object. As for your previous error "an integer is required" it'd certainly be n

Re: TypeError: an integer is required

2009-11-22 Thread MRAB
Lutfi Oduncuoglu wrote: Hello, I am a newbie on oython and I am taking the error at subject my code is below, I am trying to develop a qgis plugin and lines begin with # is the thing that I tried. Thus sys.stdout gives the type error. When I comment that line it turns an error like below. Wha

TypeError: an integer is required

2009-11-22 Thread Lutfi Oduncuoglu
Hello, I am a newbie on oython and I am taking the error at subject my code is below, I am trying to develop a qgis plugin and lines begin with # is the thing that I tried. Thus sys.stdout gives the type error. When I comment that line it turns an error like below. What may be the problem? thanks

Re: exceptions.TypeError an integer is required

2009-07-27 Thread Gabriel Genellina
En Mon, 27 Jul 2009 12:44:40 -0300, jakecjacobson escribió: You are quite correct in your statements. My goal was not to make great code but something that I could quickly test. My assumption was that the httplib.HTTPSConnection() would do the cast to int for me. As soon as I cast it to an i

Re: exceptions.TypeError an integer is required

2009-07-27 Thread jakecjacobson
On Jul 24, 3:11 pm, Steven D'Aprano wrote: > On Fri, 24 Jul 2009 11:24:58 -0700, jakecjacobson wrote: > > I am trying to do a post to a REST API over HTTPS and requires the > > script to pass a cert to the server.  I am getting "exceptions.TypeError > > an integ

Re: exceptions.TypeError an integer is required

2009-07-24 Thread Terry Reedy
jakecjacobson wrote: I am trying to do a post to a REST API over HTTPS and requires the script to pass a cert to the server. I am getting "exceptions.TypeError an integer is required" error and can't find the reason. I commenting out the lines of code, it is happening on the con

Re: exceptions.TypeError an integer is required

2009-07-24 Thread Steven D'Aprano
On Fri, 24 Jul 2009 11:24:58 -0700, jakecjacobson wrote: > I am trying to do a post to a REST API over HTTPS and requires the > script to pass a cert to the server. I am getting "exceptions.TypeError > an integer is required" error and can't find the reason. I commenting

exceptions.TypeError an integer is required

2009-07-24 Thread jakecjacobson
I am trying to do a post to a REST API over HTTPS and requires the script to pass a cert to the server. I am getting "exceptions.TypeError an integer is required" error and can't find the reason. I commenting out the lines of code, it is happening on the connection.request() lin

Re: : an integer is required

2009-06-16 Thread Ulrich Eckhardt
Dave Angel wrote: > Ulrich Eckhardt wrote: >> open() doesn't take a string as second parameter, see 'help(open)'. >> Instead, it takes one of the integers which are defined as symbols in the >> os module, see 'dir(os)'. > > [...]The second parameter to the builtin function open() is a string[...] >

Re: : an integer is required

2009-06-15 Thread Dave Angel
Ulrich Eckhardt wrote: open() doesn't take a string as second parameter, see 'help(open)'. Instead, it takes one of the integers which are defined as symbols in the os module, see 'dir(os)'. Where'd you get that misinformation? The second parameter to the builtin function open() is a strin

Re: : an integer is required

2009-06-15 Thread Ulrich Eckhardt
jeni wrote: [ ..large backtrace.. ] For your own sake and that of your readers, try next time to reduce the code that causes the problems to a minimal example. This prevents people from guessing or simply ignoring your problems. > /home/Activities/Kremala.activity/Kremala.py in insert_text_file >

: an integer is required

2009-06-15 Thread jeni
open("elements_file.txt", "a") global open= t.write(strng) t.close() : an integer is required OLPC's software is important? -- http://mail.python.org/mailman/listinfo/python-list

Re: error: an integer is required

2009-06-14 Thread jeni
gt;      t.write(strng) > >      t.close() > > > I'm getting this error: > > > : an integer is required > > > Where is the mistake? > > Help me, please!! > > Tell us the Python version and give the *full* traceback message, not > just the la

Re: error: an integer is required

2009-06-08 Thread Terry Reedy
madigre...@yahoo.gr wrote: I execute my code in linux environment. My code is: from os import * def insert_text_file(self, strng): t=open("elements_file.txt", "a") t.write(strng) t.close() I'm getting this error: : an integer is required Where is the

Re: error: an integer is required

2009-06-08 Thread MRAB
madigre...@yahoo.gr wrote: I execute my code in linux environment. My code is: from os import * def insert_text_file(self, strng): t=open("elements_file.txt", "a") t.write(strng) t.close() I'm getting this error: : an integer is required Where is the

error: an integer is required

2009-06-08 Thread madigreece
I execute my code in linux environment. My code is: from os import * def insert_text_file(self, strng): t=open("elements_file.txt", "a") t.write(strng) t.close() I'm getting this error: : an integer is required Where is the mistake? Help me, please!! -

Re: overriding file.readline: "an integer is required"

2008-08-05 Thread Terry Reedy
Gabriel Genellina wrote: def readline(self, size=None): if size == None: line = self.file.readline() else: line = self.file.readline(size) # etc., etc. Not obvious from the docs, but readline(-1) should be the same as readline(). (In 3.0b2, Non

Re: overriding file.readline: "an integer is required"

2008-08-05 Thread Gabriel Genellina
En Fri, 01 Aug 2008 16:21:26 -0300, kj <[EMAIL PROTECTED]> escribi�: In <[EMAIL PROTECTED]> Miles <[EMAIL PROTECTED]> writes: On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote: I know that I could rewrite the method like this: def readline(self, size=None): if size ==

Re: overriding file.readline: "an integer is required"

2008-08-01 Thread kj
In <[EMAIL PROTECTED]> Miles <[EMAIL PROTECTED]> writes: >On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote: >> I know that I could rewrite the method like this: >> >>def readline(self, size=None): >>if size == None: >>line = self.file.readline() >>else:

Re: overriding file.readline: "an integer is required"

2008-07-30 Thread Miles
On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote: > I know that I could rewrite the method like this: > >def readline(self, size=None): >if size == None: >line = self.file.readline() >else: >line = self.file.readline(size) ># etc., et

Re: overriding file.readline: "an integer is required"

2008-07-30 Thread Gary Herron
nvoke the new method with an integer argument, but if I invoke it without arguments, I get the error TypeError: an integer is required ...which I suppose comes from the call to self.file.readline(None). I know that I could rewrite the method like this: def readline(self, size=None):

overriding file.readline: "an integer is required"

2008-07-30 Thread kj
e new method with an integer argument, but if I invoke it without arguments, I get the error TypeError: an integer is required ...which I suppose comes from the call to self.file.readline(None). I know that I could rewrite the method like this: def readline(self, size=None): if size ==