Re: [Tutor] help with subprocess module

2017-08-19 Thread Cameron Simpson
On 19Aug2017 06:13, kay Cee wrote: update_log = open('update_log.txt', 'r+') Normally one would use 'a' (append) for a log open. I don't see what 'r+' accomplishes for you. In particular I expect it would always write at the start of the log file, overwriting whatever was there. W

Re: [Tutor] help with subprocess module

2017-08-19 Thread Alan Gauld via Tutor
On 19/08/17 11:13, kay Cee wrote: > import subprocess > import time > import datetime > > class UpdateError(Exception): > pass In defining your own type of Exception you implicitly say that you will be raising it somewhere. But you never raise this exception in your code... > def update():

Re: [Tutor] help with subprocess module

2017-08-19 Thread Mats Wichmann
On 08/19/2017 04:13 AM, kay Cee wrote: > I made a python script that will update a Ubuntu Server every second and > writes asuccess message and date to a log file, but for some reason the > file is not being written to. > > Here is the Script: > > #!/usr/bin/python3 > > import subprocess > impo

Re: [Tutor] help with subprocess module

2017-08-19 Thread Peter Otten
kay Cee wrote: > I made a python script that will update a Ubuntu Server every second and > writes asuccess message and date to a log file, but for some reason the > file is not being written to. > > Here is the Script: > > > #!/usr/bin/python3 > > > > import subprocess > > import time >