Re: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-09-30 Thread Barry via Python-list
> On 30 Sep 2024, at 06:52, Abdur-Rahmaan Janhangeer via Python-list > wrote: > > > import polars as pl > pl.read_json("file.json") > > This is not going to work unless the computer has a lot more the 60GiB of RAM. As later suggested a streaming pars

Re: Common objects for CLI commands with Typer

2024-09-23 Thread Barry Scott via Python-list
ing wrong with functions in a > module. Python is great in allowing you to pick your style. A few lines in a module, a couple of functions or use classes. But once your code gets big the disciple of using classes helps maintenance. Code with lots of globals is problematic. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Common objects for CLI commands with Typer

2024-09-20 Thread Barry via Python-list
ivalent of class > attributes at a single point which are then available to all commands? I do not know typer. But the general solution is to create an instance of your class and tell typer to call member function of the instance. app = Application() … typer.set_callback(app.my_handler) Barry &

Re: Crash when launching python

2024-09-05 Thread Barry via Python-list
ut or stderr. I recall that does not always work for app code that expects the macOS options that are passed in when launching from GUI. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Crash when launching python

2024-09-04 Thread Barry Scott via Python-list
: cd .app/Contents then have a look around. Beware that you cannot use print to stdout for a .app as its stdin/stdout do not go anywhere useful. What I do is use code like this in the main function: sys.stdout = open( '/home/barry/debug.log', 'w', 1 ) sys.stderr = s

Re: Getting a Process.start() error pickle.PicklingError: Can't pickle : it's not found as __builtin__.module with Python 2.7

2024-09-02 Thread Barry Scott via Python-list
> On 2 Sep 2024, at 15:00, marc nicole via Python-list > wrote: > > I am using Python 2.7 on Windows 10 Why? Install Python 3.12 and it will be easier to get help and support. If you have legacy that still needs porting then you can install 3.12 along side the unsupported 3

Re: ListAdmin: Is list/archive working correctly?

2024-08-31 Thread Barry Scott via Python-list
no such original-message > has appeared in the thread. I see 11 messages and none from Stefan. Maybe replies to off list emails? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Error codes

2024-08-13 Thread Barry Scott via Python-list
\Python\__pycache__\MetalMummysMods_Ehlers-DanlosMod.cpython-37.pyc'. > Element ID: (No Element) > Element Name: (No Element) These are app specific errors. The most likely source of help will be to ask Zerbu, who I assume is the author and maintainer. Barry > --- > > &g

Re: Issue bootstrapping Python - troubleshooting steps?

2024-08-06 Thread Barry Scott via Python-list
> On 6 Aug 2024, at 02:49, Piper McCorkle via Python-list > wrote: > > $ /tmp/sources/Python-3.12.4/configure --enable-shared --with-system-expat > --enable-optimizations --prefix= I assume that you must provide a value for --prefix. The linux default would be --pre

Re: python C-api and thread

2024-08-06 Thread Barry Scott via Python-list
ad this is > significant faster even than fork. using processes means you are more robust and can survive a process crash. using async, assuming you do enough I/O, will out perform threads. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Installation of Slixfeed with pip fails

2024-08-03 Thread Barry Scott via Python-list
ase advise, Please duplicate the problem and if after doing that you have not fixed the problem post details here. Barry > Schimon > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-09 Thread Barry Scott via Python-list
> On 9 Jul 2024, at 06:13, ⁨אורי via Python-list⁩ <⁨python-list@python.org⁩> > wrote: > > I tried to subscribe to Python-ideas These days ideas are discussed on https://discuss.python.org/ It is rare to see an idea on the mailing list. Barry -- https://mail.python.or

Re: PyGILState_Ensure() deadlocks, why?

2024-07-08 Thread Barry Scott via Python-list
> On 7 Jul 2024, at 23:21, Barry via Python-list wrote: > > > >> On 7 Jul 2024, at 22:09, Tomas Ukkonen via Python-list >> wrote: >> >>Py_Initialize(); > > You also need to tell python to init threading. I'm in front of my dev machine

Re: Best (simplest) way to share data between processes

2024-07-08 Thread Barry Scott via Python-list
d. In this case the OP is on an RPi. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Best (simplest) way to share data between processes

2024-07-07 Thread Barry via Python-list
a tmp file. Close the tmp file. Then use os.rename(tmpfile, productionfile). This is guaranteed that any process that reads the file will only see all the old file contents or all the new file contents, never a mix of both. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Anonymous email users

2024-06-24 Thread Barry Scott via Python-list
month of which less than 200 are spam. A few years ago the spam count was greater than a 1,000 a month. I have been using spambayes for a very long time, 20 years I guess at this point and bayesian categorisation has stood the test of time for me. For me the spammers have not won, I have the tec

Re: Suggested python feature: allowing except in context maneger

2024-06-13 Thread Barry Scott via Python-list
> On 13 Jun 2024, at 11:01, Yair Eshel via Python-list > wrote: > > I read this is a good place to give some suggestions for features in > python. Best place these days is to raise an idea on https://discuss.python.org/ Beware that this idea has come up in the past and was r

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Barry Scott via Python-list
ages in try using that. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Barry via Python-list
ython and pip and enabled by the distros. There are ways to turn off the blocking, but it’s strongly discouraged by the distros. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Issues with uninstalling python versions on windows server

2024-05-03 Thread Barry via Python-list
all-users and you should be able to uninstall as any user. But this will require admin privs for both install and uninstall. As assume you can find out how to bet the admin priv required for your automation. Barry > > Also, with the approach of using msiexec.exe to uninstall different

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-04-02 Thread Barry via Python-list
work. It is on https://sourceforge.net/projects/cxx/ Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Trying to use pyinstaller under python 3.11, and, recently started receiving error message about specific module/distribution

2024-04-02 Thread Barry via Python-list
> On 1 Apr 2024, at 15:52, Jacob Kruger via Python-list > wrote: > > Found many, many mentions of errors, with some of the same keywords, but, no > resolutions that match my exact issue at all. Try asking the pyinstaller developers. I think there is a mailing list. Barr

Re: Trying to use pyinstaller under python 3.11, and, recently started receiving error message about specific module/distribution

2024-03-31 Thread Barry via Python-list
ller and that error leads to people discussing why it happens it looks like. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Barry Scott via Python-list
without the -lpython and it should just work. Barry > > Le ven. 29 mars 2024 à 10:10, Barry a écrit : >> >> >> >>> On 28 Mar 2024, at 16:13, Olivier B. via Python-list >>> wrote: >>> >>> But on Linux, it seems that linking to

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Barry via Python-list
nality only available on Windows? Python limited API works on linux, but you do not link against the .so on linux I recall. You will have missed that libpython3.so is a symlink to libpython3.11.so.10. Windows build practices do not translate one-to-one to linux, or macOS. Barry -- https:/

Re: ANN: EmPy 4.1 -- a powerful, robust and mature templating system for Python

2024-03-25 Thread Barry via Python-list
You should considered also announcing on https://discuss.python.org/ which is a lot more active then this list. Barry > On 25 Mar 2024, at 04:13, Erik Max Francis via Python-list > wrote: > > I'm pleased to announce the release of EmPy 4.1. > > The 4._x_ series is

Re: the name ``wheel''

2024-03-24 Thread Barry via Python-list
e it separately, which is inline with Fedora’s policy of not vendoring code into a package. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: the name ``wheel''

2024-03-22 Thread Barry via Python-list
ckage. Fedora leaves all the batteries intact and rhel I assume. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Configuring an object via a dictionary

2024-03-16 Thread Barry via Python-list
> On 15 Mar 2024, at 19:51, Thomas Passin via Python-list > wrote: > > I've always like writing using the "or" form and have never gotten bit I, on the other hand, had to fix a production problem that using “or” introducted. I avoid this idiom because it fa

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-10 Thread Barry via Python-list
> On 10 Mar 2024, at 14:49, Thomas Passin via Python-list > wrote: > > That and there's a registry setting: > > https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation > Yep that and rules about size of parts of the path. Barry -

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-10 Thread Barry via Python-list
and 255 for the path part that will use 1 for the leading \. Getting an error for a name that is 255 is not surprising. Other api allow for 65535 limit, not sure on its additional limits. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem resizing a window and button placement

2024-02-24 Thread Barry via Python-list
> On 24 Feb 2024, at 04:36, Steve GS via Python-list > wrote: > > How do I extract the values > from args? You can look up the args in documentation. You can run the example code MRAB provided and see what is printed to learn what is in the args. Barry -- https://

Re: Feature proposal: unittest.mock.NAN

2024-01-24 Thread Barry Scott via Python-list
Python ideas are discussed here these days: https://discuss.python.org/ Suggest you raise this there in the Ideas category. Barry > On 24 Jan 2024, at 17:11, Kerrick Staley via Python-list > wrote: > > I think we should define a unittest.mock.NAN constant that can

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-16 Thread Barry via Python-list
e python and python3 aliases. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about garbage collection

2024-01-16 Thread Barry via Python-list
c.get_objects() then summerize the number of each type. Part 2 is to print the delta after an interval of a 2nd summary. Leaks of objects show up as the count of a type increasing every time you sample. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about garbage collection

2024-01-16 Thread Barry via Python-list
works well and robustly. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about garbage collection

2024-01-16 Thread Barry via Python-list
t and the circumstances. When this has been seen in the past it has been promptly fixed by the maintainer. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-09 Thread Barry Scott via Python-list
11. If so what is its contents? I've tried with and without a py.ini and cannot duplicate what you see. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-03 Thread Barry Scott via Python-list
for-windows To create a py.ini does require a user to understand what %localappdata% means. Some windows users, reasonable, do not use the CLI and know about that syntax for environment variables. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-01 Thread Barry via Python-list
thon 3.12. I suspect Windows, because a > change in the way Python 3.12 uses shebang lines should be visible in the > documentation. See my earlier reply with info on ftype etc output. What do you see on your windows 10 vs windows 11? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: mypy question

2023-12-30 Thread Barry via Python-list
ften use a wrapper class in place of a simple str. If you have a class SqlString then your type becomes list[SqlString]. You may find that SqlString gains interesting methods over time. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-24 Thread Barry via Python-list
thob.exe in the venv bin folder. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: What is Install-Paths-To in WHEEL file?

2023-12-24 Thread Barry via Python-list
> On 24 Dec 2023, at 00:58, Left Right via Python-list > wrote: > > I'm trying to understand the contents of Wheel files There are lots of packaging experts that hang out on https://discuss.python.org/ you are likely to get a response there if not here replies.

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-23 Thread Barry Scott via Python-list
major=3, minor=10, micro=11, releaselevel='final', serial=0) K:\shebang>assoc .py .py=Python.File K:\shebang>ftype Python.File Python.File="C:\WINDOWS\py.exe" "%L" %* Windows 11 output : 11:52:10.36 K:\shebang : \\BARNSTONE\barry> py -0 -V:3.12 *

Re: making your own DirEntry.

2023-12-23 Thread Barry Scott via Python-list
ot;real" DirEntry. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Barry via Python-list
> On 23 Dec 2023, at 00:15, Thomas Passin via Python-list > wrote: > > In neither case is the shebang line used. As i understand it, not in front of my windows box to check. The handler for .py file extension is set to be the py.exe It is py.exe that understands shebang l

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Barry via Python-list
> On 22 Dec 2023, at 14:58, Christian Buhtz via Python-list > wrote: > > On Windows 11 it usually is the "Terminal" which is different from cmd.exe. In terminal app you can run cmd.exe or powershell, so it is basically the same. Barry -- https://mail.python.org/m

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Barry via Python-list
> On 22 Dec 2023, at 14:29, Sibylle Koczian wrote: > > #!/usr/bin/env/python That was what i thought you had and it will not work. The BOM suggestion is worth trying. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Barry via Python-list
angegebene > Datei nicht finden." > > Without the "env" in the shebang line and only without it everything > works as expected - but that's contrary to the documentation, isn't it? This suggests a typo in the shebang line. Is there a space between env and python? Barry > > Thank you for information, > Sibylle > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread Barry Scott via Python-list
'b': v5 'd': v6 } } Personally I would not use .ini style these days as the format does not include type of the data. Also I would not use the ast.literal_eval as it makes debugging errors in the data harder. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread Barry Scott via Python-list
man can read it. For example: import json config = { 'key2': 42, 'key1': 'value 1', } print(json.dumps(config, indent=4, separators=(', ', ': '), sort_keys=True)) % python $T/a.py { "key1": "value 1", "key2": 42 } Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Request: inspect: signature & getfullargspec & getcallargs

2023-12-04 Thread Barry Scott via Python-list
s as an idea on https://discuss.python.org/ to get the attention of the core devs. Barry > > > Regards, > DG > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: xor operator

2023-11-13 Thread Barry via Python-list
> On 13 Nov 2023, at 17:48, Dom Grigonis wrote: > > Short circuiting happens, when: > xor([True, True, False, False], n=1) > At index 1 it is clear that the answer is false. Can you share an example with 4 values that is true? And explain why it is xor. Barry -- https://

Re: No current way to just compile flet code into truly native packages for smart phones, etc.?

2023-11-13 Thread Barry via Python-list
today. Also the people that know flet are on discord. You may find someone here. Barry > > -- > > Jacob Kruger > +2782 413 4791 > "Resistance is futile!...Acceptance is versatile..." > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: xor operator

2023-11-13 Thread Barry via Python-list
erstand how xor can be short circuited. For AND or OR only looking at the first arg works. But that does not work for xor right? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-24 Thread Barry via Python-list
ing_problem It is common to simulate hardware that does not exist yet and run software in the simulated environment. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Barry via Python-list
On 2 Oct 2023, at 16:02, Jen Kris via Python-list wrote: Iwant to write a list of 64-bit integers to a binary file.  Everyexample I have seen in my research convertsit to .txt, but I want it in binary.  I wrote this code,based on some earlier work I have done: buf= b

Re: type annotation vs working code

2023-10-01 Thread Barry via Python-list
th a default value of False. I would use a class variable not an instance variable. class OnlyOne: sole_instance = None def __init__(self): assert OnlyOne.sole_instance is None OnlyOne.sole_instance = self Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: venv --upgrade 3.12.0rc2 --> 3.12.0rc3 failure

2023-09-28 Thread Barry via Python-list
version of python changes. It is not a bug in python. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: `time.perf_counter_ns` always a 64-bit int?

2023-09-16 Thread Barry via Python-list
the value is stored in a 64 bit int for unix and windows. There is a comment that it covers the range of +-232 years. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Finding good documentation for gpiod

2023-09-03 Thread Barry via Python-list
E > On 3 Sep 2023, at 22:49, Chris Green via Python-list > wrote: > > Mostly I am managing to get things to work as I want but better > documentation of gpiod would be a great help. Ask the author? https://github.com/aswild/python-gpiod Maybe read the source code for hints?

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-18 Thread Barry via Python-list
gs to translate. This is covered in the docs at https://docs.python.org/3/library/gettext.html#localizing-your-module Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Where is the error?

2023-08-07 Thread Barry via Python-list
output the errors in a machine readable format to allow editors to auto fix. I am learning rust and it is very good at suggesting fixes. There is a command to apply fixes automatically, cargo fix. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Canonical list of Python security vulnerabilities

2023-07-14 Thread Barry via Python-list
s a better place to ask, please advise. Where do you get your python from? You may find that the organisation that packages python that you use has such a list. Barry > > Thanks. > > -- > Bob Kline > https://www.rksystems.com > mailto:bkl...@rksystems.com

Re: Should NoneType be iterable?

2023-06-20 Thread Barry via Python-list
esponsible with dealing in a application-domain specific with with that situation. In other cases I have API that returns a default list, often []. It all depends on the design needs. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

2023-06-07 Thread Barry via Python-list
> On 7 Jun 2023, at 16:39, Florian Guilbault via Python-list > wrote: > > Dear Python Technical Team, > > I hope this email finds you well. I am reaching out to you today to seek > assistance with an issue I am facing regarding the installation of 'pip' > despite my numerous attempts to reso

Re: complaint

2023-05-30 Thread Barry
ft app store stubs for python? The python.org uninstall always works in my experience, but is not related to the app store stubs. Also why do you think you need to reinstall python? It would be very unusual that that would be necessary. Barry > -- > https://mail.python.org/mailman/listinfo/p

Re: Why does IDLE use a subprocess?

2023-05-30 Thread Barry
e subprocess. You can crash idle with bugs in the code that you are developing. By running your code in a subprocess idle protects itself, and your edits from bugs in your code. Also if your code use tk then it would conflict with idle’s use of tk. That is my assumption on why the subprocess is

Re: Silly (maybe) question re imported module(s)

2023-05-19 Thread Barry Scott
simple cases it will work, but as your code gets more complex it can break. I rarely use reimport. Usually just exit python and start again. If you are working on scripts then just run them from the Terminal will work well with any need to use reimport. Barry > > > > > --

Re: Help on ImportError('Error: Reinit is forbidden')

2023-05-18 Thread Barry
On 18 May 2023, at 13:56, Jason Qian wrote:  Hi Barry, void handleError(const char* msg) { ... PyErr_Fetch(&pyExcType, &pyExcValue, &pyExcTraceback); PyErr_NormalizeException(&pyExcType, &pyExcValue, &pyExcTraceback);

Re: Help on ImportError('Error: Reinit is forbidden')

2023-05-18 Thread Barry
handleError("PyImport_Import()"); > } > } > } > void handleError(const char* msg) > { > ... > "PyImport_Import() - ImportError('Error: Reinit is forbidden')" > } You do not seem to printing out msg, you have assumed it means reinit it seems. What does

Re: Pip Error

2023-05-17 Thread Barry
changes that > could have caused this issue, but found none. I'm uncertain about the cause > of this error and how to resolve it. Any insights or suggestions would be > greatly appreciated. > > Thank you in advance for your assistance! Pip is installed by default with the pyt

Re: PythonPath / sys.path

2023-05-15 Thread Barry
e. Being a Fedora user i needed to learn how to install missing pieces of pyrhon on ubuntu. We searches for: ubuntu install pip Ubuntu install idle Both provide lots of answers. Did your searches fail to turn up answers? Barry > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: PythonPath / sys.path

2023-05-14 Thread Barry
the net for an answer but only got what I had already tried > > any pointers what I'm doing wrong (other than using windows '->) I take it you have business reasons to use an obsolete version python. Where did you get your version of python from? You seem to be doing the righ

Re: pip module not found

2023-05-12 Thread Barry
> On 12 May 2023, at 21:59, Thomas Passin wrote: > > On 5/12/2023 2:42 AM, David John wrote: >> Hi, >> I recently have been experiencing issues with the pip installation module. >> I have python version 3.11 installed. I've checked the directory installed >> in the systems variables window and

Re: pip module not found

2023-05-12 Thread Barry
ystems: > > sudo apt-get install python3-tk > > For the Yum package manager: > > yum install tkinter > > You may also need to install ImageTk: > > sudo apt-get install python3-pil.imagetk (Debian-based) > > On Centos/Red Hat derived systems, you will also nee

Re: Is npyscreen still alive?

2023-04-21 Thread Barry
/npcole/npyscreen > which returns a 404. > > There seems to be a copy in Github at > https://github.com/npcole/npyscreen/commits/master, > but the last commit was almost 4 years ago. > > Maybe it "just works" and is suitable for production? Maybe this, recently lwn.

Re: for a 'good python'

2023-04-13 Thread Barry
 > On 13 Apr 2023, at 00:19, jak wrote: > > Barry ha scritto: >>  >>>> On 12 Apr 2023, at 18:10, jak wrote: >>> Hi everyone, >>> some time ago I wrote a class to determine if an ipv4 address belonged >>> to a subnet. Seldom using pytho

Re: for a 'good python'

2023-04-12 Thread Barry
adcast}") >print(f"mask: {sn.mask}") >print(f"wildcard: {sn.wildcard}") >print(f"host_min: {sn.host_min}") >print(f"host_max: {sn.host_max}") >print(f"Avaible hosts: {sn.hosts_num}") >print(f"Class: {sn.net_class}") > >tst_hdr = '10.0.0.31' >is_not = 'is ' >if not tst_hdr in sn: >is_not = 'is NOT ' >print("hdr %s %sin range %s - %s" % > (tst_hdr, is_not, sn.host_min, sn.host_max)) > > if __name__ == '__main__': >main() There is this https://docs.python.org/3/howto/ipaddress.html if you just want a solution. Or are you after code review feedback? Barry > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows installer from python source code without access to source code

2023-04-04 Thread Barry
o C++. Once you have that installed there are bat files that setup environment in the terminal. Then you can use cl, nmake etc Barry > > -Original Message- > From: Eryk Sun > Sent: Friday, March 31, 2023 12:55 PM > To: Jim Schwartz > Cc: python-list@python.org > S

Re: [Python-Dev] Small lament...

2023-04-03 Thread Barry Warsaw
I heard it on reasonably believable authority that the FLUFL took the year off. Lamentable. -Barry > On Apr 1, 2023, at 11:19, Skip Montanaro wrote: > > Just wanted to throw this out there... I lament the loss of waking up on > April 1st to see a creative April Fool's D

Re: Problem in using libraries

2023-04-03 Thread Barry
ot;. You need to provide enough details for people to help you. Include which OS you are using. Where you got python from. How you installed the libraries you are trying to use. Commands and error messages you are seeing. Barry > -- > https://mail.python.org/mailman/listinfo/pytho

Re: Windows Gui Frontend

2023-04-01 Thread Barry Scott
macOS and Windows. I found that PyQt was easier to get working. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Python not showing correct version

2023-04-01 Thread Barry Scott
be less flexible to work with then adding a py.ini. On my Windows 11 I added %userprofile%\AppData\Local\py.ini. To make python 3.8 the default that py.exe uses put this in py.ini: [defaults] python=3.8-64 python3=3.8-64 Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Python not showing correct version

2023-03-31 Thread Barry Scott
> On 31 Mar 2023, at 09:33, Sumeet Firodia wrote: > > Thanks Barry. > > One more thing is that pip --version also refers to python 3.10 > > C:\Users\admin>pip --version > pip 23.0.1 from > C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Barry
's called math.pow. That on its own should be a strong indication > that it's designed to work with floats. So long as you know that the math module is provided to give access the C math.h functions. Barry > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Barry Scott
> On 30 Mar 2023, at 18:11, Barry Scott wrote: > > > >> On 30 Mar 2023, at 10:15, Andreas Eisele wrote: >> >> I sometimes make use of the fact that the built-in pow() function has an >> optional third argument for modulo calculation, which is handy whe

Re: Python not showing correct version

2023-03-30 Thread Barry Scott
not installed. >> WARNING: Skipping 3.10.10 as it is not installed. PIP is for installing python modules not the python program. The python program is installed by running the .exe that you get from python.org <http://python.org/>, for example. Use the standard Windows method to uninstall

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Barry Scott
that the built-in version can not do, and > if not, why is it even there? Maybe math.pow() aways using IEEE 754(?) float point via the C runtime math routines. pow() will give int answer if called with int args. Barry > Thanks in advance for any enlightening comment on

Re: found older version of python in my command prompt

2023-03-28 Thread Barry
on 3.11 from python.org and run the installer. In a cmd terminal window run py.exe and you should get the python prompt. Barry > > > > References > > Visible links > 1. https://go.microsoft.com/fwlink/?LinkId=550986 > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: PyGILState_Release called twice in embedded application

2023-03-23 Thread Barry
> On 23 Mar 2023, at 14:34, Arnaud Loonstra wrote: > > On 23-03-2023 13:33, Barry Scott wrote: >>>> On 23 Mar 2023, at 08:46, Arnaud Loonstra wrote: >>> >>> Hi all, >>> >>> I'm running in a crash due to a ResourceWarning (

Re: PyGILState_Release called twice in embedded application

2023-03-23 Thread Barry Scott
simplefilter("ignore", ResourceWarning) > > to my python code. But I'd rather prevent this from happening in the first > place. > > Any suggestion very welcomed cause I'm puzzled. What 3rd party C extension are you running with? I'd be surprised

Re: Winodws10 Command Prompt unresponsive to .py commands

2023-03-07 Thread Barry
. you can then right-click the .py file and choose whichever program you > like to open with. Use py.exe which should in the windows folder to run .py files. Barry > I'm inclined to advise you to focus on getting virtual environments working > next and leave all that auto-opening to late

Re: Bug 3.11.x behavioral, open file buffers not flushed til file closed.

2023-03-06 Thread Barry
d to the medium. WHQL? That had the effect of stooping driver manufactures having firmware to win benchmarking. Now the OS will use the commands to the drive that allow the OS to know the data is safe. Barry > > -- > Greg > -- > https://mail.python.org/mailman/listinfo/python-li

Re: Is there a more efficient threading lock?

2023-02-28 Thread Barry
s to build the int value. And some compilers indeed do, the linux kernel folks see this in gcc generated code. I understand you have to use the new atomics features. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a more efficient threading lock?

2023-02-26 Thread Barry Scott
e there are 4 byte code ops executed. Python's eval loop can switch to another thread between any of them. Its is not true that the GIL provides atomic operations in python. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a more efficient threading lock?

2023-02-25 Thread Barry
Re sqlite and threads. The C API can be compiled to be thread safe from my Reading if the sqlite docs. What I have not checked is how python’s bundled sqlite is compiled. There are claims python’s sqlite is not thread safe. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread Barry
27;t do the very > obvious and easy thing > of giving me this info: > >attempt to call + with 'abc' , > 123.45 <-- It is not easy to do that in a robust and reliable way for any object. You can end up in the code to generate the error message itself breaking. For example using unbounded CPU time when attempting to get the string repr of the variable. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Introspecting the variable bound to a function argument

2023-02-22 Thread Barry
There is the traceback module that lets you find where you are called from. Also there is the inspect module that also lets tou get at the stack in more detail. Barry > > -- > () ascii ribbon campaign -- against html e-mail > /\ www.asciiribbon.org -- against proprietary at

Re: Python: How to use the 'trace' module programmatically?

2023-02-16 Thread Barry
to do either add the outfile to trace or generate and write the report after runfunc returns. I have not tested this, just read the docs out of curiosity Here https://docs.python.org/3/library/trace.html Barry > def inner(): >print("Callee here.") > > Now I launched the program an

  1   2   3   4   5   6   7   >