Show HN: Python virtual environment, but backed by Docker: https://github.com/se7entyse7en/pydockenv
GitHub
GitHub - se7entyse7en/pydockenv: Python virtual environment, but backed by Docker!
Python virtual environment, but backed by Docker! Contribute to se7entyse7en/pydockenv development by creating an account on GitHub.
Detecting SQL injections in Python code using AST: https://www.reddit.com/r/Python/comments/bip31n/detecting_sql_injections_in_python_code_using_ast/
reddit
r/Python - Detecting SQL injections in Python code using AST
34 votes and 0 comments so far on Reddit
Pyspark dataframe OrderBy partition level or overall?: https://stackoverflow.com/questions/55860388/pyspark-dataframe-orderby-partition-level-or-overall
Stack Overflow
Pyspark dataframe OrderBy partition level or overall?
When I do an orderBy on a pyspark dataframe does it sort the data across all partitions (i.e the entire result)? Or is the sorting at a partition level?
If the later, then can anyone suggest how t...
If the later, then can anyone suggest how t...
Optimise function for many pseudodata realisations in TensorFlow 2: https://stackoverflow.com/questions/55865891/optimise-function-for-many-pseudodata-realisations-in-tensorflow-2
Stack Overflow
Optimise function for many pseudodata realisations in TensorFlow 2
My end goal is to simulate likelihood ratio test statistics, however the core problem I am having is that I do not understand how to get TensorFlow 2 to perform many optimisations for different data
df.style.apply centers multiindex values in display: https://stackoverflow.com/questions/55724702/df-style-apply-centers-multiindex-values-in-display
Stack Overflow
df.style.apply centers multiindex values in display
When I run
import pandas as pd
from IPython.display import display
df = pd.DataFrame('a',index=pd.MultiIndex.from_product([[0,1]]*3),columns=['A'])
display(df)
display(df.style.apply(lambda x: ['...
import pandas as pd
from IPython.display import display
df = pd.DataFrame('a',index=pd.MultiIndex.from_product([[0,1]]*3),columns=['A'])
display(df)
display(df.style.apply(lambda x: ['...
What are the keycodes `getwch` returns?: https://stackoverflow.com/questions/55876228/what-are-the-keycodes-getwch-returns
Stack Overflow
What are the keycodes `getwch` returns?
I'm using msvcrt.getwch to make an interactive prompt in Python targeting Windows.
The documentation says:
Read a keypress and return the resulting character as a byte string. Nothing is echoed...
The documentation says:
Read a keypress and return the resulting character as a byte string. Nothing is echoed...
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...