Python

6470 readers
15 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
1
24
Python 3.14.0 alpha 3 (discuss.python.org)
submitted 4 days ago by norambna to c/python
2
3
4
19
Python Resources for Everybody (learnbyexample.github.io)
submitted 2 days ago by learnbyexample to c/python
5
6
UV tricks (www.bitecode.dev)
submitted 6 days ago by norambna to c/python
6
 
 

cross-posted from: https://mander.xyz/post/21881380

This is my fourth blog post. Any helpful feedback or insights are welcome.

7
8
9
10
11
 
 

Made this ChatGPT coded bot for telegram to propose to my IT Project Manager lady. She said yes.

12
 
 

https://docs.python.org/3/library/pathlib.html

I'm creating this post mainly so that I don't forget the name again.

13
14
 
 

W

15
 
 

My third blog post. I added variation in the tense of the generated text as well as another possible action for the character.

16
 
 

also you can test pynotes and pyclock

17
11
submitted 4 weeks ago* (last edited 4 weeks ago) by logging_strict to c/python
 
 

In a requirements-*.in file, at the top of the file, are lines with -c and -r flags followed by a requirements-*.in file. Uses relative paths (ignoring URLs).

Say have docs/requirements-pip-tools.in

-r ../requirements/requirements-prod.in
-c ../requirements/requirements-pins-base.in
-c ../requirements/requirements-pins-cffi.in

...

The intent is compiling this would produce docs/requirements-pip-tool.txt

But there is confusion as to which flag to use. It's non-obvious.

constraint

Subset of requirements features. Intended to restrict package versions. Does not necessarily (might not) install the package!

Does not support:

  • editable mode (-e)

  • extras (e.g. coverage[toml])

Personal preference

  • always organize requirements files in folder(s)

  • don't prefix requirements files with requirements-, just doing it here

  • DRY principle applies; split out constraints which are shared.

18
 
 

Hi,

I wanted to use d2 in an environment where I could only install python and npm packages.

Given that, and that I could not find any other solution, I made d2-python-wrapper, a small python wrapper that bundles the d2 binaries.

Now you can use d2 from python like this:

from d2_python import D2

d2 = D2()

# Simple diagram
with open("test.d2", "w") as f:
    f.write("x -> y")

# Default SVG output
d2.render("test.d2", "output.svg")

# PDF output with specific theme
d2.render("test.d2", "output.pdf", format="pdf", theme="1")

The class just wraps the bin, so it works and supports the same as the bin. There is a GitHub Action that gets the bins for each platform (mac, win, linux) from the releases in this repo and publishes it to pip.

You can install this using

pip install d2-python-wrapper

Here is a short post with more context.

Just in case It's useful for anyone. 😁

19
 
 

Welcome to a new era of interconnected content discussion with PieFed – a link aggregator, a forum, a hub of social interaction and information, built for the fediverse. Our focus is on individual control, safety, and decentralised power.


Like other platforms in the fediverse, we are a self-governed space for social link aggregation and conversation. We operate without the influence of corporate entities – ensuring that your experience is free of advertisements, invasive tracking, or secret algorithms. On our platform, content is grouped into communities, allowing you to engage with topics of interest and disregard the irrelevant ones. We utilise a voting system to highlight the best content.


Video introduction the codebase

20
22
Python 3.14.0 alpha 2 (discuss.python.org)
submitted 1 month ago by norambna to c/python
21
21
Python's pathlib module (www.pythonmorsels.com)
submitted 1 month ago by norambna to c/python
22
37
Is Python Really That Slow? (blog.miguelgrinberg.com)
submitted 1 month ago by norambna to c/python
23
15
What's new in pip 24.3 (ichard26.github.io)
submitted 1 month ago by norambna to c/python
24
7
Are we PEP 740 yet? πŸ” (trailofbits.github.io)
submitted 1 month ago by [email protected] to c/python
25
15
All About Decorators in Python (www.pythonmorsels.com)
submitted 1 month ago by learnbyexample to c/python
view more: next β€Ί