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
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
I wrote a script to help you set your Wi-Fi name to an emoji 🤠 💩

It's for Verizon FiOS routers, which, like most routers, only let you use ASCII text for your SSID. Where's the fun in that?

​

[https://github.com/michaelkolber/emojifi](https://github.com/michaelkolber/emojifi)

/r/Python
https://redd.it/cbsg0y
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
Channels works in development but not in production when passing user

I am using channels and would like to have access a user's info in the front-end, so following the tutorial, I wrote the following code:

class ChatConsumer(WebsocketConsumer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.groups is None:
self.groups = []
self.room_name = self.scope['url_route']['kwargs']['room_name']
self.room_group_name = 'chat_%s' % self.room_name

def connect(self):
# Join room group
async_to_sync(self.channel_layer.group_add)(
self.room_group_name,
self.channel_name


/r/django
https://redd.it/cc5rp4
[R] Facebook, Carnegie Mellon build first AI that beats pros in 6-player poker

Pluribus is the first AI bot capable of beating human experts in six-player no-limit Hold’em, the most widely-played poker format in the world. This is the first time an AI bot has beaten top human players in a complex game with more than two players or two teams.

​

Link: [https://ai.facebook.com/blog/pluribus-first-ai-to-beat-pros-in-6-player-poker/](https://ai.facebook.com/blog/pluribus-first-ai-to-beat-pros-in-6-player-poker/)

/r/MachineLearning
https://redd.it/cbz7lg
I wrote an integrated POS system for my girlfriend's restaurant using tkinter.
https://imgur.com/a/RKeuCva

/r/Python
https://redd.it/cc5ch7
# 1
# 2
# 3
# 4
# 5
# 6
# 7
# 8
# 9
# 10
# 11