Here are some emojidentifiers for your next Python code:
import math
乁_ツ_ㄏ = None
乁_益_ㄏ = math.nan
def minnums(values: list | 乁_ツ_ㄏ = 乁_ツ_ㄏ):
if (
values is 乁_ツ_ㄏ
or not all(isinstance(n, (float, int))
for n in values)
):
return 乁_益_ㄏ
return min(values)
[#]python #unicode #emoji
=> More informations about this toot | View the thread
Pyparsing sightings - recent posts/pages using pyparsing (2/2):
https://pypi.org/project/ciscoconfparse2/
https://github.com/getmoto/moto
https://docs.saaspegasus.com/
https://github.com/jwdj/EasyABC
[#]pyparsing #python
=> More informations about this toot | View the thread
Pyparsing sightings - some recent posts/pages using pyparsing (1/2):
https://www.juniper.net/documentation/us/en/software/junos-pyez/junos-pyez-developer/junos-pyez-developer.pdf
https://packaging.python.org/en/latest/guides/licensing-examples-and-user-scenarios/
https://github.com/sucv/paperCrawler
[#]pyparsing #python #parsing
=> More informations about this toot | View the thread
That little personal thrill when you get exactly 7 pills from your pill bottle - IYKYK
=> More informations about this toot | View the thread
Some things I'm especially proud of in plusminus (my Python package for parsing and evaluating infix notation arithmetic):
Try it at https://ptmcg.pythonanywhere.com/plusminus
[#]python #parsing #infix
=> More informations about this toot | View the thread
Remember when we were young, and we thought the "U" in "USB" stood for "universal"? #usb #standards
=> More informations about this toot | View the thread
I fed a sample page to Chad (my nickname for ChatGPT) and asked if any of them were profound. It found 8 out of 36 worth mentioning.
I think Chad's bar for profoundness is pretty low (it is definitely a sucker for lines using templated opposites).
=> More informations about this toot | View the thread
Some templates are cliche-makers around pre-defined opposites:
Illusion is really just Reality in disguise.
Illusion is really just Reality having a bad day.
Over time, Abstinence is really just Indulgence in disguise.
Every Abstinence hides a cautiously tender Indulgence.
These are really just cheating, since the template already sets up any kind of structure to these aphorisms (though the random injection of adverb-adjective pairs makes for at least some variety).
=> More informations about this toot | View the thread
pyrac has about 120 templates, an additional 300 intro and prepositional phrases, and several hundred available nouns, verbs, adjectives, and adverbs to randomly fill in the template blanks. Visiting that site will produce 3 12-line sentence groups. Most are nonsense like:
For a single season, a temporarily respected arrow should not be unimpressed!
But every so often a profound-sounding nugget drops out:
Behind every illusion is a word for Hate.
Ideas are bullets.
Truth will feed nothing.
=> More informations about this toot | View the thread
pyrac (https://ptmcg.pythonanywhere.com/pyrac) is my own #Python version of Racter, which was a crude prose generator from the early 80s (https://en.wikipedia.org/wiki/Racter). Racter composed this fragment as part of a larger story, "The Policeman's Beard is Half Constructed":
More than iron, more than lead, more than gold I need electricity.
I need it more than I need lamb or pork or lettuce or cucumber.
I need it for my dreams.
Originally offered as an AI, it is actually just a compositor with a rich set of templates.
=> More informations about this toot | View the thread
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...
=> More informations about this toot | View the thread
With the latest 3.2.1 release of pyparsing, I also cleaned up the README for the examples directory. Much improved over the hand-coded HTML from 20+ years ago!
https://github.com/pyparsing/pyparsing/blob/master/examples/README.md
[#]python #pyparsing
=> More informations about this toot | View the thread
At first I assumed these were jokes, but let's just say this parser were added to an email-scraper that auto-creates calendar entries for embedded tasks. We could detect common ambiguous deadlines like this, and then generate a random future timestamp, of the quality that such phrases deserve.
Additional submissions invited.
(During my college summer working in the blueprint room at an engineering company, one of our project managers routinely marked print requests with "ASAP or sooner".)
=> More informations about this toot | View the thread
Here is the Github repo for pyparsing - this parser is the delta_time.py script in the examples directory. https://github.com/pyparsing/pyparsing
=> More informations about this toot | View the thread
Here are some of the test cases for that parser:
10 seconds ago
1000 seconds ago
10000 seconds ago
10 minutes ago
10 minutes from now
in 10 minutes
in a couple of minutes
20 seconds ago
in 30 seconds
in an hour
3 days from now
a couple of days from now
a week from today
in a couple of days
a couple of days from today
8am the day after tomorrow
6am tomorrow
0800 yesterday
1700 tomorrow
12:15 AM today
twenty-four hours from now
in just 10 seconds
in just a couple of hours
in exactly 1 hour
=> More informations about this toot | View the thread
I just released pyparsing 3.2.1 with a very cool addition to the railroad diagrams that pyparsing generates for its parsers - non-terminal diagram elements now link to their definitions elsewhere in the diagram! This is pretty handy when the diagram is for a complex parser, as in this demo of a parser/evaluator for time references like "3 weeks from today" or "0800 two days from now" or "in exactly twenty-four hours". #pyparsing #python #parser #railroaddiagram
=> More informations about this toot | View the thread
Well I have this Medium account and never posted anything on it, so I decided to write up my littletable project. littletable was an experiment in ORMs that I started about 15 years ago, but it has really come in handy in dealing with small data sets and CSVs (up to a few thousand items). https://medium.com/@ptmcg/data-in-the-small-python-package-littletable-combines-in-memory-nosql-orm-with-schemaless-setup-54ea0b24ac6a #python #orm #database #littletable
=> More informations about this toot | View the thread
I'm seeing a number of responses from pyparsing users (or matplotlib users) that they are getting a version of pyparsing that is not compatible with their version of Python (they are running Python 3.8 or older, but the new pyparsing release requires Python 3.9 or later). After some experimenting, I found this requirements.txt
to help in selecting the right pyparsing version:
matplotlib
pyparsing>=3.2;python_version>="3.9"
pyparsing>=3.1;python_version<"3.9"
[#]pyparsing #python #matplotlib
=> More informations about this toot | View the thread
Pyparsing 3.2.0 pushed to pypi! See the docs at https://pyparsing-docs.readthedocs.io/en/3.2.0_docs/ , including "What's New" sections going back to 3.0. Note: this version drops support for Python < 3.9, so give it a look if your project uses it! #python #parsing #pyparsing
=> More informations about this toot | View the thread
Pyparsing 3.2.0rc1 is now out. There are a lot of nice things and bugfixes in this release - please check it out (and see if any of the breaking changes affect your code): https://github.com/pyparsing/pyparsing/releases/tag/3.2.0rc1 #python #pyparsing
=> More informations about this toot | View the thread
=> This profile with reblog | Go to ptmcg@fosstodon.org account This content has been proxied by September (3851b).Proxy Information
text/gemini