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
Launching Jupyter in Venv

Does launching Jupyter Lab from inside an activated Venv make any terminals opened in the notebook automatically in the Venv as well?


/r/IPython
https://redd.it/au33y6
get_object_or_404 custom message/page

I'm going though Django off tutorial and have a question regarding 404 message, I cant find a way to customize it.

Page not found(404)
No Question matches the given query.

this message is not something I would love to show on a real website.

With Http404 method it is really easy to customize an error message like tutorials shows:

from django.http import Http404
def detail(request, question_id):
try:
question = Question.objects.get(pk=question_id)
except Question.DoesNotExist:
raise Http404("Question does not exist")


Is there a similar way with get_object_or_404 method? If not, why use it?

/r/djangolearning
https://redd.it/atwg50
This media is not supported in your browser
VIEW IN TELEGRAM
Animated Dijkstra, sidewinder maze, pillow and imageio (xpost /r/proceduralgeneration

/r/Python
https://redd.it/au3ha5
Happening now: Pycon APAC 2019 - Talk hosted by one of Pycharm's lead devs Dmitry Trofimov

/r/Python
https://redd.it/au5owj
Mastering Django 2 – The Book - what are your thoughts, is it worth the price?

Hello, I'm making fairly big project with Django... Probably the way I do it is not the best way to do it but I have no other choice since I have like one month to complete the project and I have to learn on the fly. Right now I'm using django documantation and sometimes stackoverflow, but some things are not clear enough and I'm looking for another good reference material. Would "Mastering Django 2 – The Book" be good or maybe you can recommend something better?

/r/django
https://redd.it/au6t4g
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