@willmcgugan@mastodon.social
@willmcgugan@mastodon.social avatar

willmcgugan

@willmcgugan@mastodon.social

CEO / Founder of Textualize.io Hyperborean Python expert, author, humanist, husband, and sometimes wildlife photographer. He/him

Please use GitHub issues for tech support

This profile is from a federated server and may be incomplete. Browse more on the original instance.

willmcgugan, to random
@willmcgugan@mastodon.social avatar

Coming soon to #Textual, a new "hatch" style for textured background.

You can set hatch on any widget, with a configurable pattern, and color.

mathsppblog, to python
@mathsppblog@fosstodon.org avatar

Just used operator.itemgetter to reorder values of a dictionary.

Quite neat snippet of code:

from operator import itemgetter  
d = {"a": 1, "b": 2, "c": 3}  
it = "cab"  
print(itemgetter(*it)(d)) # (3, 1, 2)  

willmcgugan,
@willmcgugan@mastodon.social avatar

@mathsppblog Clever

willmcgugan, to random
@willmcgugan@mastodon.social avatar

Props to @darrenburns for risking self immolation to work on textual-autocomplete!

https://github.com/darrenburns/textual-autocomplete

willmcgugan,
@willmcgugan@mastodon.social avatar

@espositocode yes, you can do that now with inline mode.

willmcgugan, to python
@willmcgugan@mastodon.social avatar

I lived streamed coding a #Textual TUI for a coffee "shop".

#Python

https://youtu.be/bdOrzkmJ6Lk?t=151

willmcgugan,
@willmcgugan@mastodon.social avatar

The app is currently online, for a little while at least.

Sorry mobile users, you will probably need a desktop browser.

https://textual-web.io/coffee-live/hw2e40guat37

willmcgugan,
@willmcgugan@mastodon.social avatar

New URL

https://textual-web.io/coffee-live/shop

I'll keep it online for a few hours at least (it's running on my laptop).

willmcgugan,
@willmcgugan@mastodon.social avatar

@pawamoy Pretty much. Just for fun though. It’s far from complete.

willmcgugan, to python
@willmcgugan@mastodon.social avatar

I'm going to be live-streaming working on a #Textual app. 2pm UK time (about 20 mins from now).

#python

https://www.youtube.com/watch?v=mX74SALm9MU&ab_channel=WillMcGugan

willmcgugan, to random
@willmcgugan@mastodon.social avatar

I fixed 2 bugs today. Coincidentally, the two bugs in combination produced the correct behaviour in my app. 🤷‍♂️

willmcgugan,
@willmcgugan@mastodon.social avatar

@josevnz It was a bit like having an out by 1 bug, and an out by -1 bug. 🤷‍♂️

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

Did you know you can use 's zipapp 🐍 module to make an executable zipfile? 💡

See the example below where I create one combining 1. an Amazon affiliation link generator script of mine + 2. a PyPI package 🎉

willmcgugan,
@willmcgugan@mastodon.social avatar

@bbelderbos A very cool feature! I don't see these much in the wild.

willmcgugan, to random
@willmcgugan@mastodon.social avatar

@mkennedy @brianokken Wouldn't be surprised if this is already on your radar. Pretty cool stuff!

https://wasmer.io/posts/py2wasm-a-python-to-wasm-compiler

willmcgugan, to random
@willmcgugan@mastodon.social avatar

Developers over 40. What advice would you give to developers just starting their career?

willmcgugan, to random
@willmcgugan@mastodon.social avatar

Here's a Markdown tip which I don't think is well known.

Triple backticks marks a code block. But if your code happens to contain three backticks you can use quadruple backtacks (or more) for the code block.

i.e.

print("```")  
willmcgugan, to python
@willmcgugan@mastodon.social avatar

I published a thing. Not an official @textualizeio project, just a personal thing.

It's an alternative way of declaring class attributes, that adds validation and watching.

It's a bit experimental. Let me know what you think!

https://github.com/willmcgugan/declare

willmcgugan,
@willmcgugan@mastodon.social avatar

@davidbrochart Yep. Similar goals, and works in a similar way. Just without Textual's runtime.

willmcgugan, to random
@willmcgugan@mastodon.social avatar

Double plus good!

Convinced Claude Opus that 2 + 2 is in fact 5.

willmcgugan, to python
@willmcgugan@mastodon.social avatar

Here's how to style inline TUI apps in #textual

Really looking forward to seeing what folk build with this. I haven't quite seen anything like it in the wild.

https://textual.textualize.io/how-to/style-inline-apps/

#python

willmcgugan, to python
@willmcgugan@mastodon.social avatar

How do you go about evaluating a module for your project?

i.e. by what criteria would you consider before adding a library to your dependancies?

willmcgugan,
@willmcgugan@mastodon.social avatar

@dabeaz Only use libraries written by David Beazley. Got it. 😜

willmcgugan, to python
@willmcgugan@mastodon.social avatar

New #Textual feature in the works! What do you think?

#Python

video/mp4

willmcgugan,
@willmcgugan@mastodon.social avatar

@adamchainz RecursionError 🤔

willmcgugan,
@willmcgugan@mastodon.social avatar

This was an April Fools. Thanks to everyone who played along!

hugovk, to python
@hugovk@mastodon.social avatar

We got a human-submitted, AI-generated PR for @pillow that claimed to speedup an internal function by 54%.

It presented no benchmark script, so I benchmarked and found no noticeable improvement.

The PR claimed the "new optimized code was tested for correctness" and offered some "Generated Regression Tests" that it declared passed.

I ran them. After fixing an import error, the tests failed for both the PR and main.

No thank you, Codeflash AI.

https://github.com/python-pillow/Pillow/pull/7915

willmcgugan,
@willmcgugan@mastodon.social avatar

@hugovk @pillow Feels like those automated linting services that make arbitrary changes or break things. But worse. This made you do work to reject it!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • lostlight
  • All magazines