# Processing.py

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

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

**Page:** 3

---

## [Processing.py sound library causing Java errors?](https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954)

<div class="topic-metadata">

**Author:** [@amb](https://discourse.processing.org/u/amb)\
**Replies:** 2\
**Last updated:** [September 24, 2022, 1:48am UTC](https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954 "2022-09-24T01:48:58Z")

</div>

Setup: Windows 10 / Processing 4.0.1 / Python Mode for Processing 4 4001 / Sound 2.3.1 I’ve been trying unsuccessfully to use the Sound library in Python mode. This sketch just tries to load the sound library and call…

---

## [2D displacement mapping for water effect](https://discourse.processing.org/t/2d-displacement-mapping-for-water-effect/3191)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 13\
**Last updated:** [September 20, 2022, 7:00pm UTC](https://discourse.processing.org/t/2d-displacement-mapping-for-water-effect/3191 "2022-09-20T19:00:45Z")

</div>

Hi all, I’ve recently stumbled on the work of Leonardo Solaas and was particularly interested in the technique used for his “Displacements” series. According to the brief description provided by the author, the wat…

---

## [How to make transparent windows in processing.py](https://discourse.processing.org/t/how-to-make-transparent-windows-in-processing-py/38727)

<div class="topic-metadata">

**Author:** [@Boxit379](https://discourse.processing.org/u/Boxit379)\
**Replies:** 1\
**Last updated:** [September 16, 2022, 12:41pm UTC](https://discourse.processing.org/t/how-to-make-transparent-windows-in-processing-py/38727 "2022-09-16T12:41:16Z")

</div>

Hi! I’ve been learning to code in Processing.py and was wondering if it’s possible to make a window completely transparent in the python version of processing. I’ve seen a few similar posts such as this one but they all…

---

## [Why does Processing 4 randomly freeze/produce a different output each time](https://discourse.processing.org/t/why-does-processing-4-randomly-freeze-produce-a-different-output-each-time/38703)

<div class="topic-metadata">

**Author:** [@luhdooce](https://discourse.processing.org/u/luhdooce)\
**Replies:** 1\
**Last updated:** [September 13, 2022, 7:00pm UTC](https://discourse.processing.org/t/why-does-processing-4-randomly-freeze-produce-a-different-output-each-time/38703 "2022-09-13T19:00:53Z")

</div>

So I’m trying to make an rtx program with the new Processing 4, but everything seems 100x harder than before on version 3 of Processing. Shapes are sometimes drawn, and sometimes not. It was also my understanding that if…

---

## [Py5 vs Processing.py](https://discourse.processing.org/t/py5-vs-processing-py/38452)

<div class="topic-metadata">

**Author:** [@antoniorumen](https://discourse.processing.org/u/antoniorumen)\
**Replies:** 2\
**Last updated:** [August 22, 2022, 10:19pm UTC](https://discourse.processing.org/t/py5-vs-processing-py/38452 "2022-08-22T22:19:18Z")

</div>

I am just starting out with processing and since I have some basic python experience I would like to utilize that to my advantage. However, I am confused as to which platform to use. What’s the difference between Process…

---

## [Processing stop button doesn't close sketch window](https://discourse.processing.org/t/processing-stop-button-doesnt-close-sketch-window/38084)

<div class="topic-metadata">

**Author:** [@TipTop](https://discourse.processing.org/u/TipTop)\
**Replies:** 2\
**Last updated:** [July 25, 2022, 1:20pm UTC](https://discourse.processing.org/t/processing-stop-button-doesnt-close-sketch-window/38084 "2022-07-25T13:20:49Z")

</div>

Hello, I expected that the sketch window would close when the stop button is pressed, as I believe it does with Java and p5 sketches. However, that does not seem to be the case with python sketches. Is this expected …

---

## [Running a script from VS code](https://discourse.processing.org/t/running-a-script-from-vs-code/38024)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 1\
**Last updated:** [July 19, 2022, 8:17am UTC](https://discourse.processing.org/t/running-a-script-from-vs-code/38024 "2022-07-19T08:17:00Z")

</div>

Hi, I have currently created a piece of code in processing and I would like to create another piece of code in VS Code, which would call and run the code I currently have, just wondering if this is possible and if so ho…

---

## [Issue with graphics, processing python](https://discourse.processing.org/t/issue-with-graphics-processing-python/37943)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 1\
**Last updated:** [July 15, 2022, 5:01pm UTC](https://discourse.processing.org/t/issue-with-graphics-processing-python/37943 "2022-07-15T17:01:08Z")

</div>

Hi all, I have created a Rubik’s cube and it works really well, however when a piece turns, the piece also appears in its original position at the same time. The problem is I rotate it, then I draw it but for some reaso…

---

## [Unable to view errors in Processing 3.5.4 IDE on Mac OS Monterey 12.4](https://discourse.processing.org/t/unable-to-view-errors-in-processing-3-5-4-ide-on-mac-os-monterey-12-4/37915)

<div class="topic-metadata">

**Author:** [@panic8681](https://discourse.processing.org/u/panic8681)\
**Replies:** 5\
**Last updated:** [July 12, 2022, 3:52pm UTC](https://discourse.processing.org/t/unable-to-view-errors-in-processing-3-5-4-ide-on-mac-os-monterey-12-4/37915 "2022-07-12T15:52:57Z")

</div>

When using Processing in Python Mode I am not able to see any errors in the console. I can run sketches, but if I purposefully type in something with a syntax error (just the word “hello” for example) I don’t get any war…

---

## [Can you get what the current rectMode is?](https://discourse.processing.org/t/can-you-get-what-the-current-rectmode-is/37870)

<div class="topic-metadata">

**Author:** [@The\_Math\_Maniac1](https://discourse.processing.org/u/The_Math_Maniac1)\
**Replies:** 1\
**Last updated:** [July 8, 2022, 3:55am UTC](https://discourse.processing.org/t/can-you-get-what-the-current-rectmode-is/37870 "2022-07-08T03:55:30Z")

</div>

I want to make a custom rectangle function, and I want to base how it draws the rectangle on what the current rectMode is. Is it possible to get what rectMode the sketch is currently on? Something like rectMode(CENTER) …

---

## [Sieve of Eratosthenes in Python](https://discourse.processing.org/t/sieve-of-eratosthenes-in-python/37866)

<div class="topic-metadata">

**Author:** [@shivambhatele](https://discourse.processing.org/u/shivambhatele)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 10:11am UTC](https://discourse.processing.org/t/sieve-of-eratosthenes-in-python/37866 "2022-07-07T10:11:10Z")

</div>

Hello All, I working on a python project and I am confused sieve of eratosthenes coding problem. The problem statement is Given a number n, print all primes smaller than or equal to n. It is also given that n is a small…

---

## [Using keyCode when Processing imported as p](https://discourse.processing.org/t/using-keycode-when-processing-imported-as-p/37652)

<div class="topic-metadata">

**Author:** [@simonc8](https://discourse.processing.org/u/simonc8)\
**Replies:** 5\
**Last updated:** [June 25, 2022, 4:43am UTC](https://discourse.processing.org/t/using-keycode-when-processing-imported-as-p/37652 "2022-06-25T04:43:26Z")

</div>

I’m curious about why keyCode doesn’t seem to recognise keypresses when you import processing using an alias. I am using trinket, so that may be an issue. With this simple code from processing import \* def keyPressed…

---

## [Draw() only running on last item in list](https://discourse.processing.org/t/draw-only-running-on-last-item-in-list/37538)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 0\
**Last updated:** [June 14, 2022, 10:48am UTC](https://discourse.processing.org/t/draw-only-running-on-last-item-in-list/37538 "2022-06-14T10:48:06Z")

</div>

Hi all, I am currently creating a Rubik’s cube solver and I have all the functionality of the cube working perfectly. You can move it and turn faces… I have written a class to scramble the cube where it creates a rando…

---

## [\[TUTORIAL\]Running Python Mode in VScode](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716)

<div class="topic-metadata">

**Author:** [@fenjalien](https://discourse.processing.org/u/fenjalien)\
**Replies:** 24\
**Last updated:** [June 16, 2022, 7:42pm UTC](https://discourse.processing.org/t/tutorial-running-python-mode-in-vscode/7716 "2022-06-16T19:42:49Z")

</div>

This is the method that I used to get processing.py sketches to run in VScode. You will need: Java to be installed and added to path The file processing-py.jar The Code runner extension To get the first two items re…

---

## [How to read the value of each sensor from the Arduino](https://discourse.processing.org/t/how-to-read-the-value-of-each-sensor-from-the-arduino/36914)

<div class="topic-metadata">

**Author:** [@The-NUll](https://discourse.processing.org/u/The-NUll)\
**Replies:** 8\
**Last updated:** [June 15, 2022, 3:59pm UTC](https://discourse.processing.org/t/how-to-read-the-value-of-each-sensor-from-the-arduino/36914 "2022-06-15T15:59:37Z")

</div>

Hi, I’m new to Arduino and Processing.py. I am using Processing and Arduino to complete my graduation project.(English is not my native language, sometimes I speak it’s very strange.) I want to implement the Serial lib…

---

## [Read Serial Value (From Arduino)](https://discourse.processing.org/t/read-serial-value-from-arduino/5829)

<div class="topic-metadata">

**Author:** [@KeirMeDear](https://discourse.processing.org/u/KeirMeDear)\
**Replies:** 2\
**Last updated:** [June 11, 2022, 9:11pm UTC](https://discourse.processing.org/t/read-serial-value-from-arduino/5829 "2022-06-11T21:11:44Z")

</div>

Hey, so all I’m trying to do is use processing to read a value from the Serial port of an arduino. I have already connected I just don’t know the correct python method to read the value. Current code: def setup(): …

---

## [How to delay a display Python Processing](https://discourse.processing.org/t/how-to-delay-a-display-python-processing/37438)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 1\
**Last updated:** [June 12, 2022, 7:37am UTC](https://discourse.processing.org/t/how-to-delay-a-display-python-processing/37438 "2022-06-12T07:37:43Z")

</div>

Hi all, I am currently wring a code to solve a Rubik’s cube and I am at the stage of animating the turns. I have managed to do it, however it happens to quickly to see. I have tried to put a delay in but where ever I put…

---

## [Draw function, Processing, Python](https://discourse.processing.org/t/draw-function-processing-python/37451)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 8\
**Last updated:** [June 11, 2022, 1:01pm UTC](https://discourse.processing.org/t/draw-function-processing-python/37451 "2022-06-11T13:01:52Z")

</div>

Hi just wondering if the draw function is called when a while loop is running. I would like the draw function to be called after every iteration of the while loop and I would like to put a delay in every iteration. Howev…

---

## [Putting a delay during a display. Processing, Python](https://discourse.processing.org/t/putting-a-delay-during-a-display-processing-python/37428)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 6:31pm UTC](https://discourse.processing.org/t/putting-a-delay-during-a-display-processing-python/37428 "2022-06-09T18:31:14Z")

</div>

Hi I am coding a Rubik’s cube simulator and I have currently coded it so if you press a button for example ‘f’ it will turn a piece. And I have coded it so that you can see the faces turning, however it happens so quickl…

---

## [3D graphics not working python](https://discourse.processing.org/t/3d-graphics-not-working-python/37400)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 6\
**Last updated:** [June 8, 2022, 10:53am UTC](https://discourse.processing.org/t/3d-graphics-not-working-python/37400 "2022-06-08T10:53:06Z")

</div>

Hi I’m creating a Rubik’s cube simulator and I’m really confused because I have programmed it to create a 3 by 3 and it is for some reason creating a 4 by 4. I have tried making a 2 by 2 and it makes a 3 by 3 but only i…

---

## [3D graphics Python](https://discourse.processing.org/t/3d-graphics-python/37388)

<div class="topic-metadata">

**Author:** [@Daniel11](https://discourse.processing.org/u/Daniel11)\
**Replies:** 4\
**Last updated:** [June 7, 2022, 7:33pm UTC](https://discourse.processing.org/t/3d-graphics-python/37388 "2022-06-07T19:33:28Z")

</div>

Hi I am really new to processing and I am trying to create a Rubik’s cube simulator with the 3D API. However, when creating an app it just doesn’t make one. Here is the code: def setup(): size(480, 480, P3D) def dr…

---

## [I got collisions working but character falls through block after colliding with it](https://discourse.processing.org/t/i-got-collisions-working-but-character-falls-through-block-after-colliding-with-it/37287)

<div class="topic-metadata">

**Author:** [@bruhmoment14](https://discourse.processing.org/u/bruhmoment14)\
**Replies:** 4\
**Last updated:** [June 3, 2022, 5:42pm UTC](https://discourse.processing.org/t/i-got-collisions-working-but-character-falls-through-block-after-colliding-with-it/37287 "2022-06-03T17:42:17Z")

</div>

I am a beginner and making a platformer game. I took a while but I got jumping and collisions to work. Only problem now is when my character is on top of the block he falls through it to the ground. I have no clue how to…

---

## [Need quicker response to key press](https://discourse.processing.org/t/need-quicker-response-to-key-press/37298)

<div class="topic-metadata">

**Author:** [@simonc8](https://discourse.processing.org/u/simonc8)\
**Replies:** 2\
**Last updated:** [June 3, 2022, 10:57am UTC](https://discourse.processing.org/t/need-quicker-response-to-key-press/37298 "2022-06-03T10:57:24Z")

</div>

I’m using processing in a Python trinket for our Code Club to move a shape around the window using the arrow keys. But there’s a significant delay after pressing the key before the shape moves, which makes this almost us…

---

## [Can't load native code to bring windows to front using the absolute path](https://discourse.processing.org/t/cant-load-native-code-to-bring-windows-to-front-using-the-absolute-path/37218)

<div class="topic-metadata">

**Author:** [@fevalop](https://discourse.processing.org/u/fevalop)\
**Replies:** 3\
**Last updated:** [June 1, 2022, 12:20am UTC](https://discourse.processing.org/t/cant-load-native-code-to-bring-windows-to-front-using-the-absolute-path/37218 "2022-06-01T00:20:46Z")

</div>

please format code with \</\> button \* homework policy \* asking questions

---

## [Sketch works in p3 but not p4](https://discourse.processing.org/t/sketch-works-in-p3-but-not-p4/35060)

<div class="topic-metadata">

**Author:** [@degendev](https://discourse.processing.org/u/degendev)\
**Replies:** 3\
**Last updated:** [May 31, 2022, 9:09am UTC](https://discourse.processing.org/t/sketch-works-in-p3-but-not-p4/35060 "2022-05-31T09:09:22Z")

</div>

I had a sketch a wrote in processing.py (3 (the non blue logo version)) that ran on my older 2017 mbp I also have a 2021 mbp (m1) with processing.py (4 (the blue one)) running on it. For some reason my sketch file onl…

---

## [Maybe there's an unclosed paren or quote mark somewhere before this line?](https://discourse.processing.org/t/maybe-theres-an-unclosed-paren-or-quote-mark-somewhere-before-this-line/37172)

<div class="topic-metadata">

**Author:** [@Sourabh1801](https://discourse.processing.org/u/Sourabh1801)\
**Replies:** 1\
**Last updated:** [May 28, 2022, 9:55pm UTC](https://discourse.processing.org/t/maybe-theres-an-unclosed-paren-or-quote-mark-somewhere-before-this-line/37172 "2022-05-28T21:55:09Z")

</div>

Problem: I am using below code in python processing ,but it giving me this error “Maybe there’s an unclosed paren or quote mark somewhere before this line?” please tell why this error come in this. code: add\_library…

---

## [How can I make my character jump (python)(complete beginner)](https://discourse.processing.org/t/how-can-i-make-my-character-jump-python-complete-beginner/37146)

<div class="topic-metadata">

**Author:** [@bruhmoment14](https://discourse.processing.org/u/bruhmoment14)\
**Replies:** 7\
**Last updated:** [May 28, 2022, 11:26am UTC](https://discourse.processing.org/t/how-can-i-make-my-character-jump-python-complete-beginner/37146 "2022-05-28T11:26:39Z")

</div>

When I move my character they have complete freedom. I want the game to control similarly to Mario, I don’t know how to make it so when you hit the up arrow key, the character moves up once instead of constantly moving u…

---

## [How to make my code better? (completely beginner)](https://discourse.processing.org/t/how-to-make-my-code-better-completely-beginner/35980)

<div class="topic-metadata">

**Author:** [@Jane\_Dau](https://discourse.processing.org/u/Jane_Dau)\
**Replies:** 11\
**Last updated:** [May 27, 2022, 3:20pm UTC](https://discourse.processing.org/t/how-to-make-my-code-better-completely-beginner/35980 "2022-05-27T15:20:12Z")

</div>

Hello, I am new here and have just started learning Processing sketch from this month. I wonder if the code I wrote below can be better. Thank you for your guidelines x=50 y=50 move=3 def setup(): size(600,600) d…

---

## [Multidimensional arrays](https://discourse.processing.org/t/multidimensional-arrays/37053)

<div class="topic-metadata">

**Author:** [@povijarrro](https://discourse.processing.org/u/povijarrro)\
**Replies:** 5\
**Last updated:** [May 25, 2022, 4:53am UTC](https://discourse.processing.org/t/multidimensional-arrays/37053 "2022-05-25T04:53:20Z")

</div>

hello. I am just wondering what is difference between m\*\[n\*\[1\]\] and \[n\*\[1\] for k in range(m)\] Because this code: m,n = 50,50 grid = \[n\*\[1\] for k in range(m)\] screen\_size =(600,600) w=float(screen\_size\[0\])/n h=float(scr…

---

## [Error:VideoExport.startFfmpeg(Unknown Source) but ffmpeg is already installed](https://discourse.processing.org/t/error-videoexport-startffmpeg-unknown-source-but-ffmpeg-is-already-installed/36977)

<div class="topic-metadata">

**Author:** [@salt](https://discourse.processing.org/u/salt)\
**Replies:** 1\
**Last updated:** [May 20, 2022, 5:41am UTC](https://discourse.processing.org/t/error-videoexport-startffmpeg-unknown-source-but-ffmpeg-is-already-installed/36977 "2022-05-20T05:41:26Z")

</div>

Ffmpeg is already installed on your computer C:\\Users\\Fu\>ffmpeg ffmpeg version 5.0.1-essentials\_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers NullPointerException at com.hamoid.VideoExport.startFfm…

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

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