get_axes not present?

2021-11-18 Thread Mahmood Naderan via Python-list
Hi I am using the following versions >>> import matplotlib >>> print(matplotlib. __version__) 3.3.4 >>> import pandas as pd >>> print(pd.__version__) 1.2.3 >>> import sys >>> sys.version_info sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0) In my code, I use axes in

Re: Advantages of Default Factory in Dataclasses

2021-11-18 Thread David Lowry-Duda
On Tue, Nov 16, 2021 at 06:24:43PM -0500, Alan Bawden wrote: >```python >def add_to(elem, inlist=[]): >inlist.append(elem) >return inlist > >list1 = add_to(1) >list2 = add_to(2) >print(list1) # prints [1] >print(list2) # prints [1, 2], potentially confusin

Re: get_axes not present?

2021-11-18 Thread Mats Wichmann
On 11/18/21 02:49, Mahmood Naderan via Python-list wrote:   File "/home/mahmood/.local/lib/python3.8/site-packages/pandas/plotting/_matplotlib/core.py", line 903, in _get_subplots     ax for ax in self.axes[0].get_figure().get_axes() if isinstance(ax, Subplot) AttributeError: 'NoneType' obj

Re: get_axes not present?

2021-11-18 Thread Mahmood Naderan via Python-list
>It's not saying get_axes doesn't exist because of version skew, it's >saying that the object returned by the call to the left of it >(get_figure()) returned None, and None doesn't have methods > >Something isn't set up right, but you'll have to trace that through. Do you think the following

Re: get_axes not present?

2021-11-18 Thread Michael Torrie
On 11/18/21 10:54 AM, Mahmood Naderan via Python-list wrote: > As you can see I put the result of plot() to ax1 and then use some functions, > e.g. set_ylabel(). And what is the result of plot()? Is it a valid object, or is it None? -- https://mail.python.org/mailman/listinfo/python-list

news to me today: RIP Aahz

2021-11-18 Thread Eli the Bearded
Aahz, co-author of Python for Dummies with Stef Maruch, recently passed away. Tiny death notice (with name typo) from the wilds of the Internet: http://file770.com/pixel-scroll-10-15-21-i-know-what-pixel-you-scrolled-last-summer/ (12) AAHZ MARUCH (1967-2021). [Item by James Davis Nicoll.] Py

import question

2021-11-18 Thread lucas
hello one and all, are there any other ways to import a module or package other then the "import" or "from...import..." statements? i ask because i'm allowing programming on my web2py website and i don't want any accessing packages like os or sys. thank you in advance and have a great day, luc

several issues with pyinstaller on Windows 10

2021-11-18 Thread Ulli Horlacher
On Windows 10 I have installed: P:\W10>python --version Python 3.10.0 P:\W10>pyinstaller --version 4.7 I can compile a VERY simple Python program: P:\W10>type argv.pv #!/usr/bin/python3 import sys for a in sys.argv: print("["+a+"]") P:\W10>pyinstaller.exe --onefile tcpbm.py But I can run i

Re: import question

2021-11-18 Thread Chris Angelico
On Fri, Nov 19, 2021 at 7:09 AM lucas wrote: > > hello one and all, > > are there any other ways to import a module or package other then the > "import" or "from...import..." statements? i ask because i'm allowing > programming on my web2py website and i don't want any accessing packages like

Re: How to support annotations for a custom type in a C extension?

2021-11-18 Thread Marco Sulla
It works. Thanks a lot. On Sun, 19 Sept 2021 at 19:23, Serhiy Storchaka wrote: > > 19.09.21 05:59, MRAB пише: > > On 2021-09-18 16:09, Serhiy Storchaka wrote: > >> "(PyCFunction)" is redundant, Py_GenericAlias already has the right > >> type. Overuse of casting to PyCFunction can hide actual bugs

Re: import question

2021-11-18 Thread Dan Stromberg
On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: > If you're trying to make a Python-in-Python sandbox, I recommend not. > Instead, use an OS-level sandbox (a chroot, probably some sort of CPU > usage limiting, etc), and use that to guard the entire Python process. > Python-in-Python will b

Re: import question

2021-11-18 Thread Grant Edwards
On 2021-11-17, lucas wrote: > are there any other ways to import a module or package other then > the "import" or "from...import..." statements? i ask because i'm > allowing programming on my web2py website and i don't want any > accessing packages like os or sys. Safely allowing people to ente

Re: several issues with pyinstaller on Windows 10

2021-11-18 Thread Eryk Sun
On 11/18/21, Ulli Horlacher wrote: > > P:\W10\dist>argv a b > The process cannot access the file because it is being used by another > process. Try searching for open handles for "argv.exe" using Sysinternals Process Explorer [1]. Terminate the offending process. Since you're inexperienced with

Re: import question

2021-11-18 Thread Chris Angelico
On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg wrote: > > > On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: >> >> If you're trying to make a Python-in-Python sandbox, I recommend not. >> Instead, use an OS-level sandbox (a chroot, probably some sort of CPU >> usage limiting, etc), and use

Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-18 Thread René Silva Valdés
Hello, I would like to report the following issue: Working with floats i noticed that: int(23.99/12) returns 1, and int(23.999/12) returns 2 This implies that int() function is rounding, which doesn't appear to be expected (documentation doesn't say anything about it). Lo

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-18 Thread 2QdxY4RzWzUUiLuE
On 2021-11-18 at 23:16:32 -0300, René Silva Valdés wrote: > Hello, I would like to report the following issue: > > Working with floats i noticed that: > > int(23.99/12) returns 1, and > int(23.999/12) returns 2 > > This implies that int() function is rounding ... It's

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-18 Thread MRAB
On 2021-11-19 02:40, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2021-11-18 at 23:16:32 -0300, René Silva Valdés wrote: Hello, I would like to report the following issue: Working with floats i noticed that: int(23.99/12) returns 1, and int(23.999/12) returns 2 This

Re: import question

2021-11-18 Thread Dan Stromberg
On Thu, Nov 18, 2021 at 6:19 PM Chris Angelico wrote: > On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg > wrote: > > > > > > On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico > wrote: > >> > >> If you're trying to make a Python-in-Python sandbox, I recommend not. > >> Instead, use an OS-level sand

Re: import question

2021-11-18 Thread Chris Angelico
On Fri, Nov 19, 2021 at 3:00 PM Dan Stromberg wrote: > > > On Thu, Nov 18, 2021 at 6:19 PM Chris Angelico wrote: >> >> On Fri, Nov 19, 2021 at 11:24 AM Dan Stromberg wrote: >> > >> > >> > On Thu, Nov 18, 2021 at 12:21 PM Chris Angelico wrote: >> >> >> >> If you're trying to make a Python-in-Pyt