Differences between revisions 11 and 12
Revision 11 as of 2019-01-25 01:03:29
Size: 1953
Editor: SamatJain
Comment: asottile/future-fstrings
Revision 12 as of 2019-04-28 00:41:35
Size: 2373
Editor: SamatJain
Comment: subprocess backport
Deletions are marked like this. Additions are marked like this.
Line 39: Line 39:
=== Libraries === === Backports ===

==== subprocess ====

[[https://github.com/google/python-subprocess32|python-subprocess32]]: Backport of Python 3.2 `subprocess` module to 2.7. Use:

{{{#!highlight python numbers=off
if os.name == 'posix' and sys.version_info[0] < 3:
    import subprocess32 as subprocess
    import subprocess

Can serve as a complete replacement for Python 2.7's `subprocess` module.

=== 2to3 libraries ===

CodingStyle/Python is another relevant page.

Development packages for Debian

Current for Ubuntu 16.04.


cffi and numpy

https://github.com/SimonSapin/azureblur/tree/master/azureblur: Example of using cffi to interact w/ a C++ class.

python - How do I convert a numpy ND-array to a CFFI C++ array and back again? - Stack Overflow

python - Why is cffi so much quicker than numpy? - Stack Overflow

Neat Web frameworks

aspen.io. Filesystem-based dispatch library. Used by Liberapay.

Neat packages

nvbn/py-backwards: Python transcompiler. Lets you use Python 3.6 features in older versions, as old as Python 2.7.

asottile/future-fstrings. Allows formatted string literals (AKA f-strings) in Python 2.7–3.5 by hacking built-in codecs.


Nuitka: Python native-code compiler, binary will still link to libpython.

Porting projects from Python 2 to Python 3



python-subprocess32: Backport of Python 3.2 subprocess module to 2.7. Use:

if os.name == 'posix' and sys.version_info[0] < 3:
    import subprocess32 as subprocess
    import subprocess

Can serve as a complete replacement for Python 2.7's subprocess module.

2to3 libraries



SamatsWiki: ProgrammingLanguages/Python (last edited 2021-04-09 17:46:53 by SamatJain)