Modifying value of a variable until computer shuts down?Make sure only a single instance of a program is runningFastest way to get system uptime in Python in LinuxProgrammatically get last boot/shutdown timePython multiprocessing - pipe communication between processesHow to access environment variable values?How to get Registry().settings during Pyramid app startup time?Python Script, args not transferred to ScriptHow to test multiple variables against a value?Python global variable scopingPython - subprocess - getstatusoutputpython - assistance with counting loopExecute command while starting qtconsolePython3.6 |- Check if string is True or False -|Python dynamic string representing argument[i]
How does The Fools Guild make its money?
Does it make sense to occupy open space?
Casting Goblin Matron with Plague Engineer on the battlefield
Best way to explain to my boss that I cannot attend a team summit because it is on Rosh Hashana or any other Jewish Holiday
What does Fisher mean by this quote?
Double blind peer review when paper cites author's GitHub repo for code
Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?
Does bottle color affect mold growth?
Was there ever a difference between 'volo' and 'volo'?
Contractions using simplewick
Why do private jets such as Gulfstream fly higher than other civilian jets?
Is alignment needed after replacing upper control arms?
Secure my password from unsafe servers
ESTA declined to the US
What does VB stand for?
Erratic behavior by an internal employee against an external employee
Why does putting a dot after the URL remove login information?
Did silent film actors actually say their lines or did they simply improvise “dialogue” while being filmed?
Why are the inside diameters of some pipe larger than the stated size?
WordCloud: do not eliminate duplicates
Colleagues speaking another language and it impacts work
Should I take out a personal loan to pay off credit card debt?
What word can be used to describe a bug in a movie?
Can ads on a page read my password?
Modifying value of a variable until computer shuts down?
Make sure only a single instance of a program is runningFastest way to get system uptime in Python in LinuxProgrammatically get last boot/shutdown timePython multiprocessing - pipe communication between processesHow to access environment variable values?How to get Registry().settings during Pyramid app startup time?Python Script, args not transferred to ScriptHow to test multiple variables against a value?Python global variable scopingPython - subprocess - getstatusoutputpython - assistance with counting loopExecute command while starting qtconsolePython3.6 |- Check if string is True or False -|Python dynamic string representing argument[i]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm writing a program in python which has three modules:
1. settings.py
2. init.py
3. main.py
settings.py just has one Boolean variable, the goal is to use it as a global variable(let's call it var, initialised as False
) across modules
init.py imports the var, and sets it to True
after performing some actions in a function
main.py has to check whether var == True
. If yes, proceed with the program else ask user to give some command line instructions (say, prg start) which will then call a function in init.py, which in turn will also set var==True
The problem is that since I have made a program that takes arguments from CLI, the var
is always set to False. So the only command that CLI accepts is prg start
else it prints the error message that I have written.
I need some method to let var
stay True
for rest of the session, and session actually translates to until computer is switched off.
code for main.py
first = sys.argv[0]
arguments = sys.argv[1:]
second = arguments[0]
if settings.var == False and second != "start":
print "Error, type 'prg start' to start"
sys.exit(0)
if second == "start":
init.start()
This is what I'm trying to accomplish:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Success
what is happening right now:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Error, type 'prg start' to start
python raspbian uptime
add a comment |
I'm writing a program in python which has three modules:
1. settings.py
2. init.py
3. main.py
settings.py just has one Boolean variable, the goal is to use it as a global variable(let's call it var, initialised as False
) across modules
init.py imports the var, and sets it to True
after performing some actions in a function
main.py has to check whether var == True
. If yes, proceed with the program else ask user to give some command line instructions (say, prg start) which will then call a function in init.py, which in turn will also set var==True
The problem is that since I have made a program that takes arguments from CLI, the var
is always set to False. So the only command that CLI accepts is prg start
else it prints the error message that I have written.
I need some method to let var
stay True
for rest of the session, and session actually translates to until computer is switched off.
code for main.py
first = sys.argv[0]
arguments = sys.argv[1:]
second = arguments[0]
if settings.var == False and second != "start":
print "Error, type 'prg start' to start"
sys.exit(0)
if second == "start":
init.start()
This is what I'm trying to accomplish:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Success
what is happening right now:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Error, type 'prg start' to start
python raspbian uptime
Could you please provide a Minimal, Complete, and Verifiable Example?
– Andrew Naguib
Mar 27 at 6:16
@AndrewNaguib if it means posting init.py and settings.py then sure!
– TotallyNoob
Mar 27 at 6:17
Post an example of what you're trying to accomplish.
– Andrew Naguib
Mar 27 at 6:18
@AndrewNaguib can you please check now. I'm sorry, I'm not a native english speaker and it's a little hard to explain
– TotallyNoob
Mar 27 at 6:25
@PatrickArtner Linux, but Raspbian (on raspberry pi) to be precise. Almost as same as Ubuntu
– TotallyNoob
Mar 27 at 6:51
add a comment |
I'm writing a program in python which has three modules:
1. settings.py
2. init.py
3. main.py
settings.py just has one Boolean variable, the goal is to use it as a global variable(let's call it var, initialised as False
) across modules
init.py imports the var, and sets it to True
after performing some actions in a function
main.py has to check whether var == True
. If yes, proceed with the program else ask user to give some command line instructions (say, prg start) which will then call a function in init.py, which in turn will also set var==True
The problem is that since I have made a program that takes arguments from CLI, the var
is always set to False. So the only command that CLI accepts is prg start
else it prints the error message that I have written.
I need some method to let var
stay True
for rest of the session, and session actually translates to until computer is switched off.
code for main.py
first = sys.argv[0]
arguments = sys.argv[1:]
second = arguments[0]
if settings.var == False and second != "start":
print "Error, type 'prg start' to start"
sys.exit(0)
if second == "start":
init.start()
This is what I'm trying to accomplish:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Success
what is happening right now:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Error, type 'prg start' to start
python raspbian uptime
I'm writing a program in python which has three modules:
1. settings.py
2. init.py
3. main.py
settings.py just has one Boolean variable, the goal is to use it as a global variable(let's call it var, initialised as False
) across modules
init.py imports the var, and sets it to True
after performing some actions in a function
main.py has to check whether var == True
. If yes, proceed with the program else ask user to give some command line instructions (say, prg start) which will then call a function in init.py, which in turn will also set var==True
The problem is that since I have made a program that takes arguments from CLI, the var
is always set to False. So the only command that CLI accepts is prg start
else it prints the error message that I have written.
I need some method to let var
stay True
for rest of the session, and session actually translates to until computer is switched off.
code for main.py
first = sys.argv[0]
arguments = sys.argv[1:]
second = arguments[0]
if settings.var == False and second != "start":
print "Error, type 'prg start' to start"
sys.exit(0)
if second == "start":
init.start()
This is what I'm trying to accomplish:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Success
what is happening right now:
pi@raspberrypi: ~$ prg start
pi@raspberrypi: ~$ prg set color 4
Error, type 'prg start' to start
python raspbian uptime
python raspbian uptime
edited Mar 27 at 7:10
Patrick Artner
29.4k6 gold badges26 silver badges45 bronze badges
29.4k6 gold badges26 silver badges45 bronze badges
asked Mar 27 at 6:06
TotallyNoobTotallyNoob
5110 bronze badges
5110 bronze badges
Could you please provide a Minimal, Complete, and Verifiable Example?
– Andrew Naguib
Mar 27 at 6:16
@AndrewNaguib if it means posting init.py and settings.py then sure!
– TotallyNoob
Mar 27 at 6:17
Post an example of what you're trying to accomplish.
– Andrew Naguib
Mar 27 at 6:18
@AndrewNaguib can you please check now. I'm sorry, I'm not a native english speaker and it's a little hard to explain
– TotallyNoob
Mar 27 at 6:25
@PatrickArtner Linux, but Raspbian (on raspberry pi) to be precise. Almost as same as Ubuntu
– TotallyNoob
Mar 27 at 6:51
add a comment |
Could you please provide a Minimal, Complete, and Verifiable Example?
– Andrew Naguib
Mar 27 at 6:16
@AndrewNaguib if it means posting init.py and settings.py then sure!
– TotallyNoob
Mar 27 at 6:17
Post an example of what you're trying to accomplish.
– Andrew Naguib
Mar 27 at 6:18
@AndrewNaguib can you please check now. I'm sorry, I'm not a native english speaker and it's a little hard to explain
– TotallyNoob
Mar 27 at 6:25
@PatrickArtner Linux, but Raspbian (on raspberry pi) to be precise. Almost as same as Ubuntu
– TotallyNoob
Mar 27 at 6:51
Could you please provide a Minimal, Complete, and Verifiable Example?
– Andrew Naguib
Mar 27 at 6:16
Could you please provide a Minimal, Complete, and Verifiable Example?
– Andrew Naguib
Mar 27 at 6:16
@AndrewNaguib if it means posting init.py and settings.py then sure!
– TotallyNoob
Mar 27 at 6:17
@AndrewNaguib if it means posting init.py and settings.py then sure!
– TotallyNoob
Mar 27 at 6:17
Post an example of what you're trying to accomplish.
– Andrew Naguib
Mar 27 at 6:18
Post an example of what you're trying to accomplish.
– Andrew Naguib
Mar 27 at 6:18
@AndrewNaguib can you please check now. I'm sorry, I'm not a native english speaker and it's a little hard to explain
– TotallyNoob
Mar 27 at 6:25
@AndrewNaguib can you please check now. I'm sorry, I'm not a native english speaker and it's a little hard to explain
– TotallyNoob
Mar 27 at 6:25
@PatrickArtner Linux, but Raspbian (on raspberry pi) to be precise. Almost as same as Ubuntu
– TotallyNoob
Mar 27 at 6:51
@PatrickArtner Linux, but Raspbian (on raspberry pi) to be precise. Almost as same as Ubuntu
– TotallyNoob
Mar 27 at 6:51
add a comment |
2 Answers
2
active
oldest
votes
You can use a file to store the variable permanently!
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable becomeFalse
automatically if I shutdown?
– TotallyNoob
Mar 27 at 6:42
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
add a comment |
You need some kind of persistent storage that goes away on shutdown. It must also be persistent although your program is not currently running.
Solutions that come to mind:
File:
Write the last boot time into a file, also add last 'prg start
time - figure out if latter came after former:
- Linux:
last reboot
+ datetime of your last'prg start'
call - you can figure out if reboot came before/after - Windows:
systeminfo | find /i "Boot Time"
(Or whatever it is called in your language), same principle
The file does not vanish, but your "last reboot time" will reset on reboot. You could simply get away with collecting'prg start'
timestamps in your file and check "live" against the current value of "last reboot" if started with other parameters.
Server/Client:
Spawn an independent "server" process on first 'prg start'
- check if that process runs using
- pipe-communication "You there?" - silence .vs. "You there?" - "YEP" (f.e. Python multiprocessing - pipe communication between processes)
- or check if an instance of your "server" is already running (f.e. Make sure only a single instance of a program is running)
The "server" process will vanish on reboot (or when manually killed - but so does the file if you delete it...)
Related:
- Programmatically get last boot/shutdown time
- Fastest way to get system uptime in Python in Linux
Thanks @patrickartner. For this I'll need a python script that can automatically writewho
command and parse thedate and time
from it. Can you guide me in an appropriate direction? Also, how can I getdate-time
forprg start
?
– TotallyNoob
Mar 27 at 8:54
@Total No I can not guide you. Lookup the module datetime and its.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.
– Patrick Artner
Mar 27 at 10:04
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370782%2fmodifying-value-of-a-variable-until-computer-shuts-down%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use a file to store the variable permanently!
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable becomeFalse
automatically if I shutdown?
– TotallyNoob
Mar 27 at 6:42
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
add a comment |
You can use a file to store the variable permanently!
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable becomeFalse
automatically if I shutdown?
– TotallyNoob
Mar 27 at 6:42
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
add a comment |
You can use a file to store the variable permanently!
You can use a file to store the variable permanently!
answered Mar 27 at 6:40
Shubham SharmaShubham Sharma
821 silver badge8 bronze badges
821 silver badge8 bronze badges
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable becomeFalse
automatically if I shutdown?
– TotallyNoob
Mar 27 at 6:42
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
add a comment |
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable becomeFalse
automatically if I shutdown?
– TotallyNoob
Mar 27 at 6:42
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable become
False
automatically if I shutdown?– TotallyNoob
Mar 27 at 6:42
Do you mean that instead of using global variable I should use a file and read and write that? In that case, how can the variable become
False
automatically if I shutdown?– TotallyNoob
Mar 27 at 6:42
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
Exactly as mentioned by @patrick-artner! Use the filename as the last boot time. That way, you have a new file for each boot.
– Shubham Sharma
Mar 27 at 7:35
add a comment |
You need some kind of persistent storage that goes away on shutdown. It must also be persistent although your program is not currently running.
Solutions that come to mind:
File:
Write the last boot time into a file, also add last 'prg start
time - figure out if latter came after former:
- Linux:
last reboot
+ datetime of your last'prg start'
call - you can figure out if reboot came before/after - Windows:
systeminfo | find /i "Boot Time"
(Or whatever it is called in your language), same principle
The file does not vanish, but your "last reboot time" will reset on reboot. You could simply get away with collecting'prg start'
timestamps in your file and check "live" against the current value of "last reboot" if started with other parameters.
Server/Client:
Spawn an independent "server" process on first 'prg start'
- check if that process runs using
- pipe-communication "You there?" - silence .vs. "You there?" - "YEP" (f.e. Python multiprocessing - pipe communication between processes)
- or check if an instance of your "server" is already running (f.e. Make sure only a single instance of a program is running)
The "server" process will vanish on reboot (or when manually killed - but so does the file if you delete it...)
Related:
- Programmatically get last boot/shutdown time
- Fastest way to get system uptime in Python in Linux
Thanks @patrickartner. For this I'll need a python script that can automatically writewho
command and parse thedate and time
from it. Can you guide me in an appropriate direction? Also, how can I getdate-time
forprg start
?
– TotallyNoob
Mar 27 at 8:54
@Total No I can not guide you. Lookup the module datetime and its.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.
– Patrick Artner
Mar 27 at 10:04
add a comment |
You need some kind of persistent storage that goes away on shutdown. It must also be persistent although your program is not currently running.
Solutions that come to mind:
File:
Write the last boot time into a file, also add last 'prg start
time - figure out if latter came after former:
- Linux:
last reboot
+ datetime of your last'prg start'
call - you can figure out if reboot came before/after - Windows:
systeminfo | find /i "Boot Time"
(Or whatever it is called in your language), same principle
The file does not vanish, but your "last reboot time" will reset on reboot. You could simply get away with collecting'prg start'
timestamps in your file and check "live" against the current value of "last reboot" if started with other parameters.
Server/Client:
Spawn an independent "server" process on first 'prg start'
- check if that process runs using
- pipe-communication "You there?" - silence .vs. "You there?" - "YEP" (f.e. Python multiprocessing - pipe communication between processes)
- or check if an instance of your "server" is already running (f.e. Make sure only a single instance of a program is running)
The "server" process will vanish on reboot (or when manually killed - but so does the file if you delete it...)
Related:
- Programmatically get last boot/shutdown time
- Fastest way to get system uptime in Python in Linux
Thanks @patrickartner. For this I'll need a python script that can automatically writewho
command and parse thedate and time
from it. Can you guide me in an appropriate direction? Also, how can I getdate-time
forprg start
?
– TotallyNoob
Mar 27 at 8:54
@Total No I can not guide you. Lookup the module datetime and its.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.
– Patrick Artner
Mar 27 at 10:04
add a comment |
You need some kind of persistent storage that goes away on shutdown. It must also be persistent although your program is not currently running.
Solutions that come to mind:
File:
Write the last boot time into a file, also add last 'prg start
time - figure out if latter came after former:
- Linux:
last reboot
+ datetime of your last'prg start'
call - you can figure out if reboot came before/after - Windows:
systeminfo | find /i "Boot Time"
(Or whatever it is called in your language), same principle
The file does not vanish, but your "last reboot time" will reset on reboot. You could simply get away with collecting'prg start'
timestamps in your file and check "live" against the current value of "last reboot" if started with other parameters.
Server/Client:
Spawn an independent "server" process on first 'prg start'
- check if that process runs using
- pipe-communication "You there?" - silence .vs. "You there?" - "YEP" (f.e. Python multiprocessing - pipe communication between processes)
- or check if an instance of your "server" is already running (f.e. Make sure only a single instance of a program is running)
The "server" process will vanish on reboot (or when manually killed - but so does the file if you delete it...)
Related:
- Programmatically get last boot/shutdown time
- Fastest way to get system uptime in Python in Linux
You need some kind of persistent storage that goes away on shutdown. It must also be persistent although your program is not currently running.
Solutions that come to mind:
File:
Write the last boot time into a file, also add last 'prg start
time - figure out if latter came after former:
- Linux:
last reboot
+ datetime of your last'prg start'
call - you can figure out if reboot came before/after - Windows:
systeminfo | find /i "Boot Time"
(Or whatever it is called in your language), same principle
The file does not vanish, but your "last reboot time" will reset on reboot. You could simply get away with collecting'prg start'
timestamps in your file and check "live" against the current value of "last reboot" if started with other parameters.
Server/Client:
Spawn an independent "server" process on first 'prg start'
- check if that process runs using
- pipe-communication "You there?" - silence .vs. "You there?" - "YEP" (f.e. Python multiprocessing - pipe communication between processes)
- or check if an instance of your "server" is already running (f.e. Make sure only a single instance of a program is running)
The "server" process will vanish on reboot (or when manually killed - but so does the file if you delete it...)
Related:
- Programmatically get last boot/shutdown time
- Fastest way to get system uptime in Python in Linux
edited Mar 27 at 7:11
answered Mar 27 at 7:01
Patrick ArtnerPatrick Artner
29.4k6 gold badges26 silver badges45 bronze badges
29.4k6 gold badges26 silver badges45 bronze badges
Thanks @patrickartner. For this I'll need a python script that can automatically writewho
command and parse thedate and time
from it. Can you guide me in an appropriate direction? Also, how can I getdate-time
forprg start
?
– TotallyNoob
Mar 27 at 8:54
@Total No I can not guide you. Lookup the module datetime and its.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.
– Patrick Artner
Mar 27 at 10:04
add a comment |
Thanks @patrickartner. For this I'll need a python script that can automatically writewho
command and parse thedate and time
from it. Can you guide me in an appropriate direction? Also, how can I getdate-time
forprg start
?
– TotallyNoob
Mar 27 at 8:54
@Total No I can not guide you. Lookup the module datetime and its.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.
– Patrick Artner
Mar 27 at 10:04
Thanks @patrickartner. For this I'll need a python script that can automatically write
who
command and parse the date and time
from it. Can you guide me in an appropriate direction? Also, how can I get date-time
for prg start
?– TotallyNoob
Mar 27 at 8:54
Thanks @patrickartner. For this I'll need a python script that can automatically write
who
command and parse the date and time
from it. Can you guide me in an appropriate direction? Also, how can I get date-time
for prg start
?– TotallyNoob
Mar 27 at 8:54
@Total No I can not guide you. Lookup the module datetime and its
.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.– Patrick Artner
Mar 27 at 10:04
@Total No I can not guide you. Lookup the module datetime and its
.now()
method to get the current time. You can search if the systeminfo command is already python wrapped - if not, call it from your script and pipe the result into a file (f.e.) and read that in and get the stuff you need from it. Divide and conquer the tasks you need to accomplish - if you get stuck on one of them, ask a new question.– Patrick Artner
Mar 27 at 10:04
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370782%2fmodifying-value-of-a-variable-until-computer-shuts-down%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you please provide a Minimal, Complete, and Verifiable Example?
– Andrew Naguib
Mar 27 at 6:16
@AndrewNaguib if it means posting init.py and settings.py then sure!
– TotallyNoob
Mar 27 at 6:17
Post an example of what you're trying to accomplish.
– Andrew Naguib
Mar 27 at 6:18
@AndrewNaguib can you please check now. I'm sorry, I'm not a native english speaker and it's a little hard to explain
– TotallyNoob
Mar 27 at 6:25
@PatrickArtner Linux, but Raspbian (on raspberry pi) to be precise. Almost as same as Ubuntu
– TotallyNoob
Mar 27 at 6:51