How to set up entry_points in setup.cfg

The section must be [options.entry_points]. See an example at https://github.com/github/octodns/blob/4b44ab14b1f0a52f1051c67656d6e3dd6f0ba903/setup.cfg#L34 [options.entry_points] console_scripts = octodns-compare = octodns.cmds.compare:main octodns-dump = octodns.cmds.dump:main octodns-report = octodns.cmds.report:main octodns-sync = octodns.cmds.sync:main octodns-validate = octodns.cmds.validate:main

What’s the difference between python3. and python3.m [duplicate]

What does the m stand for in python3.6m? It signifies that Python was configured –with-pymalloc which enables a specialized implementation for allocating memory that’s faster than the system malloc. How does it differ to non m version? The non m version is, obviously, not configured with it. In which case would I prefer to use … Read more

How to connect to a remote PostgreSQL database through SSL with Python

Use the psycopg2 module. You will need to use the ssl options in your connection string, or add them as key word arguments: import psycopg2 conn = psycopg2.connect(dbname=”yourdb”, user=”dbuser”, password=’abcd1234′, host=”server”, port=”5432″, sslmode=”require”) In this case sslmode specifies that SSL is required. To perform server certificate verification you can set sslmode to verify-full or verify-ca. … Read more

Why are single type constraints disallowed in Python?

You’re looking for bound: T = TypeVar(‘T’, bound=Callable) From the docs: a type variable may specify an upper bound using bound=<type>. This means that an actual type substituted (explicitly or implicitly) for the type variable must be a subclass of the boundary type, see PEP 484. TypeVar(name, *args) means that the type has to be … Read more

String with ‘f’ prefix in python-3.6

See PEP 498 Literal String Interpolation: The expressions that are extracted from the string are evaluated in the context where the f-string appeared. This means the expression has full access to local and global variables. Any valid Python expression can be used, including function and method calls. So the expressions are evaluated as if they … Read more

Installing Python3.6 alongside Python3.7 on Mac

Try using brew for example if already using Python 3: $ brew unlink python Then install python 3.6.5: $ brew install –ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb To get back to python 3.7.4_1 use: $ brew switch python 3.7.4_1 And if need 3.6 again switch with: $ brew switch python 3.6.5_1

Nested f-strings

I don’t think formatted string literals allowing nesting (by nesting, I take it to mean f'{f”..”}’) is a result of careful consideration of possible use cases, I’m more convinced it’s just allowed in order for them to conform with their specification. The specification states that they support full Python expressions* inside brackets. It’s also stated … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)