Skip to main content

PYTHON PROCESSING / It only really begins ...

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/

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

Popular posts from this blog

PYTHON / OpenCV, Recreate Uncanny Manga - Anime Style

Can you tell what it is? Computer Vision. Yesterday, I spend almost whole day exploring this opencv module using Python. What I discovered was revealing. Even at the very basic level, I could produce some interesting Image and Video manipulation using all the code collected from documentation and many, many blog tutorials. If you are a total noob like me, I am still getting used to knowing that the CV in OpenCV means Computer Vision! Actuallly, I recalled that I did try to get into OpenCV few years back ago, when I knew no Python and when Python opencv module was probably still early. It was all C++ code and it was a little bit too hard for me. I read a couple of books about opencv at the library, I did not understand a single thing. That was back then. Today, for strange reason, with a bit of knowledge of Python, I can go a little further. EDGE DETECT IN OPENCV Me holding you know what. What leads me this far is my curiosity on how we can replicate Wolfram Langu

WOLFRAM / Making Text With Rainbow Color

Continuing with my Wolfram Mathematica Trial Experience... I watched and went through some more Mathematica introduction videos, read lots of Mathematica documentation and also going through the Wolfram Lab Online again a few times. There are some major learning curves and Mathematica is a lot different from normal programming language. Sometimes there is a lot of interesting "shortcuts", say like: FindFaces[] , WordCloud[] . Sometimes I got a little confused on how one can do iterations. Normally FOR LOOP concept is introduced early, but in Wolfram, because everything is EXPRESSIONS and ENTITY (like OBJECTS), sometimes it gets quite quirky. Mind you I am still in the first impression and having to look at many tutorials. Lots of NEAT EXAMPLES from documentation, but sometimes I got lost. I found Wolfram to be really awesome with LIST and generating list. It's almost too easy when it works visually. I cannot explain them with my own words yet, but there are