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)
Offline
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.
Offline
Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it. If you want, maybe we can merge the two?
Offline
Gravitation wrote:
Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it. If you want, maybe we can merge the two?
What's PyGame? I'm *really* new to Python.
Offline
technoboy10 wrote:
Gravitation wrote:
Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it. 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.
Offline
Gravitation wrote:
technoboy10 wrote:
Gravitation wrote:
Very fun! I've been working on Scratch2Pygame, but got too lazy to finish it. 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.
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?
Offline
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.
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
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.
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)
Offline
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.
Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!
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.
Offline
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.
Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!
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.
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?
Offline
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.
Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!
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.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.
Offline
Gravitation wrote:
technoboy10 wrote:
Gravitation wrote:
Yep.
Good idea! We can write PyScratch as a module, and Scratch2Py to convert in between PyScratch and sb. Epic!
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.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.
GUI-type stuff. (i.e. sprite movement, pen, looks, etc.)
Thanks!
Last edited by technoboy10 (2012-11-30 14:50:49)
Offline
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.
Yeah, I think this project is turning out to be more of a mid-point of Scratch and Python.
Offline
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)
Offline
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
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
Both, I think. After we're done, feel free to adapt the viewer.
Offline
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)
Offline
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.
Offline
Hey techno, I think this little code might work. It doesn't run yet, but you can see the concept, right?
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
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
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?
Offline
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.
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
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.
Cool.
Yeah, the actual pies seemed a little seasonal.
Last edited by technoboy10 (2012-12-02 10:34:36)
Offline