Dennis,
> No surprise there... All that statement does is create a
> Python datetime object/instance initialized to a particular
> date/time value -- and then throws it away..
After a few hours I realized that that might be the case. Would have
expected at least a warning for that creating-but-not-using-it though.
> First recommendation -- forget the interactive shell... It is
> really just meant for testing snippets of code.
And thats what I'm doing, as a python user of less than a week (have been
programming for a number of years though). :-)
> Second -- study the Python Library Reference manual... I'd direct
> you to the section on subprocess.popen()
And that makes me feel like I'm back in my BASIC days, having to shell for
all the interesting stuff ...
I also found a solution using "subprocess.call()"
https://stackoverflow.com/questions/27363487/setting-the-time-and-date-via-pyth
on-linux
although I had to combine all the arguments to a single one (why?) it does
seem to work.
Its just that I could not believe that I would have to do it that way.
> this helps prevent someone walking by a logged in machine
> from randomly doing "sudo something-malicious"
:-) I have the Pi open to be able to connect stuff to its GPIO. If someone
wanted to do something malicious than just going over them with a coin
(short-circuiting them) would likely destroy a few - instead of just having
to re-install. Or even just "by accident" spilling some liquid onto it
would be enough.
But ... Really no method to do it from within python (even if I would have
to use "sudo python3 {script.py}")? Bizarre.
Regards,
Rudy Wieser
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|