Can you version control pickle files with git?

Can you track the changes to pickle files with git like you can with csv? If you have a 1GB pickle file and you add 0.1GB to it each day and then push the changes to github, will it push the 0.1GB diff or the entire 1GB file? I need to choose a file type… Read More Can you version control pickle files with git?

Converting the output of pickle.dumps() into a string and back?

In my Python program, I have a list with some objects from a custom class: # Some example program, not the actual code. class SomeClass: def __init__(self): import random import os self.thing = random.randint(5,15) self.thing2 = str(os.urandom(16)) self.thing3 = random.randint(1,10) self.thing4 = "You get the idea" a_list = [SomeClass(),SomeClass(),SomeClass(),SomeClass(),SomeClass()] import pickle print((pickle.dumps(a_list))) I need to… Read More Converting the output of pickle.dumps() into a string and back?

Get only the txt file you want from the folder containing the txt file – Python

I have a folder with a .txt files. the name of the files are: my_file1.txt my_file2.txt my_file3.txt my_file4.txt In this way, only the last number is different. import pickle my_list = [] with open("/Users/users_a/Desktop/website-basic/sub_domain/sub_domain01.txt", "rb") as f1, open("/Users/users_a/Desktop/website-ba\ sic/sub_domain/sub_domain02.txt", "rb") as f2, open("/Users/users_a/Desktop/website- basic/sub_domain/sub_domain03.txt", "rb") as f3: my_list.append(pickle.load(f1)) my_list.append(pickle.load(f2)) my_list.append(pickle.load(f3)) print(my_list) In this way, I… Read More Get only the txt file you want from the folder containing the txt file – Python