Re: src layout for projects seems not so popular

2021-08-31 Thread Abdur-Rahmaan Janhangeer
Also a takeaway from my package experience is that even though __init__.py is not needed for module import, it's still needed for packaging (py3.8). Find won't find the module else. Kind Regards, Abdur-Rahmaan Janhangeer about | blog

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread MRAB
On 2021-08-31 02:16, dn via Python-list wrote: On 31/08/2021 11.07, Dennis Lee Bieber wrote: On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy...@gmail.com" declaimed the following: ... Might have helped to mention you were in China... To me, CST is North America Central Standard Time

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Chris Angelico
On Tue, Aug 31, 2021 at 8:55 PM MRAB wrote: > > On 2021-08-31 02:16, dn via Python-list wrote: > > On 31/08/2021 11.07, Dennis Lee Bieber wrote: > >> On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy...@gmail.com" > >> declaimed the following: > > ... > > > >> Might have helped to mention you

Re: PEP Idea: Real private attribute

2021-08-31 Thread Calvin Spealman
The right way for those decorators to hold some private information, imho, isn't to put anything on the decorated object at all, but to use a weak-ref dictionary using the target object as a key. On Sat, Aug 28, 2021 at 5:42 PM Mehrzad Saremi wrote: > Python currently uses name mangling for doub

Re: Making command-line args available to deeply-nested functions

2021-08-31 Thread George Fischhof
George Fischhof ezt írta (időpont: 2021. aug. 29., V, 21:27): > > > Loris Bennett ezt írta (időpont: 2021. aug. > 26., Cs, 16:02): > >> George Fischhof writes: >> >> [snip (79 lines)] >> >> >> > Hi, >> >> > >> >> > Also you can give a try to click and / or typer packages. >> >> > Putting args

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread hongy...@gmail.com
On Tuesday, August 31, 2021 at 7:55:51 AM UTC+8, Dennis Lee Bieber wrote: > On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy...@gmail.com" > declaimed the following: > >On Ubuntu 20.04.2 LTS, I use the > >[recent2](https://github.com/dotslash/recent2/blob/master/recent2.py) to log > >and query

Re: urgent

2021-08-31 Thread jak
Il 31/08/2021 03:05, Python ha scritto: Hari wrote: i was download ur python software but it is like boring user interface for me like young student to learn ,can u have any updates? God, let me die please... Oh no, please don't speak in that way ... evidently now that python has reached

Struggling to understand timedelta rpesentation when applying an offset for an hour earlier - why is days = -1?

2021-08-31 Thread dcs3spp via Python-list
Hi, I wonder if anyone can help I am struggling to understand the representation of timedelta when used in conjunction with astimezone. Given the code below, in a python interactive interpreter, I am trying to calculate a resultant datetime an hour earlier from a UTC datetime ```bash

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Alan Gauld via Python-list
On 31/08/2021 13:45, Chris Angelico wrote: > (I find the Ireland situation particularly amusing. Time zones and daylight saving arrangements in particular are a nightmare at the micro level. I once worked on a large customer support application which required all dates/times to be viewable in UT

Create a real-time interactive TUI using Python.

2021-08-31 Thread hongy...@gmail.com
I want to know whether python can be used to create real-time interactive TUI, as hstr [1] does. [1] https://github.com/dvorka/hstr Regards, HY -- https://mail.python.org/mailman/listinfo/python-list

Trouble propagating logging configuration

2021-08-31 Thread Loris Bennett
Hi, I am having difficulty getting the my logging configuration passed on to imported modules. My initial structure was as follows: $ tree blorp/ blorp/ |-- blorp | |-- __init__.py | |-- bar.py | |-- foo.py | `-- main.py `-- pyproject.toml whereby the logging configurati

Re: Trouble propagating logging configuration

2021-08-31 Thread Loris Bennett
"Loris Bennett" writes: > Hi, > > I am having difficulty getting the my logging configuration passed on > to imported modules. > > My initial structure was as follows: > > $ tree blorp/ > blorp/ > |-- blorp > | |-- __init__.py > | |-- bar.py > | |-- foo.py > | `-- main.py >

Re: urgent

2021-08-31 Thread Hari
Yes, I can. Why do you want python? option: ? What task do you want to solve with python? option: ? Why python? option: ? Why not any other language? option: ? On Tue, Aug 31, 2021 at 3:08 AM Igor Korot wrote: > Hi, > > On Mon, Aug 30, 2021 at 4:34 PM Hari > wrote: > > > > i was download ur py

Re: urgent

2021-08-31 Thread Igor Korot
Hi, On Tue, Aug 31, 2021 at 12:44 AM Hari wrote: > > Yes, I can. Why do you want python? > option: ? What do you mean - "option". I am actually asking you why you want python? > What task do you want to solve with python? > option: ? See above. > Why python? > option: ? > Why not any other la

Re: Create a real-time interactive TUI using Python.

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 1:59 AM hongy...@gmail.com wrote: > > I want to know whether python can be used to create real-time interactive > TUI, as hstr [1] does. > > [1] https://github.com/dvorka/hstr > Yes. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP Idea: Real private attribute

2021-08-31 Thread Mehrzad Saremi
Calvin, even if the language offered truly private members? On Tue, 31 Aug 2021 at 17:31, Calvin Spealman wrote: > The right way for those decorators to hold some private information, imho, > isn't to put anything on the decorated object at all, but to use a weak-ref > dictionary using the targe

Re: Trouble propagating logging configuration

2021-08-31 Thread Dieter Maurer
Loris Bennett wrote at 2021-8-31 15:25 +0200: >I am having difficulty getting the my logging configuration passed on >to imported modules. > >My initial structure was as follows: > > $ tree blorp/ > blorp/ > |-- blorp > | |-- __init__.py > | |-- bar.py > | |-- foo.py > | `-- main.py

Re: src layout for projects seems not so popular

2021-08-31 Thread Paul Bryan
An interesting thread in PyPA (with links to other threads) discussing src layout: https://github.com/pypa/packaging.python.org/issues/320 On Tue, 2021-08-31 at 10:53 +0400, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Just an observation. Out of Github's trending repos for > Python for

Re: Struggling to understand timedelta rpesentation when applying an offset for an hour earlier - why is days = -1?

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 1:55 AM dcs3spp via Python-list wrote: > > Hi, > > I wonder if anyone can help > > I am struggling to understand the representation of timedelta when used in > conjunction with astimezone. > > Given the code below, in a python interactive interpreter, I am trying to >

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
On 01/09/2021 00.45, Chris Angelico wrote: > On Tue, Aug 31, 2021 at 8:55 PM MRAB wrote: >> On 2021-08-31 02:16, dn via Python-list wrote: >>> On 31/08/2021 11.07, Dennis Lee Bieber wrote: On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy...@gmail.com" declaimed the following: >>> ... >>

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 6:38 AM dn via Python-list wrote: > > Yeah. I do recommend making good use of the IANA tzinfo database > > though (especially since Python 3.9 made that a bit easier to access), > > as it's usually easier to get people to tell you what city/state > > they're in, rather than

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread 2QdxY4RzWzUUiLuE
On 2021-09-01 at 08:36:55 +1200, dn via Python-list wrote: > ... there is less consideration about working-out what time it is in > Pune cf Kolkata, than between (say) San Francisco and Denver - > although they are in the same country, are they in the same time-zone, > or not? (they aren't!) Wh

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 7:17 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2021-09-01 at 08:36:55 +1200, > dn via Python-list wrote: > > > ... there is less consideration about working-out what time it is in > > Pune cf Kolkata, than between (say) San Francisco and Denver - > > although the

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread 2QdxY4RzWzUUiLuE
On 2021-09-01 at 07:32:43 +1000, Chris Angelico wrote: > On Wed, Sep 1, 2021 at 7:17 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > What about Phoenix? In the winter, it's the same time there as it is in > > San Francisco, but in the summer, it's the same time there as it is in > > Denver (

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 7:54 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2021-09-01 at 07:32:43 +1000, > Chris Angelico wrote: > > > On Wed, Sep 1, 2021 at 7:17 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > What about Phoenix? In the winter, it's the same time there as it is in

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread MRAB
On 2021-08-31 22:53, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2021-09-01 at 07:32:43 +1000, Chris Angelico wrote: On Wed, Sep 1, 2021 at 7:17 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > What about Phoenix? In the winter, it's the same time there as it is in > San Francisco, but in

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 8:22 AM MRAB wrote: > > [snip] > In the EU, DST in the member states changes at the same time. It's not > like the US where it ripples across the timezones, so the differences > vary during the change. It all happens in one go. > Ah, good to know. I think that actually make

Re: urgent

2021-08-31 Thread Barry
 > On 31 Aug 2021, at 16:53, jak wrote: > > Il 31/08/2021 03:05, Python ha scritto: >> Hari wrote: >>> i was download ur python software but it is like boring user interface for >>> me like young student to learn ,can u have any updates? >> God, let me die please... > > Oh no, please don't sp

Re: urgent

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 9:03 AM Barry wrote: > > > > > On 31 Aug 2021, at 16:53, jak wrote: > > > > Il 31/08/2021 03:05, Python ha scritto: > >> Hari wrote: > >>> i was download ur python software but it is like boring user interface for > >>> me like young student to learn ,can u have any update

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
On 01/09/2021 09.13, Chris Angelico wrote: > On Wed, Sep 1, 2021 at 6:38 AM dn via Python-list > wrote: >>> Yeah. I do recommend making good use of the IANA tzinfo database >>> though (especially since Python 3.9 made that a bit easier to access), >>> as it's usually easier to get people to tell y

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread MRAB
On 2021-08-31 23:31, Chris Angelico wrote: On Wed, Sep 1, 2021 at 8:22 AM MRAB wrote: [snip] In the EU, DST in the member states changes at the same time. It's not like the US where it ripples across the timezones, so the differences vary during the change. It all happens in one go. Ah, goo

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 9:20 AM dn via Python-list wrote: > > On 01/09/2021 09.13, Chris Angelico wrote: > > On Wed, Sep 1, 2021 at 6:38 AM dn via Python-list > > wrote: > >>> Yeah. I do recommend making good use of the IANA tzinfo database > >>> though (especially since Python 3.9 made that a bit

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
> Yeah. And if you think you've heard it all, sign up for the > tzdata-announce mailing list and wait for the next phenomenon. I think > Egypt (Africa/Cairo) is currently in the lead for weirdest timezone > change, for (with short notice) announcing that they'd have DST during > summer but not duri

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
On 01/09/2021 11.27, MRAB wrote: > On 2021-08-31 23:31, Chris Angelico wrote: >> On Wed, Sep 1, 2021 at 8:22 AM MRAB wrote: >>> >>> [snip] >>> In the EU, DST in the member states changes at the same time. It's not >>> like the US where it ripples across the timezones, so the differences >>> vary d

RE: urgent (actually NOT urgent at all.)

2021-08-31 Thread Avi Gross via Python-list
This is a bit sillier then some other discussions here! There are many programs (especially back when more command-line programs were used) that presented default prompts like "$" and many or most of them let you over-ride it. Can someone tell this person that if >>> is not pleasing, they can d

Re: Struggling to understand timedelta rpesentation when applying an offset for an hour earlier - why is days = -1?

2021-08-31 Thread Dennis Lee Bieber
On Tue, 31 Aug 2021 03:59:52 -0700 (PDT), dcs3spp via Python-list declaimed the following: >I cannot understand why the resultant datetime.timedelta is days=-1, >seconds=82800 (23 hours) . > Read the documentation... https://docs.python.org/3/library/datetime.html#timedelta-objects >

Re: urgent

2021-08-31 Thread Grant Edwards
On 2021-08-29, Hari wrote: > i was download ur python software but it is like boring user > interface for me like young student to learn ,can u have any > updates? Check the calendar, it must be September again... Well, almost. -- Grant Edwards grant.b.edwardsYow! Did I

Re: Create a real-time interactive TUI using Python.

2021-08-31 Thread Dennis Lee Bieber
On Tue, 31 Aug 2021 06:12:42 -0700 (PDT), "hongy...@gmail.com" declaimed the following: >I want to know whether python can be used to create real-time interactive TUI, >as hstr [1] does. > Most of these utilities appear to rely upon embedding commands into the OS SHELL prompt. You could

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Michael F. Stemper
On 31/08/2021 16.13, Chris Angelico wrote: But ultimately, it all just means that timezones are too hard for humans to handle, and we MUST handle them using IANA's database. It is the only way. Tom Scott makes this point quite strongly on Computerphile:

Re: Create a real-time interactive TUI using Python.

2021-08-31 Thread hongy...@gmail.com
On Wednesday, September 1, 2021 at 12:49:51 AM UTC+8, Chris Angelico wrote: > On Wed, Sep 1, 2021 at 1:59 AM hongy...@gmail.com wrote: > > > > I want to know whether python can be used to create real-time interactive > > TUI, as hstr [1] does. > > > > [1] https://github.com/dvorka/hstr > > >

Re: Create a real-time interactive TUI using Python.

2021-08-31 Thread Christian Gollwitzer
Am 31.08.21 um 18:49 schrieb Chris Angelico: On Wed, Sep 1, 2021 at 1:59 AM hongy...@gmail.com wrote: I want to know whether python can be used to create real-time interactive TUI, as hstr [1] does. [1] https://github.com/dvorka/hstr Yes. I think he also would like to know, how to achie

Request for argmax(list) and argmin(list)

2021-08-31 Thread ABCCDE921
I dont want to import numpy argmax(list) returns index of (left most) max element argmin(list) returns index of (left most) min element -- https://mail.python.org/mailman/listinfo/python-list

Re: Request for argmax(list) and argmin(list)

2021-08-31 Thread Paul Bryan
Why not: >>> l = [1, 3, 5, 9, 2, 7] >>> l.index(max(l)) 3 >>> l.index(min(l)) 0 On Tue, 2021-08-31 at 21:25 -0700, ABCCDE921 wrote: > I dont want to import numpy > > argmax(list) >    returns index of (left most) max element > >  argmin(list) >    returns index of (left most) min element --