Re: xpath prob, was Re: Why is there no functional xml?

2018-01-24 Thread dieter
> Rustom Mody wrote: > >> With >> # Read above xml > with open('soap_response.xml') as f: inp = etree.parse(f) >> # namespace dict > nsd = {'soap': "http://schemas.xmlsoap.org/soap/envelope/";, 'locns': > "http://example.com/"} >> >> The following behavior is observed $(G!7(B actual

Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-24 Thread Jason Qian via Python-list
Figured it out, Thanks On Wed, Jan 24, 2018 at 4:25 PM, Jason Qian wrote: > Again, thanks for the help. Everything is working fine after the changes. > > Here is one more new issue needs some help. > > On c side, > >The createService function can pass a callback handler as second > paramet

Re: Python call c pass a callback function on Linux

2018-01-24 Thread Jason Qian via Python-list
HI Dennis, Thanks for the help, After changing WINFUNCTYPE to CFUNCTYPE, the call back function works on the Linux :) Thanks again, Jason On Wed, Jan 24, 2018 at 6:15 PM, Dennis Lee Bieber wrote: > On Wed, 24 Jan 2018 17:16:22 -0500, Jason Qian via Python-list > declaimed the foll

Re: Python call c pass a callback function on Linux

2018-01-24 Thread Chris Angelico
On Thu, Jan 25, 2018 at 9:16 AM, Jason Qian via Python-list wrote: > Hi, > > I have following code that works fine on windows. > > InvocationCB=WINFUNCTYPE(None, c_char_p, c_int) > submit = lib.submit > submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB] > submit.restype = ctypes.c_int >

Python call c pass a callback function on Linux

2018-01-24 Thread Jason Qian via Python-list
Hi, I have following code that works fine on windows. InvocationCB=WINFUNCTYPE(None, c_char_p, c_int) submit = lib.submit submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB] submit.restype = ctypes.c_int def handleResponse(message, code): print('--- handleResponse ---') prin

Re: Processing a key pressed in Python 3.6

2018-01-24 Thread eryk sun
On Wed, Jan 24, 2018 at 8:02 PM, Virgil Stokes wrote: > Yes, I am aware of this Dennis. However, but, on my system I actually had it > running without the msvcrt.kbhit() _getwch loops calling ReadConsoleInput until a key event is read. The key can be typed manually in the console, or posted (i.e.

Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-24 Thread Jason Qian via Python-list
Again, thanks for the help. Everything is working fine after the changes. Here is one more new issue needs some help. On c side, The createService function can pass a callback handler as second parameter. Without callback handler, it works fine. But if we add the callback handler, the ap

Re: How to diagnose this, fails on 3.6.3, works on 3.5.2?

2018-01-24 Thread Peter Otten
Chris Green wrote: > I have a fairly simple little python program to automate starting an > editor on a wiki page. It works fine on the system where I wrote it > (xubuntu 16.04, python 3 version 3.5.2) but it comes up with the > following error on a newer system (xubuntu 17.10, python 3 version >

How to diagnose this, fails on 3.6.3, works on 3.5.2?

2018-01-24 Thread Chris Green
I have a fairly simple little python program to automate starting an editor on a wiki page. It works fine on the system where I wrote it (xubuntu 16.04, python 3 version 3.5.2) but it comes up with the following error on a newer system (xubuntu 17.10, python 3 version 3.6.3). Here is the error:-

Re: Processing a key pressed in Python 3.6

2018-01-24 Thread Virgil Stokes
Yes, I am aware of this Dennis. However, but, on my system I actually had it running without the msvcrt.kbhit() This occurred during testing while trying different options. And I was able to reproduce this several times. Why? I do not have an answer. This is one reason why I posted the code. I

Re: Read satellite images

2018-01-24 Thread Jugurtha Hadjar
On 01/24/2018 02:06 PM, jorge.conr...@cptec.inpe.br wrote: Hi, I have some gridded 4Km satellite images. I don't have experience with Python. The size of my image is (9896,3298) and I use this to read f = open('merg_2018011100_4km-pixel', "r")  # reopen the file x = f.read() print (x[0])

Read satellite images

2018-01-24 Thread jorge . conrado
Hi, I have some gridded 4Km satellite images. I don't have experience with Python. The size of my image is (9896,3298) and I use this to read f = open('merg_2018011100_4km-pixel', "r") # reopen the file x = f.read() print (x[0]) I have this value for x = � This is the information for

xpath prob, was Re: Why is there no functional xml?

2018-01-24 Thread Peter Otten
Rustom Mody wrote: > With > # Read above xml with open('soap_response.xml') as f: inp = etree.parse(f) > # namespace dict nsd = {'soap': "http://schemas.xmlsoap.org/soap/envelope/";, 'locns': "http://example.com/"} > > The following behavior is observed — actual responses elided in

Re: Why is there no functional xml?

2018-01-24 Thread Peter Otten
Rustom Mody wrote: >> To generalize that to handle arbitrarily nested lists and namedtuples a >> bit more effort is needed, but I can't see where lxml.objectify could >> make that much easier. > > You really mean that?? > Well sure in the programming world and even more so in the python world > “