Michael Schneider

@sesenion
9 Followers
101 Following
48 Posts

Hi, my name is Michael. I like learning new stuff.

I live in Tübingen and Würzburg.

I am a chemist by profession and mostly work around automation of chemical analysis systems in the semiconductor industry.

I have been programming since the C64 days and have been a heavy Python user at work since 2011, after I started learning it in 2008.

@amadaluzia Right, the ignore_errors is with shutil.rmtree then. I frequently use both one after the other. Btw. pathlib also supports building recursive paths. There is a flag to create parents in Path.mkdir()

@amadaluzia os.mkdir in your build.py only works if the parent folder already exists.

I recommend using os.makedirs instead, which recursively creates the folder structure.

with ignore_errors=True, it also doesn't complain if the folder already exists.

@fabriek uberspace.de starts at 6 Euro per month. You get a Linux Shell on a shared system and can run your own services, pretty much agnostic of programming language or frameworks.

@b0rk I am much more familiar with xml than html, since I mostly feed a java application with xml configuration and only write html occasionally.

I was not aware of attributes without quotes in html. Also, i attributed the accepted missing close tags to browser error handling.

Also I usually skip <!DOCTYPE html>

What I always found peculiar is that the <script src=".." > element doesn't accept self-closing but always needs a </script>.

@PythonPeak

Python doesn't have a null coalescing operator. or checks for truthyness

Python has truthy and falsy values with clear rules which is which. None is falsy, so are False, 0 or "" or [].

using or in an assignment is concise, but not too explicit.

For truthyness check, I would prefer

result = value if value else "No Value"

If you need a check for None, use

result = value if value is not None else "No Value"

@codeschubse The classical ORM combination with Flask is SQLAlchemy. For Migrations there is the Alembic package.

I never got the Hang of SQLAlchemy tough, so I am happy I exclusively use Django when I need an ORM.

I could imagine running Flask as a web framework to manage URL routing and such while still using the django ORM by just importing the models into your Flask app.

Would be kind of a Frankenstein project to install django just for the ORM.

@alexisperrier Well, it is part of the Python standard library.

I've used it now and then when I wanted a small tool to have a simple GUI.

The advantage is that it runs when people just have Python installed (at least on Windows) and I don't have to tell them to pip install something else.

@ubernauten Toller Vortrag und tolles Podium. Vielen Dank!

In zehn Minuten geht's looos!

https://www.youtube.com/watch?v=pnFG8AOTlmY

@ammaratef45 Aren't literal string slices always 'static lifetime?

If so, the lifetime of the return value doesn't really matter, since "hi" lives as long as the program runs.