Search
740 results for “ptmcg”
-
I gave this lightning talk today at PyCon US, on packaging up the re.sub function as a decorator (video will auto advance slides after 20 seconds). Python code at https://gist.github.com/ptmcg/b636425d646b8e6d9bf5acf7c9d53401 #python #pyconUS #pycon2026
-
Hey PyConners! Here is the latest update of the interactive PyConUS schedule. https://gist.github.com/ptmcg/d851232d6b90812e1c01c990ecec516c
Now supports searching by time frames, such as "Saturday 3pm-4pm". Also now includes the plenary sessions. Look for me there and get your "Python in a Nutshell 4th Ed" badge pin - quantities limited! #pyconUS #python #pycon2026 -
Pyparsing-based regex inverter (a static page written using PyScript) is live at https://ptmcg.github.io/regex_inverter/ #python #pyparsing #regularexpressions #regex
-
Pyparsing-based regex inverter (a static page written using PyScript) is live at https://ptmcg.github.io/regex_inverter/ #python #pyparsing #regularexpressions #regex
-
Pyparsing-based regex inverter (a static page written using PyScript) is live at https://ptmcg.github.io/regex_inverter/ #python #pyparsing #regularexpressions #regex
-
Pyparsing-based regex inverter (a static page written using PyScript) is live at https://ptmcg.github.io/regex_inverter/ #python #pyparsing #regularexpressions #regex
-
Pyparsing-based regex inverter (a static page written using PyScript) is live at https://ptmcg.github.io/regex_inverter/ #python #pyparsing #regularexpressions #regex
-
I got less traffic for my Python article than I expected, so I added "Python" to the title, and inserted some section headers to break things up a bit, and make the flow of my thinking a bit clearer.
I was pretty happy with how this project turned out. This decorator makes the re.sub function simpler to work with. The decorator simplifies the re.sub API, wrapping your own function that takes in strings and returns a string. https://medium.com/@ptmcg/re-sub-as-a-decorator-madness-717eea7ded50 #python #decorators #regularexpressions
-
Another Medium article! I can do this every 8 months or so. This time I walk thru making re.sub accessible using a decorator. Not interested yet? How about if I used this title? "The One Simple Trick Big Regex Doesn't Want You To Know" https://medium.com/@ptmcg/re-sub-as-a-decorator-madness-717eea7ded50 #python #regular_expressions #decorators
-
Some things I'm especially proud of in plusminus (my Python package for parsing and evaluating infix notation arithmetic):
- |absolute value| expressions
- ° symbol as a unary postfix operator, to convert degrees to radians: sin(π/2) vs. sin(90°)
- exponents ² and ³
- √ and ³√ operators (both unary and binary, so you can write 2√2)
- mathematical constants e, π, φ, and τ
- set operators ∈, ∉, ∩, and ∪
- safe eval of untrusted inputs
Try it at https://ptmcg.pythonanywhere.com/plusminus
#python #parsing #infix -
Earlier today I posted about a spoof site of mine on #pythonanywhere, 𝐹º𝑛t 𝘔ⅸᵉ𝐫, which converts identifiers in ASCII #Python to equivalent identifiers by randomly selecting Unicode points that normalize back to the original ASCII, and are therefore directly runnable, even though they look like a ransom note. Remember, builtins and all stdlib names can be denormalized this way.
I went to check the web logs, and found that someone found another PA site of mine, https://ptmcg.pythonanywhere.com/pyrac...
-
I just pushed v0.8.1 of plusminus, a pure Python eval-safe and DoS-resistant parser/evaluator of arithmetic expressions. Parses a superset of Python expressions, including |x| for absolute value, √ for square root, ! for factorial, superscripts for exponents and roots, postfix ° for degree-radian conversion, Unicode operators × ÷ ≠ ≤ ∧ ∨ ∩ ∪ ∆ ∈ ∉. Extensible to custom domain-specific arithmetic. Live demo and links at https://ptmcg.pythonanywhere.com/plusminus #python #safeeval #plusminus
-
(Apologies for the multiple posts, while I sorted out all the various relevant hashtags. Danged social media!)
-
While waiting for my return flight from SNA to AUS, I updated to Python 3.15.0b1 and ran the test suite for pyparsing. Once I fixed the vendored version of typing-extensions in pip (version 26.1.1) that uses the deleted `typing.no_type_check_decorator`, all my unit tests ran successfully. (Haven't successfully created a virtualenv for 3.15t yet...) (using PyCharm 2026.1.2 on Windows 11) #python #python3 #pyconus #python315
-
While waiting for my return flight from SNA to AUS, I updated to Python 3.15.0b1 and ran the test suite for pyparsing. Once I fixed the vendored version of typing-extensions in pip (version 26.1.1) that uses the deleted `typing.no_type_check_decorator`, all my unit tests ran successfully. (Haven't successfully created a virtualenv for 3.15t yet...) (using PyCharm 2026.1.2 on Windows 11) #python #python3 #pyconus #python315
-
While waiting for my return flight from SNA to AUS, I updated to Python 3.15.0b1 and ran the test suite for pyparsing. Once I fixed the vendored version of typing-extensions in pip (version 26.1.1) that uses the deleted `typing.no_type_check_decorator`, all my unit tests ran successfully. (Haven't successfully created a virtualenv for 3.15t yet...) (using PyCharm 2026.1.2 on Windows 11) #python3 #pyconus #python315
-
While waiting for my return flight from SNA to AUS, I updated to Python 3.15.0b1 and ran the test suite for pyparsing. Once I fixed the vendored version of typing-extensions in pip (version 26.1.1) that uses the deleted `typing.no_type_check_decorator`, all my unit tests ran successfully. (Haven't successfully created a virtualenv for 3.15t yet...) (using PyCharm 2026.1.2 on Windows 11) #pyconus #python315
-
Austin art friends - I am showing one my earliest fractal art pieces in the Bee Cave Arts Foundation's Members Show, beginning next Saturday, May 9 in the Bee Cave Gallaria (same weekend as the Pecan Street Fair). The show is located in the BCAF space, The Hive, across from H&M and Dillards. Hope to see you there! #abstractart #digitialart #computerart #art #beecavearts
-
Austin art friends - I am showing one my earliest fractal art pieces in the Bee Cave Arts Foundation's Members Show, beginning next Saturday, May 9 in the Bee Cave Gallaria (same weekend as the Pecan Street Fair). The show is located in the BCAF space, The Hive, across from H&M and Dillards. Hope to see you there! #abstractart #digitialart #computerart #art #beecavearts
-
Austin art friends - I am showing one my earliest fractal art pieces in the Bee Cave Arts Foundation's Members Show, beginning next Saturday, May 9 in the Bee Cave Gallaria (same weekend as the Pecan Street Fair). The show is located in the BCAF space, The Hive, across from H&M and Dillards. Hope to see you there! #abstractart #digitialart #computerart #art #beecavearts
-
Austin art friends - I am showing one my earliest fractal art pieces in the Bee Cave Arts Foundation's Members Show, beginning next Saturday, May 9 in the Bee Cave Gallaria (same weekend as the Pecan Street Fair). The show is located in the BCAF space, The Hive, across from H&M and Dillards. Hope to see you there! #abstractart #digitialart #computerart #art #beecavearts
-
Austin art friends - I am showing one my earliest fractal art pieces in the Bee Cave Arts Foundation's Members Show, beginning next Saturday, May 9 in the Bee Cave Gallaria (same weekend as the Pecan Street Fair). The show is located in the BCAF space, The Hive, across from H&M and Dillards. Hope to see you there! #abstractart #digitialart #computerart #art #beecavearts
-
This past week I cited a merged PR in the CHANGES file for #pyparsing as "submitted by <author> et AI." #python #ai
-
Just once I'd like to push a x.x.0 release of pyparsing and not have to push x.x.1 within 24 hours. (Check out 3.3.1 release, includes AI instructions, TINY language parser, diagram, runner, and REPL, new DeprecationWarnings for camelCase names - time to switch to snake_case, and fixes packaging error in 3.3.0) #python #pyparsing #programming
-
I just published pyparsing version 3.3.0b1, with some significant additions:
- example parser/interpreter of the TINY language (with AI transcript showing prompts and corresponding AI plans and actions)
- performance tests with scripts to run and tabulate results using pyparsing 3.1-3.3 and Python 3.9-3.14Github link: https://github.com/pyparsing/pyparsing/releases/tag/3.3.0b1
Attached image is a TINY script to find prime numbers.
-
The upcoming 3.3.0 release of pyparsing will include AI instructions for best practices when using this package. They can be accessed from the command-line using `python -m pyparsing.ai.show_best_practices` (They work for human developers too.) #python #pyparsing #ai
-
If you maintain an open source package, set up a standing search on scholar.google.com for your package name. You'll get gmail notifications of published papers referencing your package.
It's truly gratifying to see students and research teams making use of my pyparsing package to parse data sets and DSLs, so they can quickly get past the pesky parser development stage and get on with the business of their actual field of study. #pyparsing #python #google #oss #opensource
-
Well, I had a minor stumble releasing #pyparsing 3.2.2 this past weekend, with a bug (Issue #600) that snuck past several thousand unit tests. So I added 1 new test with several hundred new cases that caught that bug, then fixed it (and a sibling bug 10 lines of code away from the first one). Great immediate notice of failing CI pipelines from diligent users, I was able to get 3.2.3 out with the fix Monday evening. And all's right with the world again (the #Python world, anyway).
-
Pyparsing 3.2.2 cleans up a formerly internal-only utility method make_compressed_re(), and makes it part of the public API. Given a list of strings, it generates a regex to match those strings and only those (so no cheating like ".*").
Here are before/after expressions for matching chemical symbols.