Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
What's the ideal way to track different versions of Jupyter notebooks?

I want to quickly jump between different versions as well as do comparison between multiple versions at a time.

/r/JupyterNotebooks
https://redd.it/aqbrda
Prototype of Python-powered IoT device, gets how many subs are in r/Python plays sound when new ones are added

/r/Python
https://redd.it/aqapmb
Passing values in Django

Hi all,

​

I need help with passing values from one view to another. Also, overriding the save function is giving me headhecks...can you help me on where to find materials on this things..

Thank you all in advance

/r/djangolearning
https://redd.it/aqhs3r
DJANGO PROJECT SUGGESTION

Hey guys.. I have to make a final year project and i am out of ideas.. I have been working on Django for more than one year and i know web scraping. My team mate has knowledge of Data Science.. It would great if anybody could suggest me some projects..

Thank you..

/r/django
https://redd.it/aqjumf
Need recommendation on python/django bootcamps online

Hi there!

Could someone recommend good bootcamps/tutorials on building up web apps on python/django?

Thanks!

/r/djangolearning
https://redd.it/aqjshk
Flask-Alembic model detection - is very strange

Hi,

I found that Flask-Alembic detects model based solely on their using. So, if I add in the code something like that:

`from app.my_models import project_model`

the project\_model will be detected and, if there are any updates the table will be updated.

**But**, if I don't mention the model in the code it will be ignored as a non-existing model, and then, as a consequence, the table will be dropped from the database. It's slightly different from what I expected, or maybe I use it wrong.

Can somebody please comment on it?

Thanks!

​

/r/flask
https://redd.it/aqnk5m
Plotly's Jupyterlab Chart Editor for editing charts through a user-friendly point-and-click interface
https://kyso.io/KyleOS/plotly-chart-editor

/r/IPython
https://redd.it/aqn1if
Initializing a Flask app

[https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world)


With the above tutorial an `app` package is created. For the `__init__.py` file, `Flask` is instantiated in there:

app/__init__.py: Flask application instance

from flask import Flask

app = Flask(__name__)

from app import routes

Why is that written in \`\_\_init\_\_.py\` and what is the benefit of that? As opposed to an empty `__init__.py` and then instantiating the `Flask` class in another module such as...


app/main_app.py #Flask is instantiated here instead of __init__.py

from flask import Flask

app = Flask(__name__)


​

/r/flask
https://redd.it/aqoq8m
How to put CSRF tokens on the page without a flask form?

Since learning AJAX and RESTful api's, I've been replacing all my flask wtforms with regular ol' html inputs and submit buttons. I haven't really seen the point of wtforms. But they did have the .hidden\_token attribute which was nice.

So now that I'm doing away with flask forms, how do I still put a hidden token on my pages?

/r/flask
https://redd.it/aqr5cy
[R] OpenAI: Better Language Models and Their Implications

https://blog.openai.com/better-language-models/

"We’ve trained a large-scale unsupervised language model which generates coherent paragraphs of text, achieves state-of-the-art performance on many language modeling benchmarks, and performs rudimentary reading comprehension, machine translation, question answering, and summarization — all without task-specific training."

Interestingly,

"Due to our concerns about malicious applications of the technology, we are not releasing the trained model. As an experiment in responsible disclosure, we are instead releasing a much smaller model for researchers to experiment with, as well as a technical paper."

/r/MachineLearning
https://redd.it/aqlzde
For those of you who got hired to work with Python, what coding challenges did they have have you do during the interviewing process?

I'd also appreciate knowing whether you thought those challenges accurately accessed the coding skills you needed to do your job.

/r/Python
https://redd.it/aqrz1a
Clustering Pollock

I applied kmeans clustering to some of the Pollock's paintings. The idea was to track the artist's usage of #colors through the years. Here's the outcome!

I had really good fun in mixing computer science and art. I used Python with the standard data science stack (pandas, numpy, scikitlearn) plus opencv. echarts for the visualizations at the end of the article .

Let me know what you think!

https://medium.com/@andrea.ialenti/clustering-pollock-1ec24c9cf447

/r/Python
https://redd.it/aqvtkp
Django high level architecture diagram

Hi,

Was just windering if anyone has done a graphical architectural view of a typical django project. I think this would be enormously valuable for beginners particularly, for grasping how a project should be put together. I'm happy to try and start one, but my knowledge is quite lacking so would only be able to go as far as some of the tutorials out there, so would need help with it.

/r/django
https://redd.it/aqxf4i
Storing a class containing datasets

So I'm stuck with a particularly difficult problem. Before I explain, here's an outline of the application I'm building:

1. User clicks on a map
2. Point gets sent to server
3. Fancy math functions take that point and interpolate data as an array of points
4. Send array back to front end and display as a line

I have a 2D dictionary with all the datasets in it. Here's the problem: It takes ~7 seconds to create the datasets when I want to use them for my other functions. These datasets reside in an instance of scipy.interpolate.RectBivariateSpline.

With Django, I need to find a way to only do this once so that I'm not computing the datasets every time. I need to keep this object "alive" so that I can use it repeatedly and not have horrific wait times for users.

For example, this RectBivariateSpline class/2D dictionary gets used in a view that processes JSON input:

myDatasetDict = createInitialDatasets()
xyLine = LineClass(point_stuff, myDatasetDict, distance)
linePoints = TranslateToLatLong(xyLine)
return JsonResponse(linePoints)


Does anyone have any suggestions on how I can store/maintain this object instance on my server? I'm just trying to avoid the long compute times.

Thanks




/r/djangolearning
https://redd.it/ar04go