New version of Flask is out! (0.12) Mostly bug fixes. Changenotes are in the comments here.
https://github.com/pallets/flask/
/r/flask
https://redd.it/5jrtjd
https://github.com/pallets/flask/
/r/flask
https://redd.it/5jrtjd
GitHub
GitHub - pallets/flask: The Python micro framework for building web applications.
The Python micro framework for building web applications. - pallets/flask
A Python 3.5+ web server written to go fast
https://github.com/channelcat/sanic
/r/Python
https://redd.it/5jqrfa
https://github.com/channelcat/sanic
/r/Python
https://redd.it/5jqrfa
GitHub
GitHub - sanic-org/sanic: Next generation Python web server/framework | Build fast. Run fast.
Next generation Python web server/framework | Build fast. Run fast. - GitHub - sanic-org/sanic: Next generation Python web server/framework | Build fast. Run fast.
How does the directory work in Juypter notebook?
Say i have a csv file, how do i load it into juypter so that i can call it?
I'm not sure if the directory should be where the csv file is on my computer or on jupyter. i tried using both path but its always giving me this error
IOError: [Errno 2] No such file or directory: 'sample.csv'
any help is appreciated. thanks!
/r/IPython
https://redd.it/5js89o
Say i have a csv file, how do i load it into juypter so that i can call it?
I'm not sure if the directory should be where the csv file is on my computer or on jupyter. i tried using both path but its always giving me this error
IOError: [Errno 2] No such file or directory: 'sample.csv'
any help is appreciated. thanks!
/r/IPython
https://redd.it/5js89o
reddit
How does the directory work in Juypter notebook? • /r/IPython
Say i have a csv file, how do i load it into juypter so that i can call it? I'm not sure if the directory should be where the csv file is on my...
[N] Elon Musk on Twitter : Tesla Autopilot vision neural net now working well. Just need to get a lot of road time to validate in a wide range of environments.
https://twitter.com/elonmusk/status/811738008969842689
/r/MachineLearning
https://redd.it/5jrl79
https://twitter.com/elonmusk/status/811738008969842689
/r/MachineLearning
https://redd.it/5jrl79
Twitter
Elon Musk
Tesla Autopilot vision neural net now working well. Just need to get a lot of road time to validate in a wide range of environments.
An introduction to the multiprocessing module
http://nbviewer.jupyter.org/github/rasbt/python_reference/blob/master/tutorials/multiprocessing_intro.ipynb
/r/JupyterNotebooks
https://redd.it/493cf5
http://nbviewer.jupyter.org/github/rasbt/python_reference/blob/master/tutorials/multiprocessing_intro.ipynb
/r/JupyterNotebooks
https://redd.it/493cf5
nbviewer.jupyter.org
Notebook on nbviewer
Check out this Jupyter notebook!
Jupyter Project and The Future of IPython
https://www.3blades.io/blog/jupyter-project-and-the-future-of-ipython/
/r/IPython
https://redd.it/4scfea
https://www.3blades.io/blog/jupyter-project-and-the-future-of-ipython/
/r/IPython
https://redd.it/4scfea
3Blades
Jupyter Project and The Future of IPython
The Jupyter Notebook has become one of the most adopted programs of its type. It’s not only beautifully designed but it also attracts users because it’s free and open source.
[P] StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generative Adversarial Networks
https://github.com/hanzhanggit/StackGAN
/r/MachineLearning
https://redd.it/5jt4rv
https://github.com/hanzhanggit/StackGAN
/r/MachineLearning
https://redd.it/5jt4rv
GitHub
GitHub - hanzhanggit/StackGAN
Contribute to hanzhanggit/StackGAN development by creating an account on GitHub.
Python 3 support for third party libraries
https://medium.com/broken-window/python-3-support-for-third-party-libraries-dcd7a156e5bd#.a2lojlait
/r/Python
https://redd.it/5jullg
https://medium.com/broken-window/python-3-support-for-third-party-libraries-dcd7a156e5bd#.a2lojlait
/r/Python
https://redd.it/5jullg
Medium
Adopt Python 3
Python 3.6.0 came out day before yesterday, and it was like a Christmas present for many of us. But in the midst of all the celebration…
Does MyPy have any shortcomings in its typing versus a traditional statically typed language?
I'm really impressed that they managed to capture all the possibilities of Python's type system and put it into a comprehensive syntax. Once you bring in concepts like generics and polymorphism into play in a language, types can get pretty complicated. How does MyPy compare to a statically-typed language like C++ or C#? Are there any holes or flaws?
/r/Python
https://redd.it/5juo74
I'm really impressed that they managed to capture all the possibilities of Python's type system and put it into a comprehensive syntax. Once you bring in concepts like generics and polymorphism into play in a language, types can get pretty complicated. How does MyPy compare to a statically-typed language like C++ or C#? Are there any holes or flaws?
/r/Python
https://redd.it/5juo74
reddit
Does MyPy have any shortcomings in its typing versus a... • /r/Python
I'm really impressed that they managed to capture all the possibilities of Python's type system and put it into a comprehensive syntax. Once you...
matplotlib plots freeze when trying to close in ipython 5.0, on El Capitan.
I am running python 2.7.10 and just installed ipython 5.0. When I create a simple plot using matplotlib and then try to close it, the figure just hangs. Anyone else experiencing this? Pretty shitty release if I can't even plot anything anymore.
/r/IPython
https://redd.it/4s2yrc
I am running python 2.7.10 and just installed ipython 5.0. When I create a simple plot using matplotlib and then try to close it, the figure just hangs. Anyone else experiencing this? Pretty shitty release if I can't even plot anything anymore.
/r/IPython
https://redd.it/4s2yrc
reddit
matplotlib plots freeze when trying to close in... • /r/IPython
I am running python 2.7.10 and just installed ipython 5.0. When I create a simple plot using matplotlib and then try to close it, the figure just...
Four ways to conduct one-way ANOVAs with Python
http://www.marsja.se/four-ways-to-conduct-one-way-anovas-using-python/
/r/pystats
https://redd.it/47vtcd
http://www.marsja.se/four-ways-to-conduct-one-way-anovas-using-python/
/r/pystats
https://redd.it/47vtcd
Erik Marsja
Four Ways to Conduct One-Way ANOVA with Python - Erik Marsja
Four easy methods to carry out one-way ANOVA for independent measures. With examples and calculation of eta squared and omega squared.
[P] Can Convolutional Neural Networks Crack Sudoku Puzzles?
https://github.com/Kyubyong/sudoku
/r/MachineLearning
https://redd.it/5jugp7
https://github.com/Kyubyong/sudoku
/r/MachineLearning
https://redd.it/5jugp7
GitHub
GitHub - Kyubyong/sudoku: Can Neural Networks Crack Sudoku?
Can Neural Networks Crack Sudoku? Contribute to Kyubyong/sudoku development by creating an account on GitHub.
Computational Statistics in Python — A comprehensive review
http://people.duke.edu/~ccc14/sta-663/index.html
/r/JupyterNotebooks
https://redd.it/48xrb8
http://people.duke.edu/~ccc14/sta-663/index.html
/r/JupyterNotebooks
https://redd.it/48xrb8
Where to ask questions about IPython nbextensions?
I am trying to debug an IPython nbextension, and I need to put a hook in that runs at the later of the following events:
- when the nbextension is loaded
- when the notebook metadata is loaded
I can't seem to figure this out. Where is the best place to ask questions like this?
/r/IPython
https://redd.it/4ryk6t
I am trying to debug an IPython nbextension, and I need to put a hook in that runs at the later of the following events:
- when the nbextension is loaded
- when the notebook metadata is loaded
I can't seem to figure this out. Where is the best place to ask questions like this?
/r/IPython
https://redd.it/4ryk6t
reddit
Where to ask questions about IPython nbextensions? • /r/IPython
I am trying to debug an IPython nbextension, and I need to put a hook in that runs at the later of the following events: - when the nbextension...
How do you automate your life with python?
What nifty little script did you write to save some time using python?
For me:
I gathered some libraries and did a script that downloads youtube videos (from a link of a direct video or several from a playlist), and when it is done it converts every file to mp3, then it uploads to dropbox and get the direct link of every mp3
For now it does just that. But I'll add some code to make it use the direct link to feed my podcast rss on HuffDuffer.
I use this to download entire classes that are available online and listen while I commute
/r/Python
https://redd.it/5jv3db
What nifty little script did you write to save some time using python?
For me:
I gathered some libraries and did a script that downloads youtube videos (from a link of a direct video or several from a playlist), and when it is done it converts every file to mp3, then it uploads to dropbox and get the direct link of every mp3
For now it does just that. But I'll add some code to make it use the direct link to feed my podcast rss on HuffDuffer.
I use this to download entire classes that are available online and listen while I commute
/r/Python
https://redd.it/5jv3db
reddit
How do you automate your life with python? • /r/Python
What nifty little script did you write to save some time using python? For me: I gathered some libraries and did a script that downloads youtube...
Python 3.6.0 has now been officially released!
http://blog.python.org/2016/12/python-360-is-now-available.html
/r/Python
https://redd.it/5jwf41
http://blog.python.org/2016/12/python-360-is-now-available.html
/r/Python
https://redd.it/5jwf41
blog.python.org
Python 3.6.0 is now available!
Python 3.6.0 is now available! Python 3.6.0 is the newest major release of the Python language, and it contains many new features and opti...
What are some of the most extensive projects you have seen?
I am a college student and I'm thinking about doing a side project and looking for some inspiration.
I'm looking forward to devote 5-6 months of time to a good, extensive project. Ideas?
/r/Python
https://redd.it/5jwfng
I am a college student and I'm thinking about doing a side project and looking for some inspiration.
I'm looking forward to devote 5-6 months of time to a good, extensive project. Ideas?
/r/Python
https://redd.it/5jwfng
reddit
What are some of the most extensive projects you have... • /r/Python
I am a college student and I'm thinking about doing a side project and looking for some inspiration. I'm looking forward to devote 5-6 months of...
JWT support without the jwt rest plugin?
I'm looking for a nice jwt package for a django app that is using graphql. Ideally i'd rather not need to use the popular jwt plugin for the rest framework. Any advice?
/r/django
https://redd.it/5juz6r
I'm looking for a nice jwt package for a django app that is using graphql. Ideally i'd rather not need to use the popular jwt plugin for the rest framework. Any advice?
/r/django
https://redd.it/5juz6r
reddit
JWT support without the jwt rest plugin? • /r/django
I'm looking for a nice jwt package for a django app that is using graphql. Ideally i'd rather not need to use the popular jwt plugin for the rest...
Can anyone help me and copy the stylesheet/subcategories-thing from /r/askscience to my subreddit r/kitricks?
I don't know the 101 of how to do it and it would be cool to have subcategories by colors for easy picking.
you can be admin. it's gonna be f cool when it will be fille up!
/r/Python
https://redd.it/5jwp2s
I don't know the 101 of how to do it and it would be cool to have subcategories by colors for easy picking.
you can be admin. it's gonna be f cool when it will be fille up!
/r/Python
https://redd.it/5jwp2s
reddit
Can anyone help me and copy the... • /r/Python
I don't know the 101 of how to do it and it would be cool to have subcategories by colors for easy picking. you can be admin. it's gonna be f...
Creating a CallbackURL to consume a Webhook POST Request (Update and Thanks!)
Hi guys,
A few weeks ago I asked a question about creating a callback url for a webhook [(Original Post Here)](https://www.reddit.com/r/django/comments/5ftsy6/how_do_i_create_a_callback_url_to_consume_a/) and I wanted to give a shoutout to those of you who helped me figure it out.
/u/Niicodemus - for putting it in layman's terms for me and for the bit about ngrok. At the time I did not have my website hosted so I wouldn't have been able to test it locally without the ngrok tip. It was super easy to set up if anyone has questions.
/u/spookylukey - for diving into Trello docs a bit and helping me understand the HEAD request
and /u/vitorfs's article showed me the general layout and walked me through verifying the IP addresses from trello.
So thank you to everyone who commented, I learned a lot from your help and I'm much more comfortable doing this kind of thing again in the future. For those of you curious (and to help those who have similar questions in the future) here is my code. This is all it takes to get it set up. *Comments and feedback welcome*
**Pip Requirements**
requests
ipaddress
**urls.py**
from django.conf.urls import include, url
from django.contrib import admin
from trello.views import list_webhook
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^trelloCallbacks/', list_webhook, name='trello_webhook'),
]
**trello/views.py**
from django.http import HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from ipaddress import ip_address, ip_network
import json
from .utils import add_label_to_card
list_before = '<a_trello_list_id>'
list_after = '<another_trello_list_id>'
def check_request_from_trello(forwarded_for):
client_ip_address = ip_address(forwarded_for)
print(client_ip_address)
whitelist = [
"107.23.104.115",
"107.23.149.70",
"54.152.166.250",
"54.164.77.56",
]
for valid_ip in whitelist:
if client_ip_address in ip_network(valid_ip):
print("Request from Trello IP")
break
else:
print("Request from Unknown IP")
return False
return True
@csrf_exempt
def list_webhook(request):
if request.method == "HEAD":
return HttpResponse("OK")
forwarded_for = u'{}'.format(request.META.get('HTTP_X_FORWARDED_FOR'))
if not check_request_from_trello(forwarded_for):
return HttpResponseForbidden("Access Denied, not from Trello")
obj = request.body.decode("utf-8")
data = json.loads(obj)
action = data["action"]
if not action["type"] == "updateCard":
print("Different Action Type")
return HttpResponse(status=200)
if "idList" not in action["data"]["old"]:
print("Card Didn't Move")
return HttpResponse(status=200)
card_id = action["data"]["card"]["id"]
if add_label_to_card(card_id):
print("Added Label")
return HttpResponse(status=200)
**utils.py**
import requests
def add_label_to_card(card_id):
endpoint = "https://api.trello.com/1/cards/"
endpoint += card_id
endpoint += '/labels'
params = {
"name": "logged",
"key": APP_KEY,
"token": TOKEN,
"color": "green"
}
r = requests.post(endpoint, params=params)
if r.status_code == 200:
return True
return r
/r/django
https://redd.it/5jtg26
Hi guys,
A few weeks ago I asked a question about creating a callback url for a webhook [(Original Post Here)](https://www.reddit.com/r/django/comments/5ftsy6/how_do_i_create_a_callback_url_to_consume_a/) and I wanted to give a shoutout to those of you who helped me figure it out.
/u/Niicodemus - for putting it in layman's terms for me and for the bit about ngrok. At the time I did not have my website hosted so I wouldn't have been able to test it locally without the ngrok tip. It was super easy to set up if anyone has questions.
/u/spookylukey - for diving into Trello docs a bit and helping me understand the HEAD request
and /u/vitorfs's article showed me the general layout and walked me through verifying the IP addresses from trello.
So thank you to everyone who commented, I learned a lot from your help and I'm much more comfortable doing this kind of thing again in the future. For those of you curious (and to help those who have similar questions in the future) here is my code. This is all it takes to get it set up. *Comments and feedback welcome*
**Pip Requirements**
requests
ipaddress
**urls.py**
from django.conf.urls import include, url
from django.contrib import admin
from trello.views import list_webhook
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^trelloCallbacks/', list_webhook, name='trello_webhook'),
]
**trello/views.py**
from django.http import HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from ipaddress import ip_address, ip_network
import json
from .utils import add_label_to_card
list_before = '<a_trello_list_id>'
list_after = '<another_trello_list_id>'
def check_request_from_trello(forwarded_for):
client_ip_address = ip_address(forwarded_for)
print(client_ip_address)
whitelist = [
"107.23.104.115",
"107.23.149.70",
"54.152.166.250",
"54.164.77.56",
]
for valid_ip in whitelist:
if client_ip_address in ip_network(valid_ip):
print("Request from Trello IP")
break
else:
print("Request from Unknown IP")
return False
return True
@csrf_exempt
def list_webhook(request):
if request.method == "HEAD":
return HttpResponse("OK")
forwarded_for = u'{}'.format(request.META.get('HTTP_X_FORWARDED_FOR'))
if not check_request_from_trello(forwarded_for):
return HttpResponseForbidden("Access Denied, not from Trello")
obj = request.body.decode("utf-8")
data = json.loads(obj)
action = data["action"]
if not action["type"] == "updateCard":
print("Different Action Type")
return HttpResponse(status=200)
if "idList" not in action["data"]["old"]:
print("Card Didn't Move")
return HttpResponse(status=200)
card_id = action["data"]["card"]["id"]
if add_label_to_card(card_id):
print("Added Label")
return HttpResponse(status=200)
**utils.py**
import requests
def add_label_to_card(card_id):
endpoint = "https://api.trello.com/1/cards/"
endpoint += card_id
endpoint += '/labels'
params = {
"name": "logged",
"key": APP_KEY,
"token": TOKEN,
"color": "green"
}
r = requests.post(endpoint, params=params)
if r.status_code == 200:
return True
return r
/r/django
https://redd.it/5jtg26
reddit
How do I create a Callback URL to consume a Webhook... • /r/django
Hey guys, I'm an intermediate Python developer (and by that I mean definitely not a beginner, but I still need hand holding at times) and I'm...