Flask render template doesn't render my html page keep getting "internal server error"

Running flask 2.1 w/ python 3.10 trying to create a small app here’s my main.py file contents and directory setup from waitress import serve app = Flask(__name__, template_folder=’/templates’) @app.route("/") def startService(): return "Simple Web app" @app.route("/home") def ohok(): return render_template(‘home.html’) if __name__ == "__main__": serve(app, host="127.0.0.1", port=8080) I have my home.html file correctly formatted placed… Read More Flask render template doesn't render my html page keep getting "internal server error"

How to remove string pattern and all the string behind?

For example : pattern := "helloworld." myString := "foo.bar.helloworld.qwerty.zxc" func removeFromPattern(p, ms string) { // I confused here (in efficient way) } res := removeFromPattern(pattern, myString) I want to get res = "qwerty.zxc" how do I get qwerty.zxc only, and remove foo.bar.helloworld. from myString using pattern ? >Solution : 1- Using _, after, _ =… Read More How to remove string pattern and all the string behind?

Matching multiple unicode characters in Golang Regexp

As a simplified example, I want to get ^⬛+$ matched against ⬛⬛⬛ to yield a find match of ⬛⬛⬛. r := regexp.MustCompile("^⬛+$") matches := r.FindString("⬛️⬛️⬛️") fmt.Println(matches) But it doesn’t match successfully even though this would work with regular ASCII characters. I’m guessing there’s something I don’t know about Unicode matching, but I haven’t found any… Read More Matching multiple unicode characters in Golang Regexp

DOS how to retrieve date time with the correct time zone

In a dos batch file I retrieve the date time with that: REM ——–Retrieving date time for /f %%x in (‘wmic path win32_utctime get /format:list ^| findstr "="’) do set %%x set Month=0%Month% set Month=%Month:~-2% set Day=0%Day% set Day=%Day:~-2% set Hour=0%Hour% set Hour=%Hour:~-2% set Minute=0%Minute% set Minute=%Minute:~-2% set Second=0%Second% set Second=%Second:~-2% set TimeStamp=%Year%-%Month%-%Day%_%Hour%%Minute%%Second% echo %TimeStamp%… Read More DOS how to retrieve date time with the correct time zone