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

#1 2012-11-30 10:45:06

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

EasyAsPy

EasyAsPy will be an extension of Python that allows the use of Scratch-like functions/commands. It will use PyGame for GUI stuff.
Download all the files at http://www.easyaspy.tk.

Last edited by technoboy10 (2012-12-13 16:32:29)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#2 2012-11-30 12:00:09

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

Re: EasyAsPy

This is where M30W started... With the say and ask commands. xD

I suggest looking at M30W. It's a Python version of Scratch. http://scratch.mit.edu/forums/viewtopic.php?id=106225 I'm sure Roijac wouldn't mind another developer.  smile

Offline

 

#3 2012-11-30 12:20:45

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it.  tongue  If you want, maybe we can merge the two?

Offline

 

#4 2012-11-30 12:31:28

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it.  tongue  If you want, maybe we can merge the two?

What's PyGame? I'm *really* new to Python.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#5 2012-11-30 12:49:48

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it.  tongue  If you want, maybe we can merge the two?

What's PyGame? I'm *really* new to Python.

An extension to Python allowing the creation of games and GUI applications. I have quite a bit of experience with it.  smile

Offline

 

#6 2012-11-30 13:06:31

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

Gravitation wrote:

Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it.  tongue  If you want, maybe we can merge the two?

What's PyGame? I'm *really* new to Python.

An extension to Python allowing the creation of games and GUI applications. I have quite a bit of experience with it.  smile

Okay. Yeah, I'd be happy to combine projects with you! So does your project read Scratch projects and convert them to PyGame, or do you just use Scratch-like commands and convert those to PyGame?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#7 2012-11-30 13:17:55

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

technoboy10 wrote:


What's PyGame? I'm *really* new to Python.

An extension to Python allowing the creation of games and GUI applications. I have quite a bit of experience with it.  smile

Okay. Yeah, I'd be happy to combine projects with you! So does your project read Scratch projects and convert them to PyGame, or do you just use Scratch-like commands and convert those to PyGame?

I'm still in the early stages of my project, so I don't really know if it's going to turn out exactly the way I want it to, but I want it to basically define all of the blocks and simulate the Scratch project player. The hard part is going to be scripting the conversion from .sb to .py, but maybe we can take some example from Kurt. Sound OK?

Offline

 

#8 2012-11-30 13:29:00

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

Gravitation wrote:

An extension to Python allowing the creation of games and GUI applications. I have quite a bit of experience with it.  smile

Okay. Yeah, I'd be happy to combine projects with you! So does your project read Scratch projects and convert them to PyGame, or do you just use Scratch-like commands and convert those to PyGame?

I'm still in the early stages of my project, so I don't really know if it's going to turn out exactly the way I want it to, but I want it to basically define all of the blocks and simulate the Scratch project player. The hard part is going to be scripting the conversion from .sb to .py, but maybe we can take some example from Kurt. Sound OK?

Sure. So we'll basically map Scratch blocks to Python functions? We should also let the user program in PyScratch (the Python functions).

Last edited by technoboy10 (2012-11-30 13:29:36)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#9 2012-11-30 13:37:33

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

technoboy10 wrote:


Okay. Yeah, I'd be happy to combine projects with you! So does your project read Scratch projects and convert them to PyGame, or do you just use Scratch-like commands and convert those to PyGame?

I'm still in the early stages of my project, so I don't really know if it's going to turn out exactly the way I want it to, but I want it to basically define all of the blocks and simulate the Scratch project player. The hard part is going to be scripting the conversion from .sb to .py, but maybe we can take some example from Kurt. Sound OK?

Sure. So we'll basically map Scratch blocks to Python functions? We should also let the user program in PyScratch (the Python functions).

Yep.  big_smile

Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!  big_smile

The hard part (besides the sb file format) is simulating Scratch: having multiple scripts running at once. I would use a class for each sprite, and a global cue. I have no clue whether it will work or not, though.  tongue

Offline

 

#10 2012-11-30 13:43:54

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

Gravitation wrote:


I'm still in the early stages of my project, so I don't really know if it's going to turn out exactly the way I want it to, but I want it to basically define all of the blocks and simulate the Scratch project player. The hard part is going to be scripting the conversion from .sb to .py, but maybe we can take some example from Kurt. Sound OK?

Sure. So we'll basically map Scratch blocks to Python functions? We should also let the user program in PyScratch (the Python functions).

Yep.  big_smile

Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!  big_smile

The hard part (besides the sb file format) is simulating Scratch: having multiple scripts running at once. I would use a class for each sprite, and a global cue. I have no clue whether it will work or not, though.  tongue

XD I have no clue either.
I'll start working on the non-visual Scratch blocks, and if you want, you could work on the visual blocks.
Should we keep calling it PyScratch?


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#11 2012-11-30 14:15:51

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

technoboy10 wrote:

Gravitation wrote:

technoboy10 wrote:

Sure. So we'll basically map Scratch blocks to Python functions? We should also let the user program in PyScratch (the Python functions).

Yep.  big_smile

Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!  big_smile

The hard part (besides the sb file format) is simulating Scratch: having multiple scripts running at once. I would use a class for each sprite, and a global cue. I have no clue whether it will work or not, though.  tongue

XD I have no clue either.
I'll start working on the non-visual Scratch blocks, and if you want, you could work on the visual blocks.
Should we keep calling it PyScratch?

Okay, cool! What exactly do you mean by "visual"?

And yeah, PyScratch sounds epic.  big_smile

Offline

 

#12 2012-11-30 14:50:09

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

Gravitation wrote:

Yep.  big_smile

Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!  big_smile

The hard part (besides the sb file format) is simulating Scratch: having multiple scripts running at once. I would use a class for each sprite, and a global cue. I have no clue whether it will work or not, though.  tongue

XD I have no clue either.
I'll start working on the non-visual Scratch blocks, and if you want, you could work on the visual blocks.
Should we keep calling it PyScratch?

Okay, cool! What exactly do you mean by "visual"?

And yeah, PyScratch sounds epic.  big_smile

GUI-type stuff. (i.e. sprite movement, pen, looks, etc.)
Thanks!

Last edited by technoboy10 (2012-11-30 14:50:49)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#13 2012-11-30 15:03:19

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Magnie wrote:

This is where M30W started... With the say and ask commands. xD

I suggest looking at M30W. It's a Python version of Scratch. http://scratch.mit.edu/forums/viewtopic.php?id=106225 I'm sure Roijac wouldn't mind another developer.  smile

Yeah, I think this project is turning out to be more of a mid-point of Scratch and Python.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#14 2012-11-30 17:29:56

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

I'd like to use scratch.py for broadcasts, does that work for you?
Also, we probably need to change the name since this I'd kind of a mod of Scratch.
Maybe some type of pie (py)?

Last edited by technoboy10 (2012-11-30 20:44:40)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#15 2012-12-01 06:05:11

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

technoboy10 wrote:

I'd like to use scratch.py for broadcasts, does that work for you?
Also, we probably need to change the name since this I'd kind of a mod of Scratch.
Maybe some type of pie (py)?

Yeah, go ahead.
Maybe Pumpkin Pie?

Offline

 

#16 2012-12-01 16:44:52

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: EasyAsPy

so are you making a python .sb viewer or a scratch like pygame framework?

if you're doing .sb viewer, id really appreciate if you'd come over to M30W, the editing is already working, only executing projects is left  wink

Offline

 

#17 2012-12-01 19:36:18

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

roijac wrote:

so are you making a python .sb viewer or a scratch like pygame framework?

if you're doing .sb viewer, id really appreciate if you'd come over to M30W, the editing is already working, only executing projects is left  wink

Both, I think. After we're done, feel free to adapt the viewer.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#18 2012-12-01 19:38:02

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Here's a list of names I've come up with:
CherryPy
ICanHazPy
EasyAsPy

(800th post!)

Last edited by technoboy10 (2012-12-01 19:38:59)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#19 2012-12-02 01:48:41

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

technoboy10 wrote:

Here's a list of names I've come up with:
CherryPy
ICanHazPy
EasyAsPy

(800th post!)

EasyAsPy really rings a bell... it'll be easy to remember and is descriptive of our program. Let's go for that one.  smile

Offline

 

#20 2012-12-02 02:39:07

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

Hey techno, I think this little code might work. It doesn't run yet, but you can see the concept, right?

Code:

Sprites = []
Scripts = []
Blocks = []
Cue = []
class Sprite():
    global Sprites, Scripts
    x = 0
    y = 0
    dir = 90
    hidden = False
    myScripts = []
    name = "Sprite1"
class Script():
    global Sprites, Scripts, Blocks
    id = 0
    myBlocks = []
    pos = 0
    owner = 0
    def __init__(self):    
        global Sprites
        k = 0
        for i in Sprites:
            for j in i.myScripts:
                if j.id == self.id:
                    self.owner = k
            k += 1
class Block():
    global Scripts, Blocks, Cue
    id = 0
    block = 0
    inputs = []
    complete = False
    running = False
    owner = 0
    def __init__(self):
        global Scripts
        k = 0
        for i in Scripts:
            for j in i.myBlocks:
                if j.id == self.id:
                    self.owner = k
            k += 1
    def check(self):
        global Scripts
        if self.running == False:
            Scripts[self.owner].pos += 1
            if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
                Scripts[self.owner].pos = -1
    def run(self):
        global Sprites, Cue
        #All of the block definitions go here.

Offline

 

#21 2012-12-02 06:39:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

Hey techno, I think this little code might work. It doesn't run yet, but you can see the concept, right?

Code:

Sprites = []
Scripts = []
Blocks = []
Cue = []
class Sprite():
    global Sprites, Scripts
    x = 0
    y = 0
    dir = 90
    hidden = False
    myScripts = []
    name = "Sprite1"
class Script():
    global Sprites, Scripts, Blocks
    id = 0
    myBlocks = []
    pos = 0
    owner = 0
    def __init__(self):    
        global Sprites
        k = 0
        for i in Sprites:
            for j in i.myScripts:
                if j.id == self.id:
                    self.owner = k
            k += 1
class Block():
    global Scripts, Blocks, Cue
    id = 0
    block = 0
    inputs = []
    complete = False
    running = False
    owner = 0
    def __init__(self):
        global Scripts
        k = 0
        for i in Scripts:
            for j in i.myBlocks:
                if j.id == self.id:
                    self.owner = k
            k += 1
    def check(self):
        global Scripts
        if self.running == False:
            Scripts[self.owner].pos += 1
            if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
                Scripts[self.owner].pos = -1
    def run(self):
        global Sprites, Cue
        #All of the block definitions go here.

dont wanna be offensive, but assigning instance attributes at class level isnt gonna help you a lot

Offline

 

#22 2012-12-02 08:21:39

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

roijac wrote:

Gravitation wrote:

Hey techno, I think this little code might work. It doesn't run yet, but you can see the concept, right?

Code:

Sprites = []
Scripts = []
Blocks = []
Cue = []
class Sprite():
    global Sprites, Scripts
    x = 0
    y = 0
    dir = 90
    hidden = False
    myScripts = []
    name = "Sprite1"
class Script():
    global Sprites, Scripts, Blocks
    id = 0
    myBlocks = []
    pos = 0
    owner = 0
    def __init__(self):    
        global Sprites
        k = 0
        for i in Sprites:
            for j in i.myScripts:
                if j.id == self.id:
                    self.owner = k
            k += 1
class Block():
    global Scripts, Blocks, Cue
    id = 0
    block = 0
    inputs = []
    complete = False
    running = False
    owner = 0
    def __init__(self):
        global Scripts
        k = 0
        for i in Scripts:
            for j in i.myBlocks:
                if j.id == self.id:
                    self.owner = k
            k += 1
    def check(self):
        global Scripts
        if self.running == False:
            Scripts[self.owner].pos += 1
            if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
                Scripts[self.owner].pos = -1
    def run(self):
        global Sprites, Cue
        #All of the block definitions go here.

dont wanna be offensive, but assigning instance attributes at class level isnt gonna help you a lot

Any suggestions?  smile

Offline

 

#23 2012-12-02 10:03:16

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: EasyAsPy

When you assign attributes in python you usually do this:

Code:

class Object:
    def __init__(self):
        self.foo = None
        self.baz = None

Offline

 

#24 2012-12-02 10:16:56

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: EasyAsPy

roijac wrote:

When you assign attributes in python you usually do this:

Code:

class Object:
    def __init__(self):
        self.foo = None
        self.baz = None

Oh, I'll do it like that then.  smile

Code:

Sprites = []
Scripts = []
Blocks = []
Cue = []
class Sprite():
    global Sprites, Scripts
    def __init__():
        self.x = 0
        self.y = 0
        self.dir = 90
        self.hidden = False
        self.myScripts = []
        self.name = "Sprite1"
class Script():
    global Sprites, Scripts, Blocks
    def __init__(self):    
        global Sprites
        self.id = 0
        self.myBlocks = []
        self.pos = 0
        self.owner = 0
        k = 0
        for i in Sprites:
            for j in i.myScripts:
                if j.id == self.id:
                    self.owner = k
            k += 1
class Block():
    global Scripts, Blocks, Cue
    def __init__(self):
        global Scripts
        self.id = 0
        self.block = 0
        self.inputs = []
        self.complete = False
        self.running = False
        k = 0
        for i in Scripts:
            for j in i.myBlocks:
                if j.id == self.id:
                    self.owner = k
            k += 1
    def check(self):
        global Scripts
        if self.running == False:
            Scripts[self.owner].pos += 1
            if (Scripts[self.owner].pos + 1) > len(Scripts[self.owner].myBlocks):
                Scripts[self.owner].pos = -1
    def run(self):
        global Sprites, Cue
        #All of the block definitions go here.

Also, I don't think that the cue is necessary; we'll see later.

Offline

 

#25 2012-12-02 10:17:44

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: EasyAsPy

Gravitation wrote:

technoboy10 wrote:

Here's a list of names I've come up with:
CherryPy
ICanHazPy
EasyAsPy

(800th post!)

EasyAsPy really rings a bell... it'll be easy to remember and is descriptive of our program. Let's go for that one.  smile

Cool.
Yeah, the actual pies seemed a little seasonal.

Last edited by technoboy10 (2012-12-02 10:34:36)


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

Board footer