Click to See Complete Forum and Search --> : DOS for Linux!


Rob 'Feztaa' Park
10-19-2001, 09:24 PM
Hey all,

I'm in the process of writing a python script that basically simulates (simulate, not emulate) a DOS environment.

In other words, I think you could actually say I'm writing a shell for linux in python, that will look like DOS.

Features currently included:

- realistic DOS-like command prompt
- ability to change directory using either relative or absolute DOS paths ("cd C:\home\feztaa" or "cd feztaa", etc)
- random errors appear when you type invalid commands

Planned features:

- actually being able to execute programs, as in a real shell.
- implementation of other common shell builtins
- etc.

Actually, this is meant to be mostly a joke, as I hope you've figured by now. But I am actually working on this :)

I'll post it later, when I've got more done.

bwkaz
10-19-2001, 10:29 PM
Is it going to be limited to 640K too? Please? Can it be? Pleeeeeeeeeease???

:p

jon787
10-19-2001, 11:06 PM
Does it include this DOS error:
Keyboard not found. Press F1 to continue.

jemfinch
10-20-2001, 12:23 AM
Originally posted by jon787:
Does it include this DOS error:
Keyboard not found. Press F1 to continue.

I think that's actually a BIOS error, not a DOS error. :)

Jeremy

Rob 'Feztaa' Park
10-20-2001, 06:58 PM
Heh, I could put that error in, it just prints random ones whenever something goes wrong :)

Rob 'Feztaa' Park
10-20-2001, 08:12 PM
Just a question... anybody know how to get python to pause until the user presses a key? (ala "press any key to continue" prompt)

Right now I'm just using a raw_input that ignores what it's told; the only problem is the user has to hit enter to continue.

jon787
10-20-2001, 08:23 PM
Originally posted by jemfinch:
<STRONG>I think that's actually a BIOS error, not a DOS error. :)

Jeremy</STRONG>
Sooooo!
It is still a funny error!

TheLinuxDuck
10-22-2001, 09:13 AM
Originally posted by Rob 'Feztaa' Park:
<STRONG>Just a question... anybody know how to get python to pause until the user presses a key? (ala "press any key to continue" prompt) Right now I'm just using a raw_input that ignores what it's told; the only problem is the user has to hit enter to continue.</STRONG>

Although I don't know python, I believe that the solution is the same. I believe that it's a matter of adjusting the terminal settings so that input is not buffered.

jemfinch would be the one to axe about that.

Pinball
10-25-2001, 05:50 AM
I'm not really sure about python neither, but switching the terminal settings is not always necesary. e.g: pascal's "readkey" doesn't get buffered. At least when compiled with gpc...

Stuka
10-25-2001, 01:03 PM
The Python curses module has a getch() method that blocks for input. (Found this in the docs for ActivePython).

slacker_x
10-25-2001, 03:01 PM
I think a better project would be
"1337 5|-|311"

All commands would have 1337-speak equivalents.

or figure out a way to redirect stdout through a 1337-speak interpreter.

It would be annoying as hell, but funny to install on someone else's computer :D