# Processing.py

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

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

**Page:** 9

---

## [How to use the site-packages folder to share Python modules/packages between sketches](https://discourse.processing.org/t/how-to-use-the-site-packages-folder-to-share-python-modules-packages-between-sketches/23452)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 0\
**Last updated:** [August 23, 2020, 10:12pm UTC](https://discourse.processing.org/t/how-to-use-the-site-packages-folder-to-share-python-modules-packages-between-sketches/23452 "2020-08-23T22:12:54Z")

</div>

I have heard of this many times but @berin was the one friend who made me try it at last. Inside yoursketchbook/libraries folder (Processing/libraries on Mac and Windows) you can have a site-packages folder containing “…

---

## [Print vector from left to right in terminal](https://discourse.processing.org/t/print-vector-from-left-to-right-in-terminal/23100)

<div class="topic-metadata">

**Author:** [@juanjoc](https://discourse.processing.org/u/juanjoc)\
**Replies:** 2\
**Last updated:** [August 23, 2020, 10:23pm UTC](https://discourse.processing.org/t/print-vector-from-left-to-right-in-terminal/23100 "2020-08-23T22:23:12Z")

</div>

Hello everyone. I’m new programming in processing. py. I was looking for ways of printing vectors in terminal, I know that in Java mode I can make the following: int vector\[\] = { 1, 2, 3, 4 }; void setup() { size(50,…

---

## [Not work mousePressed left click!](https://discourse.processing.org/t/not-work-mousepressed-left-click/23413)

<div class="topic-metadata">

**Author:** [@Mayarch](https://discourse.processing.org/u/Mayarch)\
**Replies:** 1\
**Last updated:** [August 21, 2020, 8:31pm UTC](https://discourse.processing.org/t/not-work-mousepressed-left-click/23413 "2020-08-21T20:31:05Z")

</div>

tileCountX=2 tileCountY=10 colorsLeft=\[\] colorsRight=\[\] interpolateShortest=True def setup(): size(800,800) colorMode(HSB) noStroke() shakeColors() def draw(): tileCountX=int(map(mouseX,0,width,2,100)) tileCo…

---

## [Help needed to build a Shape Classifier](https://discourse.processing.org/t/help-needed-to-build-a-shape-classifier/23341)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 0\
**Last updated:** [August 18, 2020, 6:19pm UTC](https://discourse.processing.org/t/help-needed-to-build-a-shape-classifier/23341 "2020-08-18T18:19:13Z")

</div>

Dear all, I am trying to implement this paper (Skeleton-based shape classification using path similarity) in Processing but have difficulties understanding formulas 5 and 7 on page 7. The goal is to find a shape (name…

---

## [Print Array of image in terminal](https://discourse.processing.org/t/print-array-of-image-in-terminal/23090)

<div class="topic-metadata">

**Author:** [@juanjoc](https://discourse.processing.org/u/juanjoc)\
**Replies:** 4\
**Last updated:** [August 6, 2020, 9:49pm UTC](https://discourse.processing.org/t/print-array-of-image-in-terminal/23090 "2020-08-06T21:49:26Z")

</div>

Hello everyone. I’m interested in printing the array data of an image in terminal. For example in python I load the image, then I only use print(image) to see the array list of the picture. In processing this is not as t…

---

## [Processing.py examples](https://discourse.processing.org/t/processing-py-examples/22989)

<div class="topic-metadata">

**Author:** [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Replies:** 1\
**Last updated:** [August 6, 2020, 2:47am UTC](https://discourse.processing.org/t/processing-py-examples/22989 "2020-08-06T02:47:36Z")

</div>

The Processing Java and p5 websites showcase online examples (see here and here), the same examples included with the Processing IDE. Python Mode’s example page is bare :cry: I’ve been messing around with pyp5js for tr…

---

## [How to get Blocks to Disappear in Paddle Ball Game and Help with Paddle Collision](https://discourse.processing.org/t/how-to-get-blocks-to-disappear-in-paddle-ball-game-and-help-with-paddle-collision/23051)

<div class="topic-metadata">

**Author:** [@Learner](https://discourse.processing.org/u/Learner)\
**Replies:** 1\
**Last updated:** [August 5, 2020, 8:56am UTC](https://discourse.processing.org/t/how-to-get-blocks-to-disappear-in-paddle-ball-game-and-help-with-paddle-collision/23051 "2020-08-05T08:56:04Z")

</div>

Hello. I am working on this assignment where I have to make a simple paddle ball game where when the ball hits the blocks they disappear. The hint we were given was that we had to use Boolean expressions, but I am comple…

---

## [\_\_main\_\_.PVector vs. processing.core.PVector](https://discourse.processing.org/t/main-pvector-vs-processing-core-pvector/22940)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 4\
**Last updated:** [July 31, 2020, 3:11pm UTC](https://discourse.processing.org/t/main-pvector-vs-processing-core-pvector/22940 "2020-07-31T15:11:50Z")

</div>

I was playing with OpenCV and sometimes I use a method that returns a PVector like: opencv.getAverageFlow(), but it is a \<type 'processing.core.PVector'\> and not \<class '\_\_main\_\_.PVector'\> as one created by the sketch. …

---

## [How Do you change the rotational origin for a shape?](https://discourse.processing.org/t/how-do-you-change-the-rotational-origin-for-a-shape/22774)

<div class="topic-metadata">

**Author:** [@Learner](https://discourse.processing.org/u/Learner)\
**Replies:** 3\
**Last updated:** [July 22, 2020, 5:17pm UTC](https://discourse.processing.org/t/how-do-you-change-the-rotational-origin-for-a-shape/22774 "2020-07-22T17:17:17Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello, I am learning processing through this intro course and we have an assignment where we need to make a triangle that spins and follows your…

---

## [Calling updatePixels() from a separate thread doesn't update the main window](https://discourse.processing.org/t/calling-updatepixels-from-a-separate-thread-doesnt-update-the-main-window/22696)

<div class="topic-metadata">

**Author:** [@Underslash](https://discourse.processing.org/u/Underslash)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 1:10am UTC](https://discourse.processing.org/t/calling-updatepixels-from-a-separate-thread-doesnt-update-the-main-window/22696 "2020-07-18T01:10:37Z")

</div>

Exactly what the title says, when I run updatePixels() from a function thats running in a thread, it doesn’t update the pixels, but calling updatePixels() from the function which I ran the thread from updates it. Example…

---

## [VectorLerp for walking on a path](https://discourse.processing.org/t/vectorlerp-for-walking-on-a-path/22660)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 0\
**Last updated:** [July 16, 2020, 11:41am UTC](https://discourse.processing.org/t/vectorlerp-for-walking-on-a-path/22660 "2020-07-16T11:41:25Z")

</div>

@jeremydouglass posted this example somewhere on this forum, and I enjoyed porting it to Python mode. That’s the post. # LerpVectorsSimplified # 2019-04 Processing 3.4 - based on LerpVectorsExample by Jeremy Douglass …

---

## [Quote marks display as a box in the window](https://discourse.processing.org/t/quote-marks-display-as-a-box-in-the-window/22518)

<div class="topic-metadata">

**Author:** [@PawnMongo](https://discourse.processing.org/u/PawnMongo)\
**Replies:** 5\
**Last updated:** [July 10, 2020, 12:12pm UTC](https://discourse.processing.org/t/quote-marks-display-as-a-box-in-the-window/22518 "2020-07-10T12:12:27Z")

</div>

I read a text file with createReader() and then displayed the contents in a window with text(). The text displayed properly except that single and double quote marks displayed as boxes. Is there is simple way to fix th…

---

## [Canonical Autosave Question](https://discourse.processing.org/t/canonical-autosave-question/22470)

<div class="topic-metadata">

**Author:** [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Replies:** 6\
**Last updated:** [July 8, 2020, 6:06pm UTC](https://discourse.processing.org/t/canonical-autosave-question/22470 "2020-07-08T18:06:52Z")

</div>

I use Processing 3.5.4 in python mode. I’ve been unable to find a setting for autosaving files. Almost every week I lose some work to this. I can’t believe there is no autosave available, yet I cannot find a settin…

---

## [Capture video in processing.py](https://discourse.processing.org/t/capture-video-in-processing-py/22457)

<div class="topic-metadata">

**Author:** [@Tahsin](https://discourse.processing.org/u/Tahsin)\
**Replies:** 1\
**Last updated:** [July 8, 2020, 3:02pm UTC](https://discourse.processing.org/t/capture-video-in-processing-py/22457 "2020-07-08T15:02:23Z")

</div>

I’m trying to capture video using processing.py but I’m getting an error: UnsatisfiedLinkError: E:\\Programme outputs\\Processing\\libraries\\video\\library\\windows64\\libgio-2.0-0.dll: Can’t find dependent libraries add\_l…

---

## [Video Tutorial for Processing.py](https://discourse.processing.org/t/video-tutorial-for-processing-py/18793)

<div class="topic-metadata">

**Author:** [@Neo\_Wang](https://discourse.processing.org/u/Neo_Wang)\
**Replies:** 2\
**Last updated:** [July 1, 2020, 7:56pm UTC](https://discourse.processing.org/t/video-tutorial-for-processing-py/18793 "2020-07-01T19:56:14Z")

</div>

wondering when there will be video tutorials for processing python mode. the tutorial like what daniel did for p5js would be so helpful for learners like me.

---

## [Can't run "Hello World" in python mode](https://discourse.processing.org/t/cant-run-hello-world-in-python-mode/22012)

<div class="topic-metadata">

**Author:** [@Spiff](https://discourse.processing.org/u/Spiff)\
**Replies:** 8\
**Last updated:** [June 27, 2020, 7:55pm UTC](https://discourse.processing.org/t/cant-run-hello-world-in-python-mode/22012 "2020-06-27T19:55:41Z")

</div>

Basic problem here. Any tips would be most welcome. I can run code in Java Mode. And I have Installed Python mode. But even the most basic code won’t run. e.g.: ellipse(50, 50, 80, 80) When I click the “Run” button, it…

---

## [Processing python module dont running code](https://discourse.processing.org/t/processing-python-module-dont-running-code/22188)

<div class="topic-metadata">

**Author:** [@omselkara](https://discourse.processing.org/u/omselkara)\
**Replies:** 8\
**Last updated:** [June 27, 2020, 6:39pm UTC](https://discourse.processing.org/t/processing-python-module-dont-running-code/22188 "2020-06-27T18:39:24Z")

</div>

my prcessing python module is opening but its not running the code

---

## [Trying to debug Pop/PushMatrix -- Can I see the stack?](https://discourse.processing.org/t/trying-to-debug-pop-pushmatrix-can-i-see-the-stack/22170)

<div class="topic-metadata">

**Author:** [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Replies:** 6\
**Last updated:** [June 26, 2020, 7:28am UTC](https://discourse.processing.org/t/trying-to-debug-pop-pushmatrix-can-i-see-the-stack/22170 "2020-06-26T07:28:49Z")

</div>

I had some working code, added some simple translation, and now I’m getting missing a pushMatrix() error. I believe all my push, pop, and translate commands are balanced, so I don’t see where the error is. Is there a w…

---

## [Imported class from another tab doesn't work](https://discourse.processing.org/t/imported-class-from-another-tab-doesnt-work/22135)

<div class="topic-metadata">

**Author:** [@Tahsin](https://discourse.processing.org/u/Tahsin)\
**Replies:** 1\
**Last updated:** [June 24, 2020, 8:09pm UTC](https://discourse.processing.org/t/imported-class-from-another-tab-doesnt-work/22135 "2020-06-24T20:09:02Z")

</div>

Hey! So I’ve been trying to make a voronoi animation in processing.py and For some reason, I can’t call my voronoi class from the other tab. I’m getting the error : NameError: global name ‘v’ is not defined I can’t fig…

---

## [Question about Functions, Booleans](https://discourse.processing.org/t/question-about-functions-booleans/21962)

<div class="topic-metadata">

**Author:** [@MrLoboda](https://discourse.processing.org/u/MrLoboda)\
**Replies:** 6\
**Last updated:** [June 17, 2020, 11:16pm UTC](https://discourse.processing.org/t/question-about-functions-booleans/21962 "2020-06-17T23:16:02Z")

</div>

Hey Processing Forum, I am working on a simple code that is supposed to look at where a user clicked and return a True or False for a function. Later on I want to use an IF statement to determine if my function has retu…

---

## [Example code for minim sound library](https://discourse.processing.org/t/example-code-for-minim-sound-library/21640)

<div class="topic-metadata">

**Author:** [@joebrailsford](https://discourse.processing.org/u/joebrailsford)\
**Replies:** 20\
**Last updated:** [June 17, 2020, 6:33am UTC](https://discourse.processing.org/t/example-code-for-minim-sound-library/21640 "2020-06-17T06:33:49Z")

</div>

Hi. Does any body have an example piece of code for allowing computer microphone input using the minim library on the python platform? I am trying to build a sound reactive drawing tool but am not able to find and examp…

---

## [Python mode is not working](https://discourse.processing.org/t/python-mode-is-not-working/21818)

<div class="topic-metadata">

**Author:** [@glkr](https://discourse.processing.org/u/glkr)\
**Replies:** 5\
**Last updated:** [June 15, 2020, 1:06pm UTC](https://discourse.processing.org/t/python-mode-is-not-working/21818 "2020-06-15T13:06:53Z")

</div>

I couldn’t run Processing in Python mode. Nothing happens when I click the run button. When I click the Run, it glows green but turns gray again instantly. I deleted the program and reinstalled it, but again the same t…

---

## [Changing coordinate system without mirroring objects](https://discourse.processing.org/t/changing-coordinate-system-without-mirroring-objects/21846)

<div class="topic-metadata">

**Author:** [@renec112](https://discourse.processing.org/u/renec112)\
**Replies:** 4\
**Last updated:** [June 15, 2020, 7:25am UTC](https://discourse.processing.org/t/changing-coordinate-system-without-mirroring-objects/21846 "2020-06-15T07:25:02Z")

</div>

I would love to change my coordinate to be in the middle instead. It’s easily done with translate(width/2, height/2). Like so: def setup(): size(1920, 1080) def draw(): background(255) translate(width/2,hei…

---

## [How to control layers when exporting an SVG](https://discourse.processing.org/t/how-to-control-layers-when-exporting-an-svg/21758)

<div class="topic-metadata">

**Author:** [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Replies:** 6\
**Last updated:** [June 14, 2020, 1:05am UTC](https://discourse.processing.org/t/how-to-control-layers-when-exporting-an-svg/21758 "2020-06-14T01:05:43Z")

</div>

I export an SVG from Processing, load into Inkscape, and then send to my AxiDraw. I would like to separate the image into three separate layers, RGB, or CMY in the exported SVG. This will allow me to print different …

---

## [Tips for porting Processing Java code to Python mode :)](https://discourse.processing.org/t/tips-for-porting-processing-java-code-to-python-mode/21612)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 7\
**Last updated:** [June 13, 2020, 12:21pm UTC](https://discourse.processing.org/t/tips-for-porting-processing-java-code-to-python-mode/21612 "2020-06-13T12:21:02Z")

</div>

I had some students asking me about examples in Java mode, how to use them, and I really enjoy porting stuff into Python mode, so I wrote this, trying to collect some tips: Feedback is welcome :smiley: Maybe you have…

---

## [How to delete elements while traversing the list in processing.py?](https://discourse.processing.org/t/how-to-delete-elements-while-traversing-the-list-in-processing-py/21041)

<div class="topic-metadata">

**Author:** [@huahua](https://discourse.processing.org/u/huahua)\
**Replies:** 4\
**Last updated:** [June 12, 2020, 4:54am UTC](https://discourse.processing.org/t/how-to-delete-elements-while-traversing-the-list-in-processing-py/21041 "2020-06-12T04:54:05Z")

</div>

the code as follows is about particles system, and it could run successfully. i understant the code. the elements in the list particles represent particles, and particles will continue to be generated and die gradually, …

---

## [Variable issue in the setup() block](https://discourse.processing.org/t/variable-issue-in-the-setup-block/21648)

<div class="topic-metadata">

**Author:** [@slashwreck](https://discourse.processing.org/u/slashwreck)\
**Replies:** 3\
**Last updated:** [June 7, 2020, 10:14am UTC](https://discourse.processing.org/t/variable-issue-in-the-setup-block/21648 "2020-06-07T10:14:30Z")

</div>

I load an img in my setup(). I can use its attributes like .width but when I attempt to use them as parameters to size(), I get NameError: global name ''img'' is not defined. But before that line, I’m happily referri…

---

## [Using Sound Input From Mic](https://discourse.processing.org/t/using-sound-input-from-mic/21448)

<div class="topic-metadata">

**Author:** [@joebrailsford](https://discourse.processing.org/u/joebrailsford)\
**Replies:** 8\
**Last updated:** [June 7, 2020, 9:22am UTC](https://discourse.processing.org/t/using-sound-input-from-mic/21448 "2020-06-07T09:22:26Z")

</div>

Hi. I am trying to create a drawing tool that then takes the input from the microphone and applies a visual effect to the drawing in relation to the amplitude of the input. However I can’t get the microphone to work. I …

---

## [Placement of keyPressed function](https://discourse.processing.org/t/placement-of-keypressed-function/21604)

<div class="topic-metadata">

**Author:** [@jarlook](https://discourse.processing.org/u/jarlook)\
**Replies:** 2\
**Last updated:** [June 6, 2020, 10:22pm UTC](https://discourse.processing.org/t/placement-of-keypressed-function/21604 "2020-06-06T22:22:56Z")

</div>

I created a keyPressed function. If I place it in the primary tab of the sketch, it works fine. If I place it in a secondary tab (cvplib.py) and import that into the primary tab (import cvplib), it doesn’t work. I hav…

---

## [Sending real-time data via TCP](https://discourse.processing.org/t/sending-real-time-data-via-tcp/21242)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 15\
**Last updated:** [May 28, 2020, 12:30am UTC](https://discourse.processing.org/t/sending-real-time-data-via-tcp/21242 "2020-05-28T00:30:15Z")

</div>

Dear fellow Python users, I would need your help in figuring out how to send a continuous stream of data from an external environment to Processing via TCP. TCP is important because I need the data to remain intact and …

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

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