Newbie question: Unicode hiccup on reading file i just wrote

2006-01-30 Thread Darcy
hi all, i have a newbie problem arising from writing-then-reading a unicode file, and i can't work out what syntax i need to read it in. the syntax i'm using now (just using quick hack tmp files): BEGIN f=codecs.open("tt.xml","r","utf8") fwrap=codecs.EncodedFile(f,"ascii","utf8") try: ss=u''

Re: Newbie question: Unicode hiccup on reading file i just wrote

2006-01-31 Thread Darcy
Fredrik Lundh wrote: > Diez B. Roggisch wrote: >>Just don't do any fancy encoding stuff at all, a simple >>rrr=xml.dom.minidom.parseString(open("tt.xml").read()) >>should do. > or > rrr = xml.dom.minidom.parse("tt.xml") thanks a lot guys -- both approaches work a treat. in particular: die

python 2 urlopen vs python 3 urlopen

2018-08-27 Thread Sean Darcy
python 2 : python Python 2.7.15 (default, May 15 2018, 15:37:31) . >>> import urllib2 >>> res = urllib2.urlopen('https://api.ipify.org').read() >>> print res www.xxx.yyy.zzz python3 python3 Python 3.6.6 (default, Jul 19 2018, 16:29:00) ... >>> from urllib.request import urlopen >>> res = url

Re: Running all unit tests

2009-02-06 Thread Darcy Mason
y > built in that could do this for me. > > -- > Jason Voegele > Only fools are quoted. >                 -- Anonymous I don't know about the recommended approach, but I've done something like you suggest in a library I authored. Any files named test*.py are fo

Re: Python Imaging Library (PIL) question

2008-10-20 Thread Darcy Mason
On Oct 20, 2:14 pm, Sid <[EMAIL PROTECTED]> wrote: > Hi, > >   I am tryin to copy an image into my own data structure(a sort of 2d array   > for further FFT). I've banged my head over the code for a couple of hours   > now. The simplified version of  my problem is below. > > #-Code-

Re: Dummy explanation to win32com needed

2008-10-22 Thread Darcy Mason
On Oct 22, 3:43 pm, korean_dave <[EMAIL PROTECTED]> wrote: > Hi. I need a dummy's explanation to utilizing the win32com component > to access Microsoft Excel. > > So far, I have this code. > >     import win32com.client >     xl = win32com.client.Dispatch("Excel.Application") >     xl.Visible = 1 >

Re: Calling Python functions from Excel

2009-11-16 Thread Darcy Mason
On Nov 15, 2:20 am, Cannonbiker wrote: > Please I need Calling Python functions from Excel and receive result > back in Excel. Can me somebody advise simplest solution please? I am > more VBA programmer than Python. A couple of years ago I used MSScriptControl for this. Couldn't find a great ref