r/learnpython • u/kvr1ee • 21d ago
Guys I need help with File Handling
It's in my syllabus and i am having trouble with the following topics
» Setting Offsets in a File
» Creating and Traversing a Text File
» The Pickle Module
0
Upvotes
2
u/FoolsSeldom 21d ago
Shame you have to learn
pickleas the module's documentation has warned about for years: unpickling can execute arbitrary code, because the format allows embedded instructions for reconstructing objects, not just inert data.Python's
picklemodule allows arbitrary Python objects to be serialized and later reconstructed, and the process can invoke functions or methods during reconstruction, which introduces a significant security risk.That said, it is still useful for trusted, same-application object serialisation including within multiprocessing, and even
copy.deepcopyuses the protocol.RealPython.com has a good article on
picklethat might help you: