python save variable to file code example
Example 1: python export variable to file
# Overwrite file
config = open('config.py', 'w')
config.write(f"""
File has been overwrite
funny = "LOL"
""")
Example 2: how to save a variable python
variable = "variable"
Example 3: how to save python variables locally
with open('train.pickle', 'wb') as f:
pickle.dump([X_train, y_train], f)