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
Is there a commenting/discussion system for online notebooks?

Hi All.

I have some Jupyter notebooks that I give to my students for hands-on exercise.

Is there a way I can add a comment box in the notebooks if the student has any doubt, he can see that comment box and ask his query? or view past queries. Something like disqus.

Adding Disqus to notebook exposes the unique-id I don't want to do that. ref: [https://github.com/vwxyzjn/jupyter\_disqus](https://github.com/vwxyzjn/jupyter_disqus)

/r/IPython
https://redd.it/gn4ku5
This media is not supported in your browser
VIEW IN TELEGRAM
After rolling my head for hours I made this.it can measure the speed of any object of person passing through this camera. I would love to hear your suggestions.

/r/Python
https://redd.it/gn976a
This media is not supported in your browser
VIEW IN TELEGRAM
My second month into Python.I built this game with classes using Turtle.Link of the tutorials I used in the comments!Thanks for watching!

/r/Python
https://redd.it/gnah93
How to auto-reload Celery worker on Code Change

This is the #2 of my Django Celery tutorial series

Many newbie developers do not know Celery would not auto-reload worker like Django server so this might cause some weird problems when learning Celery.

In this Django Celery tutorial, I would talk about how to auto-reload Celery worker on code change.

Hope it can help people here, and if you have any feedback, please let me know.

[How to auto-reload Celery worker on Code Change](https://www.accordbox.com/blog/how-auto-reload-celery-worker-code-change/)

/r/django
https://redd.it/gnal7i
Created my first Flask Application for my Local Fraternity (Demoing for a program I am in)
https://www.youtube.com/watch?v=Mbg5rM14Z00&feature=youtu.be

/r/flask
https://redd.it/gngika
Honest opinion about my learning progress?

In theory I have worked as a programmer for 5 years. In practice, most of the first 1.5 years I was learning, attending meetings, helping out with reports and documents in other offices of the company I worked for, translating etc. Recently I started a new job, this is the third time I start a new language. Previously I worked with Php and Node.js. I am currently part of a Python/Django project.

I have no previous knowledge of Python or it's frameworks. The project is a complicated finance app which requires knowledge of specific business terms and workflows which I am also learning from scratch. The CEO and CTO knew this because I made sure to clarify it (several times) during the interview. They said that they do not expect me to do something productive for the first month, and by the second month they don't expect me to do a lot either. Also, I am not a quick learner (I know this much) and I don't think I am particularly smart or a good programmer.

So, by the end of this week I will have been in the new company for 3 weeks. I have done nothing but following tutorials, courses

/r/djangolearning
https://redd.it/gnih6p
Help deploying Flask REST API for a newbie

I've programmed in python for a couple years but haven't done much with web dev/server stuff. I've looked through previous questions, but I am still confused. I have created a Flask API that gets variables start date and end date, runs a function in python that opens corresponding netCDF files on our computer, grabs the wind data from a single point for those dates, and returns the variables as a JSON.

app = flask.Flask(__name__)
app.config['DEBUG'] = TRUE

@app.route('/wind_data')
def api_id():
start_date = request.args(['start'])
end_date = request.args(['end'])
result = extract_pixel_values_from_netcdf(start_date, end_date)

return jsonify(result)

this works on localhost -- [http://127.0.0.1:5000/wind\_data/?start=2020010100&end=2020010112](http://127.0.0.1:5000/wind_data/?start=2020010100&end=2020010112) but now I'm trying to deploy it so that anyone can access this API and it will grab the data that's stored on our computer. We have IIS 8 and also Google Cloud Console, I've also read about Heroku. A lot of these however are mentioning flask Apps and not APIs. So for instance

/r/flask
https://redd.it/gnj30z
Is there a good book or resource of some kind thal will help use jupyter notebooks like mathematica



/r/JupyterNotebooks
https://redd.it/gnh7vw
Api call

Hello,
I made an api. I want to call it from html file in form tag. Here is the situation. I created a view for api and added it urls file as api/result. In the form action I replaced this url and it runs perfectly. But it wants to render a template at the end but I don't want to do that, I just want to get result of api call. I can use render, or pass template name as parameter to response, or redirect it but these solutions are disrupting api from having a generic type, because it will render a specific page at the end, it works for me but for other it cant work and this breaks the api structure. Any suggestion? How to get result without rendering a template?

/r/django
https://redd.it/gnlg7b
Associate resources to users based on their email in a database before their registration in FLASK using SQLAlchecmy?

I currently need a suggestion for what I am doing with FLASK for my website. Assume I have a list of emails for my users and I would like to give them access to resources based on some criterion. Therefore, I have two email lists. The first one I give resources A, B, C, D, and the second group I assign them resources B, C, E (They can access their resources after login). This is done using many-to-many relationships and was done successfully. However, to configure the many-to-many relationships I need to create users with their email (user table) then I need to have a resource table and then create an association.

Now, what is the problem?

The problem here is that if you have their email already in the system before their registration. Then, when they want to register with their email, they will receive an error message that the user already exists, or this email is already is an associate with the account.

My solution is I think I should create a temporary table to hold their email and associate it with resources. This table should be separated from the user table. Then, they can register with their email without

/r/flask
https://redd.it/gnpoz9
Switching from rails to django

I just want to ask, how much will it take for a programmer with 1 Year experience in rails as a full stack developer to learn python and django? I have seen much code similarities between python and ruby. Is anyone here who has similar background?

/r/django
https://redd.it/gnraf6
This media is not supported in your browser
VIEW IN TELEGRAM
Linear Regression using Gradient Descent (3 types)

/r/Python
https://redd.it/gns9rb
Shakespearean Insult Generator (because I was bored)

Recently we have been learning about Shakespeare in my English class. My English teacher showed us an interesting website that is a "kit for making Shakespearean insults." I was obviously intrigued and I checked the site out. ( [https://web.mit.edu/dryfoo/Funny-pages/shakespeare-insult-kit.html](https://web.mit.edu/dryfoo/Funny-pages/shakespeare-insult-kit.html) ). I found out the page was on MIT's website and it wasn't the prettiest page, but the insults you could make with it were good. I instantly thought, I could pretty easily make a python script to automatically generate these. I'm not that well versed in python, I'm ok at it but not a pro or anything. Here are some sample insults made by the script (the code is here if you want it: [https://gist.github.com/teky1/7cf7e8879209100c6295bb7ffcd570dd](https://gist.github.com/teky1/7cf7e8879209100c6295bb7ffcd570dd) ):

​

https://preview.redd.it/8vkbqdbqq4051.png?width=527&format=png&auto=webp&s=3f5e20fa3c34a14e3f23edb49aceef3e4a8a717b

/r/Python
https://redd.it/gny1n6
What areas of Python development are missing good learning resources?

I'm thinking about dabbling in creating training courses, blog posts, or videos for the Python community, which I've been a part of for over 6 years now.

From your perspective, what are some areas of Python or web development that are not clear or are missing some good learning resources? What are the gaps that are missing? What are concepts that, despite Googling and reading, are still just confusing?

I'd love to focus on those areas first to have the biggest impact.

Thanks!

/r/django
https://redd.it/gnw15b