# Processing.py

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

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

**Page:** 10

---

## [Simple python class wont render Invoking \<bound method Sketch.on\_timer of Sketch\> (p5py)](https://discourse.processing.org/t/simple-python-class-wont-render-invoking-bound-method-sketch-on-timer-of-sketch-p5py/20959)

<div class="topic-metadata">

**Author:** [@renec112](https://discourse.processing.org/u/renec112)\
**Replies:** 9\
**Last updated:** [May 26, 2020, 1:35pm UTC](https://discourse.processing.org/t/simple-python-class-wont-render-invoking-bound-method-sketch-on-timer-of-sketch-p5py/20959 "2020-05-26T13:35:50Z")

</div>

I’m trying to make a simple class. class class\_circle: def \_\_init\_\_(self, r): self.r = r def show(self): fill(255) circle(0,0,self.r) c = class\_circle(100) def setup(): size(1280…

---

## [Hardcore-model(random placement and detachment of spheres on a grid, whereby neighbouring sites are blocked by the sphere)](https://discourse.processing.org/t/hardcore-model-random-placement-and-detachment-of-spheres-on-a-grid-whereby-neighbouring-sites-are-blocked-by-the-sphere/21029)

<div class="topic-metadata">

**Author:** [@QTPay](https://discourse.processing.org/u/QTPay)\
**Replies:** 3\
**Last updated:** [May 22, 2020, 1:30pm UTC](https://discourse.processing.org/t/hardcore-model-random-placement-and-detachment-of-spheres-on-a-grid-whereby-neighbouring-sites-are-blocked-by-the-sphere/21029 "2020-05-22T13:30:08Z")

</div>

hello, I’m trying now to do Simulation of Hard Core model (random placement and detachment of spheres on a grid, whereby neighbouring sites are blocked by the sphere) using Markov chain. the task is the following : W…

---

## [Gallery for Processing.py sketches?](https://discourse.processing.org/t/gallery-for-processing-py-sketches/21150)

<div class="topic-metadata">

**Author:** [@PawnMongo](https://discourse.processing.org/u/PawnMongo)\
**Replies:** 2\
**Last updated:** [May 22, 2020, 4:01am UTC](https://discourse.processing.org/t/gallery-for-processing-py-sketches/21150 "2020-05-22T04:01:57Z")

</div>

I enjoy browsing the great sketches that are posted at openprocessing.org/browse. I’ll often look at the code for their sketches to figure out how they achieved their results. My native tongue is python, however, so fi…

---

## [Problem with redraw](https://discourse.processing.org/t/problem-with-redraw/20922)

<div class="topic-metadata">

**Author:** [@bunal](https://discourse.processing.org/u/bunal)\
**Replies:** 9\
**Last updated:** [May 16, 2020, 9:12pm UTC](https://discourse.processing.org/t/problem-with-redraw/20922 "2020-05-16T21:12:13Z")

</div>

Hello, I’m trying to create a grid solver. I’m calling redraw after I visit some cell and I want that cell to be green one by one until the goal cell. But it just makes all of the visited cells green after the function t…

---

## [Processing.py sketches sketches on the web](https://discourse.processing.org/t/processing-py-sketches-sketches-on-the-web/20750)

<div class="topic-metadata">

**Author:** [@PawnMongo](https://discourse.processing.org/u/PawnMongo)\
**Replies:** 3\
**Last updated:** [May 13, 2020, 9:43am UTC](https://discourse.processing.org/t/processing-py-sketches-sketches-on-the-web/20750 "2020-05-13T09:43:47Z")

</div>

Is there some simple way that I can upload a sketch created in Processing.py to the web so that it can be run by someone without Processing.py on their computer? If not, is there a plan to add this capability in the nea…

---

## [How can I connect OSCP5 in Processing python](https://discourse.processing.org/t/how-can-i-connect-oscp5-in-processing-python/20688)

<div class="topic-metadata">

**Author:** [@lasc95](https://discourse.processing.org/u/lasc95)\
**Replies:** 3\
**Last updated:** [May 10, 2020, 7:13pm UTC](https://discourse.processing.org/t/how-can-i-connect-oscp5-in-processing-python/20688 "2020-05-10T19:13:38Z")

</div>

Hi dears, I try to connect Processing.py with supercollider but I have problems with import OSCP5. Can you help me :c How can I instance OSCP5, I imported with add\_library(‘oscP5’). thanks :smiley:

---

## [Is anyone using Jython's open() and/or io.open()? Insights needed](https://discourse.processing.org/t/is-anyone-using-jythons-open-and-or-io-open-insights-needed/20452)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 4\
**Last updated:** [May 10, 2020, 6:24pm UTC](https://discourse.processing.org/t/is-anyone-using-jythons-open-and-or-io-open-insights-needed/20452 "2020-05-10T18:24:22Z")

</div>

I really think Processing’s loadStrings() and saveStrings() are super-great, and I use them all the time when I need to read text from and write text into a file. But I’m writing some instructional materials and I wan…

---

## [Use System variable in processing.py?](https://discourse.processing.org/t/use-system-variable-in-processing-py/20627)

<div class="topic-metadata">

**Author:** [@huahua](https://discourse.processing.org/u/huahua)\
**Replies:** 4\
**Last updated:** [May 10, 2020, 5:29am UTC](https://discourse.processing.org/t/use-system-variable-in-processing-py/20627 "2020-05-10T05:29:47Z")

</div>

the codes in picture could be run successfully,but i am confused. i don’t know why i could’t use System variable directly in processing.py. i see the System variable could be used directly in java(processing). help me…

---

## [How to import python 3.7 into Processing](https://discourse.processing.org/t/how-to-import-python-3-7-into-processing/19576)

<div class="topic-metadata">

**Author:** [@Upchanges](https://discourse.processing.org/u/Upchanges)\
**Replies:** 3\
**Last updated:** [May 9, 2020, 11:12pm UTC](https://discourse.processing.org/t/how-to-import-python-3-7-into-processing/19576 "2020-05-09T23:12:05Z")

</div>

I think I’m using python 2 for my current Processing app on my Mac. I have been trying to import python 3.7 but I couldn’t find out how to do it. I would greatly appreciate if someone could help me. Thank you!

---

## [How am I supposed to stop a looped function in draw? \[HELP!\]](https://discourse.processing.org/t/how-am-i-supposed-to-stop-a-looped-function-in-draw-help/20574)

<div class="topic-metadata">

**Author:** [@Logic-Gate](https://discourse.processing.org/u/Logic-Gate)\
**Replies:** 3\
**Last updated:** [May 9, 2020, 8:19pm UTC](https://discourse.processing.org/t/how-am-i-supposed-to-stop-a-looped-function-in-draw-help/20574 "2020-05-09T20:19:54Z")

</div>

asking questions hey, I just know that this will have a simple solution, I just can’t figure it out. I have a function that generates random points generate ; the idea is to generate points and display them on the ca…

---

## [Changing brightness in video](https://discourse.processing.org/t/changing-brightness-in-video/20524)

<div class="topic-metadata">

**Author:** [@cupofcalculus](https://discourse.processing.org/u/cupofcalculus)\
**Replies:** 1\
**Last updated:** [May 8, 2020, 12:15am UTC](https://discourse.processing.org/t/changing-brightness-in-video/20524 "2020-05-08T00:15:00Z")

</div>

I know how to iterate over an image, finding the color of each pixel, and modifying it. Is there’s an easier method to adjust the brightness of a video, namely so that it doesn’t cause the video to lag?

---

## [Processing.py and Arduino connection](https://discourse.processing.org/t/processing-py-and-arduino-connection/20026)

<div class="topic-metadata">

**Author:** [@Bodo29](https://discourse.processing.org/u/Bodo29)\
**Replies:** 6\
**Last updated:** [May 3, 2020, 5:25pm UTC](https://discourse.processing.org/t/processing-py-and-arduino-connection/20026 "2020-05-03T17:25:35Z")

</div>

Hi, I’m brand new here in this forum and also in using processing. So first: English is not my first language. Sorry for any mistakes or misunderstandings. I’ve got the following problem while trying to use an Arduino…

---

## [Operation on 3D model using Python in Processing](https://discourse.processing.org/t/operation-on-3d-model-using-python-in-processing/20378)

<div class="topic-metadata">

**Author:** [@Nirav\_Meghani](https://discourse.processing.org/u/Nirav_Meghani)\
**Replies:** 5\
**Last updated:** [May 3, 2020, 11:44am UTC](https://discourse.processing.org/t/operation-on-3d-model-using-python-in-processing/20378 "2020-05-03T11:44:39Z")

</div>

Hello everyone. I need to do operation on every pixel of 3d model. How to go through every pixel of 3d model? Usually, in python we read image as array and using row & column we get particular pixel. But for 3d model ho…

---

## [Importing processing.video](https://discourse.processing.org/t/importing-processing-video/20290)

<div class="topic-metadata">

**Author:** [@cupofcalculus](https://discourse.processing.org/u/cupofcalculus)\
**Replies:** 2\
**Last updated:** [April 30, 2020, 4:32am UTC](https://discourse.processing.org/t/importing-processing-video/20290 "2020-04-30T04:32:19Z")

</div>

I’m trying to import the processing.video and it doesn’t seem to be working. It raises an exception stating ‘This sketch requires the “video” library.’ Where/how do I get it?

---

## [How I save a picture in SVG?](https://discourse.processing.org/t/how-i-save-a-picture-in-svg/20247)

<div class="topic-metadata">

**Author:** [@christiank79](https://discourse.processing.org/u/christiank79)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 11:21am UTC](https://discourse.processing.org/t/how-i-save-a-picture-in-svg/20247 "2020-04-29T11:21:59Z")

</div>

Hello, I don’t know how to save a picture in SVG, the coding send me an error. Can you help me? Thank you. Christian add\_library('svg') # import processing.svg ''' portrait\_lines\_black Jim Bumgardner 2-25-2000 ''' …

---

## [Regenerating a Floor Plan in Python](https://discourse.processing.org/t/regenerating-a-floor-plan-in-python/19989)

<div class="topic-metadata">

**Author:** [@Mits](https://discourse.processing.org/u/Mits)\
**Replies:** 10\
**Last updated:** [April 27, 2020, 11:37pm UTC](https://discourse.processing.org/t/regenerating-a-floor-plan-in-python/19989 "2020-04-27T23:37:15Z")

</div>

I have a floor plan. I want to take the image and reproduce the same by exchanging zones and optimize the floor layout. I have to code in Python. I tried using Genetic Algorithm but I didn’t get clarity on how to plot th…

---

## [PVector methods versus mathematical operators?](https://discourse.processing.org/t/pvector-methods-versus-mathematical-operators/20029)

<div class="topic-metadata">

**Author:** [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Replies:** 4\
**Last updated:** [April 25, 2020, 4:13pm UTC](https://discourse.processing.org/t/pvector-methods-versus-mathematical-operators/20029 "2020-04-25T16:13:00Z")

</div>

Looking at the PVector reference entry, it states – “Since vectors represent groupings of values, we cannot simply use traditional addition/multiplication/etc. Instead, we’ll need to do some “vector” math, which is made…

---

## [Using Save() and exporting application macOS](https://discourse.processing.org/t/using-save-and-exporting-application-macos/19549)

<div class="topic-metadata">

**Author:** [@sarina](https://discourse.processing.org/u/sarina)\
**Replies:** 16\
**Last updated:** [April 20, 2020, 6:41pm UTC](https://discourse.processing.org/t/using-save-and-exporting-application-macos/19549 "2020-04-20T18:41:15Z")

</div>

I have used save() in my code to save images of the window to the sketch folder as a ‘screenshot’ function and have exported my program to an application. When I run the application and tried to screenshot the image is …

---

## [How to move something diagonally?](https://discourse.processing.org/t/how-to-move-something-diagonally/19884)

<div class="topic-metadata">

**Author:** [@iJermo](https://discourse.processing.org/u/iJermo)\
**Replies:** 2\
**Last updated:** [April 18, 2020, 9:24am UTC](https://discourse.processing.org/t/how-to-move-something-diagonally/19884 "2020-04-18T09:24:35Z")

</div>

That’s where I am at. I’ve looked everywhere but I couldn’t convert java solutions into my python code class car(): def \_\_init\_\_(self): self.c1 = 95 self.c2 = 18 self.c3 = 132 self.wi…

---

## [Can anyone read and help with a lab?](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759)

<div class="topic-metadata">

**Author:** [@rachellinden24](https://discourse.processing.org/u/rachellinden24)\
**Replies:** 6\
**Last updated:** [April 18, 2020, 3:51am UTC](https://discourse.processing.org/t/can-anyone-read-and-help-with-a-lab/19759 "2020-04-18T03:51:32Z")

</div>

Perform data analysis of numeric values enter by user via keyboard: -use a list of stores values -read in five single digit positive numbers from user via keyboard -create console outputs with text labels and values …

---

## [How to refresh my simulation to its beginning?](https://discourse.processing.org/t/how-to-refresh-my-simulation-to-its-beginning/19604)

<div class="topic-metadata">

**Author:** [@Upchanges](https://discourse.processing.org/u/Upchanges)\
**Replies:** 6\
**Last updated:** [April 11, 2020, 1:09am UTC](https://discourse.processing.org/t/how-to-refresh-my-simulation-to-its-beginning/19604 "2020-04-11T01:09:12Z")

</div>

I created a coronavirus simulation and I wanted to refresh everything to the beginning each time I click the screen. I would greatly appreciate your help if you could help me. Thank you! My code: x= \[ \] y= \[ \] h= \[Fals…

---

## [\[Tutorial\] How to use Processing.py with PyCharm and intellisense](https://discourse.processing.org/t/tutorial-how-to-use-processing-py-with-pycharm-and-intellisense/19495)

<div class="topic-metadata">

**Author:** [@Abdulla060](https://discourse.processing.org/u/Abdulla060)\
**Replies:** 5\
**Last updated:** [April 9, 2020, 3:36am UTC](https://discourse.processing.org/t/tutorial-how-to-use-processing-py-with-pycharm-and-intellisense/19495 "2020-04-09T03:36:22Z")

</div>

Hello everyone. in the past few days, I’ve been kinda bored sitting at home all day. so I’ve decided to write a stub file for the Processing.py along with a full tutorial on how to make it work in PyCharm. the full tuto…

---

## [py.Processing with PyCharm?](https://discourse.processing.org/t/py-processing-with-pycharm/14236)

<div class="topic-metadata">

**Author:** [@nemecsek69](https://discourse.processing.org/u/nemecsek69)\
**Replies:** 7\
**Last updated:** [April 8, 2020, 10:43pm UTC](https://discourse.processing.org/t/py-processing-with-pycharm/14236 "2020-04-08T22:43:40Z")

</div>

Hi. I am using the Python mode, but would like MORE. Being a Pyhon developer I would like to use PyCharm as my IDE of choice (and possibly execute the code from there). Is this possible?

---

## [Entering two different outputs inside one variable?](https://discourse.processing.org/t/entering-two-different-outputs-inside-one-variable/17849)

<div class="topic-metadata">

**Author:** [@macedorrn](https://discourse.processing.org/u/macedorrn)\
**Replies:** 7\
**Last updated:** [April 7, 2020, 9:39pm UTC](https://discourse.processing.org/t/entering-two-different-outputs-inside-one-variable/17849 "2020-04-07T21:39:20Z")

</div>

I am working on a program where a circle must be drawn only within the walls(4 rectangles on the borders), I managed to get the circle to be drawn inside two walls(right and top borders), but the other remaining two it s…

---

## [Use a function from a class to open a 2nd window](https://discourse.processing.org/t/use-a-function-from-a-class-to-open-a-2nd-window/19166)

<div class="topic-metadata">

**Author:** [@SeanW](https://discourse.processing.org/u/SeanW)\
**Replies:** 3\
**Last updated:** [April 7, 2020, 5:19am UTC](https://discourse.processing.org/t/use-a-function-from-a-class-to-open-a-2nd-window/19166 "2020-04-07T05:19:31Z")

</div>

Hello, I am trying to open a 2nd window by using a function from a class (DHTable) i made. I plan on then plotting ellipses or rectangles based on variables in an instance of DHTable. I have seen other code on the forum…

---

## [Python syntax to use File.separator](https://discourse.processing.org/t/python-syntax-to-use-file-separator/19378)

<div class="topic-metadata">

**Author:** [@cupofcalculus](https://discourse.processing.org/u/cupofcalculus)\
**Replies:** 2\
**Last updated:** [April 4, 2020, 4:12am UTC](https://discourse.processing.org/t/python-syntax-to-use-file-separator/19378 "2020-04-04T04:12:40Z")

</div>

My instructor uses the Java syntax in Processing, and I’m trying to convert it to Python. The relevant part of his code is: //Global variables String fname4 = "gumballs.jpg"; String loadName = fname4; int ncolors = 8; …

---

## [Random falling rectangles](https://discourse.processing.org/t/random-falling-rectangles/19185)

<div class="topic-metadata">

**Author:** [@Bruh\_Momentum](https://discourse.processing.org/u/Bruh_Momentum)\
**Replies:** 2\
**Last updated:** [March 30, 2020, 9:05pm UTC](https://discourse.processing.org/t/random-falling-rectangles/19185 "2020-03-30T21:05:16Z")

</div>

Hi, I would like to know if anyone can help me. I want to have rectangles fall from the top of the window in random x positions, but I am not sure how to do that. If anyone could help, that would be great. I currently do…

---

## [Test for collision between a rectangle and an image](https://discourse.processing.org/t/test-for-collision-between-a-rectangle-and-an-image/19173)

<div class="topic-metadata">

**Author:** [@Lake\_Panzer](https://discourse.processing.org/u/Lake_Panzer)\
**Replies:** 2\
**Last updated:** [March 30, 2020, 9:37am UTC](https://discourse.processing.org/t/test-for-collision-between-a-rectangle-and-an-image/19173 "2020-03-30T09:37:07Z")

</div>

Hello there! In class, I have been learning how to use python in processing. However, I have learned barely anything in processing, and I now have a project to complete. I am trying to make a simple game where you contro…

---

## [Stacking Coloured Blocks Game](https://discourse.processing.org/t/stacking-coloured-blocks-game/19016)

<div class="topic-metadata">

**Author:** [@macedorrn](https://discourse.processing.org/u/macedorrn)\
**Replies:** 2\
**Last updated:** [March 27, 2020, 2:40pm UTC](https://discourse.processing.org/t/stacking-coloured-blocks-game/19016 "2020-03-27T14:40:13Z")

</div>

How can I get to draw my main\_stack in the correct way, and with the conditional - only add to the scoring\_stack if the last item of main\_stack is the same color as last item of scoring\_stack - and, the scoring\_stack sho…

---

## [Refraction light pattern](https://discourse.processing.org/t/refraction-light-pattern/8731)

<div class="topic-metadata">

**Author:** [@netasoreq](https://discourse.processing.org/u/netasoreq)\
**Replies:** 8\
**Last updated:** [March 25, 2020, 8:32pm UTC](https://discourse.processing.org/t/refraction-light-pattern/8731 "2020-03-25T20:32:21Z")

</div>

Hi ! i would like to do code in processing, that look like refraction light pattern . Someone have any suggest how to start ?

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

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