Launched our first tiny MacOS App Store app written entirely in Python :D Clingwrap: niche app to share custom screen regions in Teams, Zoom, or any video calling app (useful for wide screen monitors)
Sharing my entire 49" screen over Microsoft Teams has always been difficult (people on normal monitors can't see shared widescreen monitors well because of the aspect ratio). Sharing windows also gets annoying because you have to constantly switch between them, which is especially frustrating during presentations or pair programming.
Unfortunately, Teams and Slack don't offer a good way to share only a part of your screen during screen sharing (Although I think Zoom does at this point)
My friend and I always wanted to see what it would be like to launch a small app on MacOS, so we worked on solving this problem. Clingwrap is a simple app with a window that you can share in any video calling program. This window allows you to display custom regions of your screen.
This is the first app I've ever launched and I'm an amateur when it comes to this stuff. It was tough and the app itself certainly is not perfect, but the learning process was rewarding. There are a number of improvements we'd like to make, including having the share window UI be less visible during sharing. It works well enough on our Macs (M1) that it's mostly solved
/r/Python
https://redd.it/10da7pc
Sharing my entire 49" screen over Microsoft Teams has always been difficult (people on normal monitors can't see shared widescreen monitors well because of the aspect ratio). Sharing windows also gets annoying because you have to constantly switch between them, which is especially frustrating during presentations or pair programming.
Unfortunately, Teams and Slack don't offer a good way to share only a part of your screen during screen sharing (Although I think Zoom does at this point)
My friend and I always wanted to see what it would be like to launch a small app on MacOS, so we worked on solving this problem. Clingwrap is a simple app with a window that you can share in any video calling program. This window allows you to display custom regions of your screen.
This is the first app I've ever launched and I'm an amateur when it comes to this stuff. It was tough and the app itself certainly is not perfect, but the learning process was rewarding. There are a number of improvements we'd like to make, including having the share window UI be less visible during sharing. It works well enough on our Macs (M1) that it's mostly solved
/r/Python
https://redd.it/10da7pc
reddit
Launched our first tiny MacOS App Store app written entirely in...
Sharing my entire 49" screen over Microsoft Teams has always been difficult (people on normal monitors can't see shared widescreen monitors well...
Lyrid: New Actor Model Framework for complex parallel programming
I'm really exciting to share my new Python framework for parallel programming called Lyrid. It's still a prototype, but may be if you guys can give me some feedback, I would really appreciate.
Lyrid is an actor model framework, similar to Akka and Erlang, that provides a nice way to design and build a parallel system in Python, which, you know, has some issues with GIL. Not only simple patterns like "computing tasks in parallel and get the results back", but also complex architecture that looks more like a cyclic graph are possible in Lyrid. It enables flexibility to design complex system with the benefit of parallel computing.
Actor model is another paradigm, not OOP, not Functional Programming, saying a system is composed of actors. An actor can have its own state, data, and behavior, similar to OOP. But, an actor works in message-driven manner. Then, actors can interact with each other via message passing only, like in microservices (if done properly).
In this way, it allows the system to be designed for scaling, not only for multi-core, but also on multiple machines. Currently, Lyrid operates on single machine. Might go for large-scale distributed system in the future.
For More detail about Lyrid and
/r/Python
https://redd.it/10dcmpr
I'm really exciting to share my new Python framework for parallel programming called Lyrid. It's still a prototype, but may be if you guys can give me some feedback, I would really appreciate.
Lyrid is an actor model framework, similar to Akka and Erlang, that provides a nice way to design and build a parallel system in Python, which, you know, has some issues with GIL. Not only simple patterns like "computing tasks in parallel and get the results back", but also complex architecture that looks more like a cyclic graph are possible in Lyrid. It enables flexibility to design complex system with the benefit of parallel computing.
Actor model is another paradigm, not OOP, not Functional Programming, saying a system is composed of actors. An actor can have its own state, data, and behavior, similar to OOP. But, an actor works in message-driven manner. Then, actors can interact with each other via message passing only, like in microservices (if done properly).
In this way, it allows the system to be designed for scaling, not only for multi-core, but also on multiple machines. Currently, Lyrid operates on single machine. Might go for large-scale distributed system in the future.
For More detail about Lyrid and
/r/Python
https://redd.it/10dcmpr
New async networking lib with P2P support
Hello Pythonistas,
I spent the last year designing a new async networking library for Python based on what I perceive as short-comings in Python's current networking ecosystem. Some things I don't like about how Python does networking at the moment include:
1. No async support for UDP.
2. Can't use async functions with Protocol classes.
3. Different APIs for UDP and TCP.
4. No way to manage network interface cards.
5. IPv6 is still painful to use.
So I designed a new async API for general networking. Usage looks like this:
The library also supports P2P networking. You can read more about it on https://p2pd.readthedocs.io/
And the project is on Pypi https://pypi.org/project/p2pd/ and Github https://github.com/robertsdotpm/p2pd
/r/Python
https://redd.it/10ddpe4
Hello Pythonistas,
I spent the last year designing a new async networking library for Python based on what I perceive as short-comings in Python's current networking ecosystem. Some things I don't like about how Python does networking at the moment include:
1. No async support for UDP.
2. Can't use async functions with Protocol classes.
3. Different APIs for UDP and TCP.
4. No way to manage network interface cards.
5. IPv6 is still painful to use.
So I designed a new async API for general networking. Usage looks like this:
from p2pd import *
# Load very general interface information.
netifaces = await init_p2pd()
# Load the default interface.
i = await Interface(netifaces=netifaces)
# Select a route to use.
# The address family used is i.supported()[0] when one is not specified.
# When a route is not specified the first route is used.
# Routes control what external addresses are used for networking.
route = await i.route().bind()
# Open a UDP pipe to an echo server.
dest = await Address("p2pd.net", 7, route)
pipe = await pipe_open(UDP, dest, route)
pipe.subscribe()
# Echo client example.
# Recv may time out because it's UDP.
await pipe.send(b"test message", dest.tup)
out = await pipe.recv()
await pipe.close()
The library also supports P2P networking. You can read more about it on https://p2pd.readthedocs.io/
And the project is on Pypi https://pypi.org/project/p2pd/ and Github https://github.com/robertsdotpm/p2pd
/r/Python
https://redd.it/10ddpe4
PyPI
p2pd
Asynchronous P2P networking library and service
Compclasses: prefer composition over inheritance
I am thrilled to share that I just made Compclasses public, a (small) library built to simplify the usage of composition (over inheritance?!) in #python.
Any feedback is very welcomed!
Documentation: https://fbruzzesi.github.io/compclasses
Github: https://github.com/fbruzzesi/compclasses
/r/Python
https://redd.it/10deaff
I am thrilled to share that I just made Compclasses public, a (small) library built to simplify the usage of composition (over inheritance?!) in #python.
Any feedback is very welcomed!
Documentation: https://fbruzzesi.github.io/compclasses
Github: https://github.com/fbruzzesi/compclasses
/r/Python
https://redd.it/10deaff
fbruzzesi.github.io
Compclasses
Like *dataclasses*, but for composition
Python contest worth 50 Euros
Hey guys
Fellow python developer and entrepreneur here.
Me and my team is thinking to host a small coding contest, with 50 euros as the prize money.
We still want to know, if people would be interested in something like this, we are ready with everything else, there's gonna be NO REGISTRATION FEE. So this is not really a promotion.
Just wanna know your views.
If everything works well, then I will post then link in this subreddit too!
Thanks!
/r/Python
https://redd.it/10droer
Hey guys
Fellow python developer and entrepreneur here.
Me and my team is thinking to host a small coding contest, with 50 euros as the prize money.
We still want to know, if people would be interested in something like this, we are ready with everything else, there's gonna be NO REGISTRATION FEE. So this is not really a promotion.
Just wanna know your views.
If everything works well, then I will post then link in this subreddit too!
Thanks!
/r/Python
https://redd.it/10droer
reddit
Python contest worth 50 Euros
Hey guys Fellow python developer and entrepreneur here. Me and my team is thinking to host a small coding contest, with 50 euros as the prize...
I made a web extension that lets you preview content of a links on hover for google. Currently works in chromium browsers. Using flask backend to bypass Cors
You can download it from https://github.com/ipriyam26/preview
The backend is also open sourced and can be found on my github
​
https://reddit.com/link/10daxxd/video/dq5z1nw4rdca1/player
Hosted on a cheap render server so please tolerate the delay
/r/Python
https://redd.it/10daxxd
You can download it from https://github.com/ipriyam26/preview
The backend is also open sourced and can be found on my github
​
https://reddit.com/link/10daxxd/video/dq5z1nw4rdca1/player
Hosted on a cheap render server so please tolerate the delay
/r/Python
https://redd.it/10daxxd
GitHub
GitHub - ipriyam26/preview: Chromium Extension to preview google results on hover.
Chromium Extension to preview google results on hover. - ipriyam26/preview
Good practices for 'merging' information from two different models in order to manipulate them in a template
Hi guys. I'm new to Django, and i'am a little bit lost.
In my application, users can follow communities, and earn points by performing certain actions.
Quests are point goals to earn by performing some actions, users get a reward when they complete a quest. Quests are linked to communities, Epics are a set of Quests to complete. Quests are not necessary related to Epics.
I created these models:
class Quest(models.Model):
QUESTTYPESCHOICES = ('...')
community = models.ForeignKey(Community, ondelete=models.CASCADE)
type = models.CharField(maxlength=20, choices=QUESTTYPESCHOICES)
name = models.CharField(maxlength=100, blank=False)
description = models.TextField(blank=False)
type = models.CharField(maxlength=20, choices=QUESTTYPESCHOICES)
target = models.CharField(maxlength=255, null=True, blank=True)
pointgoal = models.IntegerField()
startdate = models.DateField(null=True, blank=True)
enddate = models.DateField(null=True, blank=True)
class
/r/django
https://redd.it/10dtcfo
Hi guys. I'm new to Django, and i'am a little bit lost.
In my application, users can follow communities, and earn points by performing certain actions.
Quests are point goals to earn by performing some actions, users get a reward when they complete a quest. Quests are linked to communities, Epics are a set of Quests to complete. Quests are not necessary related to Epics.
I created these models:
class Quest(models.Model):
QUESTTYPESCHOICES = ('...')
community = models.ForeignKey(Community, ondelete=models.CASCADE)
type = models.CharField(maxlength=20, choices=QUESTTYPESCHOICES)
name = models.CharField(maxlength=100, blank=False)
description = models.TextField(blank=False)
type = models.CharField(maxlength=20, choices=QUESTTYPESCHOICES)
target = models.CharField(maxlength=255, null=True, blank=True)
pointgoal = models.IntegerField()
startdate = models.DateField(null=True, blank=True)
enddate = models.DateField(null=True, blank=True)
class
/r/django
https://redd.it/10dtcfo
reddit
Good practices for 'merging' information from two different models...
Hi guys. I'm new to Django, and i'am a little bit lost. In my application, users can follow communities, and earn points by performing certain...
How do you manage typing between Django backend and a TypeScript frontend?
Hi Django community. Have you ever worked on an application that uses a Django backend and a TypeScript frontend, and if so, how did you manage your types?
Context: the project I work on basically defines the types twice, i.e. once for the backend and once for the frontend. Keeping the types consistent between the frontend and the backend (i.e. API responses) is a bit of a nuisance and can be error-prone.
/r/django
https://redd.it/10dbxyn
Hi Django community. Have you ever worked on an application that uses a Django backend and a TypeScript frontend, and if so, how did you manage your types?
Context: the project I work on basically defines the types twice, i.e. once for the backend and once for the frontend. Keeping the types consistent between the frontend and the backend (i.e. API responses) is a bit of a nuisance and can be error-prone.
/r/django
https://redd.it/10dbxyn
reddit
How do you manage typing between Django backend and a TypeScript...
Hi Django community. Have you ever worked on an application that uses a Django backend and a TypeScript frontend, and if so, how did you manage...
Django SaaS boilerplate with cookiecutter
https://github.com/ErnestoFGonzalez/djangorocket
/r/django
https://redd.it/10dhsg5
https://github.com/ErnestoFGonzalez/djangorocket
/r/django
https://redd.it/10dhsg5
GitHub
GitHub - ernestofgonzalez/djangorocket: A Django SaaS boilerplate
A Django SaaS boilerplate. Contribute to ernestofgonzalez/djangorocket development by creating an account on GitHub.
How to save files locally when AWS s3 is unavailable
Hi there! In our project we use s3 (via django-storages) as a default media storage, our application makes a lot of photos and sends it to the cloud. But in reality, our customers sometimes use our service with very unstable internet connection, so sometimes we cannot save images and just lose it.
I was thininking about overriding _save method of "S3Boto3Storage" adding condition checking if there is connection to AWS. And if no, save it using the new class instance of
And additionally I planned to schedule a celery job to try sending locally stored photos to S3 and delete it from the locale storage in case of success.
But seems like it is connecting to the AWS long time before _save method has been called, and that means that we need to override almost every method or to write own custom storage backend completely. Moreover, I am not really sure whether this will be a good practice. Does anyone have any suggestions or a piece of advice?
/r/django
https://redd.it/10dqxge
Hi there! In our project we use s3 (via django-storages) as a default media storage, our application makes a lot of photos and sends it to the cloud. But in reality, our customers sometimes use our service with very unstable internet connection, so sometimes we cannot save images and just lose it.
I was thininking about overriding _save method of "S3Boto3Storage" adding condition checking if there is connection to AWS. And if no, save it using the new class instance of
Django.core.files.storage.FileSystemStorageAnd additionally I planned to schedule a celery job to try sending locally stored photos to S3 and delete it from the locale storage in case of success.
But seems like it is connecting to the AWS long time before _save method has been called, and that means that we need to override almost every method or to write own custom storage backend completely. Moreover, I am not really sure whether this will be a good practice. Does anyone have any suggestions or a piece of advice?
/r/django
https://redd.it/10dqxge
reddit
How to save files locally when AWS s3 is unavailable
Hi there! In our project we use s3 (via django-storages) as a default media storage, our application makes a lot of photos and sends it to the...
Tuesday Daily Thread: Advanced questions
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/10dwvx5
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/10dwvx5
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
SocketIO but multiple "background threads" - where to "spawn" them?
Hi all! First time using the SocketIO package, and have read a ton of tutorials, but they're all kinda "bare minimum", and usually only use a single background thread, and on top of it, it's a "global" (eww).
I basically have a bunch of client-side ajax requests that I'm wanting to convert over to a SocketIO-type configuration where each ajax request is a separate thread that runs queries and returns data back to the clients.
I don't really know how to set this type of thing up where multiple background threads are working. Like, where to put it in my code exactly. I'm also not sure how to "monitor" those threads to know when one dies (for whatever reason) and needs to be re-spawned again.
Does anyone have a working example of this? I'm trying to avoid globals as well if possible.
/r/flask
https://redd.it/10e0kct
Hi all! First time using the SocketIO package, and have read a ton of tutorials, but they're all kinda "bare minimum", and usually only use a single background thread, and on top of it, it's a "global" (eww).
I basically have a bunch of client-side ajax requests that I'm wanting to convert over to a SocketIO-type configuration where each ajax request is a separate thread that runs queries and returns data back to the clients.
I don't really know how to set this type of thing up where multiple background threads are working. Like, where to put it in my code exactly. I'm also not sure how to "monitor" those threads to know when one dies (for whatever reason) and needs to be re-spawned again.
Does anyone have a working example of this? I'm trying to avoid globals as well if possible.
/r/flask
https://redd.it/10e0kct
reddit
SocketIO but multiple "background threads" - where to "spawn" them?
Hi all! First time using the SocketIO package, and have read a ton of tutorials, but they're all kinda "bare minimum", and usually only use a...
Comprehensive Guide to Testing a Flask Application with Pytest
Hey there guys!
I'm searching for some comprehensive guide on how to test a flask app. I have some protected views implemented with flask-login and can't test them easily. Also there's other functionality that's beyond the easy beginner stuff but my skill's not there yet. Do you know of some good resources to dive deeper into testing with a flask app?
/r/flask
https://redd.it/10ddd42
Hey there guys!
I'm searching for some comprehensive guide on how to test a flask app. I have some protected views implemented with flask-login and can't test them easily. Also there's other functionality that's beyond the easy beginner stuff but my skill's not there yet. Do you know of some good resources to dive deeper into testing with a flask app?
/r/flask
https://redd.it/10ddd42
reddit
Comprehensive Guide to Testing a Flask Application with Pytest
Hey there guys! I'm searching for some comprehensive guide on how to test a flask app. I have some protected views implemented with flask-login...
Trying to build a dynamic Table using Flask/turbo/threading
Hey guys
Im currently trying to create a dynamicly updating table, housing some data and I'm slowly loosing it.
The problem is, no matter what I do, I can't seem to get it to consistently update.
The wierd thing is, sometimes it will randomly work,but it will start duplicating the "delete all" button with every update. And then after a quick reload of the side, without changing anything in the code, it won't update anymore.
I also sometimes get a "GET /turbo-stream HTTP/1.1" 500 -" error, and then without changing anything, just restarting frontend.py, it won't appear again.
The following code is what I have currently:
frontend.py:
import threading
import time
from flask import Flask, Response, render_template, url_for
from turbo_flask import Turbo
from Backend import Backend
app = Flask(__name__)
turbo = Turbo(app)
app.config['SERVER_NAME'] = '192.168.2.183:5000'
#This is what trap_data looks like (for a single entry):
#(141, '192.168.1.1', 'Authentication Failure', 'Invalid username or password', 3, 1,
/r/flask
https://redd.it/10dw2xv
Hey guys
Im currently trying to create a dynamicly updating table, housing some data and I'm slowly loosing it.
The problem is, no matter what I do, I can't seem to get it to consistently update.
The wierd thing is, sometimes it will randomly work,but it will start duplicating the "delete all" button with every update. And then after a quick reload of the side, without changing anything in the code, it won't update anymore.
I also sometimes get a "GET /turbo-stream HTTP/1.1" 500 -" error, and then without changing anything, just restarting frontend.py, it won't appear again.
The following code is what I have currently:
frontend.py:
import threading
import time
from flask import Flask, Response, render_template, url_for
from turbo_flask import Turbo
from Backend import Backend
app = Flask(__name__)
turbo = Turbo(app)
app.config['SERVER_NAME'] = '192.168.2.183:5000'
#This is what trap_data looks like (for a single entry):
#(141, '192.168.1.1', 'Authentication Failure', 'Invalid username or password', 3, 1,
/r/flask
https://redd.it/10dw2xv
reddit
Trying to build a dynamic Table using Flask/turbo/threading
Hey guys Im currently trying to create a dynamicly updating table, housing some data and I'm slowly loosing it. The problem is, no matter what...
I can't get it to render a template, it just appears in the response and not on the webpage itself
https://redd.it/10dntuu
@pythondaily
https://redd.it/10dntuu
@pythondaily
reddit
I can't get it to render a template, it just appears in the...
Posted in r/flask by u/olishott • 5 points and 9 comments