Re: Is there anything in the script which could cause it to not run its full course please?

2020-05-05 Thread Cameron Simpson

On 04May2020 17:17, ozst...@gmail.com  wrote:

On Tuesday, 5 May 2020 01:35:42 UTC+10, David Raymond  wrote:

Not necessarily the cause of your problem, but if you're going to compare dates 
it should be as objects, or as text as year-month-day. Here you're comparing 
dates as text in day-month-year format. So January first  comes before May 
4th 2020

"01-01-" < "04-05-2020"

[...]


Thank you, see what you mean. I have corrected this now.


It seem worth pointing out that this is why many of us like ISO8601 
dates, which are written from largest component to smallest component.  
For example:


   2020-05-04

They have the convenient property of sorting lexically as they would 
sort numerically.


But David's right on in saying that if you're comparing numbers, do it 
numerically. Comparing text when the underlying thing isn't text is the 
wrong approach.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Is there anything in the script which could cause it to not run its full course please?

2020-05-04 Thread ozstar1
On Tuesday, 5 May 2020 01:35:42 UTC+10, David Raymond  wrote:
> Not necessarily the cause of your problem, but if you're going to compare 
> dates it should be as objects, or as text as year-month-day. Here you're 
> comparing dates as text in day-month-year format. So January first  comes 
> before May 4th 2020
> 
> "01-01-" < "04-05-2020"
> 
> ...
> 04-05-2020 09:30:00 40
> 04-05-2020 12:30:00 40
> 04-05-2020 15:30:00 40
> 04-05-2020 22:30:00 40
> ...
> input_date,input_time,input_duration=date_time_duration.split(' ')
> current_datetime = datetime.datetime.now()
> current_date = current_datetime.strftime('%d-%m-%Y')
> if(input_date>=current_date):
>while(True):
> ...

Thank you, see what you mean. I have corrected this now.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there anything in the script which could cause it to not run its full course please?

2020-05-04 Thread ozstar1


Many thanks for your help. It is really appreciated. I see both your points and 
maybe this is where my problems lays. 

If for example it starts (and it does) at 9.30am then the print is.. 
streaming  It is supposed to wait for the 40 minutes, stop then print 
this.. Waiting for the next stream to start at 12:30 however I get this same 
message maybe 4 minutes in, not 40.

I have checked for admin 'events' in Win10 1909 however there is nothing there, 
and the start menu has only 3 items, none that would effect this.

The box doesn't have anything else running, as it is virtually dedicated to 
this streaming. It has two displays, one for the stream program and the other 
for the dos box, so nothing is on the streamer screen where the mouse clicks.

Once again many thanks and let me digest your info. 
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Is there anything in the script which could cause it to not run its full course please?

2020-05-04 Thread David Raymond
Not necessarily the cause of your problem, but if you're going to compare dates 
it should be as objects, or as text as year-month-day. Here you're comparing 
dates as text in day-month-year format. So January first  comes before May 
4th 2020

"01-01-" < "04-05-2020"

...
04-05-2020 09:30:00 40
04-05-2020 12:30:00 40
04-05-2020 15:30:00 40
04-05-2020 22:30:00 40
...
input_date,input_time,input_duration=date_time_duration.split(' ')
current_datetime = datetime.datetime.now()
current_date = current_datetime.strftime('%d-%m-%Y')
if(input_date>=current_date):
   while(True):
...
-- 
https://mail.python.org/mailman/listinfo/python-list