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
Statistics for Software: Instrumenting Code for Reliability and Performance
https://www.paypal-engineering.com/2016/04/11/statistics-for-software/

/r/pystats
https://redd.it/4ecj6q
Jupyter Events Calendar

This calendar contains the dates and locations of Jupyter Developer talks and workshops.
[Jupyter Events](https://calendar.google.com/calendar/embed?src=p51j0ac1iccmj44tae12hq4dk0%40group.calendar.google.com&ctz=America/Los_Angeles)

/r/IPython
https://redd.it/4t2g9y
Causal Discovery Software Available for Big Data Analysis

The Center for Causal Discovery (CCD) (www.ccd.pitt.edu) has released the Fast Greedy Search (FGS) algorithm (an optimized version of Chickering's Greedy Equivalence Search algorithm) for use by biomedical investigators who are searching for causal associations in large sets of continuous data. A technical paper describing the optimization is available at http://arxiv.org/abs/1507.07749. It is available as free and open source software. This release is just the first step toward providing a suite of algorithms that will assist biomedical researchers in analyzing their data to obtain causal insights.
  
Using simulated data, FGS was able to learn a causal network on data containing 50,000 variables and 1,000 samples in about 15 minutes on a laptop computer. While FGS does not model hidden variables that cause two or more measured variables, an upcoming release of another algorithm will do so.

FGS is available as a command line implementation (Causal-cmd) that calls a local Java library or as a Java web application (Causal-web) that runs the analysis at the Pittsburgh Supercomputing Center; the API’s can also be run through R (R-causal) or Python (Py-causal). Additional details and instructions for downloading both these versions of the software are available at
http://www.ccd.pitt.edu/wiki/index.php?title=Tools_and_Software.

Our goal is to help the biomedical community use causal modeling to gain novel insights and drive innovative research, so we hope to make these tools as usable and useful as possible. We welcome any and all feedback that you might have, which will help us improve this and future releases.

/r/pystats
https://redd.it/4cqctx
Recycle Python Program

I am still in the mist of learning python programming and I wanted to create a little program. This program basically is an alternative to the "rm" command we love and hate on our linux/unix based systems. The program instead sends things to the recycle/trash bin. I am still trying to expand on the functionality of the program but I do hope you all can check it out and maybe test it out a bit and let me know what you think. Something like this may exist already but I guess I just wanted to create my first "why isn't there..." based program.


I created it on my my mac, and I think the program will work on linux too. I had issues getting the install script to run on systems that use "yum" package manager. I tried to automate it all, but honestly all you need to run the program is python3 and send2trash module using pip3. Would love to have suggestions on improving the code to make it as elegant as possible.

https://github.com/tarrell13/Recycle

/r/Python
https://redd.it/5jib2h
Internal Server Error!

Hi all!

Back again here with a flask question. I am a beginner and learn some awesome things from reddit (how to legit code).

Here is my code that I have grabbed certain information from an API that I am now trying to host locally through flask.

from flask import Flask, render_template
import httplib
import json

app = Flask(__name__)


@app.route('/')
def index():
connection = httplib.HTTPConnection('api.football-data.org')
headers = {'X-Auth-Token': 'this is my api token here', 'X-Response-Control': 'minified'}
connection.request('GET', '/v1/competitions/426/leagueTable', None, headers)
response = json.loads(connection.getresponse().read().decode())
return response


if __name__ == '__main__':
app.run()



When I run 127.0.0.1:5000 I get:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.


Here is what my server is telling me!

MacBooks-MBP:Football macbookpro13$ python Footy_Web.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2016-12-20 13:58:17,493] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Python/2.7/site-packages/flask/app.py", line 1642, in full_dispatch_request
response = self.make_response(rv)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1746, in make_response
rv = self.response_class.force_type(rv, request.environ)
File "/Library/Python/2.7/site-packages/werkzeug/wrappers.py", line 847, in force_type
response = BaseResponse(*_run_wsgi_app(response, environ))
File "/Library/Python/2.7/site-packages/werkzeug/wrappers.py", line 57, in _run_wsgi_app
return _run_wsgi_app(*args)
File "/Library/Python/2.7/site-packages/werkzeug/test.py", line 871, in run_wsgi_app
app_rv = app(environ, start_response)
TypeError: 'dict' object is not callable
127.0.0.1 - - [20/Dec/2016 13:58:17] "GET / HTTP/1.1" 500 -




I should mention this code works outside of the flask framework!





EDIT:

I HAVE SOLVED THIS THANKS TO STACKOVERFLOW:

I NEEDED TO print(jsonify(response))

/r/flask
https://redd.it/5jfdnx
Django Development on OSX - Best Practices?

I have very little experience with OSX, but work is getting me a macbook pro.
I have 20 years experience with windows and maybe effectively 2-3 years with linux.

I use Windows for work. I've learned three things about python/django development on windows:

1. It's possible
2. Don't. It's a trap!
3. Windows is great for running VMs which allow you to use Vagrant or a remote interpreter.

Just learned that I'm getting a macbook pro for work, so I figured I'd put a little thought into my work environment before I get it. Might be a few weeks with the holidays.

For the most part, I use Pycharm Professional for django development.

Are there pitfalls or best practices developing django on OSX?

/r/django
https://redd.it/5jk12r