Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create_code_file(self, track, sub_domain, filename, code, ext ) -> None:
- dir = os.path.join(BASE_DIR,self.PREFIX+track,sub_domain)
- file_path = os.path.join(dir,filename+ext)
- if not os.path.exists(dir):
- os.makedirs(dir)
- if not os.path.isfile(file_path):
- print(code, file=open(file_path, 'w'))
- else:
- print(code, file=open(file_path, 'w'))
- with open(os.path.join(path, file_path), 'wb') as temp_file:
- temp_file.write(buff)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement