new.py 539 B

123456789101112131415161718
  1. #!/usr/bin/env python3
  2. import datetime
  3. if __name__ == "__main__":
  4. print("\033[94mBlog Template Generator v1.0 by \033[1mRyozuki\033[0m")
  5. print("-------")
  6. name = input("Filename: ")
  7. title = input("Title: ")
  8. about = input("About: ")
  9. tags = input("Tags (comma separated): ")
  10. date = datetime.datetime.now()
  11. with open(f"blog/{name}.info", 'w') as f:
  12. f.write(title + "\n" + about + "\n" + str(date) + "\n" + tags + "\n")
  13. with open(f"blog/{name}.md", 'w') as f:
  14. f.write("# -{title}\n")