Check for given filename

This commit is contained in:
Wolfgang Nowak 2023-08-31 19:48:18 +02:00
parent e5401f356e
commit 0f32983003

View file

@ -1,7 +1,8 @@
#!/usr/bin/python3 #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" Liest markdownfile ein und spuckt html aus: md2html meinmarkdownfile.md """
Liest markdownfile ein und spuckt html aus: md2html meinmarkdownfile.md
""" """
import sys, markdown2 as markdown import sys, markdown2 as markdown
@ -11,7 +12,7 @@ markdown.Markdown.extras = ["break-on-newline", "footnotes"]
try: try:
mdfile = sys.argv[1] mdfile = sys.argv[1]
except: except:
sys.exit("No file, honey.") sys.exit("No file, honey.\n"+sys.argv[0]+ ": Liest markdownfile ein und spuckt html aus: md2html meinmarkdownfile.md")
headline = mdfile.split(".md")[0] headline = mdfile.split(".md")[0]
htmlfilename = headline + ".html" htmlfilename = headline + ".html"