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;








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











share|improve this question


























  • 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

















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











share|improve this question


























  • 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













0












0








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











share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












2 Answers
2






active

oldest

votes


















0














You can use a file to store the variable permanently!






share|improve this answer

























  • 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



















0














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





share|improve this answer



























  • 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













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
);



);













draft saved

draft discarded


















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









0














You can use a file to store the variable permanently!






share|improve this answer

























  • 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
















0














You can use a file to store the variable permanently!






share|improve this answer

























  • 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














0












0








0







You can use a file to store the variable permanently!






share|improve this answer













You can use a file to store the variable permanently!







share|improve this answer












share|improve this answer



share|improve this answer










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 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


















  • 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

















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














0














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





share|improve this answer



























  • 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















0














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





share|improve this answer



























  • 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













0












0








0







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





share|improve this answer















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






share|improve this answer














share|improve this answer



share|improve this answer








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 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

















  • 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
















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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript