Handle SIGINT in C and Python

2018-01-31 Thread Victor Porton
I need to assign a real C signal handler to SIGINT. This handler may be called during poll() waiting for data. For this reason I cannot use Python signals because "A Python signal handler does not get executed inside the low-level (C) signal handler. Instead, the low-level signal handler sets a

Re: Where has the practice of sending screen shots as source code come from?

2018-01-31 Thread Abdur-Rahmaan Janhangeer
it seems that at the end, invariably, the subject becomes well routed to regions far away from codeland Abdur-Rahmaan Janhangeer https://abdurrahmaanjanhangeer.wordpress.com On 28 Jan 2018 19:08, "Steven D'Aprano" < steve+comp.lang.pyt...@pearwood.info> wrote: > I'm seeing this annoying practice

Re: Handle SIGINT in C and Python

2018-01-31 Thread Victor Porton
Victor Porton wrote: > I need to assign a real C signal handler to SIGINT. > > This handler may be called during poll() waiting for data. For this reason > I cannot use Python signals because "A Python signal handler does not get > executed inside the low-level (C) signal handler. Instead, the low

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton wrote: >> For this reason I >> cannot use Python signals because "A Python signal handler does not get >> executed inside the low-level (C) signal handler. Instead, the low-level >> signal handler sets

Re: PyPy support breaking CPython compatibility?

2018-01-31 Thread Etienne Robillard
Le 2018-01-30 à 16:38, Ned Batchelder a écrit : I'm confused by this: -if os.environ.get('SCHEVO_OPTIMIZE', '1') == '1': +if os.environ.get('SCHEVO_OPTIMIZE', '1') == True: I was also curious about this: when does os.environ.get return anything but a string? I was probably high when I cod

Re: PyPy support breaking CPython compatibility?

2018-01-31 Thread Chris Angelico
On Wed, Jan 31, 2018 at 8:15 PM, Etienne Robillard wrote: > > > Le 2018-01-30 à 16:38, Ned Batchelder a écrit : >>> >>> I'm confused by this: >>> >>> -if os.environ.get('SCHEVO_OPTIMIZE', '1') == '1': >>> +if os.environ.get('SCHEVO_OPTIMIZE', '1') == True: >>> >> I was also curious about this: whe

Re: Import statements and multiprocessing

2018-01-31 Thread Nicholas Cole
On Tue, Jan 30, 2018 at 7:26 PM, Terry Reedy wrote: > On 1/30/2018 10:54 AM, Nicholas Cole wrote: > >> I have a strange problem on python 3.6.1 > > [involving multiprocessing] Interestingly it seems to have been a very subtle circular import problem that was showing up only in multiprocessing, an

Re: PyPy support breaking CPython compatibility?

2018-01-31 Thread Ned Batchelder
On 1/30/18 3:58 PM, Etienne Robillard wrote: Hi Ned, Le 2018-01-30 à 15:14, Ned Batchelder a écrit : I'm curious what you had to change for PyPy? (Unless it's a Py2/Py3 thing as Chris mentions.) Please take a look at the changesets: https://bitbucket.org/tkadm30/libschevo/commits/745d1aeab

Install PyDev package or any other regular package during runtime in the python project

2018-01-31 Thread user2301
I am trying to dynamically install PyDev package at runtime. I have a PyDev project created in eclipse. I have a PyDev package on network location. Based on some configuration and input in my PyDev project, I want to install and load the PyDev package from network location. The classes contained

Re: Package containing C sources (Posting On Python-List Prohibited)

2018-01-31 Thread Vincent Vande Vyvre
Le 31/01/18 à 07:52, Victor Porton a écrit : Lawrence D’Oliveiro wrote: On Wednesday, January 31, 2018 at 6:13:00 PM UTC+13, Victor Porton wrote: I am going to create a Python wrapper around a generally useful C library. So the wrapper needs to contain some C code to glue them together. Not n

Re: Where has the practice of sending screen shots as source code come from?

2018-01-31 Thread alister via Python-list
On Tue, 30 Jan 2018 21:22:39 +0100, Jugurtha Hadjar wrote: > On 01/29/2018 03:48 PM, alister via Python-list wrote: >> On Mon, 29 Jan 2018 15:20:06 +0100, Jugurtha Hadjar wrote: >> >>> On 01/28/2018 04:43 PM, Skip Montanaro wrote: I've never been a Windows user, but at my current job, Windows

Re: [OT] Dutch Reach [was Re: Where has the practice of sending screen shots as source code come from?]

2018-01-31 Thread Adriaan Renting
Adriaan Renting| Email: rent...@astron.nl Software Engineer Radio Observatory ASTRON | Phone: +31 521 595 100 (797 direct) P.O. Box 2 | GSM: +31 6 24 25 17 28 NL-7990 AA Dwingeloo | FAX: +31 521 595 101 The Netherlands| Web: http://www.astron.nl/

for info

2018-01-31 Thread harnali70
from where we learn python for free of cost. i am begineer in python.plzz help me -- https://mail.python.org/mailman/listinfo/python-list

Re: for info

2018-01-31 Thread Joel Goldstick
On Wed, Jan 31, 2018 at 10:55 AM, wrote: > from where we learn python for free of cost. i am begineer in python.plzz > help me > -- > https://mail.python.org/mailman/listinfo/python-list > Start with python.org tutorial pages -- Joel Goldstick http://joelgoldstick.com/blog http://cc-baseballst

Help to debug my free library

2018-01-31 Thread Victor Porton
LibComCom is a C library which passes a string as stdin of an OS command and stores its stdout in another string. I wrote this library recently: https://github.com/vporton/libcomcom Complete docs are available at https://vporton.github.io/libcomcom-docs/ Now I am trying to make Python bindings

Re: Help to debug my free library

2018-01-31 Thread Chris Angelico
On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: > LibComCom is a C library which passes a string as stdin of an OS command and > stores its stdout in another string. Something like the built-in subprocess module does? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 9:55:45 PM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton >>> wrote: For this reason I cannot use Python signals because "A Python signal

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
Chris Angelico wrote: > On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >> LibComCom is a C library which passes a string as stdin of an OS command >> and stores its stdout in another string. > > Something like the built-in subprocess module does? I was going to write: "It seems that subpr

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
wxjmfa...@gmail.com wrote: > Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : >> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >> > LibComCom is a C library which passes a string as stdin of an OS >> > command and stores its stdout in another string. >> >> Something li

Re: Help to debug my free library

2018-01-31 Thread Chris Angelico
On Thu, Feb 1, 2018 at 6:26 AM, Victor Porton wrote: > Chris Angelico wrote: > >> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >>> LibComCom is a C library which passes a string as stdin of an OS command >>> and stores its stdout in another string. >> >> Something like the built-in subpro

Re: Help to debug my free library

2018-01-31 Thread Chris Angelico
On Thu, Feb 1, 2018 at 6:41 AM, Victor Porton wrote: > wxjmfa...@gmail.com wrote: > >> Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : >>> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: >>> > LibComCom is a C library which passes a string as stdin of an OS >>> > command

Re: Help to debug my free library

2018-01-31 Thread breamoreboy
On Wednesday, January 31, 2018 at 7:41:50 PM UTC, Victor Porton wrote: > wxjmfa...@gmail.com wrote: > > > Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : > >> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: > >> > LibComCom is a C library which passes a string as stdin of

Re: Help to debug my free library

2018-01-31 Thread alister via Python-list
On Thu, 01 Feb 2018 06:48:03 +1100, Chris Angelico wrote: > On Thu, Feb 1, 2018 at 6:41 AM, Victor Porton wrote: >> wxjmfa...@gmail.com wrote: >> >>> Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: > LibComC

Re: Help to debug my free library

2018-01-31 Thread Chris Angelico
On Thu, Feb 1, 2018 at 9:31 AM, alister via Python-list wrote: > On Thu, 01 Feb 2018 06:48:03 +1100, Chris Angelico wrote: > >> On Thu, Feb 1, 2018 at 6:41 AM, Victor Porton wrote: >>> wxjmfa...@gmail.com wrote: >>> Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : > O

[RELEASE] Python 3.7.0b1 is now available for testing

2018-01-31 Thread Ned Deily
On behalf of the Python development community and the Python 3.7 release team, I'm happy to announce the availability of Python 3.7.0b1. b1 is the first of four planned beta releases of Python 3.7, the next major release of Python, and marks the end of the feature development phase for 3.7. You c

Re: [OT] Dutch Reach [was Re: Where has the practice of sending screen shots as source code come from?]

2018-01-31 Thread Steven D'Aprano
On Wed, 31 Jan 2018 16:14:45 +0100, Adriaan Renting wrote: > I am Dutch and after googling the term, I can confirm that the "Dutch > Reach" is taught in driving school here. I was taught this maneuvre when > getting my licence 20 years ago. Thanks for the data point. Was it a requirement of the d

Re: Help to debug my free library

2018-01-31 Thread Victor Porton
Dennis Lee Bieber wrote: > On Wed, 31 Jan 2018 20:58:56 +0200, Victor Porton > declaimed the following: > >>LibComCom is a C library which passes a string as stdin of an OS command >>and stores its stdout in another string. >> >>I wrote this library recently: >>https://github.com/vporton/libcomc

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> The usual behaviour for POSIX is that the call is aborted with EINTR >>> after you get the signal. >> >> That poll() is interrupted does not imply that Pytho

Re: [OT] Dutch Reach [was Re: Where has the practice of sending screen shots as source code come from?]

2018-01-31 Thread Rustom Mody
On Wednesday, January 31, 2018 at 11:17:45 PM UTC+5:30, Adriaan Renting wrote: > I am Dutch and after googling the term, I can confirm that the "Dutch > Reach" is taught in driving school here. > I was taught this maneuvre when getting my licence 20 years ago. > And in the Netherlands, we large

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 5:57:58 PM UTC+13, Victor Porton wrote: >> I meant to call poll() from C code, not Python code. > > Do you need to use C code at all? Python is quite capable of handling this > . I alread

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread eryk sun
On Thu, Feb 1, 2018 at 4:57 AM, Victor Porton wrote: > Lawrence D’Oliveiro wrote: > >> On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote: >>> Lawrence D’Oliveiro wrote: >>> The usual behaviour for POSIX is that the call is aborted with EINTR after you get the signal

Dependency injection: overriding defaults

2018-01-31 Thread Victor Porton
I am writing a library, a command line utility which uses the library, and a daemon which uses the library. I am going to use dependency_injector package. Consider loggers: For the core library the logger should default to stderr. For the command line utility, we use the default logger of the

Re: Help to debug my free library

2018-01-31 Thread Rustom Mody
On Thursday, February 1, 2018 at 1:11:50 AM UTC+5:30, Victor Porton wrote: > wxjmfauth wrote: > > > Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit : > >> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton wrote: > >> > LibComCom is a C library which passes a string as stdin of an O

Object-oriented gettext

2018-01-31 Thread Victor Porton
I want to write a multiuser application which uses multiple languages (one language for logging and a language per user). https://docs.python.org/3/library/gettext.html describes a procedural gettext interface. The language needs to be switched before each gettext() call. I want an object orie

Advice on where to define dependency injection providers

2018-01-31 Thread Victor Porton
I define ExecutionContext in xmlboiler.core.execution_context module. ExecutionContext is meant to contain a common "environment" suitable for different kinds of tasks. Currently ExecutionContext contains a logger and a translator of messages: class ExecutionContext(object): def __init__(se

Re: Object-oriented gettext

2018-01-31 Thread Victor Porton
Victor Porton wrote: > I want to write a multiuser application which uses multiple languages (one > language for logging and a language per user). > > https://docs.python.org/3/library/gettext.html describes a procedural > gettext interface. The language needs to be switched before each gettext()

Re: Dependency injection: overriding defaults

2018-01-31 Thread dieter
Victor Porton writes: > I am writing a library, a command line utility which uses the library, and a > I am going to use dependency_injector package. > > Consider loggers: > > For the core library the logger should default to stderr. > > For the command line utility, we use the default logger of