This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-14 22:08:27

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

PY-DOS, my fake DOS OS written in Python

LATEST VERSION: v0.3
LAST UPDATED: JULY 16, 2010

CHANGES FROM v0.2.3
- Note app added
- "Bad command" changed
- Author info better

SOURCE

Code:

note = ""
def app_note():
    global note
    print("Welcome to the note app! Here you can write a note and leave it for later.")
    print('\n')
    if note == "":
        areusure = str(input("You don't seem to have a note. Write one now? [Y/N] "))
        if areusure == "Y":
            note = str(input("Write your note here: "))
            print("Note saved")
            load_the_os(0)
        else:
            load_the_os(0)
    else:
        print("Current note:", note)
        areusure = str(input("Make new note? [Y/N] "))
        if areusure == "Y":
            note = str(input("Write your note here: "))
            print("Note saved")
            load_the_os(0)
        else:
            load_the_os(0)
        
def show_the_ver():
    print("PY-DOS v0.3 by ThePCKid on Scratch")
    load_the_os(0)

def get_some_help():
    print("help     Display this help screen")
    print("ver      Display the version of this fake OS")
    print("stop     Shutdown PY-DOS")
    print("logout   Logout of PY-DOS")
    print("note     Launch the note app")
    load_the_os(0)

def load_the_os(i):
    if i == 1:
        print("Type 'help' for help")
        print("Please note that because PY-DOS is written in Python, command names, usernames, and passwords are case-sensitive.")
    inpt = str(input(">"))

    if inpt == "help":
        get_some_help()
    elif inpt == "ver":
        show_the_ver()
    elif inpt == "stop":
        areusure = str(input("Are you sure? [Y/N] "))
        if areusure == "Y":
            pass
        else:
            load_the_os(0)
    elif inpt == "logout":
        for i in range(0, 15):
            print('\n')
        try_to_login()
    elif inpt == "note":
        app_note()
    else:
        print("Unknown command. Try 'help' to get a list of known commands.")
        load_the_os(0)

def try_to_login():
    tempuser = temppass = ""
    tempuser = str(input("Username: "))
    temppass = str(input("Password: "))
    if tempuser == username:
        if temppass == password:
            print("Logged in!")

            for i in range(0, 25):
                print('\n')

            load_the_os(1);
        else:
            print("Incorrect password")
            try_to_login()
    else:
        print("Incorrect username")
        try_to_login()

username = password = ""

username = str(input("Enter your desired username: "))
password = str(input("Enter your desired password: "))
for i in range(0, 25):
    print('\n')

try_to_login()

ARCHIVE (FROM V0.3 UP)

Last edited by ThePCKid (2011-04-17 12:49:29)

Offline

 

#2 2010-07-14 22:10:03

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

ok.... how do i run it? and where? with what?


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#3 2010-07-14 22:11:56

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

poppypaynterscratch wrote:

ok.... how do i run it? and where? with what?

Download Python 3.1.2 (or greater)
Open this in Python.
Run -> Run module

Python's site: http://python.org/

You can't compile Python files, so I posted the source

Last edited by ThePCKid (2010-07-14 22:13:05)

Offline

 

#4 2010-07-14 22:22:38

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

ooooooo.... i see, thx  smile


i think i'll need to learn python sometime...

(i've heard they have souls 0w0 )


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#5 2010-07-14 22:24:15

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

It sounds like pie dos.


~ihaveamac - visit ihaveamac.net

Offline

 

#6 2010-07-14 22:28:51

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

lol, but it not working D: says this:

SyntaxError: unexpected character after line continuation character
*************'s-imac:untitled folder **********$
the stars stannd for the machine name


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#7 2010-07-14 22:31:15

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

poppypaynterscratch wrote:

lol, but it not working D: says this:

SyntaxError: unexpected character after line continuation character
*************'s-imac:untitled folder **********$
the stars stannd for the machine name

Weird, it works fine on Windows...

Offline

 

#8 2010-07-14 22:34:12

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

ThePCKid wrote:

poppypaynterscratch wrote:

lol, but it not working D: says this:

SyntaxError: unexpected character after line continuation character
*************'s-imac:untitled folder **********$
the stars stannd for the machine name

Weird, it works fine on Windows...

huh... should i not replace the spaces with tabs?


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#9 2010-07-14 22:35:00

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

poppypaynterscratch wrote:

ThePCKid wrote:

poppypaynterscratch wrote:

lol, but it not working D: says this:

SyntaxError: unexpected character after line continuation character
*************'s-imac:untitled folder **********$
the stars stannd for the machine name

Weird, it works fine on Windows...

huh... should i not replace the spaces with tabs?

Don't replace anything

Offline

 

#10 2010-07-14 22:39:21

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

ThePCKid wrote:

poppypaynterscratch wrote:

ThePCKid wrote:


Weird, it works fine on Windows...

huh... should i not replace the spaces with tabs?

Don't replace anything

tried again doing that, and it didnt work  sad


me wrote:

me wrote:

me wrote:

boohoo  sad

Last edited by poppypaynterscratch (2010-07-14 22:39:34)


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#11 2010-07-14 22:50:46

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Updated

Offline

 

#12 2010-07-14 22:54:26

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

ihaveamac wrote:

It sounds like pie dos.

That's exactly how you say it

Offline

 

#13 2010-07-14 23:24:56

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

ThePCKid wrote:

ihaveamac wrote:

It sounds like pie dos.

That's exactly how you say it

does it work now? also, i just made this :3
(looks terrible here, awesome in word  tongue )

                                                                  _________
                                                      ...—‘’’’                ‘’’’’’--....
                                                .-‘’’                                         ‘’’-.
                                           /’’                                                      ‘\
                                       /’’                                                              ‘\
                                     /                                                                     \
                                   /                                                                         \
                                 /                                                                             \
                                |’                                                                             ‘|
                                |                                                                               |
                                |                    .----.                         .---.                      |
                                |                   (       )                      (      )                    |
                                 ‘|                   ‘’’’’’                        ‘’’’’                     |’
                                  \                                                                           /
                                   \                                                                         /
                                     \                                                                     /
                                      \                         ‘-----------‘                             /
                                        \                                                               /
                                          \                   _______________                  /
                                             ’\                                                       /’
                                                ‘-.                                                .-‘
                                                     ‘-.                                      .-‘                   
                                                           ‘ -.. _                   _..- ‘
                                                                     ‘’’’’’’’’’’’’’’


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#14 2010-07-15 09:07:02

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

poppypaynterscratch wrote:

ThePCKid wrote:

ihaveamac wrote:

It sounds like pie dos.

That's exactly how you say it

does it work now? also, i just made this :3
(looks terrible here, awesome in word  tongue )

                                                                  _________
                                                      ...—‘’’’                ‘’’’’’--....
                                                .-‘’’                                         ‘’’-.
                                           /’’                                                      ‘\
                                       /’’                                                              ‘\
                                     /                                                                     \
                                   /                                                                         \
                                 /                                                                             \
                                |’                                                                             ‘|
                                |                                                                               |
                                |                    .----.                         .---.                      |
                                |                   (       )                      (      )                    |
                                 ‘|                   ‘’’’’’                        ‘’’’’                     |’
                                  \                                                                           /
                                   \                                                                         /
                                     \                                                                     /
                                      \                         ‘-----------‘                             /
                                        \                                                               /
                                          \                   _______________                  /
                                             ’\                                                       /’
                                                ‘-.                                                .-‘
                                                     ‘-.                                      .-‘                   
                                                           ‘ -.. _                   _..- ‘
                                                                     ‘’’’’’’’’’’’’’’

Try this:
Open Notepad (TextEdit if you use a Mac), copy the source in it, from one of the comboboxes choose "All files" (or something like that), and save the file as 'fakeos.py' (without the quotes).

Offline

 

#15 2010-07-15 21:05:39

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Updated

Offline

 

#16 2010-07-15 23:01:13

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Added archive link. Will grow in time.

Offline

 

#17 2010-07-16 12:19:52

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Updated to v0.3

Offline

 

#18 2010-07-16 15:07:22

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Bump

Offline

 

#19 2010-07-17 20:18:01

poppypaynterscratch
Scratcher
Registered: 2009-09-20
Posts: 100+

Re: PY-DOS, my fake DOS OS written in Python

ok.... i really hate textedit -_- it doesn't have all files option, but you can change the file type after you save it. i mean REALLY? WHAT THE FRUIT.  anyways, ill try again....


well, it didnt work. what a surprise. everytime it says that theres an extra character or whatever... will someone else that has a mac try it? and tell me what im doing wrong?

Last edited by poppypaynterscratch (2010-07-17 20:21:26)


http://i33.tinypic.com/2dw6hxv.gif

Offline

 

#20 2011-04-17 12:45:31

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Topic reopened via request of owner.


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#21 2011-04-17 12:47:34

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

I have never tried Python 3.1.3, but I recently installed Python 2.7.1 and 3.2.

In both of those versions, PY-DOS doesn't work. There is no traceback. On every command, even if it's valid, I get my invalid command message that I put in PY-DOS.

Does anyone know how I can fix that?

cheddargirl wrote:

Topic reopened via request of owner.

Thanks!

Last edited by ThePCKid (2011-04-17 12:48:03)

Offline

 

#22 2011-04-17 13:25:17

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Well, I just installed a brand-new shiny version of Python 3.2 on my laptop (never got around to it after my hard drive failure a while back) and copied the Python text from your post and pasted it into a text file with a .py extension, then I loaded it into IDLE and it ran perfectly.  This is on a Windows PC running Vista Home Premium.  So it works for me...


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#23 2011-04-17 13:42:41

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Paddle2See wrote:

Well, I just installed a brand-new shiny version of Python 3.2 on my laptop (never got around to it after my hard drive failure a while back) and copied the Python text from your post and pasted it into a text file with a .py extension, then I loaded it into IDLE and it ran perfectly.  This is on a Windows PC running Vista Home Premium.  So it works for me...

It works in IDLE, but it doesn't work in the command line. Do you know how to make it work on the command line? It worked in both IDLE and the command line in 3.1.2...

Offline

 

#24 2011-04-18 17:31:56

ThePCKid
Scratcher
Registered: 2009-09-16
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

Can I please get some help?

Offline

 

#25 2011-04-18 17:43:34

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: PY-DOS, my fake DOS OS written in Python

does this work better?

Code:

note = ""
def app_note():
    global note
    print("Welcome to the note app! Here you can write a note and leave it for later.")
    print('\n')
    if note == "":
        areusure = str(input("You don't seem to have a note. Write one now? [Y/N] "))
        if areusure == "Y":
            note = str(input("Write your note here: "))
            print("Note saved")
            load_the_os(0)
        else:
            load_the_os(0)
    else:
        print("Current note:", note)
        areusure = str(input("Make new note? [Y/N] "))
        if areusure == "Y":
            note = str(input("Write your note here: "))
            print("Note saved")
            load_the_os(0)
        else:
            load_the_os(0)
        
def show_the_ver():
    print("PY-DOS v0.3 by ThePCKid on Scratch")
    load_the_os(0)

def get_some_help():
    print("help     Display this help screen")
    print("ver      Display the version of this fake OS")
    print("stop     Shutdown PY-DOS")
    print("logout   Logout of PY-DOS")
    print("note     Launch the note app")
    load_the_os(0)

def load_the_os(i):
    if i == 1:
        print("Type 'help' for help")
        print("Please note that because PY-DOS is written in Python, command names, usernames, and passwords are case-sensitive.")
    inpt = str(input(">"))

    if inpt == "help":
        get_some_help()
    elif inpt == "ver":
        show_the_ver()
    elif inpt == "stop":
        areusure = str(input("Are you sure? [Y/N] "))
        if areusure == "Y":
            pass
        else:
            load_the_os(0)
    elif inpt == "logout":
        for i in range(0, 15):
            print('\n')
        try_to_login()
    elif inpt == "note":
        app_note()
    else:
        print("Unknown command. Try 'help' to get a list of known commands.")
        load_the_os(0)

def try_to_login():
    tempuser = temppass = ""
    tempuser = str(input("Username: "))
    temppass = str(input("Password: "))
    if tempuser == username:
        if temppass == password:
            print("Logged in!")

            for i in range(0, 25):
                print('\n')

            load_the_os(1);
        else:
            print("Incorrect password")
            try_to_login()
    else:
        print("Incorrect username")
        try_to_login()

username = password = ""

username = str(input("Enter your desired username: "))
password = str(input("Enter your desired password: "))
for i in range(0, 25):
    print('\n')

try_to_login()

Hey.  It's me SSSS, back from the dead!  smile

Offline

 

Board footer