Sidebar

Python

"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python SpongeB0B 1 month ago 83%
Installing gunicorn once on the OS and reuse it between venv ?

cross-posted from: https://programming.dev/post/17866168 > Hi, > > I use [gunicorn](https://gunicorn.org) in my [venv](https://docs.python.org/3/library/venv.html) > > I have quite few `venv` that run gunicorn. > > I would like to reuse `gunicorn` for other `venv` > > I launch my web application like this > > ```bash > #PWD = venv dir > source ./bin/activate > gunicorn A_WebApp:app > #A_WebApp is my python file A_WebApp.py > ``` > I supposes that `gunicorn` is a shell program ? if yes I should use `$PATH` ? \ > or `gunicorn` is a Python program only ? and then what I should do to use gunicorn in another `venv` ? > > Thanks.

4
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python Zara 2 months ago 100%
Do you know a CCTV software write in Python ?

Hi, I'm looking for a software similar to ZoneMinder \ https://lemmy.ml/post/18530232 But it seem that ZoneMinder become slowly outdated, php etc.. I've found a couples of alternatives ( hard choice as the limitations of use are often buried deep ) It seem that [openCV](https://pypi.org/project/opencv-python/) is really famous for AI Computer vision, So I would be surprise if there were no Python program to manage cameras like a ZoneMinder !? Do you know any ? Thanks.

10
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python martinn 5 months ago 100%
A library for creating fully typed declarative API clients quickly and easily github.com

cross-posted from: https://programming.dev/post/13395352 > Would love to hear any suggestions, feedback or comments.

13
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python MichelDesmoulin 5 months ago 72%
Testing with Python (part 1): the basics www.bitecode.dev
5
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python MichelDesmoulin 5 months ago 100%
Announcing py2wasm: A Python to Wasm compiler wasmer.io
17
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 5 months ago 66%
Lightning Talk: Write Valid C++ and Python in One File - Roth Michaels - CppCon 2023 www.youtube.com
2
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 5 months ago 88%
PEP 744 – JIT Compilation peps.python.org
13
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 5 months ago 90%
LPython 0.21 Released For Alpha-Stage Python AOT Compiler www.phoronix.com
9
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python slyuser 6 months ago 70%
Python IDLE: A Comprehensive Guide for Beginners

Unleash Your Python Potential with Python IDLE: The Ultimate Beginner's Guide! From Installation Hacks to Secret Debugging Tricks, Master Python IDLE in Minutes! 💻🚀 #Python #Programming #BeginnerGuide

4
1
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python Communist 6 months ago 85%
Help with a python script to control my lights? github.com

I'm just trying to control my smartlights with a script, it seems to be having a lot of problems, I really don't know what I'm doing, i'd appreciate any help I can get Once I have a script that can individually turn lights on/off i can edit the rest myself, I just can't get the base functionality working.

5
6
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python bluestarshield 6 months ago 100%
Python workbook recommendations?

Hey, I've been looking to learn Python for a while, tried as a kid but got bored before I did anything. I was wondering if anyone knew of any good Python self-study workbooks? The ones with exercises in addition to theory. I'm using Mint, in case that brings up any IDE issues.

8
1
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python slyuser 6 months ago 61%
Coding a Python Program for Mm to Inches Conversion

Developed a script to perform mm to inches conversions, which was conveniently transformed into a web app using Streamlit.

3
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python cypherpunks 6 months ago 100%
CPython PR merged yesterday: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 (part of PEP 703) github.com

https://peps.python.org/pep-0703/

19
1
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 8 months ago 90%
Python 3.13 gets a JIT tonybaloney.github.io
17
3
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python cypherpunks 9 months ago 80%
Python = Syntactic Sugar? Talk Python to Me Ep.441 www.youtube.com
3
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python Xer0 9 months ago 88%
What other Python communities are you part of?

Just wondering if anyone is part of any Python chats, communities, forums etc, and which ones are good to join?

7
3
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python xiffu 9 months ago 81%
Lets create a short tutorial on how to connect, create a table and insert data in SQlite with Python www.chat-to.dev

Join chat rooms and explore programming content on Chat-to.dev.

7
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 11 months ago 76%
Pope tempted by Python! Signs off on coding scheme for kids www.theregister.com
9
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 11 months ago 100%
PyTorch: Compiling NumPy code into C++ or CUDA via torch.compile pytorch.org
9
1
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python makeasnek 11 months ago 100%
OSS tools for documenting database schema?

I am working on a new django project which will use a MySQL database. Obviously there are several tables and attributes items in those tables have. I realize I could just document those attributes in the code itself, but more than one codebase may be accessing this database. I would rather have a more comprehensive solution to document relationships, expected CASEing of the text, allowed characters, etc. I know UML exists, but it seems there are 1,000+ tools which do UML modeling, not all of which will gracefully do an SQL database. Examples of things I want to document: - For a "user profile" there are various attributes: username (primary key), friendly name, etc - For a "task" - id (primary key), name (letters numbers and spaces only, max 56 characters), owner (a single username (foreign key(), assignees (zero or more usernames (list of foreign keys)), etc Here's what I need: - GUI for building flowchart/model/whatever you call it showing each table and each attribute in each table, with ability to add notes to table or attribute. Attributes must have ability to be relational just like in a database. - FOSS only, must run on Linux. No "free" web-based garbage that will end up behind a paywall 5 years from now ie draw.io - Must store source files for this model in a text/xml/json/something file which can easily be put into our git repo - Must not be so tightly coupled to MySQL that is requires a database connection to work or couldn't be used if we switch to a non-MySQL backent. If it has templates for and knowledge about MySQL databases that's great but it shouldn't require them to be useful. What do you suggest for this?

7
3
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python loki 11 months ago 92%
Reproducible builds for CPython source tarballs sethmlarson.dev
12
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python ylai 11 months ago 100%
The fraud was in the code newsletter.mollywhite.net
39
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python cypherpunks 12 months ago 94%
Python 3.12.0 is released www.python.org
16
3
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python rev 1 year ago 100%
PEP 703 is going to be accepted, are you ready for noGIL? discuss.python.org

Meta is dedicating 3 engineers to get the nogil patches into cpython. There are some other companies stepping up as well. This is huge this is the closest we have ever been to solving the issue of the GIL.

23
12
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python nathanpc 1 year ago 100%
Resources for someone looking into moving from other languages to Python?

Hello Python community! There are a lot of resources online targeted at beginners that want to learn Python but very rarely do you see articles talking about moving to Python when you already have tons of experience in other languages like Ruby, and especially, many years of Perl experience and is interested in moving to Python. I'm not looking for information on how to program in Python, that's really easy to find and most of the learning curve will be learning about the standard libraries and overcoming the years of muscle memory from other languages. I'm looking for information on the following topics: - What's the recommended project structure for a library or a program that'll be distributed via PyPI? - What are the general best practices to follow when writing "clean Python code"? - What's the most commonly followed style guide for the language? - How does import work internally and how does it perform its path lookup for local files (specifically for importing modules internal to a project)? - How to properly set up pyenv for a project? (This one is tricky for me because the Python community loves pyenv and I'm used to having packages globally installed in Ruby and Perl)

16
4
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python Ajsra 1 year ago 100%
Coefficient of Variation in Python with Pandas & NumPy www.marsja.se
5
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python SurpriseCandid8978 1 year ago 94%
great begnner resouces to learn Python?

Hi, Does Anyone have any great resources to learn python for a non-programmer? Youtube? Free online courses, etc? Im starting out and there is a lot out there. They all look good too. So far, i got python installed lol. Thanks, Edit: thanks everyone. I have some homework to do and check out all the resources !

16
20
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python uthredii 1 year ago 83%
Check type annotations in Python with mypy opensource.com
4
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python uthredii 1 year ago 42%
Check type annotations in Python with mypy opensource.com
-1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python aswin 1 year ago 100%
pyscan scans 200+ dependencies for vulnerabilities by the time it takes to read this. github.com

Pyscan v0.1.4 | [GitHub](https://github.com/aswinnnn/pyscan) Pyscan is the fastest CLI tool to find dependency vulnerabilities in your python projects. + blazingly fast scanner that can be used within large projects. + automatically finds `requirements.txt`, `pyproject.toml` or, the source code. + can be integrated into existing build processes. + In its early stage, thus hasn't been battle-hardened yet. #### Install ```bash pip install pyscan-rs ``` **look out for the "-rs"** part or ```bash cargo install pyscan ``` #### Usage Go to your python source directory (or wherever you keep your `requirements.txt`/`pyproject.toml`) and run: ```bash > pyscan ``` or ```bash > pyscan -d path/to/src ``` Pyscan is a tool written in Rust that uses [OSV](https://osv.dev), which is an open source vulnerabilities database, which inspired me to make this tool.

2
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python pumpkin 1 year ago 100%
Compiling typed Python https://bernsteinbear.com//blog/typed-python/
12
3
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python Limeey 1 year ago 100%
JupyterLabs - wish I could see the notebook title like in notebooks

I switched from notebook to labs recently and I'm missing how the notebook name is displayed in notebooks. it seems like the only way to know which notebook I'm in now is through the tab, but if I have multiple tabs open it compresses them. Is there any extension or something that will display the notebook name (and make it easily editable) like in notebooks?

3
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python penguin_ex_machina 1 year ago 100%
Python GUI Beginners Tutorial - In 30-min - Flutter For Python with Flet www.youtube.com
7
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python pumpkin 1 year ago 100%
How to Create a UTF-16 Surrogate Pair by Hand, with Python https://www.oilshell.org/blog/2023/06/surrogate-pair.html
1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python radarsat1 1 year ago 100%
How to nest context managers while hiding the dependency?

Let's say I have a context manager that provides a resource that then mutates on exit: ``` from contextlib import contextmanager @contextmanager def context(): x = ['hi'] yield x x[0] = 'there' ``` I found that if I want to make another context class that uses this, such that the context (before mutation) is valid, I have to pass it in: ``` class Example1: def __init__(self, obj): self.obj = obj def use_obj(self): print(self.obj) def __enter__(self): print("start") return self def __exit__(self, *exc): print("end") with context() as x: with Example1(x) as y: y.use_obj() ``` prints: ``` start ['hi'] end ``` However, what I don't like is, let's say that `obj` is an internal detail of my class. I don't want the user to have to define it beforehand and pass it in. The only way I can figure how to do this is by calling the context manager's `__enter__()` explicitly: ``` class Example2: def use_obj(self): print(self.obj) def __enter__(self): print("start") self.ctx = context() self.obj = self.ctx.__enter__() return self def __exit__(self, *exc): print("end") self.ctx.__exit__(None, None, None) with Example2() as y: y.use_obj() ``` which also prints, ``` start ['hi'] end ``` For comparison, just as some other random attempt, the following doesn't work because the context ends when `self.obj` is created: ``` class Example3: def use_obj(self): print(self.obj) def __enter__(self): print("start") with context() as x: self.obj = x return self def __exit__(self, *exc): print("end") with Example3() as y: y.use_obj() ``` which prints, ``` start ['there'] end ``` Okay, so my point is that `Example2` is the right solution here. But, it's really ugly. So my question is, is there a better way to write `Example2`?

4
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python acoustics_guy 1 year ago 100%
Which package/environment managers are you using?

I'm setting up a new laptop and considering which of the (many) environment managers to use this time around. My standard has been miniconda, since a big plus for me is the ability to set and download specific python version for different projects all in one tool. I also quite like having global access to different environments (i.e. environments aren't tied to specific projects). I typically have a standard `GenDataSci` environment always available for initially testing things out, then if I know I'll be continuing as a single project I'll make a stand alone environment for it. But I've also used poetry for tighter control and reproducibility when I'm actually packaging to publish on PyPI. Hatch looks interesting as well but I can't tell if it includes the ability to have separate python version installs for each environment. What workflows and managers are people using now?

7
5
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python gwilikers 1 year ago 100%
Introduction to List Comprehensions https://youtube.com/playlist?list=PL4eU-_ytIUt8oN3Mqp1reD8_xeVNMn0EW

Brendan Metcalfe's intro series to list comprehensions is one of the best I've come across. In addition to showing how to use them, he compares it to other similar methods and shows why LCs can be more effective. Wanted to share his stuff here.

13
1
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python Barbarian 1 year ago 100%
This is valid Python syntax www.bitecode.dev

cross-posted from: https://programming.dev/post/21515 > Some surprising, but valid, python syntax examples.

10
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python recnexus 1 year ago 100%
What are the best talks about Python?

I’m looking for some conference talks about python that I could watch during some downtime at work. Give me your favorites!

4
2
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPY
Python lntl 1 year ago 87%
pickling large objects

I have a large object that I want to save to the disk because it takes a minute to generate. The OOM reaper kills the process while pickle.dump ing the object. It's a tuple of dicts of tuple of array.array. Can pickle dump in chunks? If not, is there another technique I can use?

6
7