Create Restic Backup Program

I’m sharing a wrapper program written in python to backup my files in my device using restic. import subprocess restic_command = ['restic', 'backup'] backup = ["C:\\Users\\veronica\\ibisPaint", "C:\\Users\\veronica\\Pictures", "C:\\Users\\veronica\\Documents"] print("List of directories to be backed up:\n" ) #list the files that will be backed up. #enumerate = allows you to keep track of the number of iterations in a loop. for number, dir in enumerate(backup, start=1): print(f" {number}. {dir}") # Or: print(" " + str(number) + ".", letter ) # \n makes a new line print("\nBackup process started...\n") # combines the lists together. backup_command = restic_command + backup restic = subprocess.run(backup_command, shell=True) The end. -w- ...

December 30, 2024 · 1 min · SourFox

Assignment 5: Elements and Indices

Today I had to do another assignment which is to create a python program which prints the elements of a list followed by their corresponding indices. Each element and its index must be on the same line seperated by a space. And if the list is empty, print “Empty List”. I’m going to make a list called num and put 1 to 4 inside. num = [1, 2, 3, 4] Then I’ll use the if statement to do: ...

November 11, 2023 · 2 min · SourFox