Check out the full stack #Python Architect job at my company- I don't see a press release about the contract, so DM me for the contract details.
https://artemisconsultinginc.com/list-of-positions/
#Python
Well this is new... how the @#$ do we install this? At least poetry namespaces it. This is just some tooling that doesn't respect namespacing.
```
[project]
dependencies = [
"requests"
]
```
So pip owns that?
```bash
python -v venv venv
. ./venv/Scripts/activate
pip install .
```See, much simpler than `poetry install`
♡ 0 ↻ 0
Oh, nice. Better syntax for typing generics in #python
https://peps.python.org/pep-0695/
I'll be able to use this in libraries that need to support old versions of python in about.... 1 trillion years.
While hacking on my markpickle library I ran into markdown-to-json and have been hacking with the author to do maintenance development and today I got 2.1.0 published, all modernized and shiny.
Markpickle handles more scenarios, but now shares one of the key algorithms from markdown-to-json because it was just a better algorithm.
♡ 0 ↻ 0
Okay, editable installs in #python is an advanced scenario that I've never seen work. This just reaffirms my opinion that setup.py and everything it touches is $#!+
It is slow, error prone an not expected to work.
Humans can't understand the size of time spans, like millions or billions of years.
That is why we have created `poetry install` and `pipenv install -e .` so that you will feel the trillions of years vicerally.
Weekend plans? You don't have weekend plans anymore, #PyCon youtube videos just dropped.
Convert #python statement block into single line expression
Why?
Lambdas - can only have one line
Increase code coverage by line for hard to reach lines (this is cheating, doesn't help branch coverage)
IDEA: A #pip / #pipenv wrapper that reports back to you what it is going to install before it installs & reports the security rating/states/download counts, so you can decide if you really want to install it.
I think I just need to parse the output from
```python
--dry-run
```
and feed it into package info API calls.
There are 7 libraries that try to run unit tests in code blocks in markdown.
There are 2 libraries that deserialize markdown to python (as json-like objects, not as a DOM)
There are more than I can count that serialize every table-like data structure from python to markdown tables.
There are 0 original ideas left in the world.
#python there is a whole ecosystem of tools for using python embedded in markdown
- import code in markdown as module (I writing one)
- execute code in markdown as script
- run unit tests in markdown
- doing notebook thing with markdown files
- format python inside of code blocks
My python-to-markdown serializer now supports binary as images.
https://github.com/matthewdeanmartin/markpickle/blob/main/docs/examples.md#list-of-binary
Next is treating bold/italic as terminal codes and/or fancy unicode.
Not sure how much farther I can take this experiment before I run into the wall of "DOMs are not ASTs" ASTs for the most part turn into DOMs just fine.
Go opt in to be searched at yet another opt-in profile index:
You know SOLID, but what about LIQUID?
**L**iskov substitution
**I**nterface segregation
**Q**uality over quantity
**U**niform access
**I**nversion of control
**D**ependency inversion
Or ARBITRARY?
**A**bstraction
**R**esponsibility
**B**ehavior-driven
**I**nversion of control
**T**est-driven
**R**euse
**A**ggregation
**R**efactoring
**Y**AGNI
In short, don't write code without ARBITRARY principles.
♡ 0 ↻ 0My bot refused to make an OOP principle list based on FART-SHART for alignment reasons, the results could spin out of control and be the end of us all.
♡ 2 ↻ 0Retweeting, I wish I could quote tweet, because I just saw another tweet about SOLID.
♡ 0 ↻ 0
As any #python developer knows, this is a duck.
#python bandit - What is a line of code anyhow? We will never know.
```
STARTING_POINT = ( # nosec
"thing" # nosec
) # nosec
```
#python The new #pypi blog lacks commenting (but Github has comments on the commits!). It also lacks a feed.
You'd think there would be a standalone free product to create a feed from HTML by now. I'll have to look for one later. (feedly has one, but it cost $)
https://blog.pypi.org/posts/2023-03-21-welcome-to-the-pypi-blog/
Ever want to turn json into markdown? I wanted to and couldn't. So I made a python-to-markdown serialization library. Handles some but not all types.
```
>>> loads("- a\\n- b\\n - c\\n")
['a', 'b', 'c']
```
and
```
>>> dumps([1,2])
'- 1\\n- 2\\n'
```
https://pypi.org/project/markpickle/0.2.0/
And by couldn't I mean, I couldn't without like, importing the json to python, walking the graph of the dict and deciding how to turn each key and value into markdown.
♡ 1 ↻ 0
#python Help, my code raises exceptions so I'm using #chatGPT to help me write a decorator that simulates VB's "On Error Resume Next"
But it fails at the critical point... walks the ast, and the statement wrapper doesn't seem to work. (because the statement is wrapped in an Expr? I don't know!)
https://gist.github.com/matthewdeanmartin/fa88ae03818a5a8e503c8685b97234b1
Shoot, this could be too difficult for me or ChatGPT. ChatGPT keeps mixing up byte code and source code constructs.
♡ 0 ↻ 0
How many text editors are
- terminal (TUI)
- #python
- run on windows
I think possibly babi and what else?
Everyone is writing linux only curses even though there is a way to do cursons on windows.
Almost all python TUI editors are curses based. Only babi imports windows-curses as a drop in replacement. But the drop in replacement doesn't work with existing curses-dependent apps because of even more linux-only imports.
Sigh.
♡ 0 ↻ 0
#python Should you pin your dependencies?
Yes? No? No matter the answer, you're wrong!
---
This is my annual attempt to write bash that has loops.
Why do I do it?:
- Self hatred?
- Create motivation to finally learn #zsh/#fish (or even #xonsh)?
- I'd forgotten that loops are trash in #bash?
- prelude to just doing it all in #python?
(updated, tagging 5 communities so that they can all fight with me in the replies and the pet fish owners can be confused)
Code kata, go write a console fish tank.
emoji_fish = [
"🐠", "🐟",
"🐡", "🐙", "🦑",
"🦐", "🦞", "🦀"
]
It is just a random walker with a visualizer & more walkers.
Advanced is getting certain fish to chase other fish & handling collisions (fish eat each other, or turn into 3 fish, etc)
So you're thinking of putting all your shared #python code into a Dockerfile, e.g.
COPY utils.py /shared_stuff
1) That code is not in a venv.
2) That is not a versioned package
3) docker build will break your code as be base image evolves
4) can't run unit test or execute your code
5) have to add utils.py to your code repo & .gitignore it
Any option that involves wheel files is correct.
But if you really want to shoot your self in the foot:
1) store utils.py in wikipedia. You really will never know what is there
2) store it in a cookie that you have use browser automation to access. It will be astonishing to maintenance devs
3) store it in bash history, it is the source control for bash, it can be source control for #python
4) store it in a random number generator, at one offset or another, there will be the bytes of utils.py♡ 0 ↻ 0
Watching #python 3.10 & 3.11 videos but really, I'm not all that caught up on 3.1 thru 3.9. I should watch them all.
#python #kata - Write a program that will assign gift giving lists to n people. They don't want to give n * n gifts, so each person needs to get g gifts.
Eg. 25 people & everyone gives 3 gifts each and receives 3 gifts.
Handle edge cases, write unit tests & so on.
Expand so kids get 2x more gifts than adults.
#python stdlib has a generated code documenter shoved into it: #pydoc. It has a lot of design problems, top of which is that it works poorly as a pure CI task to generate static HTML.
I forked it and made it at least usable, albeit still ugly.
https://github.com/matthewdeanmartin/pydoc_fork
Next step would be to use modern website templating. Maybe if it ever got attention & I felt peer pressure to improve it again.
How are we making terminal pacman clones?
Archived poll
- print/os.sys("clear")0 votes
- ANSI codes4 votes
- WinDLL("kernel32")0 votes
- curses7 votes
11 voters
Content warning: meta: tagging strategy
LAZYWEB: How are people putting their console games in to #pyscript . I just need print() and input()
#python #YesIShouldReadTheDocs #IAskedChatGPTAndItDoesNotKnow
LAZYWEB: How are people putting their console games in to pyscript. I just need print() and input()
#python #YesIShouldReadTheDocs #IAskedChatGPTAndItDoesNotKnow
fwiw, here is the game: https://github.com/chess-yeti/white_rooms/blob/main/main.py
♡ 0 ↻ 0
LAZYWEB: How are people putting their console games in to pyscript. I just need print() and input()
#python #YesIShouldReadTheDocs #IAskedChatGPTAndItDoesNotKnow
I like my updated profile. I talk about what I *tweet* about, not what I don't tweet about. Too many bios say, "I like scifi" but only tweet sports or politics.
---
Software developer, tech lead in Washington, DC.
I tweet without CW
- software, programming, #python, dad jokes, DC government tech contracting, #govtech
I tweet with CW
- #Vegetarianism, Left Leaning politics, #Running.
I don't speak for my employer.