Re: Strange tab completion oddity with enums?

2019-10-07 Thread Piet van Oostrum
Chris Angelico writes: > I'm not sure what's going on here, and it's probably not actually > enum-specific, but that's where I saw it. > > If you create a plain class and have an attribute with an annotation, > you can see that: > class Foo: > ... spam: "ham" = 1 > ... Foo.__a > Foo

Re: sqlalchemy & #temp tables

2019-10-07 Thread Frank Millman
On 2019-10-07 5:30 PM, Albert-Jan Roskam wrote: Hi, I am using sqlalchemy (SA) to access a MS SQL Server database (python 3.5, Win 10). I would like to use a temporary table (preferably #local, but ##global would also be an option) to store results of a time-consuming query. In other queries

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-07 Thread dieter
jf...@ms4.hinet.net writes: > ... > But most of the download from Github has a directory named '-master' > which causes a trouble sometimes. Those are likely not meant to be imported directly. Typically, you have a "setup" step which installs (in some way) a "distribution". This step usually

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

2019-10-07 Thread dieter
Geoff Bache writes: > Yes, this is hard, that's why I'm here :) > > I've enabled the equivalent tools to valgrind in Visual Studio, and tried > setting PYTHONMALLOC=debug, but neither of those seem to be showing > anything either. I don't really know what else to try in this direction. It likely

Re: python -m pip install and pip install

2019-10-07 Thread Cameron Simpson
On 08Oct2019 02:49, Hongyi Zhao wrote: On Tue, 08 Oct 2019 06:28:05 +0530, Pankaj Jangid wrote: A very good use-case is when you have both, python2 and python3 installed. python2 -m pip install mod python3 -m pip install mod will install the package in the corresponding PYTHONPATH. If so, wh

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-07 Thread jfong
DL Neil於 2019年10月8日星期二 UTC+8上午11時02分20秒寫道: > On 8/10/19 3:45 PM, jf...@ms4.hinet.net wrote: > > For example: > > from my-dir import test > > > > I know it can be solved by renaming, but any alternative? > > > The manual is your friend: > - import > - importlib > > (the latter allows modules to

Re: How to handle '-' in the 'from' part in a "from import" statement?

2019-10-07 Thread DL Neil via Python-list
On 8/10/19 3:45 PM, jf...@ms4.hinet.net wrote: For example: from my-dir import test I know it can be solved by renaming, but any alternative? The manual is your friend: - import - importlib (the latter allows modules to be identified by strings) However, Pythons has naming rules. If you try

How to handle '-' in the 'from' part in a "from import" statement?

2019-10-07 Thread jfong
For example: from my-dir import test I know it can be solved by renaming, but any alternative? --Jach -- https://mail.python.org/mailman/listinfo/python-list

Re: python -m pip install and pip install

2019-10-07 Thread Hongyi Zhao
On Tue, 08 Oct 2019 06:28:05 +0530, Pankaj Jangid wrote: > A very good use-case is when you have both, python2 and python3 > installed. > > python2 -m pip install mod If so, why not just: pip2 install mod > > and > > python3 -m pip install mod and using: pip3 install mod > > will install

Re: python -m pip install and pip install

2019-10-07 Thread Pankaj Jangid
Hongyi Zhao writes: > Hi, > > What's the diff: > > python -m pip install mod > and > pip install mod A very good use-case is when you have both, python2 and python3 installed. python2 -m pip install mod and python3 -m pip install mod will install the package in the corresponding PYTHONPATH.

Re: Mouse control

2019-10-07 Thread David L Neil via Python-list
On 7/10/19 4:11 AM, Alexander Vergun wrote: I am coding a voice assistant under Python 3.7, Windows 7. I am using PYcharm and libraries such as PYSimpleGUI, mouse, keyboard etc. Everything works except for the mouse control and probably keyboard, the problem is following, when I run the script

Re: Formatting floating point

2019-10-07 Thread DL Neil via Python-list
On 8/10/19 4:04 AM, boffi wrote: DL Neil writes: Agreed: there's ton(ne)s of information 'out there', much of it old, eg Python2, "formatter" (deprecated since v3.4) ? are you referring to the `string.Formatter`[*] class? $ python Python 3.7.4 (default, Aug 13 2019, 20:35:49) [

Re: pre-edit stuff persists in a reloaded a module

2019-10-07 Thread Friedrich Rentsch
On 10/5/19 1:48 PM, Friedrich Rentsch wrote: Hi all, Python 2.7. I habitually work interactively in an Idle window. Occasionally I correct code, reload and find that edits fail to load. I understand that reloading is not guaranteed to reload everything, but I don't understand the exact mec

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

2019-10-07 Thread MRAB
On 2019-10-07 08:04, Geoff Bache wrote: It's possible. Our embedding code is fairly simple and we've tried to encapsulate all the DECREFing in resource objects, i.e. that do DECREF in their destructor when they go out of scope. We hoped this would minimise this sort of problem. The C++ calling

sqlalchemy & #temp tables

2019-10-07 Thread Albert-Jan Roskam
Hi, I am using sqlalchemy (SA) to access a MS SQL Server database (python 3.5, Win 10). I would like to use a temporary table (preferably #local, but ##global would also be an option) to store results of a time-consuming query. In other queries I'd like to access the temporary table again in va

Re: Formatting floating point

2019-10-07 Thread boffi
DL Neil writes: > Agreed: there's ton(ne)s of information 'out there', much of it old, > eg Python2, "formatter" (deprecated since v3.4) ? are you referring to the `string.Formatter`[*] class? $ python Python 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] :: Anaconda, Inc. on

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

2019-10-07 Thread Geoff Bache
Yes, this is hard, that's why I'm here :) I've enabled the equivalent tools to valgrind in Visual Studio, and tried setting PYTHONMALLOC=debug, but neither of those seem to be showing anything either. I don't really know what else to try in this direction. /Geoff On Sat, Oct 5, 2019 at 7:22 AM d

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

2019-10-07 Thread Geoff Bache
It's possible. Our embedding code is fairly simple and we've tried to encapsulate all the DECREFing in resource objects, i.e. that do DECREF in their destructor when they go out of scope. We hoped this would minimise this sort of problem. The C++ calling code essentially tries to call progwrapper.p

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

2019-10-07 Thread Geoff Bache
I've so far only tried within my application, but I'm aware it would be easier if I could reproduce it outside. Even simplifying the context within the application has proved difficult though, so I suspect this will be hard. But I can try a bit more... The file isn't "large" by production standard

Re: Get __name__ in C extension module

2019-10-07 Thread Ian Pilcher
On 10/7/19 2:09 AM, Barry Scott wrote: I meant pass in the specific named logger that you C code will use. Right, but I'm assuming that your C/C++ code will receive the logger object by calling PyArg_ParseTuple (or similar), and I further assume that you want to validate that the object actuall

Re: python -m pip install and pip install

2019-10-07 Thread Chris Angelico
On Mon, Oct 7, 2019 at 10:21 PM Hongyi Zhao wrote: > > Hi, > > What's the diff: > > python -m pip install mod > and > pip install mod I presume from your series of posts that you either do not have access to a web browser, or do not trust search engines, because all of these questions can be answ

python -m pip install and pip install

2019-10-07 Thread Hongyi Zhao
Hi, What's the diff: python -m pip install mod and pip install mod -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Peter Otten
Chris Angelico wrote: >> Looks like everything starting with an underscore (except class, doc, and >> module) is suppressed, probably to suppress some noise... >> > > That's why dir() shows what it does, but tab completion seems to have > some other source, as it's able to find a lot of other att

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Chris Angelico
On Mon, Oct 7, 2019 at 6:00 PM Peter Otten <__pete...@web.de> wrote: > > Chris Angelico wrote: > > > I'm not sure what's going on here, and it's probably not actually > > enum-specific, but that's where I saw it. > > > > If you create a plain class and have an attribute with an annotation, > > you

Re: Get __name__ in C extension module

2019-10-07 Thread Barry Scott
> On 7 Oct 2019, at 00:44, Ian Pilcher wrote: > > On 10/6/19 12:55 PM, Barry Scott wrote: >> Then the answer to your question is simple. Do it in python and passt >> logger into the C++ module. > > Funny thing, that's exactly where I started this journey. I couldn't > figure out how to get t

Re: Get __name__ in C extension module

2019-10-07 Thread Barry Scott
> On 7 Oct 2019, at 04:34, MRAB wrote: > > On 2019-10-07 00:38, Ian Pilcher wrote: >> On 10/6/19 11:55 AM, MRAB wrote: >> > Don't you already have the module's name? You have to specify it in the > >> > PyModuleDef struct that you pass to PyModule_Create. >> >> I do. Perhaps I'm trying to b

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Peter Otten
Chris Angelico wrote: > I'm not sure what's going on here, and it's probably not actually > enum-specific, but that's where I saw it. > > If you create a plain class and have an attribute with an annotation, > you can see that: > class Foo: > ... spam: "ham" = 1 > ... Foo.__a > Foo