embeddedengineer / python_task Goto Github PK
View Code? Open in Web Editor NEWTask requirement : - open a new binary file with size 10 kilo bytes. Fill it with random bits - every 10 seconds, a random number ranging from 0 bits to 100 bits are appended to the file - every 20 seconds, a random number of bits ranging from 0 bits to 50 bits are removed from the beginning of the file - if the file size reached 20 kilo bytes, do the following: + Write down in a log file the time when it reached the 20 kilo bytes, the number of times the file was appended with bits, and the number of times the bits were removed + Reduce the size to 10 kilo bytes by taking only the first 10 kilo bytes of the file and ignoring the rest + Send an email to indicate that the file has reached this threshold + Repeat the process, and use the same log file everytime and keep the old information