Skip to content

Instantly share code, notes, and snippets.

@jtarang
Created November 5, 2018 21:14
Show Gist options
  • Save jtarang/06359c9e9466229c66fc4c2dbd89988a to your computer and use it in GitHub Desktop.
Save jtarang/06359c9e9466229c66fc4c2dbd89988a to your computer and use it in GitHub Desktop.
class FileWriter():
def __init__(self):
print('runs asap')
self.filename = 'crap.txt'
def write2file(self, data):
with open(self.filename, 'w') as f:
f.write(data)
F = FileWriter()
F.filename = 'changefilename.txt'
F.write2file(data='sfasdlkfasdlflasd')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment