Questions about Python Mode

Hi, this is Qi Wang. I'm on my fourth year in Zhejiang University, one of the top 3 univ. of China. Being a member of Visual Analysis Group(http://www.cad.zju.edu.cn/home/vagwiki/index.php/VagMemebers), I've been coding in Processing for over half year and played with Java when I could speak, lol. I've been trying something new with Python Mode recently.

You mentioned that we could refer to GitHub issues for more information. After checking the issues the haven't been closed yet, I'm still confused about what I should do in GSoC or let's say what should be included in the proposal for Python Mode, since I haven't found any bugs to fix or functions to enhance.

Besides, what language will we use to update compatibility with the 3.0 alpha releases? Is it Java or Python?

Thank you!

Comments

  • From what I understand about python mode, the two main pieces of work are:

    1) Processing sketches are classes that extend PApplet. PApplet's dependency on Applet was removed between 3.0a4 and 3.0a5. Python Mode would have to be rewritten to accommodate these changes.

    2) Processing 3.0 introduced many new editor features for auto-completion, error checking, etc. Python mode was created based on the Processing 2.0 editor and would have to be rewritten.

    The work would involve researching the details of #1 and #2 and proposing solutions.

    I believe the mode itself is written in Java (just like the PDE itself).

  • edited March 2015

    PApplet's dependency on Applet was removed between 3.0a4 and 3.0a5.

    Actually, up till version 3.0a5, Processing still extends Applet class: ~O)
    println(this instanceof java.applet.Applet);

  • edited March 2015

    As GoToLoop said, it seems PApplet still extends Applet class. Running code:

        PApplet pApplet = new PApplet();
        System.out.println(pApplet instanceof java.applet.Applet);
    

    It prints "true".

    Could you please tell me the reason why we make the removal of Applet as the base class for PApplet? How could I turn on the auto-completion function in PDE3.0a5? Or it's just in the PDE X instead?

  • Also, auto-complete options are in the preferences.

  • edited March 2015

    Judging by what's written there about Applet class dependency removal and the challenges ahead (bugs) due to it,
    I guess I'm gonna await till Processing 4 before going any further than P3.0a5! :P

  • :P Is there any explanation for why println() function will print "true", now that the removal has been done? Note that I thing I did use the the core.java of 3.0a5.

  • edited March 2015

    It's true b/c it's still there like always were! P3.0a5 is the last version which still inherits from Applet!
    I thought my previous "warning" above to stick w/ v 3.0a5 was already clear clue about it! >-)

    size(600, 400, JAVA2D);
    frame.setTitle("I still depend on Applet class!");
    println(this instanceof java.applet.Applet);
    

    https://github.com/processing/processing/blob/processing-0232-3.0a5/core/src/processing/core/PApplet.java#L161

  • Thanks for your patience. I should read the source directly :P I will spend more time on it, trying to throw a good proposal!

  • edited March 2015

    As for auto-completion function, are you talking about the "Code completion with Ctrl-space" in the "File -> Preferences"? But it doesn't function like auto-completion, 'cause I have to enter "ctrl-space" to make it work.

    auto-completion

    It there another auto-completion that I missed? If not, shall we make it auto pop up suggesting code like eclipse does? Thank you.

  • I prefer auto pop-up myself. "Too much" work to reach CTRL+SPC for that all the time! :P

  • If you prefer auto-completion to be "always on" you can go to the preferences.txt file and set:

    pdex.completion.trigger=true

    We have gone back and forth many times about what to set the defaults to, but the general consensus is that for beginners having constant auto-completion gets in the way.

  • edited March 2015

    It'd be nice if that more powerful setting was also within PDE's preferences tab! *-:)

  • edited March 2015

    lol, GoToLoop, did you find the "pdex.completion.trigger" before?

    I think such an important and useful function should be included in the preference window, instead of only a "code completion with Ctrl-space" presented.

    According to the previous GSoC, there are few Python projects accepted. Thus I shall switch to PDE projects, especially on the Code Assistant part.

  • edited March 2015

    Did you find the "pdex.completion.trigger" before?

    Nope. Although I do know about that "preferences.txt", I didn't peruse that for any new v3 features.
    Actually I'm currently on Processing 2.2.1 in my OS! Got v3.0a5 installed in another laptop though.

  • I thought you knew that before :P More work should be done in Preferences tab!!

    Say I have downloaded the source code from "https://github.com/processing/processing" and I'm using Eclipse to import the projects, is there any main class to run to generate the whole PDE via eclipse?

  • Does the Python mode in processing actually uses the python language or just emulates it's syntax and functions?

Sign In or Register to comment.