Back into Processing again, with Python!
While Daniel Shiffman is continuously inspiring us with his CODING TRAIN series on YouTube, using Processing with Java and Javascript language, I decided to free my mind and trying to really do something using Processing and Python language.
Installing Python language version on Processing 3 is easy enough, just first download the latest Processing and install the Python language mode via Add Mode button.
Other link that might help:
https://github.com/jdf/processing.py
http://py.processing.org/tutorials/
With Python, outside Processing, commonly people will be introduced to Python IDE or IDLE environment. Something that looks like Console Window or Command Prompt, where we type single liners command.
Python Command Line and IDE normally have this advantage of being able to dir() for help on functions and module, etc.
A good text editor will give you:
- Syntax Highlighting
- Command Completion
- Feedback via Console
Nowadays, when playing with Python, I am using either Sublime Text or more fancy Pineapple app that is simulating Jupyter Notebook iPython (Interactive Python).
The advantage of something like Jupyter Notebook is to quickly NOTE extra information and also being able to see the result INLINE within the NOTEBOOK.
Something like above is a really nice and ideal environment for learner.
OK, so back to Processing world.
If you have some kind of familiarity with Processing Java version, you soon can start testing this by doing below:
SETUP and DRAW function are always needed and will be run automatically by Processing app.
So, it will probably takes me a bit of time to transfer my all-over-the-place knowledge of Processing into this Python environment. For some areas, it might be simple, but not sure.
But, I think the point I wanted to make is:
So, just like a person learns to read, write, sing, .... they will at point will sit down with pencil paper and start expressing their emotion or thought.
I continue:
I only remember ellipse() and size() function for now. Maybe fill() and stroke().
Soon wanting to test simplest Python range() function and loop.
Actually I made a mistake there on draw(), because currently LOOP DRAW is running those LOOP I created. I remembered, LOOP DRAW FUNCTION is continuously called, while SETUP FUNCTION is run once.
So even without loop, anything under DRAW is continuously being drawn:
That's a good "aha!" moment.
Maybe I will look up some examples and then continue from there.
- Python Processing comes with some EXAMPLES, but most Processing examples and tutorials online are probably written in Java and Javascript, which is a pity. But this might change overtime. After all, PROCESSING is a really nice visual programming environment, and PYTHON is a very friendly language to code.
- A quick way to get REFERENCE and HELP by highlighting functions? Even COMMAND COMPLETION is not provided, I don't think.
- Video tutorials of Python Processing. Maybe I will try and do a couple.
- At least PROCESSING and PYTHON MODE are still going, so hopefully this can continue.
While Daniel Shiffman is continuously inspiring us with his CODING TRAIN series on YouTube, using Processing with Java and Javascript language, I decided to free my mind and trying to really do something using Processing and Python language.
Installing Python language version on Processing 3 is easy enough, just first download the latest Processing and install the Python language mode via Add Mode button.
Other link that might help:
https://github.com/jdf/processing.py
http://py.processing.org/tutorials/
BLANK MODE
As soon as Processing Python Mode, opens up and running I am presented with a blank environment. Suddenly I recalled my journey in learning programming from zero until now...With Python, outside Processing, commonly people will be introduced to Python IDE or IDLE environment. Something that looks like Console Window or Command Prompt, where we type single liners command.
Python Command Line and IDE normally have this advantage of being able to dir() for help on functions and module, etc.
A good text editor will give you:
- Syntax Highlighting
- Command Completion
- Feedback via Console
Nowadays, when playing with Python, I am using either Sublime Text or more fancy Pineapple app that is simulating Jupyter Notebook iPython (Interactive Python).
The advantage of something like Jupyter Notebook is to quickly NOTE extra information and also being able to see the result INLINE within the NOTEBOOK.
Something like above is a really nice and ideal environment for learner.
OK, so back to Processing world.
JUMP INTO PYTHON PROCESSING
Processing app, Python mode, gives you this kind of working environment:If you have some kind of familiarity with Processing Java version, you soon can start testing this by doing below:
SETUP and DRAW function are always needed and will be run automatically by Processing app.
So, it will probably takes me a bit of time to transfer my all-over-the-place knowledge of Processing into this Python environment. For some areas, it might be simple, but not sure.
But, I think the point I wanted to make is:
One is only truly started to code when they code WITHOUT looking at tutorial and digging the program based on instinct.
So, just like a person learns to read, write, sing, .... they will at point will sit down with pencil paper and start expressing their emotion or thought.
I continue:
I only remember ellipse() and size() function for now. Maybe fill() and stroke().
Soon wanting to test simplest Python range() function and loop.
Actually I made a mistake there on draw(), because currently LOOP DRAW is running those LOOP I created. I remembered, LOOP DRAW FUNCTION is continuously called, while SETUP FUNCTION is run once.
So even without loop, anything under DRAW is continuously being drawn:
That's a good "aha!" moment.
Maybe I will look up some examples and then continue from there.
FEEDBACK:
Something is clearly needed with PROCESSING PYTHON:- Python Processing comes with some EXAMPLES, but most Processing examples and tutorials online are probably written in Java and Javascript, which is a pity. But this might change overtime. After all, PROCESSING is a really nice visual programming environment, and PYTHON is a very friendly language to code.
- A quick way to get REFERENCE and HELP by highlighting functions? Even COMMAND COMPLETION is not provided, I don't think.
- Video tutorials of Python Processing. Maybe I will try and do a couple.
- At least PROCESSING and PYTHON MODE are still going, so hopefully this can continue.
Comments
Post a Comment