# Processing.py

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

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

**Page:** 13

---

## [Improving the 'title' of a second window in Python Mode](https://discourse.processing.org/t/improving-the-title-of-a-second-window-in-python-mode/13746)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 3\
**Last updated:** [September 2, 2019, 8:07pm UTC](https://discourse.processing.org/t/improving-the-title-of-a-second-window-in-python-mode/13746 "2019-09-02T20:07:18Z")

</div>

Thanks to GoToLoop and others who discussed it here and on the earlier forums, I know I can make a sketch with more than one window like this: def setup(): size(200, 300) second\_window = OtherWindow() def…

---

## [Shader issue when converted from Java](https://discourse.processing.org/t/shader-issue-when-converted-from-java/13589)

<div class="topic-metadata">

**Author:** [@lnp](https://discourse.processing.org/u/lnp)\
**Replies:** 3\
**Last updated:** [August 28, 2019, 11:51am UTC](https://discourse.processing.org/t/shader-issue-when-converted-from-java/13589 "2019-08-28T11:51:35Z")

</div>

I converted a very simple Java example in to Python and I get a black screen instead. Just started tinkering with shaders so this is not a good start! Is there something obvious I’ve missed here? The shader seems to exis…

---

## [How to update data using onClick button](https://discourse.processing.org/t/how-to-update-data-using-onclick-button/13644)

<div class="topic-metadata">

**Author:** [@rumidita](https://discourse.processing.org/u/rumidita)\
**Replies:** 2\
**Last updated:** [August 28, 2019, 4:52am UTC](https://discourse.processing.org/t/how-to-update-data-using-onclick-button/13644 "2019-08-28T04:52:31Z")

</div>

I would like to update data using onClick button, so I try using an item from controlP5 library. I hope when I click the button, the ‘old’ data will be changed by the ‘new’ data. But, it seems still hold the ‘old’ data. …

---

## [How to use controlP5 in second window using python mode](https://discourse.processing.org/t/how-to-use-controlp5-in-second-window-using-python-mode/13253)

<div class="topic-metadata">

**Author:** [@rumidita](https://discourse.processing.org/u/rumidita)\
**Replies:** 6\
**Last updated:** [August 20, 2019, 2:42am UTC](https://discourse.processing.org/t/how-to-use-controlp5-in-second-window-using-python-mode/13253 "2019-08-20T02:42:03Z")

</div>

Hello, I want to put a button in the second window using ‘bang’ function from controlP5 library. I managed to do it in the main window, but it fails when I try to put in the second window. Instead of appearing in the s…

---

## [Python mode tutorials seem to be missing](https://discourse.processing.org/t/python-mode-tutorials-seem-to-be-missing/13398)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 5\
**Last updated:** [August 19, 2019, 8:07am UTC](https://discourse.processing.org/t/python-mode-tutorials-seem-to-be-missing/13398 "2019-08-19T08:07:04Z")

</div>

I used to be able to access a set of tutorials online using this link https://py.processing.org/tutorials/ but they are no longer there. Does anyone have the same problem?

---

## [Inconsistent collision detection using 'fisica' wrapper for JBox2d in Processing.py sketch](https://discourse.processing.org/t/inconsistent-collision-detection-using-fisica-wrapper-for-jbox2d-in-processing-py-sketch/13467)

<div class="topic-metadata">

**Author:** [@gytmas](https://discourse.processing.org/u/gytmas)\
**Replies:** 0\
**Last updated:** [August 19, 2019, 5:59am UTC](https://discourse.processing.org/t/inconsistent-collision-detection-using-fisica-wrapper-for-jbox2d-in-processing-py-sketch/13467 "2019-08-19T05:59:36Z")

</div>

Hi There. I am using processing.py to model some fairly rudimentary evacuation simulations. I am using Fisica as the physics engine to handle the collisions, however, it does not seem to be working. The collision detect…

---

## [Help with a VR example (beginner)](https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 2\
**Last updated:** [August 18, 2019, 1:52pm UTC](https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434 "2019-08-18T13:52:57Z")

</div>

I did the following basic test code and created 4 boxes in 3D ‘space’. I would like to view this output using my Iphone 7, looking through a Virtual Reality (VR) headset for example, the Google cardboard. What code cha…

---

## [Import 'javax.media' in Python mode](https://discourse.processing.org/t/import-javax-media-in-python-mode/13428)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 2\
**Last updated:** [August 17, 2019, 5:11pm UTC](https://discourse.processing.org/t/import-javax-media-in-python-mode/13428 "2019-08-17T17:11:30Z")

</div>

Hi, Just a quick question – I would like to import the PerspectiveTransform and WarpPerspective classes from javax.media.jai in Python mode. Simply writing from javax.media.jai import PerspectiveTransform, WarpPerspec…

---

## [Python Processing refer to an object from main script](https://discourse.processing.org/t/python-processing-refer-to-an-object-from-main-script/13272)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 7\
**Last updated:** [August 9, 2019, 1:23pm UTC](https://discourse.processing.org/t/python-processing-refer-to-an-object-from-main-script/13272 "2019-08-09T13:23:08Z")

</div>

OK, I just started learning Python & I never liked how people had the classes on same page everything else went on. So I placed them on another page, but sadly I don’t know how to actually get to them. I liked one of the…

---

## [ControlP5 toggle in processing.py](https://discourse.processing.org/t/controlp5-toggle-in-processing-py/13247)

<div class="topic-metadata">

**Author:** [@Luno\_T](https://discourse.processing.org/u/Luno_T)\
**Replies:** 4\
**Last updated:** [August 9, 2019, 6:41am UTC](https://discourse.processing.org/t/controlp5-toggle-in-processing-py/13247 "2019-08-09T06:41:01Z")

</div>

Hello, I am trying to learn to use the ControlP5 library in python mode. I am struggling with basic stuff as I have no experience in Java, and I can hardly find proper examples for the python mode. For instance, when I…

---

## [Is there a sort of API with which we can run processing.py in a server?](https://discourse.processing.org/t/is-there-a-sort-of-api-with-which-we-can-run-processing-py-in-a-server/13020)

<div class="topic-metadata">

**Author:** [@Procoder](https://discourse.processing.org/u/Procoder)\
**Replies:** 1\
**Last updated:** [July 28, 2019, 10:40am UTC](https://discourse.processing.org/t/is-there-a-sort-of-api-with-which-we-can-run-processing-py-in-a-server/13020 "2019-07-28T10:40:09Z")

</div>

I am trying to figure out a way to create a web editor for processing.py using codemirror . I think I have to create a custom mode for processing.py for codemirror and also I have to figure out a way to run the code. If …

---

## [Help with playing a sound](https://discourse.processing.org/t/help-with-playing-a-sound/12866)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 2\
**Last updated:** [July 21, 2019, 9:40pm UTC](https://discourse.processing.org/t/help-with-playing-a-sound/12866 "2019-07-21T21:40:54Z")

</div>

Hi, I created an ‘oscillator’ using the sound library but it is not working. Please help, thanks. Here’s the code: add\_library('sound') def setup(): size(200,200) v\_osc=SinOsc(this) v\_osc.play(440,0.5) …

---

## [Override Escape Key in Python Mode](https://discourse.processing.org/t/override-escape-key-in-python-mode/12726)

<div class="topic-metadata">

**Author:** [@pi3point1415](https://discourse.processing.org/u/pi3point1415)\
**Replies:** 2\
**Last updated:** [July 16, 2019, 4:35am UTC](https://discourse.processing.org/t/override-escape-key-in-python-mode/12726 "2019-07-16T04:35:08Z")

</div>

In normal Java mode, when I use the code: if (key == ESC) { key = 0; } pressing escape does not close the sketch. However, in python mode, when I try similar code: if key == ESC: key = 0 pressing …

---

## [Set of reference material for Processing(Python mode) programming](https://discourse.processing.org/t/set-of-reference-material-for-processing-python-mode-programming/12606)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 4\
**Last updated:** [July 14, 2019, 3:28pm UTC](https://discourse.processing.org/t/set-of-reference-material-for-processing-python-mode-programming/12606 "2019-07-14T15:28:40Z")

</div>

I am an artist/computer programmer but new to Processing and currently using Processing(Python mode). Have created various samples of visuals, moving image and sound. I am using the following set of online reference mat…

---

## [Problem with rotated PGraphics](https://discourse.processing.org/t/problem-with-rotated-pgraphics/12366)

<div class="topic-metadata">

**Author:** [@Raums](https://discourse.processing.org/u/Raums)\
**Replies:** 5\
**Last updated:** [July 11, 2019, 11:57pm UTC](https://discourse.processing.org/t/problem-with-rotated-pgraphics/12366 "2019-07-11T23:57:11Z")

</div>

I’ve spent a couple hours trying to make an MCVE of this but haven’t been able to replicate the problem. The main program is at 2k lines so I can’t post it here. I’ve been stuck on this for a while so really hoping someo…

---

## [Help needed with Serial comms on Python Mode / Firmata](https://discourse.processing.org/t/help-needed-with-serial-comms-on-python-mode-firmata/12553)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 0\
**Last updated:** [July 7, 2019, 2:14pm UTC](https://discourse.processing.org/t/help-needed-with-serial-comms-on-python-mode-firmata/12553 "2019-07-07T14:14:10Z")

</div>

Serial comms is broken on Processing Python Mode, as documented here: I suppose I can call this a "regression’, I have several projects that depend on Serial/Firmata and sensors connected to Arduinos. Websockets is …

---

## [How to extract a substring from a string using position and length](https://discourse.processing.org/t/how-to-extract-a-substring-from-a-string-using-position-and-length/12536)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 6\
**Last updated:** [July 7, 2019, 5:50am UTC](https://discourse.processing.org/t/how-to-extract-a-substring-from-a-string-using-position-and-length/12536 "2019-07-07T05:50:02Z")

</div>

Hello, Example: string1 = ‘abcdefghijk’ I need to extract a substring from 4th position for a length of 2 characters I tried this Python code and I get a syntax error: substring1 = string1(3:2) (the result in subst…

---

## [How to code XML processing using Processing(Python mode)](https://discourse.processing.org/t/how-to-code-xml-processing-using-processing-python-mode/12484)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 2\
**Last updated:** [July 4, 2019, 8:39am UTC](https://discourse.processing.org/t/how-to-code-xml-processing-using-processing-python-mode/12484 "2019-07-04T08:39:54Z")

</div>

Hello, I am new to posting in this forum and currently learning Processing (Python mode). I would like to convert the following code from Processing(tested and working) to Python mode but not sure what’s the syntax. Chec…

---

## [fullScreen() crashes with P2D in Python mode](https://discourse.processing.org/t/fullscreen-crashes-with-p2d-in-python-mode/11975)

<div class="topic-metadata">

**Author:** [@data-arts](https://discourse.processing.org/u/data-arts)\
**Replies:** 7\
**Last updated:** [June 13, 2019, 7:07pm UTC](https://discourse.processing.org/t/fullscreen-crashes-with-p2d-in-python-mode/11975 "2019-06-13T19:07:45Z")

</div>

Hello all, Can anyone help me understand why fullScreen(P2D) crashes in Python mode? I’ve included a sketch below that demonstrates the problem, although for me this happens with all sketches. In my environment (Proces…

---

## [Processing.py equivalent of drawing from within another thread?](https://discourse.processing.org/t/processing-py-equivalent-of-drawing-from-within-another-thread/11983)

<div class="topic-metadata">

**Author:** [@chupo\_cro](https://discourse.processing.org/u/chupo_cro)\
**Replies:** 3\
**Last updated:** [June 11, 2019, 9:08am UTC](https://discourse.processing.org/t/processing-py-equivalent-of-drawing-from-within-another-thread/11983 "2019-06-11T09:08:17Z")

</div>

Hi all, my first post here. I’ve seen there are quite a few topics (in the old forums) about drawing from within another thread to be able to update the screen during intermediate states of different algorithms which ar…

---

## [Multiple inheritence: combining VerletParticle() with WB\_Point()](https://discourse.processing.org/t/multiple-inheritence-combining-verletparticle-with-wb-point/11921)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 3\
**Last updated:** [June 11, 2019, 1:27pm UTC](https://discourse.processing.org/t/multiple-inheritence-combining-verletparticle-with-wb-point/11921 "2019-06-11T13:27:00Z")

</div>

Hi all, I’m working on a sketch where a Cell class needs to inherit both from Toxiclibs’ VerletParticle() and Hemesh WB\_Point(). Ideally I would like the Cell object to share specific attributes from the two libraries (W…

---

## [P2D vs JAVA2D - strange differences in PGraphics methods and masking](https://discourse.processing.org/t/p2d-vs-java2d-strange-differences-in-pgraphics-methods-and-masking/11853)

<div class="topic-metadata">

**Author:** [@alexolotl](https://discourse.processing.org/u/alexolotl)\
**Replies:** 22\
**Last updated:** [June 7, 2019, 4:27pm UTC](https://discourse.processing.org/t/p2d-vs-java2d-strange-differences-in-pgraphics-methods-and-masking/11853 "2019-06-07T16:27:47Z")

</div>

I’ve created a test sketch to demonstrate and try to pinpoint some of the unusual behavior I’ve noticed when switching between P2D and JAVA2D renderers (specifically, what seem to be bugs with the P2D renderer) Differen…

---

## [Threads in processing.py?](https://discourse.processing.org/t/threads-in-processing-py/11396)

<div class="topic-metadata">

**Author:** [@alexolotl](https://discourse.processing.org/u/alexolotl)\
**Replies:** 6\
**Last updated:** [June 5, 2019, 2:38am UTC](https://discourse.processing.org/t/threads-in-processing-py/11396 "2019-06-05T02:38:22Z")

</div>

Is it possible to use thread() in processing.py? I’m trying to asynchronously and dynamically load large images without interfering with the framerate or draw loop I didn’t see any mention of thread() in the processing.…

---

## [Detecting all the shapes formed by intersecting lines](https://discourse.processing.org/t/detecting-all-the-shapes-formed-by-intersecting-lines/11372)

<div class="topic-metadata">

**Author:** [@Raums](https://discourse.processing.org/u/Raums)\
**Replies:** 4\
**Last updated:** [May 20, 2019, 10:31pm UTC](https://discourse.processing.org/t/detecting-all-the-shapes-formed-by-intersecting-lines/11372 "2019-05-20T22:31:43Z")

</div>

Hi All, I have a series of overlapping lines forming multiple closed areas. I want to take all these lines and generate separate shapes for each area they form. What would be the best way to go about this? Below is an e…

---

## [Two windows with 'one draw()'](https://discourse.processing.org/t/two-windows-with-one-draw/11388)

<div class="topic-metadata">

**Author:** [@theo](https://discourse.processing.org/u/theo)\
**Replies:** 4\
**Last updated:** [May 20, 2019, 8:12pm UTC](https://discourse.processing.org/t/two-windows-with-one-draw/11388 "2019-05-20T20:12:36Z")

</div>

Hello, I managed to create a second window with PApplet and runSketch (even if I haven’t understood every thing) but the draw() of the first and second window don’t seem to be linked: they draw whenever they want (if th…

---

## [Outputting video/gif](https://discourse.processing.org/t/outputting-video-gif/11301)

<div class="topic-metadata">

**Author:** [@Avatrin](https://discourse.processing.org/u/Avatrin)\
**Replies:** 2\
**Last updated:** [May 16, 2019, 11:29am UTC](https://discourse.processing.org/t/outputting-video-gif/11301 "2019-05-16T11:29:30Z")

</div>

Hi I have an animation which run in Processing.py. How can I output a video of the, lets say, first n seconds of that animation? I would prefer a gif, but any format would do.

---

## [Problem with spring force in growth algorithm](https://discourse.processing.org/t/problem-with-spring-force-in-growth-algorithm/10770)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 5\
**Last updated:** [May 11, 2019, 12:39pm UTC](https://discourse.processing.org/t/problem-with-spring-force-in-growth-algorithm/10770 "2019-05-11T12:39:32Z")

</div>

Dear all, I would need a hand to help me find what is wrong with the following implementation of a sketch originally relying on the iGeo library (not compatible with Processing 3). Simply put, the algorithm consists in…

---

## [Matrix operations with Processing](https://discourse.processing.org/t/matrix-operations-with-processing/11062)

<div class="topic-metadata">

**Author:** [@Avatrin](https://discourse.processing.org/u/Avatrin)\
**Replies:** 4\
**Last updated:** [May 10, 2019, 10:47am UTC](https://discourse.processing.org/t/matrix-operations-with-processing/11062 "2019-05-10T10:47:19Z")

</div>

Hi I want to create an animation with Processing. I need to use matrix multiplication for the physics and am aware of the fact that I cannot use numpy with PyProcessing. So, I need to find an alternative. Do anybody her…

---

## [Animating a 3d shape in Pyprocessing](https://discourse.processing.org/t/animating-a-3d-shape-in-pyprocessing/11066)

<div class="topic-metadata">

**Author:** [@Avatrin](https://discourse.processing.org/u/Avatrin)\
**Replies:** 2\
**Last updated:** [May 9, 2019, 8:45pm UTC](https://discourse.processing.org/t/animating-a-3d-shape-in-pyprocessing/11066 "2019-05-09T20:45:23Z")

</div>

Hi I cannot find any animation tutorials on the Pyprocessing website. If I wanted to animate this pyramid from the 3d shape tutorial on that website, how can I go about doing that? def drawShape(): translate(width/2, …

---

## [Converting unicode to 'int'](https://discourse.processing.org/t/converting-unicode-to-int/11047)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 2\
**Last updated:** [May 9, 2019, 10:16am UTC](https://discourse.processing.org/t/converting-unicode-to-int/11047 "2019-05-09T10:16:25Z")

</div>

Hi, I’m trying to convert numbers in a column from a CSV file to integers. It seems those numbers are of unicode type. The problem is that I get an error when calling int() on that number: invalid literal for int() wi…

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

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