Re: Load and save commands for interpeter
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Paul Prescod wrote:
> I just had an idea that it would be cool if the Prothon command line
> had commands to load and save scripts. When you "save" it would turn
> your transcript into a valid Prothon program that you could run again
> or edit and run.
The history of what has happened in your session is already in a file you
can open and edit to turn into a script. The file is in the same folder as
prothon.exe and is called ".prothon_history". Have you ever noticed that
the command history was remembered between sessions?
> When you "load" it would read a script and execute each line one at a
> time, printing out the result as if you had typed it.
I have considered this before. I've considered it in two contexts. The
console as you suggest and as the core of an interactive IDE.
The reason I didn't do it in the console is that the idea quickly mushroomed
into a real shell. At that point I realized there was no reason not to drop
out into the real shell.
The interactive IDE is going to happen in the future.
> In general it would be cool if the command line had extra functions
> like "run" which would run a command in the operating system shell.
> Maybe with string interpolation...
O>> import os
O>> os.system('dir')
Volume in drive C has no label.
Volume Serial Number is 0828-A3FF
Directory of C:\Prothon\win32\Prothon
07/06/2004 02:31 PM <DIR> .
07/06/2004 02:31 PM <DIR> ..
07/11/2004 12:23 PM 1,005 .prothon_history
07/05/2004 09:58 PM 8,277 CHANGES.txt
07/05/2004 09:55 PM 61,440 dbm.dll
05/17/2004 10:32 AM 2,412 LICENSE.txt
05/17/2004 10:32 AM 348,160 msvcr71.dll
07/05/2004 09:55 PM 94,208 OS.dll
07/06/2004 11:08 AM <DIR> pr
07/05/2004 09:55 PM 69,632 Prosist.dll
07/05/2004 09:55 PM 397,312 prothon.exe
07/05/2004 09:55 PM 204,800 re.dll
05/17/2004 10:32 AM 453 README.txt
06/09/2004 01:31 PM 804 rel.pth
07/06/2004 02:34 PM 200,808 self.txt
07/05/2004 09:55 PM 593,920 SQLite.dll
13 File(s) 1,983,231 bytes
3 Dir(s) 363,920,523,264 bytes free
0
O>>