Re: from ./.. import

2019-10-04 Thread Terry Reedy
On 10/4/2019 9:01 AM, Hongyi Zhao wrote: Hi, See this file: https://github.com/hongyi-zhao/dotbot/blob/master/dotbot/messenger/ messenger.py It has the following codes: from ..util.singleton import Singleton from ..util.compat import with_metaclass from .color import Color from .level import L

Re: Using a logging.Logger in a C extension

2019-10-04 Thread dieter
Ian Pilcher writes: > I am working my way through writing a C extension, and I've realized > that I need to log a few messages from the C code. Have a look at "cython". It significantly facilitates the realisation of C extensions, drastically reduces risks to make something wrong and makes it ve

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-04 Thread dieter
Geoff Bache writes: > ... > We are running Python embedded in our C++ product and are now experiencing > crashes (access violation reading 0xff on Windows) in the Python > garbage collector. Errors like this are very difficult to analyse. The main reason: the memory corruption is likely f

Re: Print to Paper

2019-10-04 Thread Michael Torrie
On 10/4/19 8:59 AM, Daniel wrote: > How to do a code to print to paper? please post here a "Hello World" > code to be printed on paper with an inkjet. What operating system? Are you using a graphical UI toolkit or is this a command-line program you're making? -- https://mail.python.org/mailman/

Re: Print to Paper

2019-10-04 Thread Grant Edwards
On 2019-10-04, Daniel wrote: > How to do a code to print to paper? please post here a "Hello World" > code to be printed on paper with an inkjet. os.popen('lpr','w').write('Hello World\n') That's a bit old-school -- you should probably use subprocess.Popen instead. -- https://mail.pyt

Using a logging.Logger in a C extension

2019-10-04 Thread Ian Pilcher
I am working my way through writing a C extension, and I've realized that I need to log a few messages from the C code. Ideally, I would pass my existing Logging.logger object into my C function and use PyObject_CallMethod to call the appropriate method on it (info, debug, etc.). PyArg_ParseTupl

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-04 Thread MRAB
On 2019-10-04 20:32, Geoff Bache wrote: Hi all, We are running Python embedded in our C++ product and are now experiencing crashes (access violation reading 0xff on Windows) in the Python garbage collector. We got this on Python 3.6.4 originally, but I can reproduce it with both Python

Re: Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-04 Thread Chris Angelico
On Sat, Oct 5, 2019 at 5:38 AM Geoff Bache wrote: > > Hi all, > > We are running Python embedded in our C++ product and are now experiencing > crashes (access violation reading 0xff on Windows) in the Python > garbage collector. > > We got this on Python 3.6.4 originally, but I can reprodu

Access violation in Python garbage collector (visit_decref) - how to debug?

2019-10-04 Thread Geoff Bache
Hi all, We are running Python embedded in our C++ product and are now experiencing crashes (access violation reading 0xff on Windows) in the Python garbage collector. We got this on Python 3.6.4 originally, but I can reproduce it with both Python 3.6.8 and Python 3.7.4. The chances of pr

Print to Paper

2019-10-04 Thread Daniel
How to do a code to print to paper? please post here a "Hello World" code to be printed on paper with an inkjet. Thanks Daniel --- Este email foi escaneado pelo Avast antivĂ­rus. https://www.avast.com/antivirus -- https://mail.python.org/mailman/listinfo/python-list

Re: Print to Paper

2019-10-04 Thread Piet van Oostrum
Daniel writes: > How to do a code to print to paper? please post here a "Hello World" > code to be printed on paper with an inkjet. > Thanks > Daniel It depends on the Operating System. Python doesn't have a standard, system-independent way to print to paper. On most Unix-like systems (like my

Re: pathlib

2019-10-04 Thread Barry Scott
> On 2 Oct 2019, at 23:58, DL Neil via Python-list > wrote: > > In my mind, I'm wondering if it will come to that (having 'got past' the > original observation/issue, I'm concerned by .rename()'s silent errors, for > example). However, that 'outside' research, eg StackOverflow, shows that

Re: pathlib

2019-10-04 Thread Barry Scott
> On 3 Oct 2019, at 13:04, Richard Damon wrote: > > I am not sure that Concrete is really the right term here, but the > beginning of the documentation for Pathlib does sort of define what it > means here: There is a need to describe three ideas. The PurePath The OS Specific PurePath's, Wind

Re: from ./.. import

2019-10-04 Thread Jon Ribbens via Python-list
On 2019-10-04, Hongyi Zhao wrote: > See this file: > https://github.com/hongyi-zhao/dotbot/blob/master/dotbot/messenger/ > messenger.py > > It has the following codes: > > from ..util.singleton import Singleton > from ..util.compat import with_metaclass > from .color import Color > from .level imp

from ./.. import

2019-10-04 Thread Hongyi Zhao
Hi, See this file: https://github.com/hongyi-zhao/dotbot/blob/master/dotbot/messenger/ messenger.py It has the following codes: from ..util.singleton import Singleton from ..util.compat import with_metaclass from .color import Color from .level import Level I just cannot figure out why they usi

Re: a &= b

2019-10-04 Thread David
On Fri, 4 Oct 2019 at 19:02, Hongyi Zhao wrote: > > Could you please give me some more hints on: > > a &= b $ python3 Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> a = 15 >>> b = 3 >>> c =

Re: a &= b

2019-10-04 Thread Joel Goldstick
On Fri, Oct 4, 2019 at 5:01 AM Hongyi Zhao wrote: > > Hi, > > Could you please give me some more hints on: > > a &= b > > It's very difficult for me to understand. > -- > https://mail.python.org/mailman/listinfo/python-list & is bitwise And. a &= b is equivalent to a = a & b -- Joel Goldstick

a &= b

2019-10-04 Thread Hongyi Zhao
Hi, Could you please give me some more hints on: a &= b It's very difficult for me to understand. -- https://mail.python.org/mailman/listinfo/python-list