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
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
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
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
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
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
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
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
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
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[...]
>
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
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
>
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
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
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
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
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!!
-
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
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 ==
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:
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
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):
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 ==
23 matches
Mail list logo