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
Help finding it hard to memorize all the functions and operating languages. Is there a cheatsheet or anything so i don't have to remember all of this?

It doesnt have to be super indepth. Just need something for the basics, strings and whatnot.

/r/Python
https://redd.it/cbfkfm
[D] Controversial Theories in ML/AI?

As we know, Deep Learning faces certain issues (e.g., generalizability, data hunger, etc.). If we want to speculate, which controversial theories do you have in your sights you think that it is worth to look nowadays?

So far, I've come across 3 interesting ones:

1. Cognitive science approach by Tenenbaum: [Building machines that learn and think like people](https://arxiv.org/abs/1604.00289). It portrays the problem as an architecture problem.
2. Capsule Networks by Hinton: [Transforming Autoencoders](https://www.cs.toronto.edu/~hinton/absps/transauto6.pdf). More generalizable DL.
3. Neuroscience approach by Hawkins: [The Thousand Brains Theory](https://numenta.com/neuroscience-research/research-publications/papers/a-framework-for-intelligence-and-cortical-function-based-on-grid-cells-in-the-neocortex/). Inspired by the neocortex.

What are your thoughts about those 3 theories or do you have other theories that catch your attention?

/r/MachineLearning
https://redd.it/cbgizh
Lost Phone

Has anyone on this sub lost a phone on Alnmouth beach Northumberland? We can’t ring the contact who text the phone but there was a notification from this sub.

Edit: The phone was found on the beach between Alnmouth and Warkworth

/r/Python
https://redd.it/cbgpqu
This media is not supported in your browser
VIEW IN TELEGRAM
I made a program which encrypts the RGB value of each pixel using an 8 bit key and xor encryption that i learnt in school. Not sure if there is a real usecase for this however i find it pretty cool

/r/Python
https://redd.it/cbhenw
Best practice on ATOMIC_REQUESTS

It looks like ATOMIC\_REQUESTS is off by default in Django, but I've talked to a lot of people who turn it on. I agree that it does help reason about requests (since a request can complete fully or not at all), but to me it also creates potential hazards. For instance, what if, as a side-effect, I send a user an alert or something, then end up rolling back the transaction? I could always put that in an "on\_commit" call but that seems tedious.

​

What do people usually do?

/r/django
https://redd.it/cbmehj
Learning Python as a blind person, any advice?

So, I've diligently been trying to learn Python on my own, as I've heard there are many advantages to how easy the syntax is. I even tried to make an interest calculator from scratch.
I believe that the only way to learn programming is to type the commands out yourself, even if you have them right in front of you. This enforces true conceptual learning and makes it easier to memorize. I did this with both JS and HTML 5, and they worked. I'm getting my tutorials straight from python.org.
With all of this said, It's really difficult to judge how much white space I need before every line, thus I keep getting syntax errors based on this one simple problem.
As the post title states, I am indeed fully blind, as in can't see at all. So, it's really difficult to judge the amount of white space required for this reason, and Idol is not exactly screen reader friendly either. Unfortunately, as I know that Idol is what comes with Python when you get it. I'm currently running Python 3.7.
With all of this info, do any of you Python programmers have any advice as to which editors are

/r/Python
https://redd.it/cbpcw6
Best way to have free and paid member groups.

So I'm working on an app and there will be two tiers: Free and Paid.


Currently I have it working where users who are a part of the "Free User" group can upload 5 files. After that when they try to access the app's upload page, they are returned to a page that says they must be a paid member.


User's in the "Gold Member" (paid member) group can upload unlimited files.


What would be the best process for integrating payment with this? I guess I will use stripe since it seems to be the new paypal.

​

But should I have members be automatically assigned to the free group when they sign up, then give an option to pay later?

​

How would this work? Is there some sort of API integration with stripe where after a payment is submitted, I can do something in django language that changes a user's group?

​

It seems like I should give users the option to become paid straight from signup. Maybe through a checkbox / boolean field? For example after the standard username password and email fields, present:

​

Select Your Membership Level:


Free . . .

/r/django
https://redd.it/cbr8do
What non-Python tech do you use with Django?

As the title says, what non-Python tech do you use with Django? For example, Docker, Travis CI, etc

/r/django
https://redd.it/cbsfm4
Server Issues

Tl/dr: What pip installs to get flask working do I need?

Hi! I've just finished creating a small website using python flask and decided it was time to upload it to a hosting server for the world to see. However this has not gone according to plan and I've had to rethink my whole project.

The hosting service I have access to is a2 hosting, they have no documentation on deploying Flask and after asking a member of staff for help I was left hanging.

So, after a few hours of googling around, reading about passenger_wsgi and how it helps apache servers understand python apps I've came to a dead-end.

I've managed to get a basic helloWorld.py file working on the homepage, however when I move to the second page and try to render a template I receive an Internal Server Issue.

I ssh'd into the server to install flask, njinx, jinja2 etc however none of these have fixed my issues. Are there other pip installs I'll need for this to work?


www.jamfish.co.uk

The second url is assigned to '/second'

Thanks for your time today, any help would be amazing. If I figure out how to fix this I'll update the post.

/r/flask
https://redd.it/cbu7qt
Attempting to import a .xlsx file, receiving an error for invalid date

Hello. I am attempting to import a .xlsx file using django-import-export. But I'm receiving an error when I am importing the file:

RELEASDATEJP

Enter a valid date

​

Here is what the first line of my .xlsx file looks like:

[https://i.imgur.com/gcgylvA.jpg](https://i.imgur.com/gcgylvA.jpg)

https://i.redd.it/gea0scndvk931.jpg

​

My [settings.py](https://settings.py) file has:

DATE\_INPUT\_FORMATS = \['%d/%b/%Y'\]

​

my [models.py](https://models.py) file:

releaseDateJP = models.DateField(null=True,blank=True)
releaseDatePAL = models.DateField(null=True,blank=True)
releaseDateNA = models.DateField(null=True,blank=True)

/r/django
https://redd.it/cbpj3p
HELP! KernelRestarter: restart failed

When I run python it works fine, but when I open R files they no longer work. This suddenly happened. It does the Kernel Restarter a few times until it finally says KernelRestarter: restart failed.

​

How come it suddenly does not work? Why does it work for Python but not R?

​

Thanks for the help!

/r/JupyterNotebooks
https://redd.it/cbq60d
Using Websocket vs Polling Webserver every 5 seconds or so?

Currently I am polling my server every X seconds using JavaScript (with a limit of course) to retrieve some data that is processed later to give the user a faster experience.

Would using a websocket be better? As of course no need for polling or a limit.

How would one benefit vs pollng the webserver?

/r/flask
https://redd.it/cbumru
TOC Depth

How do I increase the maximum level of depth of my table of contents? I need 6 sub-headings, but it can only give me 5

/r/IPython
https://redd.it/cbuxt6
Does anyone here work for themselves?

I am learning Django and web dev in general because I want to freelance part-time to pay the bills while working on side projects that either build side income or turn into a full-fledged business. I am currently in a customer-facing position that I don’t enjoy very much and I want to do web development full-time in some form or another.

My fallback plan is that worse comes to worst, I can get a job as a junior Django developer and I would be okay with that in the short term.

I am wondering if anyone here either freelances on the side while building out other projects that bring in income, or are trying to do so.

Would love to hear any anecdotes of people who are doing this or others who may be looking to follow a similar path.

/r/django
https://redd.it/cbxyel
This media is not supported in your browser
VIEW IN TELEGRAM
First time at tkinter. Made a tiny gui which shuffles love statements.

/r/Python
https://redd.it/cbw0je