Markdown cells instead of Python comments?
I'm new to Jupyter. I code in Python and am wondering if there is a recommendation when to use Markdown cells and when to use comments in Python.
If I have comments in my Python code then why would I use Markdown cells as the purpose of both is to document what is going on.
Any best practice?
/r/IPython
https://redd.it/b8k98q
I'm new to Jupyter. I code in Python and am wondering if there is a recommendation when to use Markdown cells and when to use comments in Python.
If I have comments in my Python code then why would I use Markdown cells as the purpose of both is to document what is going on.
Any best practice?
/r/IPython
https://redd.it/b8k98q
reddit
r/IPython - Markdown cells instead of Python comments?
0 votes and 2 comments so far on Reddit
Aggregating just the code cells without the markdown cells
Once you have finalized your code and want to save from Jupyter notebook to a tradition python script file is there an easy way to copy / paste the code whilst ignoring the Markdown cells?
/r/IPython
https://redd.it/b8ksyn
Once you have finalized your code and want to save from Jupyter notebook to a tradition python script file is there an easy way to copy / paste the code whilst ignoring the Markdown cells?
/r/IPython
https://redd.it/b8ksyn
reddit
r/IPython - Aggregating just the code cells without the markdown cells
0 votes and 0 comments so far on Reddit
Accepting Payments with Stripe, Vue.js, and Flask
https://testdriven.io/blog/accepting-payments-with-stripe-vuejs-and-flask/
/r/flask
https://redd.it/b8ityt
https://testdriven.io/blog/accepting-payments-with-stripe-vuejs-and-flask/
/r/flask
https://redd.it/b8ityt
testdriven.io
Accepting Payments with Stripe, Vue.js, and Flask
This tutorial details how to develop a web app for selling products using Stripe, Vue.js, and Flask.
[P] Rock Paper Scissors with Artificial Intelligence
Hi! I've created a Rock-Paper-Scissors game that works with artificial intelligence (AI). The AI can see and detect your hand gestures by front-facing camera. Also it can learn your playing strategy in a smart way. The more you play, It gets harder to win!
This app uses TensorFlow and deep learning technologies in order to detect the hand gestures. Sometimes the gestures may not be properly detected, but this will improve in future versions. You can help me in this process by taking pictures of your hand in different positions and sending them as a zip file to rpsapp@outlook.com .
Please Note:
* To get best results in hand gestures detection, put your device on a flat and steady surface.
* In order for the app to work properly, your device should have decent camera and hardware to run relatively heavy calculations.
I've been working on developing this app for a year, so any feedback from you will be a pleasure for me :)
You can get the app on Google Play: https://play.google.com/store/apps/details?id=cc.ramtin.rps
And you can read more about it on XDA: https://www.xda-developers.com/play-rock-paper-scissors-hand-gestures-against-ai-bot/
/r/MachineLearning
https://redd.it/b8htjt
Hi! I've created a Rock-Paper-Scissors game that works with artificial intelligence (AI). The AI can see and detect your hand gestures by front-facing camera. Also it can learn your playing strategy in a smart way. The more you play, It gets harder to win!
This app uses TensorFlow and deep learning technologies in order to detect the hand gestures. Sometimes the gestures may not be properly detected, but this will improve in future versions. You can help me in this process by taking pictures of your hand in different positions and sending them as a zip file to rpsapp@outlook.com .
Please Note:
* To get best results in hand gestures detection, put your device on a flat and steady surface.
* In order for the app to work properly, your device should have decent camera and hardware to run relatively heavy calculations.
I've been working on developing this app for a year, so any feedback from you will be a pleasure for me :)
You can get the app on Google Play: https://play.google.com/store/apps/details?id=cc.ramtin.rps
And you can read more about it on XDA: https://www.xda-developers.com/play-rock-paper-scissors-hand-gestures-against-ai-bot/
/r/MachineLearning
https://redd.it/b8htjt
Google Play
Rock Paper Scissors with Artif - Apps on Google Play
Play RPS without touching the screen, versus Artificial Intelligence!
What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/b8jq2r
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/b8jq2r
reddit
r/Python - What's everyone working on this week?
6 votes and 30 comments so far on Reddit
I Wrote My First Python Package!
Just thought I'd share this: I've been working on a Python package that makes it easy to obtain and work with data from the USDA's Standard Reference Database for nutrient composition of different foods. I became interested in the USDA's API as it seems to be the standard for high-quality nutrition data -- it's used by many apps and it has data for \~160 different nutrients. My goal is to make the data much more accessible to developers.
Part of the package also has a feature which will tell you if you are meeting the Recommended Daily Amounts of each nutrient, so it could be helpful for nutritionists or people looking to improve their diet.
This is the first Python package I've made and I uploaded it to PyPI so it can be installed with pip. You can find the code here:
[https://github.com/noahtren/noms](https://github.com/noahtren/noms)
Thanks for checking it out, and please share any advice on how to make it better. :)
/r/Python
https://redd.it/b8ncrx
Just thought I'd share this: I've been working on a Python package that makes it easy to obtain and work with data from the USDA's Standard Reference Database for nutrient composition of different foods. I became interested in the USDA's API as it seems to be the standard for high-quality nutrition data -- it's used by many apps and it has data for \~160 different nutrients. My goal is to make the data much more accessible to developers.
Part of the package also has a feature which will tell you if you are meeting the Recommended Daily Amounts of each nutrient, so it could be helpful for nutritionists or people looking to improve their diet.
This is the first Python package I've made and I uploaded it to PyPI so it can be installed with pip. You can find the code here:
[https://github.com/noahtren/noms](https://github.com/noahtren/noms)
Thanks for checking it out, and please share any advice on how to make it better. :)
/r/Python
https://redd.it/b8ncrx
GitHub
GitHub - noahtren/noms: A fun and simple Python package that allows you to work with highly detailed nutrition data
A fun and simple Python package that allows you to work with highly detailed nutrition data - GitHub - noahtren/noms: A fun and simple Python package that allows you to work with highly detailed nu...
People with experience in Django: is it possible to make a web application with a server push feature?
It should be like this:
I have a Raspberry Pi, an Arduino nano connected to the raspberry and other Arduino nano that will communicate with the "central" one.
My central Arduino, the one connected to the raspberry, will receive messages from others and pass them forward to the serial port. My app needs to read this info and do something about it. It can just be ignored, stored, do something on the Arduino end or it can trigger a event in the app. This event should be like a window that pop in front of the web page telling what happened.
I'm aware of the existence of the channels library and the celery one, too. Although I'm not anywhere near sure if it can be pulled together.
So... Can it be done with django?
/r/django
https://redd.it/b8nm6b
It should be like this:
I have a Raspberry Pi, an Arduino nano connected to the raspberry and other Arduino nano that will communicate with the "central" one.
My central Arduino, the one connected to the raspberry, will receive messages from others and pass them forward to the serial port. My app needs to read this info and do something about it. It can just be ignored, stored, do something on the Arduino end or it can trigger a event in the app. This event should be like a window that pop in front of the web page telling what happened.
I'm aware of the existence of the channels library and the celery one, too. Although I'm not anywhere near sure if it can be pulled together.
So... Can it be done with django?
/r/django
https://redd.it/b8nm6b
reddit
r/django - People with experience in Django: is it possible to make a web application with a server push feature?
9 votes and 8 comments so far on Reddit
Kellie Ottoboni Receives Award for Post-Election Auditing Notebook
https://blog.jupyter.org/kellie-ottoboni-receives-award-for-post-election-auditing-notebook-96e7277863d1
/r/IPython
https://redd.it/b8nkmn
https://blog.jupyter.org/kellie-ottoboni-receives-award-for-post-election-auditing-notebook-96e7277863d1
/r/IPython
https://redd.it/b8nkmn
Jupyter Blog
Kellie Ottoboni Receives Award for Post-Election Auditing Notebook
On Thursday, March 14th at their annual conference in Washington DC, Kellie Ottoboni received the Innovation Award from the Election…
Simplifying the API for aggregates in a subquery
https://github.com/martsberger/django-sql-utils
/r/django
https://redd.it/b8lro6
https://github.com/martsberger/django-sql-utils
/r/django
https://redd.it/b8lro6
GitHub
GitHub - martsberger/django-sql-utils: SQL utilities for Django
SQL utilities for Django. Contribute to martsberger/django-sql-utils development by creating an account on GitHub.
Integrating with Slack in 3 minutes (Python + Flask)
https://youtu.be/aVl-ixd7gL8
/r/flask
https://redd.it/b8nag7
https://youtu.be/aVl-ixd7gL8
/r/flask
https://redd.it/b8nag7
YouTube
Integrating with Slack in 3 minutes
In this tutorial, I build a Slack messaging system for my web app. I am integrating Slack in a demo web app built using Flask with Python and pushing the dat...
How do I prevent POST request on page refresh?
Hello,
Currently I am working on my webpage that has an "add to cart" feature.
​
Everything add to cart is clicked (post request), my session\['cart'\] is updated to include the new product added (list of items in the cart).
​
But there's a problem.
Lets say you add an item to cart, to session\['cart'\] = \[Banana\], if you then refresh the page the session\['cart'\] will become
session\['cart'\]=\[Banana, Banana\].
​
If you refresh again it'll become session\['cart'\]=\[Banana, Banana, Banana\] etc.
​
Is there a way to prevent a page refresh to send POST requests?
​
Thank you,
/r/flask
https://redd.it/b7ennc
Hello,
Currently I am working on my webpage that has an "add to cart" feature.
​
Everything add to cart is clicked (post request), my session\['cart'\] is updated to include the new product added (list of items in the cart).
​
But there's a problem.
Lets say you add an item to cart, to session\['cart'\] = \[Banana\], if you then refresh the page the session\['cart'\] will become
session\['cart'\]=\[Banana, Banana\].
​
If you refresh again it'll become session\['cart'\]=\[Banana, Banana, Banana\] etc.
​
Is there a way to prevent a page refresh to send POST requests?
​
Thank you,
/r/flask
https://redd.it/b7ennc
reddit
r/flask - How do I prevent POST request on page refresh?
5 votes and 5 comments so far on Reddit
How to create unique field with random content with only letters and case sensitive?
I want create random chars for links, such like imgur urls, for example: "abZXy". How to do it?
/r/djangolearning
https://redd.it/b8twbv
I want create random chars for links, such like imgur urls, for example: "abZXy". How to do it?
/r/djangolearning
https://redd.it/b8twbv
reddit
r/djangolearning - How to create unique field with random content with only letters and case sensitive?
1 vote and 1 comment so far on Reddit
8 Python Modules For Files Handling
https://devarea.com/8-python-modules-for-files-handling/
/r/Python
https://redd.it/b8vqom
https://devarea.com/8-python-modules-for-files-handling/
/r/Python
https://redd.it/b8vqom
This media is not supported in your browser
VIEW IN TELEGRAM
I wrote a Python package to do adaptive sampling of functions in parallel [OC]
/r/Python
https://redd.it/b8xk3a
/r/Python
https://redd.it/b8xk3a
Call for maintainers for Celery's Django integrations
Since we're beginning our efforts to develop Celery 5 all resources are going to be directed to that effort.
Unlike Django, Celery has a very small team which we are looking to expand.
Part of the reason for expansion is because we no longer have the time to maintain the Django integrations properly.
​
If you are interested in maintaining our Django integrations, comment here or message me.
/r/django
https://redd.it/b8yv8z
Since we're beginning our efforts to develop Celery 5 all resources are going to be directed to that effort.
Unlike Django, Celery has a very small team which we are looking to expand.
Part of the reason for expansion is because we no longer have the time to maintain the Django integrations properly.
​
If you are interested in maintaining our Django integrations, comment here or message me.
/r/django
https://redd.it/b8yv8z
reddit
r/django - Call for maintainers for Celery's Django integrations
0 votes and 6 comments so far on Reddit
Best site I've ever found for learning Python as a beginner.
https://edabit.com/challenges/python3
/r/Python
https://redd.it/b8xf9q
https://edabit.com/challenges/python3
/r/Python
https://redd.it/b8xf9q
The best way to prevent a django model choicefield from saving any value not available in choices
I have a choice field for my Post model called privacy\_setting. Currently, in my PostSerializer, where I save the post with the validated data, I am somehow able to save any value in the privacy\_setting field that is not available in the choices section. What is the best approach to prevent this from happening?
> post = Post.objects.create(
text=validated\_data\['text'\],
owner=validated\_data\['owner'\],
privacy\_setting=validated\_data\['get\_privacy\_setting\_display'\])
My Post model field:
> privacy\_setting = models.CharField(
max\_length = 2,
choices = POST\_PRIVACY\_CHOICES,
default = PUBLIC
)
​
/r/django
https://redd.it/b93r4w
I have a choice field for my Post model called privacy\_setting. Currently, in my PostSerializer, where I save the post with the validated data, I am somehow able to save any value in the privacy\_setting field that is not available in the choices section. What is the best approach to prevent this from happening?
> post = Post.objects.create(
text=validated\_data\['text'\],
owner=validated\_data\['owner'\],
privacy\_setting=validated\_data\['get\_privacy\_setting\_display'\])
My Post model field:
> privacy\_setting = models.CharField(
max\_length = 2,
choices = POST\_PRIVACY\_CHOICES,
default = PUBLIC
)
​
/r/django
https://redd.it/b93r4w
reddit
r/django - The best way to prevent a django model choicefield from saving any value not available in choices
0 votes and 0 comments so far on Reddit
Mypy 0.700 Released: Up To 4x Faster
https://mypy-lang.blogspot.com/2019/04/mypy-0700-released-up-to-4x-faster.html
/r/Python
https://redd.it/b934ac
https://mypy-lang.blogspot.com/2019/04/mypy-0700-released-up-to-4x-faster.html
/r/Python
https://redd.it/b934ac
Blogspot
Mypy 0.700 Released: Up To 4x Faster
We’ve just uploaded mypy 0.700 to the Python Package Index ( PyPI ). Mypy is a static type checker for Python. This release switches to a...
A package I want to use contains Linux paths for reading data and configs. Is there a way I can use it on a Windows machine without editing the source code?
This [very interesting ML package](https://github.com/facebookresearch/habitat-api) just came out, and like most such packages (especially in early phases), it seems to be designed primarily for Linux. For example, this code:
`env = habitat.Env(`
`config=habitat.get_config(config_file="tasks\\pointnav.yaml")`
`)`
returns an error since it wants to read another file from a path that uses forward slashes. Is there a way to get python to automatically "translate" files to work with Windows paths? In principle it shouldn't be too hard to tinker with the paths in one package, but since this seems to be systematic to many packages it would be quite handy to have an easier way to do it.
​
Thanks!
/r/Python
https://redd.it/b94s72
This [very interesting ML package](https://github.com/facebookresearch/habitat-api) just came out, and like most such packages (especially in early phases), it seems to be designed primarily for Linux. For example, this code:
`env = habitat.Env(`
`config=habitat.get_config(config_file="tasks\\pointnav.yaml")`
`)`
returns an error since it wants to read another file from a path that uses forward slashes. Is there a way to get python to automatically "translate" files to work with Windows paths? In principle it shouldn't be too hard to tinker with the paths in one package, but since this seems to be systematic to many packages it would be quite handy to have an easier way to do it.
​
Thanks!
/r/Python
https://redd.it/b94s72
GitHub
facebookresearch/habitat-api
A modular high-level library to train embodied AI agents across a variety of tasks, environments, and simulators. - facebookresearch/habitat-api
[Ask Flask] - Utilizing Flask for Obfuscating/Protecting Client/Server Python Application
My team and I are working on a project currently in Python 3 that utilizes a client/server communication model. Both our client and our server are written in Python 3, with the client utilizing the Kivy Framework for a GUI. All of our client/server communication is protected with strong, third-party audited encryption, with any communication between clients being protected by end-to-end encryption. My team and I would like to eventually release this code as an app both on desktop and mobile devices. However, because Python doesn't really make use of anything to protect code, we are hesitant to just throw our client .py file out there to be read (and copied). We are a very small team, and we worry that our idea could be easily snatched up by a company with massively more resources and funding while in it's early stages.
Since .py code can't really be obfuscated well, we were recommended to take a look at Flask for the purpose of using a web server middleman to mask what's happening behind the scenes. If I understand correctly, essentially we would have our GUI client communicate over Flask (I'd assume something like HTTPS?) with
/r/flask
https://redd.it/b91tbb
My team and I are working on a project currently in Python 3 that utilizes a client/server communication model. Both our client and our server are written in Python 3, with the client utilizing the Kivy Framework for a GUI. All of our client/server communication is protected with strong, third-party audited encryption, with any communication between clients being protected by end-to-end encryption. My team and I would like to eventually release this code as an app both on desktop and mobile devices. However, because Python doesn't really make use of anything to protect code, we are hesitant to just throw our client .py file out there to be read (and copied). We are a very small team, and we worry that our idea could be easily snatched up by a company with massively more resources and funding while in it's early stages.
Since .py code can't really be obfuscated well, we were recommended to take a look at Flask for the purpose of using a web server middleman to mask what's happening behind the scenes. If I understand correctly, essentially we would have our GUI client communicate over Flask (I'd assume something like HTTPS?) with
/r/flask
https://redd.it/b91tbb
reddit
r/flask - [Ask Flask] - Utilizing Flask for Obfuscating/Protecting Client/Server Python Application
4 votes and 4 comments so far on Reddit