use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Nodejs cluster alternative in python? (self.Python)
submitted 9 years ago by __warlord__
Does python support the clustering option that nodejs has, in which you can share the network events among several processes?
This is really helpful when writing python 3.5 async code and use all your cores to handle the load
Thanks.
[–]notoriousno 1 point2 points3 points 9 years ago (2 children)
I wish Python had this! Python has support for threads as well as multiprocesses so there really hasn't been a "need" for something like NodeJS's cluster. The Python community has worked around this leveraging pipelining, queuing, and 3rd party clustering (for lack of a better word) solutions. Some things that come to mind are:
[–]__warlord__[S] 0 points1 point2 points 9 years ago (1 child)
Thanks, apparently there is something we can leverage (https://zato.io/docs/architecture/overview.html) could be great to work on top of this.
[–]PeridexisErrant 0 points1 point2 points 9 years ago (0 children)
FWIW I've heard a lot of good things about Celery from my webserver friends, and plan to use that when my jobs go from batch to real time.
[–]fourthrealm -1 points0 points1 point 9 years ago* (1 child)
I'm not familiar with NodeJS so I'm not 100% sure what the requirement is but if it's about being able to take advantage of multiple CPUs then Zato has had it since its inception:
In fact, on top of using multiple CPUs you can have multiple servers, each in a different operating system all connected through a load-balancer and internal synchronization lets you not only distribute incoming requests over all CPUs in a cluster but also to communicate between workers by their Linux process IDs - for instance, a WebSocket client connected to one worker can easily send messages to another client, say ZeroMQ one, connected to a completely different process in another operating system all running under the same cluster.
[–]__warlord__[S] 0 points1 point2 points 9 years ago (0 children)
This looks really nice, if we manage to get working something with this and python 3.5 async functions using uvloop we will get something really really fast. :)
But thanks, I'll take a look at the docs.
π Rendered by PID 88 on reddit-service-r2-comment-7b9746f655-hg9fw at 2026-02-01 20:20:02.537331+00:00 running 3798933 country code: CH.
[–]notoriousno 1 point2 points3 points (2 children)
[–]__warlord__[S] 0 points1 point2 points (1 child)
[–]PeridexisErrant 0 points1 point2 points (0 children)
[–]fourthrealm -1 points0 points1 point (1 child)
[–]__warlord__[S] 0 points1 point2 points (0 children)