Skip to content

Instantly share code, notes, and snippets.

@KaushikShresth07
Created June 12, 2021 13:30
Show Gist options
  • Select an option

  • Save KaushikShresth07/740a32a1f04f3786dbc56c51e9851ebf to your computer and use it in GitHub Desktop.

Select an option

Save KaushikShresth07/740a32a1f04f3786dbc56c51e9851ebf to your computer and use it in GitHub Desktop.
import os
from datetime import datetime
def Notepad(Content,PathNow,PathToSave):
time = datetime.now().strftime("%H:%M")
filename = str(time).replace(":","-") + "-note.txt"
with open(filename,"w") as file:
file.write(Content)
path_1 = str(PathNow) + str(filename)
path_2 = str(PathToSave) + str(filename)
os.rename(path_1,path_2)
os.startfile(path_2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment