Re: No shortcut Icon on Desktop

2022-04-14 Thread Mats Wichmann
On 4/14/22 18:06, Grant Edwards wrote: > On 2022-04-14, Richard Damon wrote: > >> I think the issue is that the 'python' interpreter/compiler isn't the >> sort of program that makes sense to make a desktop icon for, as it is a >> command line utility. > > Yes, it is a command line utility. Why

Re: No shortcut Icon on Desktop

2022-04-14 Thread Grant Edwards
On 2022-04-14, Richard Damon wrote: > I think the issue is that the 'python' interpreter/compiler isn't the > sort of program that makes sense to make a desktop icon for, as it is a > command line utility. Yes, it is a command line utility. Why does that mean you shouldn't have a desktop short

Re: No shortcut Icon on Desktop

2022-04-14 Thread Mats Wichmann
On 4/14/22 17:08, Richard Damon wrote: > I think the issue is that the 'python' interpreter/compiler isn't the > sort of program that makes sense to make a desktop icon for, as it is a > command line utility. > > Perhaps making an icon for IDLE, if it has also been installed, but then > the issue

Re: No shortcut Icon on Desktop

2022-04-14 Thread Richard Damon
On 4/14/22 2:42 PM, Mirko via Python-list wrote: Am 13.04.2022 um 20:39 schrieb Dennis Lee Bieber: On Thu, 14 Apr 2022 03:38:11 +1000, Tim Deke declaimed the following: Dear Sir, I have successfully downloaded Python into my laptop but the shortcut icon is not appearing on the desktop. I am

Re: error of opening Python

2022-04-14 Thread Andrew Hernandez
that is not an error, its simply the python console intrepeter -- https://mail.python.org/mailman/listinfo/python-list

Re: No shortcut Icon on Desktop

2022-04-14 Thread Grant Edwards
On 2022-04-14, Mirko via Python-list wrote: >> Python normally does not create "shortcut icon"s -- one downloads an > > The Python Windows installer *absolutely* should. Agreed. I'm not much of a Windows user, but I do maintain a few Windows applications with installers. They all create des

Re: No shortcut Icon on Desktop

2022-04-14 Thread Mirko via Python-list
Am 13.04.2022 um 20:39 schrieb Dennis Lee Bieber: > On Thu, 14 Apr 2022 03:38:11 +1000, Tim Deke declaimed > the following: > >> Dear Sir, >> >> I have successfully downloaded Python into my laptop but the shortcut icon >> is not appearing on the desktop. I am using Windows 10 with the PC >> spec

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Jon Ribbens via Python-list
On 2022-04-14, MRAB wrote: > On 2022-04-14 16:22, Jon Ribbens via Python-list wrote: >> On 2022-04-14, Paul Bryan wrote: >>> I think because minutes and hours can easily be composed by multiplying >>> seconds. days is separate because you cannot compose days from seconds; >>> leap seconds are app

RE: Functionality like local static in C

2022-04-14 Thread Schachner, Joseph
Yes, python has something like that. In fact, two things. 1) Generator. Use a "yield" statement. Every call "yields" a new value. The state of the function (local variables) is remembered from each previous call to the next. 2) In a file, declare a variable to be global. In the funct

Re: Functionality like local static in C

2022-04-14 Thread Chris Angelico
On Fri, 15 Apr 2022 at 03:53, Sam Ezeh wrote: > > I've seen people use function attributes for this. > ``` > Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> def function(): > ... print(function.var

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Chris Angelico
On Fri, 15 Apr 2022 at 00:54, Loris Bennett wrote: > > Hi, > > With Python 3.9.2 I get > > $ import datetime > $ s = "1-00:01:01" > $ t = datetime.datetime.strptime(s, "%d-%H:%M:%S") > $ d = datetime.timedelta(days=t.day, hours=t.hour, minutes=t.minute, > seconds=t.second) > $ d.days >

Re: Functionality like local static in C

2022-04-14 Thread Dieter Maurer
Cecil Westerhof wrote at 2022-4-14 17:02 +0200: >In C when you declare a variable static in a function, the variable >retains its value between function calls. >The first time the function is called it has the default value (0 for >an int). >But when the function changes the value in a call (for ex

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Chris Angelico
On Fri, 15 Apr 2022 at 03:45, Marco Sulla wrote: > > On Thu, 14 Apr 2022 at 19:16, MRAB wrote: > > > > When you're working only with dates, timedelta not having a 'days' > > attribute would be annoying, especially when you consider that a day is > > usually 24 hours, but sometimes 23 or 25 hours

Re: Functionality like local static in C

2022-04-14 Thread Joe Pfeiffer
Cecil Westerhof writes: > In C when you declare a variable static in a function, the variable > retains its value between function calls. > The first time the function is called it has the default value (0 for > an int). > But when the function changes the value in a call (for example to 43), > t

Re: Functionality like local static in C

2022-04-14 Thread Sam Ezeh
I've seen people use function attributes for this. ``` Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> def function(): ... print(function.variable) ... function.variable += 1 ... >>> function.variab

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Marco Sulla
On Thu, 14 Apr 2022 at 19:16, MRAB wrote: > > When you're working only with dates, timedelta not having a 'days' > attribute would be annoying, especially when you consider that a day is > usually 24 hours, but sometimes 23 or 25 hours (DST). I agree. Furthermore, timedelta is, well, a time delta

Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-04-14 Thread Marco Sulla
On Wed, 13 Apr 2022 at 20:05, Peter J. Holzer wrote: > > On 2022-04-12 21:03:00 +0200, Marco Sulla wrote: > > On Tue, 29 Mar 2022 at 00:10, Peter J. Holzer wrote: > > > They are are about a year apart, so they will usually contain different > > > versions of most packages right from the start. So

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread MRAB
On 2022-04-14 16:22, Jon Ribbens via Python-list wrote: On 2022-04-14, Paul Bryan wrote: I think because minutes and hours can easily be composed by multiplying seconds. days is separate because you cannot compose days from seconds; leap seconds are applied to days at various times, due to irre

Re: Functionality like local static in C

2022-04-14 Thread Mirko via Python-list
Am 14.04.2022 um 17:02 schrieb Cecil Westerhof via Python-list: > In C when you declare a variable static in a function, the variable > retains its value between function calls. > The first time the function is called it has the default value (0 for > an int). > But when the function changes the va

Re: Functionality like local static in C

2022-04-14 Thread Barry
> On 14 Apr 2022, at 16:28, Cecil Westerhof via Python-list > wrote: > > In C when you declare a variable static in a function, the variable > retains its value between function calls. > The first time the function is called it has the default value (0 for > an int). > But when the function c

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Jon Ribbens via Python-list
On 2022-04-14, Paul Bryan wrote: > I think because minutes and hours can easily be composed by multiplying > seconds. days is separate because you cannot compose days from seconds; > leap seconds are applied to days at various times, due to > irregularities in the Earth's rotation. That's an argu

Functionality like local static in C

2022-04-14 Thread Cecil Westerhof via Python-list
In C when you declare a variable static in a function, the variable retains its value between function calls. The first time the function is called it has the default value (0 for an int). But when the function changes the value in a call (for example to 43), the next time the function is called th

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Lars Liedtke
Additionally, which datatype would you expect them to be returned in? One could argument for int or float (Decimal?),  both could be valid datatypes, depending on how exact you might want them, while the second is the time base of SI units. Cheers Lars -- Lars Liedtke Software Entwickler

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Paul Bryan
I think because minutes and hours can easily be composed by multiplying seconds. days is separate because you cannot compose days from seconds; leap seconds are applied to days at various times, due to irregularities in the Earth's rotation. On Thu, 2022-04-14 at 15:38 +0200, Loris Bennett wrote:

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Loris Bennett
"Loris Bennett" writes: > Hi, > > With Python 3.9.2 I get > > $ import datetime > $ s = "1-00:01:01" > $ t = datetime.datetime.strptime(s, "%d-%H:%M:%S") > $ d = datetime.timedelta(days=t.day, hours=t.hour, minutes=t.minute, > seconds=t.second) > $ d.days > 1 > $ d.seconds > 61 >

Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Loris Bennett
Hi, With Python 3.9.2 I get $ import datetime $ s = "1-00:01:01" $ t = datetime.datetime.strptime(s, "%d-%H:%M:%S") $ d = datetime.timedelta(days=t.day, hours=t.hour, minutes=t.minute, seconds=t.second) $ d.days 1 $ d.seconds 61 $ d.minutes AttributeError: 'datetime.timedelta