Re: Cython, producing different modules from the same .pyx

2019-12-19 Thread Greg Ewing
On 20/12/19 2:16 am, Lele Gaifax wrote: My first approach has been duplicating the Extension() entry in the setup.py(*), changing the first argument (that is, the name of the module). Although that did produce the alternative binary module, it could not be loaded because it contains the wrong PyI

How to improve epoll speed when recv from kernel via netlink?

2019-12-19 Thread lampahome
I tried to receive msg from kernel via netlink of socket. And I use epoll to receive netlink events whenever it comes from kernel to user space. But I found the performance is poor e.g. epoll costs 90% time of execution time after I profile it by cProfile module. Are there any tips to improve th

Re: on sorting things

2019-12-19 Thread Chris Angelico
On Fri, Dec 20, 2019 at 8:06 AM Eli the Bearded <*@eli.users.panix.com> wrote: > > In comp.lang.python, Peter Otten <__pete...@web.de> wrote: > > Eli the Bearded wrote: > >> But what caught my eye most, as someone relatively new to Python but > >> with long experience in C in Perl, is sorting does

Re: on sorting things

2019-12-19 Thread Eli the Bearded
In comp.lang.python, Peter Otten <__pete...@web.de> wrote: > Eli the Bearded wrote: >> But what caught my eye most, as someone relatively new to Python but >> with long experience in C in Perl, is sorting doesn't take a s/C in /C and/ Ugh. >> *comparison* function, it takes a *key generator* fu

Re: INHERITANCE in python3

2019-12-19 Thread Ethan Furman
On 12/19/2019 06:22 AM, Pieter van Oostrum wrote: Random832 writes: On Wed, Dec 18, 2019, at 23:10, wrote: [vahid asadi] my problem here is why this attribute is not recognize by python and it raise an traceback error that said 'there is no such p.family attribute'. although i use multiple

Re: Cython, producing different modules from the same .pyx

2019-12-19 Thread Ethan Furman
On 12/19/2019 05:16 AM, Lele Gaifax wrote: in my package, I would like to compile and distribute two different extension modules starting from the same .pyx file, just with different compilation flags and libraries. If you don't get an answer here, you can try the Cython Users group: https:

Re: hexdump module installation error

2019-12-19 Thread Pieter van Oostrum
tommy yama writes: > user@USERnoMacBook-Air LibraBrowser % python3 hexdump.py > > /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python: > can't open file 'hexdump.py': [Errno 2] No such file or directory > > user@USERnoMacBook-Air Libr

Re: INHERITANCE in python3

2019-12-19 Thread Pieter van Oostrum
Random832 writes: > On Wed, Dec 18, 2019, at 23:10, vahid asadi via Python-list wrote: >> HI guys this is my first post on python mailing lists ever and i glad >> to do this. >> my problem here is why this attribute is not recognize by python and it >> raise an traceback error that said 'there

Understanding of GIL

2019-12-19 Thread onlinejudge95
Hi Devs, I am currently writing some custom Django commands for data updation, my workflow is like Fetch data from *PostgreSQL*. Call *Elasticsearch* for searching based on the data fetched from *PostgreSQL*. Query *PostgreSQL* and do an upsert behavior. I am using pandas data frame to hold my da

Re: hexdump module installation error

2019-12-19 Thread tommy yama
Yes. thanks for your enthusiasm. i may raise this in the git On Thu, Dec 19, 2019 at 12:46 PM Rhodri James wrote: > On 19/12/2019 12:43, tommy yama wrote: > > Thanks for your quick response i did not expect. > > I hope you see the error below in my response as i just copy and paste > it. > > > >

Re: hexdump module installation error

2019-12-19 Thread Chris Angelico
On Thu, Dec 19, 2019 at 11:44 PM tommy yama wrote: > > Hi Rhodri, > > Thanks for your quick response i did not expect. > I hope you see the error below in my response as i just copy and paste it. > > "no module named 'hexdump'." > > In addition, i tried to execute python3 hexdump.py. However, no s

Cython, producing different modules from the same .pyx

2019-12-19 Thread Lele Gaifax
Hi all, in my package, I would like to compile and distribute two different extension modules starting from the same .pyx file, just with different compilation flags and libraries. My first approach has been duplicating the Extension() entry in the setup.py(*), changing the first argument (that i

Re: hexdump module installation error

2019-12-19 Thread Rhodri James
On 19/12/2019 12:43, tommy yama wrote: Thanks for your quick response i did not expect. I hope you see the error below in my response as i just copy and paste it. "no module named 'hexdump'." In addition, i tried to execute python3 hexdump.py. However, no such file directory. from hexdump

Re: hexdump module installation error

2019-12-19 Thread tommy yama
Hi Rhodri, Thanks for your quick response i did not expect. I hope you see the error below in my response as i just copy and paste it. "no module named 'hexdump'." In addition, i tried to execute python3 hexdump.py. However, no such file directory. from hexdump import hexdump ModuleNotFound

Re: hexdump module installation error

2019-12-19 Thread Rhodri James
On 19/12/2019 11:23, tommy yama wrote: Thanks for your kind response. The error was simply "module Hexdump was not found". Several things: a) Did it really say "module Hexdump was not found"? "hexdump" and "Hexdump" are not the same things; module names are case-sensitive. b) There will ha

Re: How to specific multiple dtypes in numpy.ndarray?

2019-12-19 Thread Thomas Jollans
On 19/12/2019 11.52, lampahome wrote: > I meet performance is low when I use struct.unpack to unpack binary data. > > So I tried to use numpy.ndarray > But meet error when I want to unpack multiple dtypes > > Can anyone teach me~ > > Code like below: > # python3 > import struct > import numpy as np

Re: hexdump module installation error

2019-12-19 Thread tommy yama
Thanks for your kind response. The error was simply "module Hexdump was not found". Regards, On Wed, Dec 18, 2019 at 11:39 PM Rhodri James wrote: > On 18/12/2019 02:23, tommy yama wrote: > > Hi, > > > > This sounds familiar to somebody? > > After upgrading my mac OS to Catalina, this persists

How to specific multiple dtypes in numpy.ndarray?

2019-12-19 Thread lampahome
I meet performance is low when I use struct.unpack to unpack binary data. So I tried to use numpy.ndarray But meet error when I want to unpack multiple dtypes Can anyone teach me~ Code like below: # python3 import struct import numpy as np s1 = struct.Struct("@QIQ") ss1 = s1.pack(1,11,111) np.nd

[RELEASE] Python 3.8.1, 3.7.6, 3.6.10, and 3.9.0a2 are now available!

2019-12-19 Thread Ɓukasz Langa
from locale import seasons_greetings seasons_greetings() On behalf of the entire Python development community, and the currently serving Python release team in particular, I'm pleased to announce the unprecedented combined release of no less than four versions of Python. Let's dig in! Python 3

Re: on sorting things

2019-12-19 Thread Peter Otten
Eli the Bearded wrote: > I recently saw a link to an old post on a blog and then started looking > at the newer posts. This one: > > https://leancrew.com/all-this/2019/11/the-key-to-sorting-in-python/ > > discusses ways to deal with useful sorting of movie / television show > titles. Some initia

Re: on sorting things

2019-12-19 Thread Chris Angelico
On Thu, Dec 19, 2019 at 6:36 PM Eli the Bearded <*@eli.users.panix.com> wrote: > > I recently saw a link to an old post on a blog and then started looking > at the newer posts. This one: > > https://leancrew.com/all-this/2019/11/the-key-to-sorting-in-python/ > > discusses ways to deal with useful s