Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread jfong
Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道: > On Thu, Apr 12, 2018 at 2:16 PM, wrote: > > This C function returns a buffer which I declared it as a ctypes.c_char_p. > > The buffer has size 0x1 bytes long and the valid data may vary from a > > few bytes to the whole size. > > > > In eve

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Chris Angelico
On Thu, Apr 12, 2018 at 4:20 PM, wrote: > Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道: >> On Thu, Apr 12, 2018 at 2:16 PM, wrote: >> > This C function returns a buffer which I declared it as a ctypes.c_char_p. >> > The buffer has size 0x1 bytes long and the valid data may vary from a

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Cameron Simpson
On 11Apr2018 21:16, jf...@ms4.hinet.net wrote: This C function returns a buffer which I declared it as a ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid data may vary from a few bytes to the whole size. Could you show us the function? In every call I know how much the

Re: beacons and geofences

2018-04-12 Thread Karsten Hilbert
On Thu, Apr 12, 2018 at 12:33:39AM +0200, ElChino wrote: > Rafal Sikora wrote: > > > Hi! I want users’ devices to be able to monitor the maximum amount of POIs > > at > > once (geo-fences/beacons) and I need to prepare an algorithm solution for > > monitoring the POIs. How should it be implemen

Re: Compression of random binary data

2018-04-12 Thread Ned Batchelder
On 4/11/18 9:29 PM, cuddlycave...@gmail.com wrote: I’m replying to your post on January 28th Nice carefully chosen non random numbers Steven D'Aprano. Was just doing what you asked, but you don’t remember 😂😂😂 Best practice is to include a quote of the thing you are replying to.  It makes it m

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread jfong
Chris Angelico於 2018年4月12日星期四 UTC+8下午4時05分29秒寫道: > On Thu, Apr 12, 2018 at 4:20 PM, wrote: > > Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道: > >> On Thu, Apr 12, 2018 at 2:16 PM, wrote: > >> > This C function returns a buffer which I declared it as a > >> > ctypes.c_char_p. The buffer has s

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Jach Fong
This is the first time I am using python-list to interact with comp.lang.python forum (because there are so many spam when using browser to view it) so forgive me if something goes wrong. Python already treat the returned buffer as 'bytes'. The problem is Python don't know its size (or decides

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-12 Thread zljubisic
On Wednesday, 11 April 2018 21:19:44 UTC+2, José María Mateos wrote: > On Wed, Apr 11, 2018, at 14:48, zlj...com wrote: > > I have a dataframe: > > [...] > > This seems to work: > > df1 = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B'

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Albert-Jan Roskam
On Apr 12, 2018 09:39, jf...@ms4.hinet.net wrote: > > Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道: > > On Thu, Apr 12, 2018 at 2:16 PM, wrote: > > > This C function returns a buffer which I declared it as a > > > ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid > > > d

Making matrix solver/ solver for X

2018-04-12 Thread steffie . booij
Hee guys, I'm learning Python partly for school and wanted to see if I could figure some things out myself. I wanted to make like a value finder, sort of like numpy.solve (sounds more ambitious than it is) but I'm sort of stuck, since I'm a beginner. Let's say I want to find the values of matr

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Gregory Ewing
On Thu, Apr 12, 2018 at 2:16 PM, wrote: This C function returns a buffer which I declared it as a ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid data may vary from a few bytes to the whole size. I think we need to see the code you're using to call this C function. The

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Cameron Simpson
On 12Apr2018 16:11, Jach Fong wrote: This is the first time I am using python-list to interact with comp.lang.python forum (because there are so many spam when using browser to view it) so forgive me if something goes wrong. Python already treat the returned buffer as 'bytes'. The problem is

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread eryk sun
On Thu, Apr 12, 2018 at 11:25 PM, Gregory Ewing wrote: > > To get around this, you may need to declare the return type > as POINTER(c_char) instead: > >> For a general character pointer that may also point to binary data, > >> POINTER(c_char) must be used. > > I'm not sure where to go from here, t

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread Jach Fong
Gregory Ewing at 2018/4/13 上午 07:25 wrote: On Thu, Apr 12, 2018 at 2:16 PM,  wrote: This C function returns a buffer which I declared it as a ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid data may vary from a few bytes to the whole size. I think we need to see the co

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-12 Thread eryk sun
On Fri, Apr 13, 2018 at 12:38 AM, Jach Fong wrote: > Gregory Ewing at 2018/4/13 上午 07:25 wrote: > >> To get around this, you may need to declare the return type >> as POINTER(c_char) instead: >> >>> For a general character pointer that may also point to binary data, >> >> > POINTER(c_char) must b

Installing NETCDF4 in windows using python 3.4

2018-04-12 Thread shalu . ashu50
Hi All, I have downloaded NETCDF4 module from https://pypi.python.org/pypi/netCDF4 e.g. netCDF4-1.3.1-cp34-cp34m-win_amd64.whl I have installed it using pip install netCDF4-1.3.1-cp34-cp34m-win_amd64.whl through the command prompt in Spyder. It has successfully installed. C:\python3>pip insta