RE: python question


Ah another one of those changes I use 2.4 and 2.5 right  now I am just going
to jump 2.6 and go to 3.0 but that is a big change cause  3.0 can be called
python + there are so many cool changes its going to be hard to switch.
Even the dictionaries and the print statement are changed.  You have to
actually convert your python code to use it.  So no shock about the IO lib
in 2.6 probably split it out so it's easier to port.

Ken

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Nick Stockton
Sent: Tuesday, December 16, 2008 9:57 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: python question

The io module was introduced in Python 2.6 and is defined here.
http://www.python.org/dev/peps/pep-3116/

Nick Stockton
----- Original Message ----- 
From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Tuesday, December 16, 2008 8:20 PM
Subject: RE: python question


>
> You should not need to do io.open  The following works
>
> Log=open("test.log","w")
> Log.write("one line\n")
> Log.close()
>
> I couldn't even import io so maybe it's just it thinks io is a library and
> you're not getting the error.
>
> Ken
>
> -----Original Message-----
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler
> Littlefield
> Sent: Tuesday, December 16, 2008 6:04 PM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: python question
>
> I'm not sure if this is a python bug, or if I'm doing something wrong.
> I've opened a file with io.open, and it seems to work:
>  log=io.open("TDLynk.log","w")
> then I write something with:
> log.write("Hello world!")
> I get this error:
> File "C:\code\tdLynk\logger.py", line 12, in WriteLog
> log.write(input)
> File "C:\Python26\lib\io.py", line 1487, in write
> s.__class__.__name__)
> TypeError: can't write str to text stream
> ..why not?
>
>
> Thanks,
> Tyler Littlefield
> email: tyler@xxxxxxxxxxxxx
> web: tysdomain-com
> Visit for quality software and web design.
> skype: st8amnd2005
>
> __________
> View the list's information and change your settings at
> http://www.freelists.org/list/programmingblind
>
> __________
> View the list's information and change your settings at
> http://www.freelists.org/list/programmingblind
>
>
> __________ Information from ESET Smart Security, version of virus 
> signature database 3694 (20081215) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> 

__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

Other related posts: