# Processing.py

**URL:** https://discourse.processing.org/c/processing-py/9.md?page=1

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 2

---

## [Sample code to create SVG file, using Processing 4.1.1 with Python mode](https://discourse.processing.org/t/sample-code-to-create-svg-file-using-processing-4-1-1-with-python-mode/43828)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 5\
**Last updated:** [February 5, 2024, 1:32am UTC](https://discourse.processing.org/t/sample-code-to-create-svg-file-using-processing-4-1-1-with-python-mode/43828 "2024-02-05T01:32:08Z")

</div>

Hello, I would like to create an SVG file in Processing 4.1.1 Python mode but I am getting an error on this line: add\_library (‘svg’) Error: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppCla…

---

## [Export .GIF file](https://discourse.processing.org/t/export-gif-file/43613)

<div class="topic-metadata">

**Author:** [@salvalnx](https://discourse.processing.org/u/salvalnx)\
**Replies:** 4\
**Last updated:** [January 4, 2024, 7:30pm UTC](https://discourse.processing.org/t/export-gif-file/43613 "2024-01-04T19:30:22Z")

</div>

Hello everyone I’m working on a simple Processing project in Python but I can’t find a way to export the animation to .gif. Is there a way to do it? Thank you

---

## [Nature of Code (Random Walker) using Python](https://discourse.processing.org/t/nature-of-code-random-walker-using-python/43236)

<div class="topic-metadata">

**Author:** [@Hsu](https://discourse.processing.org/u/Hsu)\
**Replies:** 2\
**Last updated:** [November 19, 2023, 2:19pm UTC](https://discourse.processing.org/t/nature-of-code-random-walker-using-python/43236 "2023-11-19T14:19:18Z")

</div>

Hello, everyone. I am currently learning Processing by watching Nature of Code wrote by Dan Shiffman. And I encountered a problem that bothers me for 1 week, that’s why I am asking for help from the brilliants here. I…

---

## [Using javax.swing import JOptionPane issues](https://discourse.processing.org/t/using-javax-swing-import-joptionpane-issues/43215)

<div class="topic-metadata">

**Author:** [@dwu09](https://discourse.processing.org/u/dwu09)\
**Replies:** 6\
**Last updated:** [November 15, 2023, 4:33pm UTC](https://discourse.processing.org/t/using-javax-swing-import-joptionpane-issues/43215 "2023-11-15T16:33:19Z")

</div>

Hi, trying to use the JOptionpane in Processing and get following message: java.lang.reflect.InaccessibleObjectException: Unable to make public abstract javax.swing.TransferHandler javax.swing.TransferHandler$HasGetTra…

---

## [Anyone managed to get Spout working with Processing.py?](https://discourse.processing.org/t/anyone-managed-to-get-spout-working-with-processing-py/42860)

<div class="topic-metadata">

**Author:** [@MrEvanJ1](https://discourse.processing.org/u/MrEvanJ1)\
**Replies:** 2\
**Last updated:** [October 26, 2023, 1:37am UTC](https://discourse.processing.org/t/anyone-managed-to-get-spout-working-with-processing-py/42860 "2023-10-26T01:37:53Z")

</div>

I am hoping to get the Spout library working with Processing for Python but am finding it does not work for me. Trying to add it to a project produces the following error: RuntimeWarning: PyTableCode.call caught a Thro…

---

## [Error changing global variable inside draw() function](https://discourse.processing.org/t/error-changing-global-variable-inside-draw-function/42414)

<div class="topic-metadata">

**Author:** [@bruhnana](https://discourse.processing.org/u/bruhnana)\
**Replies:** 1\
**Last updated:** [July 14, 2023, 11:01am UTC](https://discourse.processing.org/t/error-changing-global-variable-inside-draw-function/42414 "2023-07-14T11:01:46Z")

</div>

I’m trying to make a space invaders game using Processing Python but for some reason when a barrier is destroyed and I try to repopulate it after the player tries to play again, the entire code just freezes I think. The …

---

## [Processing.py animated presentation help](https://discourse.processing.org/t/processing-py-animated-presentation-help/42238)

<div class="topic-metadata">

**Author:** [@urjija](https://discourse.processing.org/u/urjija)\
**Replies:** 2\
**Last updated:** [June 29, 2023, 8:06pm UTC](https://discourse.processing.org/t/processing-py-animated-presentation-help/42238 "2023-06-29T20:06:15Z")

</div>

hi, I’m trying to make an animated presentation using processing.py, I got the presentation part down, but im having some trouble trying to add some animations into this, every YouTube video I’ve seen is for java and not…

---

## [ASCII visualization issue](https://discourse.processing.org/t/ascii-visualization-issue/42041)

<div class="topic-metadata">

**Author:** [@rrnn](https://discourse.processing.org/u/rrnn)\
**Replies:** 10\
**Last updated:** [May 27, 2023, 12:33am UTC](https://discourse.processing.org/t/ascii-visualization-issue/42041 "2023-05-27T00:33:00Z")

</div>

Hello! I’m trying to draw with some ASCII characters (like ░▒▓) on a Mac with Processing.py but unfortunately when I hit play they are not displaying correctly as you can see from the screenshot here What am I miss…

---

## [The render window is scaled improperly when Windows display scale is set to greater than 100%](https://discourse.processing.org/t/the-render-window-is-scaled-improperly-when-windows-display-scale-is-set-to-greater-than-100/36932)

<div class="topic-metadata">

**Author:** [@Metamere](https://discourse.processing.org/u/Metamere)\
**Replies:** 2\
**Last updated:** [May 14, 2023, 7:28pm UTC](https://discourse.processing.org/t/the-render-window-is-scaled-improperly-when-windows-display-scale-is-set-to-greater-than-100/36932 "2023-05-14T19:28:48Z")

</div>

Hi. I have a QHD monitor (2560x1440), and I have my display scale set to 150% for readability. Unfortunately, in Python mode, the render window is also scaled up the same amount, making things very jagged. I didn’t reali…

---

## [Can't get numpy to work](https://discourse.processing.org/t/cant-get-numpy-to-work/18002)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 18\
**Last updated:** [April 18, 2023, 2:47pm UTC](https://discourse.processing.org/t/cant-get-numpy-to-work/18002 "2023-04-18T14:47:47Z")

</div>

I’m trying to learn reinforcement learning & all the tutorials I found so far use a program called numpy or something called numpy. I’ve downloaded it & unzipped it, but still get there no module named numpy. Can someone…

---

## [What is the future of Processing Python Mode?](https://discourse.processing.org/t/what-is-the-future-of-processing-python-mode/35009)

<div class="topic-metadata">

**Author:** [@javagar](https://discourse.processing.org/u/javagar)\
**Replies:** 23\
**Last updated:** [February 25, 2023, 11:21pm UTC](https://discourse.processing.org/t/what-is-the-future-of-processing-python-mode/35009 "2023-02-25T23:21:42Z")

</div>

What are the current plans for the future of Processing Python Mode or, alternatively, for a Python package based on the core ideas of Processing, such as p5py, but that is as easy to install as Python Mode? See: As w…

---

## [Sound library does not work in Processing 4 - Python Mode](https://discourse.processing.org/t/sound-library-does-not-work-in-processing-4-python-mode/40936)

<div class="topic-metadata">

**Author:** [@guojian.ryan](https://discourse.processing.org/u/guojian.ryan)\
**Replies:** 1\
**Last updated:** [February 15, 2023, 5:21pm UTC](https://discourse.processing.org/t/sound-library-does-not-work-in-processing-4-python-mode/40936 "2023-02-15T17:21:51Z")

</div>

Hi, I just updated to Processing 4 and found the sound library stopped working with Python Mode. The Java mode worked fine. Any help is much appreciated. add\_library("sound") sf = None def setup(): global sf sf…

---

## [Animation in Python mode](https://discourse.processing.org/t/animation-in-python-mode/40875)

<div class="topic-metadata">

**Author:** [@maral](https://discourse.processing.org/u/maral)\
**Replies:** 7\
**Last updated:** [February 8, 2023, 5:34pm UTC](https://discourse.processing.org/t/animation-in-python-mode/40875 "2023-02-08T17:34:41Z")

</div>

I am a complete newbie with respect to P5. Just downloaded the package and before starting, I was wondering if it has the option to create animations, similar to those created by the original Processing framework.

---

## [P3D failing in Python Mode on Mac](https://discourse.processing.org/t/p3d-failing-in-python-mode-on-mac/40683)

<div class="topic-metadata">

**Author:** [@jonsantos](https://discourse.processing.org/u/jonsantos)\
**Replies:** 3\
**Last updated:** [February 1, 2023, 1:40am UTC](https://discourse.processing.org/t/p3d-failing-in-python-mode-on-mac/40683 "2023-02-01T01:40:04Z")

</div>

I have been unable to get the P3D renderer to work as expected while trying to run the Directional example (Examples/Lights/Directional) in Python Mode on my Mac (12.6). The example does work in Java Mode on my Mac, and…

---

## [PVectors in Class Objects](https://discourse.processing.org/t/pvectors-in-class-objects/40697)

<div class="topic-metadata">

**Author:** [@SailorMike](https://discourse.processing.org/u/SailorMike)\
**Replies:** 9\
**Last updated:** [January 26, 2023, 12:06am UTC](https://discourse.processing.org/t/pvectors-in-class-objects/40697 "2023-01-26T00:06:13Z")

</div>

I’m hoping someone can explain this to me, as I’m pretty new to this stuff. Here’s a program that shows the problem I’m having: targ\_pos = PVector(100, 300, 0) mis\_pos = PVector(400, 600, 0) l\_o\_s = PVector() class F…

---

## [I cannot add Python mode!](https://discourse.processing.org/t/i-cannot-add-python-mode/40630)

<div class="topic-metadata">

**Author:** [@Alkis](https://discourse.processing.org/u/Alkis)\
**Replies:** 12\
**Last updated:** [January 25, 2023, 5:50am UTC](https://discourse.processing.org/t/i-cannot-add-python-mode/40630 "2023-01-25T05:50:25Z")

</div>

Processing 4 has no “Add mode” option in the drop down menu as described by dozens of references in the Web! So I am stuck without being able to use Python scripts in Processing IDE! Can anyone tell me how to install Py…

---

## [Python mode "immediate" processing?](https://discourse.processing.org/t/python-mode-immediate-processing/40504)

<div class="topic-metadata">

**Author:** [@SailorMike](https://discourse.processing.org/u/SailorMike)\
**Replies:** 7\
**Last updated:** [January 8, 2023, 3:53am UTC](https://discourse.processing.org/t/python-mode-immediate-processing/40504 "2023-01-08T03:53:11Z")

</div>

I’m trying to learn Processing from “Math Adventures with Python” . The author shows a function that returns a number running from a command line (\>\>\>). How does one access a command environment line from Processing?

---

## [Help drawing recursive trees](https://discourse.processing.org/t/help-drawing-recursive-trees/34656)

<div class="topic-metadata">

**Author:** [@43zombiegit](https://discourse.processing.org/u/43zombiegit)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 8:38pm UTC](https://discourse.processing.org/t/help-drawing-recursive-trees/34656 "2023-01-06T20:38:39Z")

</div>

Hi guys, I have the following code. I’m trying to get the branches to draw slowly through the draw function and not during one draw iteration but can’t figure it out given the recursion. If anyone could help that would …

---

## [Python visual quality](https://discourse.processing.org/t/python-visual-quality/40360)

<div class="topic-metadata">

**Author:** [@kmll](https://discourse.processing.org/u/kmll)\
**Replies:** 2\
**Last updated:** [December 29, 2022, 7:58pm UTC](https://discourse.processing.org/t/python-visual-quality/40360 "2022-12-29T19:58:20Z")

</div>

I have tested the new version of Processing and tried the Python module. However the visual is not of the same quality as if I use Java. Is this a known issue? def setup(): size(800, 600) stroke(255) backgro…

---

## [Stripping time from a string to calculate elapsed time](https://discourse.processing.org/t/stripping-time-from-a-string-to-calculate-elapsed-time/12503)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 8\
**Last updated:** [December 11, 2022, 2:14am UTC](https://discourse.processing.org/t/stripping-time-from-a-string-to-calculate-elapsed-time/12503 "2022-12-11T02:14:58Z")

</div>

Hello, I would like to calculate elapsed time based on start and end times (extracted from an XML file) startDate=“2016-11-16 09:26:33 +1000” endDate="2016-11-16 09:26:33 As the times are embedded in a string(see abov…

---

## [Handy or similar pencil sketch library in Processing.py](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005)

<div class="topic-metadata">

**Author:** [@Fosker](https://discourse.processing.org/u/Fosker)\
**Replies:** 5\
**Last updated:** [December 3, 2022, 11:50pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005 "2022-12-03T23:50:46Z")

</div>

Is there a way to make your sketches look more like they have been sketched by a pencil (ie rough sketch type lines)? I’ve seen people using the Handy library in other processing modes but can’t see any info on it with…

---

## [Cant get object to work in processing.py](https://discourse.processing.org/t/cant-get-object-to-work-in-processing-py/39830)

<div class="topic-metadata">

**Author:** [@Fosker](https://discourse.processing.org/u/Fosker)\
**Replies:** 1\
**Last updated:** [November 22, 2022, 6:02pm UTC](https://discourse.processing.org/t/cant-get-object-to-work-in-processing-py/39830 "2022-11-22T18:02:25Z")

</div>

Sorry new to Processing and trying to build a wall with different sized bricks, at the basic stage of creating a brick class this doesn’t produce anything when I run it and I can’t work out why…! class Brick(object): d…

---

## [Similar to Method Overriding in Java, how to override the method about Box2d](https://discourse.processing.org/t/similar-to-method-overriding-in-java-how-to-override-the-method-about-box2d/39706)

<div class="topic-metadata">

**Author:** [@huxx](https://discourse.processing.org/u/huxx)\
**Replies:** 0\
**Last updated:** [November 14, 2022, 4:49pm UTC](https://discourse.processing.org/t/similar-to-method-overriding-in-java-how-to-override-the-method-about-box2d/39706 "2022-11-14T16:49:49Z")

</div>

beginContact() is a method of box2d Library. I want to use it in processing.py. Due to the difference between java and python, the error comes out: You are missing the beginContact() method. java.lang.NoSuchMethodExcep…

---

## [Making boxes bounce around a screen](https://discourse.processing.org/t/making-boxes-bounce-around-a-screen/39514)

<div class="topic-metadata">

**Author:** [@matt423](https://discourse.processing.org/u/matt423)\
**Replies:** 6\
**Last updated:** [November 11, 2022, 3:53pm UTC](https://discourse.processing.org/t/making-boxes-bounce-around-a-screen/39514 "2022-11-11T15:53:16Z")

</div>

Hi, I am relatively new to processing.py and I’ve been stuck on my code for a few days now. Basically I’m trying to make a bunch of boxes bounce around the screen and bounce off of each other if they collide. I’ve writte…

---

## [How to directly use the class from library in my class](https://discourse.processing.org/t/how-to-directly-use-the-class-from-library-in-my-class/39564)

<div class="topic-metadata">

**Author:** [@huxx](https://discourse.processing.org/u/huxx)\
**Replies:** 2\
**Last updated:** [November 3, 2022, 10:43am UTC](https://discourse.processing.org/t/how-to-directly-use-the-class-from-library-in-my-class/39564 "2022-11-03T10:43:29Z")

</div>

//First label add\_library('box2d\_processing') add\_library('jbox2d') from gameInterface import GameInterface def setup(): global gameI box2D =Box2DProcessing(this) gameI=GameInterface(box2D) //Second label…

---

## [Why can't I access the thing in library in my class](https://discourse.processing.org/t/why-cant-i-access-the-thing-in-library-in-my-class/39554)

<div class="topic-metadata">

**Author:** [@huxx](https://discourse.processing.org/u/huxx)\
**Replies:** 2\
**Last updated:** [November 3, 2022, 3:11am UTC](https://discourse.processing.org/t/why-cant-i-access-the-thing-in-library-in-my-class/39554 "2022-11-03T03:11:01Z")

</div>

:smiling\_face\_with\_tear: If I write all things in the Main, it can work How can I treat this things, I don’t want to write all this kind objects in Main and deliver it to the class How can I directly use t…

---

## [P3D not running in python mode](https://discourse.processing.org/t/p3d-not-running-in-python-mode/39282)

<div class="topic-metadata">

**Author:** [@Ishy](https://discourse.processing.org/u/Ishy)\
**Replies:** 3\
**Last updated:** [October 15, 2022, 11:27am UTC](https://discourse.processing.org/t/p3d-not-running-in-python-mode/39282 "2022-10-15T11:27:13Z")

</div>

hi, i just started out using processing and i quickly discovered that P3D doesn’t work. my code is: def setup(): size(200, 200, P3D) when i click run it just doesnt do anything and stops quickly after (0.5-1 seco…

---

## [Draw function not working properly](https://discourse.processing.org/t/draw-function-not-working-properly/39086)

<div class="topic-metadata">

**Author:** [@Ben0981](https://discourse.processing.org/u/Ben0981)\
**Replies:** 4\
**Last updated:** [October 4, 2022, 7:36pm UTC](https://discourse.processing.org/t/draw-function-not-working-properly/39086 "2022-10-04T19:36:06Z")

</div>

Hey, so I am new to processing and am currently just trying to move 2 rectangles by a given velocity but whenever I try actually moving them nothing gets drawn at all but if I just keep them stationary they get drawn jus…

---

## [Python mode as default in IDE](https://discourse.processing.org/t/python-mode-as-default-in-ide/39009)

<div class="topic-metadata">

**Author:** [@kemelzaidan](https://discourse.processing.org/u/kemelzaidan)\
**Replies:** 2\
**Last updated:** [October 2, 2022, 8:19pm UTC](https://discourse.processing.org/t/python-mode-as-default-in-ide/39009 "2022-10-02T20:19:23Z")

</div>

Is there a way to start processing IDE in python mode as default? I tried changing the option in preference.txt from mode.last=processing.mode.java.JavaMode to mode.last=processing.mode.java.PythonMode but this didn’t wo…

---

## [Processing + Python community visibility](https://discourse.processing.org/t/processing-python-community-visibility/38981)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 8:11pm UTC](https://discourse.processing.org/t/processing-python-community-visibility/38981 "2022-10-01T20:11:23Z")

</div>

Sometimes I feel like we are a bit invisible for the Processing Foundation. If you are into Twitter, check out this informal quiz here:

[Previous page](https://discourse.processing.org/c/processing-py/9.md)

[Next page](https://discourse.processing.org/c/processing-py/9.md?page=2)
