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
Segmentation fault with SQL Server driver on Linux?

I’m trying to run a Django application on opensuse 42.1, using python 3.4.5 and Django 2.0.14, pyodbc 4.0.25, and Django-pyodbc-azure 2.0.8

For some reason, when making multiple queries when navigating to a dashboard page, the program fails with a segmentation fault. I have installed Microsoft’s Linux drivers for sql server from their website. Has anyone run into this error and if so did you manage to find a solution?

/r/django
https://redd.it/auc3on
Where and how do all of you place your virtual environments?

I'm about to create my first virtual environments(VE) and found out there are different methods of storing all those directories. I'm just wonder what some of you do to manage and organize you folders. Please explain your reasoning if there was one. Seeing what different people do to organize their work could give me better ways to organize mine and I don't like it when my computer clutters!

​

Personally, I'm thinking of making a folder called "Projects" in my home directory. Then, create VEs in Projects.

/r/Python
https://redd.it/au904b
python autoscale to match computer resources?

I'm looking for something that can create new instances of a python script based off of the available resources on the computer.

​

My stack includes an AWS SQS which I pull from and then run operations based off of. I would like to be able to retrieve from SQS and then auto scale depending on available resources on the computer. is there anything that can help me with this or do I have to create something myself? if so what do you have any suggestions?

/r/Python
https://redd.it/aug92z
Having trouble integrating a project with Sql Server on Linux. Wondering if anyone else has encountered this bug.

I am trying to deploy a Django app (using 2.0.13) on Python 3.4.5 to a linux server running openSuse 42.1

My app runs 5 separate api requests when the user logs in. On my local windows box, it runs fine, but when I go to deploy it to production, I get a segmentation fault. I have installed Microsofts official database drivers for both Sql Server 13.1 and 17.

​

My project dependencies are:

Django==2.0.13
pyodbc==4.0.25
django-pyodbc-azure==2.0.8.0

Has anyone else encountered an error like this before?

/r/djangolearning
https://redd.it/aue61a
[D] Machine Learning - WAYR (What Are You Reading) - Week 57

This is a place to share machine learning research papers, journals, and articles that you're reading this week. If it relates to what you're researching, by all means elaborate and give us your insight, otherwise it could just be an interesting paper you've read.

Please try to provide some insight from your understanding and please don't post things which are present in wiki.

Preferably you should link the arxiv page (not the PDF, you can easily access the PDF from the summary page but not the other way around) or any other pertinent links.

Previous weeks :

|1-10|11-20|21-30|31-40|41-50|51-60|
|----|-----|-----|-----|-----|-----|
|[Week 1](https://www.reddit.com/4qyjiq)|[Week 11](https://www.reddit.com/57xw56)|[Week 21](https://www.reddit.com/60ildf)|[Week 31](https://www.reddit.com/6s0k1u)|[Week 41](https://www.reddit.com/7tn2ax)|[Week 51](https://reddit.com/9s9el5)||||
|[Week 2](https://www.reddit.com/4s2xqm)|[Week 12](https://www.reddit.com/5acb1t)|[Week 22](https://www.reddit.com/64jwde)|[Week 32](https://www.reddit.com/72ab5y)|[Week 42](https://www.reddit.com/7wvjfk)|[Week 52](https://reddit.com/a4opot)||
|[Week 3](https://www.reddit.com/4t7mqm)|[Week 13](https://www.reddit.com/5cwfb6)|[Week 23](https://www.reddit.com/674331)|[Week 33](https://www.reddit.com/75405d)|[Week 43](https://www.reddit.com/807ex4)|[Week 53](https://reddit.com/a8yaro)||
|[Week 4](https://www.reddit.com/4ub2kw)|[Week 14](https://www.reddit.com/5fc5mh)|[Week 24](https://www.reddit.com/68hhhb)|[Week 34](https://www.reddit.com/782js9)|[Week 44](https://reddit.com/8aluhs)|[Week 54](https://reddit.com/ad9ssz)||
|[Week 5](https://www.reddit.com/4xomf7)|[Week 15](https://www.reddit.com/5hy4ur)|[Week 25](https://www.reddit.com/69teiz)|[Week 35](https://www.reddit.com/7b0av0)|[Week 45](https://reddit.com/8tnnez)|[Week 55](https://reddit.com/ai29gi)||
|[Week 6](https://www.reddit.com/4zcyvk)|[Week 16](https://www.reddit.com/5kd6vd)|[Week 26](https://www.reddit.com/6d7nb1)|[Week 36](https://www.reddit.com/7e3fx6)|[Week 46](https://reddit.com/8x48oj)|[Week 56](https://reddit.com/ap8ctk)||
|[Week 7](https://www.reddit.com/52t6mo)|[Week 17](https://www.reddit.com/5ob7dx)|[Week 27](https://www.reddit.com/6gngwc)|[Week 37](https://www.reddit.com/7hcc2c)|[Week 47](https://reddit.com/910jmh)||
|[Week 8](https://www.reddit.com/53heol)|[Week 18](https://www.reddit.com/5r14yd)|[Week 28](https://www.reddit.com/6jgdva)|[Week 38](https://www.reddit.com/7kgcqr)|[Week 48](https://reddit.com/94up0g)||
|[Week 9](https://www.reddit.com/54kvsu)|[Week 19](https://www.reddit.com/5tt9cz)|[Week 29](https://www.reddit.com/6m9l1v)|[Week 39](https://www.reddit.com/7nayri)|[Week 49](https://reddit.com/98n2rt)||
|[Week 10](https://www.reddit.com/56s2oa)|[Week 20](https://www.reddit.com/5wh2wb)|[Week 30](https://www.reddit.com/6p3ha7)|[Week 40](https://www.reddit.com/7qel9p)|[Week 50](https://reddit.com/9cf158)||

Most upvoted papers two weeks ago:

/u/whenmaster: [Self-Attention Generative Adversarial Networks](https://arxiv.org/abs/1805.08318)

/u/UnluckyLocation: [Dynamic Sum Product Networks for Tractable Inference on Sequence Data](https://arxiv.org/abs/1511.04412)

/u/lmcinnes: [Limit theory for point processes in manifolds](https://arxiv.org/abs/1104.0914)

Besides that, there are no rules, have fun.

/r/MachineLearning
https://redd.it/auci7c
multiprocessing help

def calc_square(numbers):
for n in numbers:
print(n**2)

def calc_cube(numbers):
for n in numbers:
print(n**3)

if __name__ == "__main__":
arr = [2,3,5,8,13,21,34,55]
p1 = multiprocessing.Process(target=calc_square, args=(arr, ))
p2 = multiprocessing.Process(target=calc_cube, args=(arr, ))

p1.start()
p2.start()

p1.join()
p2.join()

I'm trying to do multiprocessing with Python 3. Whenever I run the code above, it doesn't seem to do anything. I would expect it to print the squares and cubes of the values in arr. Did I do something wrong?

/r/Python
https://redd.it/auhwm5
How To Set Up Jupyter Notebook with Python 3 on Ubuntu 18.04

[http://dev.edupioneer.net/7145a27b50](http://dev.edupioneer.net/7145a27b50)

/r/Python
https://redd.it/aujajd
Made a reddit scapper for updating wallpapers

Hello, I wanted to learn about reddit scrapping using praw, so I made a GUI app using PyQt which will browse a given subreddit and will download top images every week and change your wallpaper everyday.

​

[Github Link](https://github.com/vinaysb/Wallpaper-Updater)

/r/Python
https://redd.it/aujkel
Does anybody know what is going on with micropython?

This topic might be a bit off-topic here, but the micropython-themed subs are dead. Has the project failed or something? Has the hardware side been abandoned by the official micropython team? The pyboard is permanently "out of stock".

Is there a new reference board? Something I can buy to play around with no real goal in mind?

/r/Python
https://redd.it/aulvm0
Several Django projects, one Web Server

Which is the best approach to deploy different Django projects under the same Web Server?


I got a Ubuntu Server, running Nginx, and I got a Django project (django-wiki) under [www.example.com](https://www.example.com)

​

But I need to create others apps and install other packages like django-blog, create a custom system and add new ideas for further projects.


Should I have a virtual environment for each project?


/opt/wiki/venv

/opt/blog/venv

/opt/my-new-proj/venv

​

Creating different files to start/stop at boot using gunicorn under systemD or should I group the different projects under the same folder and overload the virtual environment?


If I keep the projects isolated, using Gunicorn I could create different files to use with SystemD. Is it fine?

​

Also, what happens with the Nginx config files serving different projects like

[www.example.com/wiki](https://www.example.com/wiki)

[www.example.com/blog](https://www.example.com/blog)

[www.example.com/my-new-proj](https://www.example.com/my-new-proj)

​

I would like to know your ideas and advice about good practices deploying Django apps.

​

Thanks in advance!

​

/r/django
https://redd.it/auo855
I was playing with turtle and made this

/r/Python
https://redd.it/aup1c3
Django Saleor cms code explained

Django Saleor cms code explained

​

hello not sure if you anyone would be willing help but i have the python down and looking to dive down into the language more so i wondering if anyone could give me walk through of saleor code and help me learn of it all works togather.



example would be how saleor sends data from dashboard to database when i create a new product and what code is responsible for that?

more then willing to pay for this service

/r/django
https://redd.it/aur6cy
[D] Great idea, how to publish?

I'm an independent software developer. While working on my own image processing project I invented a "thing". There is no reason to keep it to myself, as idea it's not patentable. What I'd like is to make it public and add something to my resume. What is the right way of doing it?
As for the idea:

1. It gives great, clear benefits.

2. it's generic and applicable in other domains as well.

3. it's intuitive. If I tell most of you will say 'nice' even before looking at the results.

4. it's easy to implement. I did it in pytorch, it's as easy to do in tensorflow or any other similar tool.


It would be quite popular, but I've seen nothing like this. So, I think it's something really new and worth publishing.

/r/MachineLearning
https://redd.it/aul89k
This media is not supported in your browser
VIEW IN TELEGRAM
First Program / GUI EVER! (Follow Up Video) | This is a continuation from last week where I posted my flooring calculator CLI program that everyone was so supportive of. Just wanted to let everyone know I have made a GUI for it. Not quite finished but it works flawlessly! :D

/r/Python
https://redd.it/aup5bi
Simple Flask Apps (no db)

I'm teaching a Flask course at the moment, and the requirements are that students do *not* use a database (introduced next unit). There's no flexibility around this requirement.

​

What are some ideas for apps that students can create? Here are a couple I've come up with:

* Madlibs
* Coin toss
* Random numbers
* Random student from list
* Tax calculator
* Home loan repayment calculator

​

Some simple APIs that they've experimented with:

* Chuck Norris
* ISS

/r/flask
https://redd.it/aus1jh
Trouble rendering wtform validator error

With the below I have a simple form with a text input box. I have set the `InputRequired()` validator on `SignUpForm`; however when I run localhost I don't get the validator message "Wrong value" if no input is supplied when I push the submit button.

​

from flask import Flask, request, render_template, redirect, url_for
from . import forms

app = Flask(__name__)
app.secret_key = "Shhhhh!"

@app.route('/', methods=['GET', 'POST'])
def index():
form = forms.SignUpForm()
if form.validate_on_submit():
return redirect(url_for('forward'))
return render_template('index.html', form=form)

@app.route('/forward', methods=['POST'])
def forword():
if request.method == 'POST':
return render_template('forward.html')

​

from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import InputRequired, Email


/r/flask
https://redd.it/auucc8