@all
1. Regular expressions
-----------------------------------
I uploaded
http://users.online.be/AD/P_RegexPhone.gcIt demonstrates the use of python regex module re.py.
Clicking in a list of phone numbers will transform it to a standard format.
The right listview shows the python script that is generated and modified on the fly before execution
Inspiration from
http://www.regular-expressions.info/reference.html "Regular Expressions Reference - Basic Syntax"
http://www.pythonregex.com/ "Python Regex Tool"
http://www.regular-expressions.info/repeat.html "Regex tutorial * and + "
http://diveintopython.org/regular_exp ... ons/street_addresses.html "7.2. Case Study: Street Addresses"
http://diveintopython.org/regular_expressions/verbose.html "7.5. Verbose Regular Expressions"
Regular expressions and pattern matching is lacking in Gui4Cli as an independent functionality, so this was a motivation for me to get to grips with python.
2. Environmental variable PYTHONSTART
-----------------------------------------------------------
This variable will tell python to run the corresponding script first (as if all commands were typed from the shell).
To the contrary of PYTHONPATH setting this variable works OK.
You can set it from CLI
as
> setenv PYTHONSTARTUP 'myscriptpath.py'
and then
>python will start with executing this first
This is quite usefull for rapid testing or repetitive use & developing of some script from shell.
3. Gui's for Python
--------------------------
Is anybody aware of a python GUI package or module that works under OS4? TkInter is in the 2.5.1 distribution but i can't get it to work. I don't know what to expect either: Do you have to set up a loop to see which gadget has been hit or used, or can you add code directly to the gadget (or event as they are called in Gui4Cli) ??
4. rst 2 html gui
---------------------
I uploaded
http://users.online.be/AD/P_2htm.gc permitting to transform restructured text files to html
It needs rst2html.py
5. Save and load python datastructures
-----------------------------------------------------
Saving and loading datastructures (a feature Hollywood has too) is one of the ways to make different pythonscripts to interact in "real time" (using ram: or env:) or slower using HD.
http://users.online.be/AD/P_dump.gc demonstrates this
6. Launching applications or scripts from a Gui
---------------------------------------------------------------
The following quick methods are available to speed up launching of your favorite or recently most used applications or scripts
- Use Workbench putting them together in a directory with icons an launching tooltype
- If in the same directory maybe launchable with a diorectory manager
- Have those icons on Amidock or similar
- Have a gui using an event based gui system (say Gui4Cli)
- using buttons or icons
- using a directory listview (if most are in teh same directory
- using a 'dictionary' with 'keys' (names) and application paths, the names being visible in a listview
Uploaded
http://users.online.be/AD/P_Launch.gc demonstrating these 3 methods for the other uploaded Python-Gui4Cli gui's
It is to be noted that Gui4Cli has three ways of launching an external script, CLI command or application
- Synchronous; CLI "MyexternalcommandPath'
- asynchronous; RUN "MyexternalapplicationPath"
- asynchronous too but with a notification of the applications closing : LAUNCH "MyAppPath" using xONRETURN to continue the command sequence needed after that.
(of course you can also use Workbench's arexx port from Gui4Cli to launch an application)
(Appart form that it has its own way of launching & opening Gui4Cli scripts)
Python has the os.startfile() function I have still to test its possibilities