New submission from Darcy Beurle :
I have some emails that I'm importing from an XML format according to rfc822.
Some of these have some encoding other than ascii. I create the message with
the default policy:
message = email.message_from_string(
# Extract text from
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 =
On Nov 15, 2:20 am, Cannonbiker lusve...@gmail.com 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
about the recommended approach, but I've done something
like you suggest in a library I authored. Any files named test*.py are
found and added to the unittest test suite.
See
http://code.google.com/p/pydicom/source/browse/trunk/source/dicom/test/run_tests.py.
HTH
Darcy
--
http://mail.python.org
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
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.
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: diez, thanks
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''