Browsed by
Category: Python

Command Line Interface To Own Python Functions

Command Line Interface To Own Python Functions

Now go to the Commands-Section and add your own.

PE147

PE147

 

It’s done… I solved PE147!

Note 0: I made up a graphic solution for the calculation of the “odd” rectangles.
Note 1: The solution needs ~20 minutes to compute.

 

Python3(.4) Https Server

Python3(.4) Https Server

Here is an example how to create a https server in python3.4. It assumes you have got a ssl certificate in ssl/localhost.pem and a html template under templates/index.html.

Furthermore it assumes you have created a virtual environment under ./env/ and installed jinja2 into it.

The server code:

Shell script to create the certificate (self signed)… this is a variation of an elder post. Here it creates a certificate only (self) signed for localhost:

And if you like you can import the file ssl/localhost.crt as trusted server certificate into your browser. This will overcome the certificate warning.

 

Python Sqlite3 With Database(name) Do: …

Python Sqlite3 With Database(name) Do: …

This is a small wrapper that allows to use pythons with statement on a sqlite3 database:

Use it like this:

Shell Menues

Shell Menues

Here is a python class to create such shell menues:

shell-menues

Use it like that:

The output and thus the returned values will be something like:

Github page