dn <
[email protected]> writes:
Was constructing a two-part tutorial. When it came to the preparing for
the second meeting, was surprised to discover that PyCharm retained code
and values in its Python Console (its REPL tab/window) - I'm presuming, >within its 'project' structure.
I was already wondering whether some Python-Implementations
offer something like this.
I have started to work on a Newsreader. The first version of
the Newsreader is not to have any user interface at all. So,
the user directly calls Python functions to use the program.
The program is started in Idle and then one gets the usual
shell prompt of Idle and can excute Python code, using all
the definitions of the program.
For example, to configure the newsreader, the user creates
on object representing a newsserver:
s = newsaccount_class( "news.example.com" )
, then he can get a list of all the Python newsgroups:
s.groups( '*python*' )
. The abbreviated output is:
['comp.lang.python', 'pl.rec.humor.monty-python', ... ]
. It would be too cumbersome if the user would have to repeat
the configuration with "s = newsaccount_class( . . . )" every
time he starts the program, so I am offering a function to
save all the variables he has defined and try to find a way
to make it easy to write and save "macros" (= nothing else
than standard Python functions).
(This "zero user interface" does not exclude that at a later
date a more traditional user interface is added,
for example, via the standard package "cmd" or using tkinter.)
PS: While writing this post, by chance, I came across the
documentation of the standard package "code". This might
help me to find a way to get the source code of function
definitions if I use it to write my own shell!
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)