u/cogitoe
-
62points
-
1points
Pobshell: A Bash-like shell for live Python objects (self.Python) [Showcase]
-
26points
Mathematica licensing is changing (self.Mathematica)
-
4points
A Message from the Universe (self.awakened) [Reflection]
cogitoe
cogitoe
This is the only escape route I see for Trump: He sells Ukraine down the river in exchange for peace in Iran. He stops bombing Iran and in Ukraine he supports a "peace" where Russia get their maximal territory demands. When Ukraine says no, he halts all arms to Ukraine & lifts sanctions on Russia. In exchange Russia persuades Iran to stop the drones & open the straits, promising a mutual defence treaty with Russian missiles based in Iran.
cogitoe
Pobshell, a CLI utility for debugging and exploring live Python objects.
It loads your local and global variables into a "virtual filesystem" and lets you explore it with Bash-like commands and navigation. Think cd, ls, cat, and find — but for Python objects instead of files. Stroll around your code, runtime state, and data structures. Inspect everything: modules, classes, instances, methods. It's pick‑up‑and‑play: familiar commands plus optional new tricks.
A 40s YT video demo: https://www.youtube.com/watch?v=_d4DgVnqWjQ
Github repo: https://github.com/pdalloz/pobshell
Use it to
- explore packages and complex classes or data structures
- pipe live object state to a CLI LLM for interactive debugging sessions
- recursive search for attributes or data items by name, code, signature, str value, inspect predicates (iscode, isclass, ismethod, ...)
- diff and grep code or data structures
Works on Ubuntu, MacOS, Windows
Feedback appreciated!
cogitoe
That's a good idea! I think Pobshell could invoke ipdb and manage the ipdb session by passing through ipdb/pdb commands.
Also, I've looked a bit more at IPython %magic, and it does seem to support bespoke tab completion. It would be some work to convert current tab completion code, but it looks possible.
cogitoe
Thank you. I've been thinking about IPython/Jupyter too. One problem is no tab completion because of cmd2 reliance on readline.
I have ideas for workarounds, but its too soon to spend time without knowing how many people end up using Pobshell.
cogitoe
Great! Let me know how it goes. Remember that its alpha release right now, you might find rough edges.
cogitoe
Definitely it does. The find command gives recursive search, and can 'grep' lots of characteristics eg name, docstring, source code, str representation, inspect predicates ```
find foo --name bar find foo --doc "\bbar\b" -r find foo --cat defbar* find foo --str bar find foo --isclass
Also any command can be applied to a subset of attributes/contents of current object using same syntaxls -l --str "\b42\b" -rAnd output of any command can be piped to your OS grepls -l /foo/ | grep "bar" ```
cogitoe
Thanks! It doesn't have two-way integration with pdb, but it can be started from a pdb prompt:
(pdb) import pobshell; pobshell.shell()
cogitoe
The shell can be imported and used as you describe. Some of Pobshell's main strengths focus on interactive use.
But for sure there is also an option to create a persistent session object & run commands with it:
import pobshell
pob_session = pobshell.pob()
pob_session.onecmd_plus_hooks('ls -l')
pob_session.onecmd_plus_hooks('quit')
NB you must end with the quit command (to avoid risk of memory leaks from saved frame objects)
cogitoe
You can do similar with dir() and list comprehensions but it gets painful quickly.
There's a reason most people prefer exploring/interacting with the filesystem with Posix shells to Python REPLs with list comprehensions -- I prefer Python for multi use code, but ls and cd etc are better for exploring and seeing what's going on.
When there's a lot less friction it can be a step change in usefulness.
Edit: Reworded a sentence for clarity
cogitoe
Its also formatted inspect functions and "current object" idea from filesystem shells which means these commands act on all attributes or contents if not given an argument. (So very expressive)
Plus ability to pipe output to OS utils and LLMs. And recursive search.
Edit: "on attributes or contents" -> "on all attributes or contents"
cogitoe
Any feedback is appreciated!
cogitoe
I didn't write that Mathematica was going subscription only, I don't think it is.
"there's no reason that you can't use it for ten years from now" I guess you're on Windows or Linux; as I wrote above
On Mac this is a real problem because older versions of Mathematica stop working after a few OS updates. E.g. the latest version of macOS (14, Sonoma) requires Mathematica 13.3 or later.
On Mac you have to upgrade regularly or Mathematica stops working. It's not safe to keep working on an old OS that doesn't get security updates.
It looks like we can't get an upgrade unless we buy a year's Personal service subscription - on Mac that means paying close to the full purchase price every 3 years.
cogitoe
I think they're not enforcing usage caps at the moment. And I found it painful for dynamic interactivity or when editing commands on an ipad.
Wolfram engine is an option, but if monetization MBAs have started "optimizing the wolfram product portfolio", I think the language might not be worth further intellectual investment, let's see.
cogitoe
There's an annual Desktop subscription - $200/year which definitely expires.
Plus (currently), a "Personal License subscription" which includes upgrades and a second license, I imagine the upgrade persists but it's $299/year compared to price to buy home mma desktop, $399.
The old "upgrade" price has basically doubled, and the "subscription" terms aren't clear.
For me its too high for occasional fun with youtube puzzles about 100 numbered prisoners and some boxes. I think I'm not alone in that, and they'll lose a lot of (Mac) home edition users.
cogitoe
I'm happy you've found meaning. That's who you are.
I haven't been able to find any, that's who I am. But more than that, I've realised that I'm healthier when I stop looking for it.
We're not all the same.
Have a great day too!
cogitoe
It's pointless having "Unexplained wealth orders" for people shopping in Harrods, and then allowing shell companies with hidden owners to buy property in London.
From the BBC https://www.bbc.com/news/live/world-europe-60517447/page/2
Prof John Heathershaw, who leads research into international kleptocracy at the University of Exeter, warns Russia "will not take these sanctions seriously" due to the UK's "kleptocracy problem"."There are professional 'enablers' that help Russian kleptocrats obscure their ownership and sources of wealth, gain UK residency and property, and launder their reputations," he says.Tackling this, he says, would involve regulation that is "opposed" by many big businesses
Johnson's original announcement was for legislation on shell companies next session of parliament. Now, to quote something you wrote on another thread:
"Parts of the Economic Crime Bill will be brought forward before the Easter recess."
Not fast, and with his history of kicking this can down the road (about five years now), not confidence inspiring.
cogitoe
"keep the buffer states" means they must have governments that support the Putin regime.
It's not the West's fault that those states chose more liberal governments.
If those liberal governments felt threatened enough to want to join NATO, the current situation shows how right they were.
cogitoe
So happy to see others have this thought too.
I turned the heating off first thing this morning, and it's not going back on.
cogitoe
Its easy to call for action that would hurt the German economy more than the UK. Why doesn't he start with the dirty Russian money sloshing around London, where he could act unilaterally immediately?
cogitoe
Any more demonstrations in front of the consulate?
By the way, we should stop Russian clubs playing UEFA matches.
Does this take account of UK's high non-attendance rate? Kids not attending school won't have been tested! How does UK non-attendance compare to other countries?