I have a py script which creates txt file to the same location where is script. I need to change this location to c:\ or share location. How to do that can you help?
this is script. how to change it?
def save_passwords(self):
with open('test.txt','w',encoding='utf-8') as f:
f.writelines(self.passwordList)
sorry. my script is this. how will be script look like in this situation?
def save_passwords(self):
with open(hostname + '.txt','w',encoding='utf-8') as f:
f.writelines(self.passwordList)
subprocess.check_call(["attrib","+H",hostname + ".txt"])