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

#1 2010-12-27 11:25:06

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

python code

Yes I know I'm terrible with python but here is a little code.  smile :
print "Welcome to ZapOS!"
on = 0
f1 = 0
f2 = 0
while on == 0:
    cmmnd = raw_input("Input your command:")
    if cmmnd  == "ZapPro":
        print "Welcome to ZapPro! a  file convertor where you can convert .txt files to .jrg files input your file name for a conversion.(without the .txt)"
        cvn = raw_input("")
        if cvn == fn:
           f2 = f1
           print "(-)File converted(-)"
           print "To use your newly converted file use the command'ZapSml'"
    if cmmnd == "ZapWord":
        if f1 != 0:
            print f1
            ovr = raw_input("Overwrte last file?(yes/no)")
            if ovr != no:
                et = raw_input("Enter text:")
                print et
                fn = raw_input("File name?")       
        else:
            et = raw_input("Enter text:")
            print et
            fn = raw_input("File name?")
        print fn,".txt"
        f1 = et
        print "(-)saved(-)"
    if cmmnd == "ZapSml":
        if f2 != 0:
            print len(f2)
        else:
            print "You have no jrg file"
    if cmmnd == "off":
        on = 1

You can open a VERY simple word processor with the command "ZapWord"
Then write anything and press enter. Then name your file (yolu can onlyhave one) With that file you can  convert it into a .jrg file with the command "ZapPro"
With the .jrg you can find the length of the origanal text withthe command "ZapSml". smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#2 2010-12-27 11:40:11

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: python code

lol. I made a batch file called zapOS!

Offline

 

#3 2010-12-27 18:46:44

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: python code

ProgrammingFreak wrote:

lol. I made a batch file called zapOS!

tongue  big_smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#4 2010-12-27 23:15:09

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: python code

So what does it actually do?

Offline

 

#5 2010-12-28 10:34:31

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: python code

Magnie wrote:

So what does it actually do?

Eh not much. -_-' Told  ya I'm not very good.


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#6 2010-12-28 14:58:12

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: python code

Hehe, I'm just wondering what it's supposed to do. I may be able to help you with it. ^.^

Offline

 

#7 2010-12-28 15:22:58

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: python code

Magnie wrote:

Hehe, I'm just wondering what it's supposed to do. I may be able to help you with it. ^.^

Ok cool. smile
@funky#'s  It's a code in python.


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#8 2010-12-28 19:35:08

terminator68
Scratcher
Registered: 2008-02-26
Posts: 1000+

Re: python code

Oh, nice program!


--------------------Scratcher since '08--------------------
http://images1.wikia.nocookie.net/__cb20110314152018/mlpfanart/images/5/5d/Applejack_chewing.gif

Offline

 

#9 2010-12-28 23:13:17

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: python code

Yes. I remember that Magnie is really good at python.  wink


Hai.

Offline

 

#10 2010-12-29 11:56:07

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: python code

terminator68 wrote:

Oh, nice program!

Thanks. smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#11 2010-12-29 13:34:09

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: python code

Although this is an "Advanced Topic," it has nothing to do with Scratch, which is what this forum is about. I'll move this over to Miscellaneous for you - it'll fit better in there.

Offline

 

#12 2010-12-29 14:49:51

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: python code

coolstuff wrote:

Although this is an "Advanced Topic," it has nothing to do with Scratch, which is what this forum is about. I'll move this over to Miscellaneous for you - it'll fit better in there.

Whaaa? Ok whatevs thanks. smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#13 2010-12-30 19:27:22

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: python code

Yay, I know enough Python to tell what the program does without running it!  smile

I have been using Python for several years. I think that this is a pretty cool script!

The next stage is to make it load and save actual files  tongue  (look up 'cpickle'')


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

#14 2010-12-30 22:52:28

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: python code

floppy_gunk wrote:

Yay, I know enough Python to tell what the program does without running it!  smile

I have been using Python for several years. I think that this is a pretty cool script!

The next stage is to make it load and save actual files  tongue  (look up 'cpickle'')

Wow thanks.  smile  Tomarrow I'll make and post a new code.  smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

Board footer