Getting to Know Python 3.7- Data Classes, Async-Await and More: https://blog.heroku.com/python37-dataclasses-async-await
Heroku
Getting to Know Python 3.7: Data Classes, async/await and More!
Some of the exciting features and improvements in Python 3.7
Python Design Pattern: using class attributes to store data vs. local function variables: https://stackoverflow.com/questions/55706215/python-design-pattern-using-class-attributes-to-store-data-vs-local-function-v
Stack Overflow
Python Design Pattern: using class attributes to store data vs. local function variables
Often I find myself running into the same question. A common pattern is that I create a class that performs some operations. Eg. Loads data, transforms/cleans data, saves data. The question then ar...
Emacs and conda workaround: https://stackoverflow.com/questions/55175916/emacs-and-conda-workaround
Stack Overflow
Emacs and conda workaround
I'm using emacs and anaconda.
I have this in my init.el:
(setenv "WORKON_HOME" "/home/user/anaconda3/envs/")
And conda on my path:
# added by Anaconda3 installer
export PATH="/home/user/anacond...
I have this in my init.el:
(setenv "WORKON_HOME" "/home/user/anaconda3/envs/")
And conda on my path:
# added by Anaconda3 installer
export PATH="/home/user/anacond...
[P] Tradeoff solved: Jupyter Notebook OR version control. Jupytext brings you the best of both worlds: https://www.reddit.com/r/Python/comments/bj14sq/p_tradeoff_solved_jupyter_notebook_or_version/
reddit
r/Python - [P] Tradeoff solved: Jupyter Notebook OR version control. Jupytext brings you the best of both worlds
32 votes and 8 comments so far on Reddit
What is the coolest thing you did with python web scrapping ?: https://www.reddit.com/r/Python/comments/bj0gcy/what_is_the_coolest_thing_you_did_with_python_web/
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
GAE/P: Transaction safety with API calls: https://stackoverflow.com/questions/55885628/gae-p-transaction-safety-with-api-calls
Stack Overflow
GAE/P: Transaction safety with API calls
Suppose you use a transaction to process a Stripe payment and update a user entity:
@ndb.transactional
def process_payment(user_key, amount):
user = user_key.get()
user.stripe_payment(amou...
@ndb.transactional
def process_payment(user_key, amount):
user = user_key.get()
user.stripe_payment(amou...
Teaching a kid to code with Pygame Zero · Matt Layman: https://www.reddit.com/r/Python/comments/bj5w1b/teaching_a_kid_to_code_with_pygame_zero_matt/
reddit
r/Python - Teaching a kid to code with Pygame Zero · Matt Layman
55 votes and 1 comment so far on Reddit
Qubism: Self-similar visualization of many-body wavefunctions in Python (2014): https://nbviewer.jupyter.org/github/qutip/qutip-notebooks/blob/master/examples/qubism-and-schmidt-plots.ipynb
nbviewer.jupyter.org
Notebook on nbviewer
Check out this Jupyter notebook!
Distributions vs. Releases: Why Python Packaging Is Hard: https://pydist.com/blog/distributions-vs-releases
Pydist
Distributions vs. Releases
Why Python packaging is hard: just because you both installed v1.2.3, doesn't mean you installed the same thing.
Flask post/redirect/get pattern cannot recover from an error: https://stackoverflow.com/questions/55882202/flask-post-redirect-get-pattern-cannot-recover-from-an-error
Stack Overflow
Flask post/redirect/get pattern cannot recover from an error
I have an error recovery problem in a Flask view function. Its simplified version is here:
@app.route('/log', methods=['POST', 'GET'])
def elog():
form = LogForm()
if form.validate_on_subm...
@app.route('/log', methods=['POST', 'GET'])
def elog():
form = LogForm()
if form.validate_on_subm...
I turned 15 today so I made this perspective-based 3D renderer from scratch in python. The only libraries I used are Pillow and math. It's not perfect, but it works. It can display a given mesh, move it, and rotate it. Coming up with the formulas was the hardest part.: https://www.reddit.com/r/Python/comments/bj8pi2/i_turned_15_today_so_i_made_this_perspectivebased/
reddit
r/Python - I turned 15 today so I made this perspective-based 3D renderer from scratch in python. The only libraries I used are…
62 votes and 14 comments so far on Reddit
convert io.StringIO to io.BytesIO: https://stackoverflow.com/questions/55889474/convert-io-stringio-to-io-bytesio
Stack Overflow
convert io.StringIO to io.BytesIO
original question: i got a StringIO object, how can i convert it into BytesIO?
update: The more general question is, how to convert a binary (encoded) file-like object into decoded file-like objec...
update: The more general question is, how to convert a binary (encoded) file-like object into decoded file-like objec...
3D points projection using multiple camera: https://stackoverflow.com/questions/55826305/3d-points-projection-using-multiple-camera
Stack Overflow
3D points projection using multiple camera
I am using Python with OpenCV 3.4.
I have a system composed of 2 cameras that I want to use to track an object and get its trajectory, then its speed.
I am currently able to calibrate intrinsica...
I have a system composed of 2 cameras that I want to use to track an object and get its trajectory, then its speed.
I am currently able to calibrate intrinsica...
Check if package is imported from within the source tree: https://stackoverflow.com/questions/55900956/check-if-package-is-imported-from-within-the-source-tree
Stack Overflow
Check if package is imported from within the source tree
Users should install our python package via pip or it can be cloned from a github repo and installed from source. Users should not be running import Foo from within the source tree directory for a ...
spent 3 boring hour designing gui in PAGE for a simple program now I'm unwinding by making the console version colorful. so satisfying: https://www.reddit.com/r/Python/comments/bjc8v3/spent_3_boring_hour_designing_gui_in_page_for_a/
reddit
r/Python - spent 3 boring hour designing gui in PAGE for a simple program now I'm unwinding by making the console version colorful.…
40 votes and 11 comments so far on Reddit
Does time.sleep continue it's timer when the computer is in Sleep mode?: https://www.reddit.com/r/Python/comments/bjh9fk/does_timesleep_continue_its_timer_when_the/
reddit
Does time.sleep continue it's timer when the computer is in Sleep...
So when the computer is in sleep, does the sleep timer continue to count?
Can't get desired results using try/except clause within scrapy: https://stackoverflow.com/questions/55907516/cant-get-desired-results-using-try-except-clause-within-scrapy
Stack Overflow
Can't get desired results using try/except clause within scrapy
I've written a script in scrapy to make proxied requests using newly generated proxies by get_proxies() method. I used requests module to fetch the proxies in order to reuse them in the script. Wha...
Can python-docx preserve font color and styles when importing documents?: https://stackoverflow.com/questions/55871465/can-python-docx-preserve-font-color-and-styles-when-importing-documents
Stack Overflow
Can python-docx preserve font color and styles when importing documents?
Essentially what I need to do is write a program that takes in many .docx files and puts them all in one, ordered in a certain way. I have importing working via:
import docx, os, glob
finaldocnam...
import docx, os, glob
finaldocnam...