# Processing.py

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

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

**Page:** 4

---

## [Objects in contact then disappear](https://discourse.processing.org/t/objects-in-contact-then-disappear/36531)

<div class="topic-metadata">

**Author:** [@maya](https://discourse.processing.org/u/maya)\
**Replies:** 2\
**Last updated:** [May 16, 2022, 2:47am UTC](https://discourse.processing.org/t/objects-in-contact-then-disappear/36531 "2022-05-16T02:47:10Z")

</div>

Hi, I would like for when the ball comes in contact with the dog, the dog disappears. Any ideas as to how I would do this? This is what I have so far: dogs = \[\] def setup(): size(500, 500) global x, y, speed, a…

---

## [Compare Processing to Python Processing code?](https://discourse.processing.org/t/compare-processing-to-python-processing-code/36886)

<div class="topic-metadata">

**Author:** [@firefox](https://discourse.processing.org/u/firefox)\
**Replies:** 2\
**Last updated:** [May 15, 2022, 1:40am UTC](https://discourse.processing.org/t/compare-processing-to-python-processing-code/36886 "2022-05-15T01:40:00Z")

</div>

Hello, I’m new to the Processing, and I have a background in pyhton. I used to make patterns with python, but now I need something better. I’m having trouble finding examples of processing in python, but I have found ma…

---

## [Can't save current frame as SVG](https://discourse.processing.org/t/cant-save-current-frame-as-svg/36703)

<div class="topic-metadata">

**Author:** [@antoniorumen](https://discourse.processing.org/u/antoniorumen)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 9:18pm UTC](https://discourse.processing.org/t/cant-save-current-frame-as-svg/36703 "2022-05-11T21:18:11Z")

</div>

I have tried to find a solution to my issue, but couldn’t. I am using Processing 4 with Python Mode. I am trying to save the current frame as SVG and exit by pressing the “s” key. However, I am getting the following err…

---

## [Processing not running my Python script and now won't load native code](https://discourse.processing.org/t/processing-not-running-my-python-script-and-now-wont-load-native-code/32323)

<div class="topic-metadata">

**Author:** [@jenniferalmarine](https://discourse.processing.org/u/jenniferalmarine)\
**Replies:** 4\
**Last updated:** [May 7, 2022, 10:15pm UTC](https://discourse.processing.org/t/processing-not-running-my-python-script-and-now-wont-load-native-code/32323 "2022-05-07T22:15:18Z")

</div>

I’m new to Processing (and have limited experience with Python in general). I’m trying to run my Python script and I’m getting this error message in the console: Hmm. Can’t load native code to bring window to front usi…

---

## [Countdown timer is not working](https://discourse.processing.org/t/countdown-timer-is-not-working/36761)

<div class="topic-metadata">

**Author:** [@snakey](https://discourse.processing.org/u/snakey)\
**Replies:** 1\
**Last updated:** [May 7, 2022, 9:31pm UTC](https://discourse.processing.org/t/countdown-timer-is-not-working/36761 "2022-05-07T21:31:55Z")

</div>

\[Original post\] Countdown timer in python I’ve been using this timer in my game for a while, but I’ve just noticed a problem. The timer utilises second(), once the seconds on my clock go past 59 and turn to 0, the time…

---

## [Processing Python mode skipping error messages and running bad code](https://discourse.processing.org/t/processing-python-mode-skipping-error-messages-and-running-bad-code/36746)

<div class="topic-metadata">

**Author:** [@tdwheeler](https://discourse.processing.org/u/tdwheeler)\
**Replies:** 5\
**Last updated:** [May 7, 2022, 2:37pm UTC](https://discourse.processing.org/t/processing-python-mode-skipping-error-messages-and-running-bad-code/36746 "2022-05-07T14:37:02Z")

</div>

I’m noticing that processing in Python mode is not returning a lot of errors to the console. For instance this: def draw(): number = 12 for i in 10/number: print("this should be an error?") should give…

---

## [Rotating player to always face the direction of the cursor (python)](https://discourse.processing.org/t/rotating-player-to-always-face-the-direction-of-the-cursor-python/36675)

<div class="topic-metadata">

**Author:** [@adora](https://discourse.processing.org/u/adora)\
**Replies:** 2\
**Last updated:** [May 4, 2022, 9:32pm UTC](https://discourse.processing.org/t/rotating-player-to-always-face-the-direction-of-the-cursor-python/36675 "2022-05-04T21:32:26Z")

</div>

So in my game, I want the player character to always look in the direction of the cursor. Here is my relevant code: def setup(): size(1440, 780) playerX = width / 2 playerY = height / 2 playerSpeed = 0.05 def…

---

## [Using Thai in the program](https://discourse.processing.org/t/using-thai-in-the-program/36595)

<div class="topic-metadata">

**Author:** [@sys10m](https://discourse.processing.org/u/sys10m)\
**Replies:** 1\
**Last updated:** [May 1, 2022, 2:12am UTC](https://discourse.processing.org/t/using-thai-in-the-program/36595 "2022-05-01T02:12:27Z")

</div>

I am currently working on a super short program which just takes a one word string input (in Thai) and then pass on the python program which has been written. I have a problem with dealing with Thai text. everything from…

---

## [Arrange images in the order they are clicked in](https://discourse.processing.org/t/arrange-images-in-the-order-they-are-clicked-in/36653)

<div class="topic-metadata">

**Author:** [@snakey](https://discourse.processing.org/u/snakey)\
**Replies:** 3\
**Last updated:** [April 30, 2022, 10:26am UTC](https://discourse.processing.org/t/arrange-images-in-the-order-they-are-clicked-in/36653 "2022-04-30T10:26:50Z")

</div>

Hi! I’m a beginner and need help with this small project. Right now I have a row of images (really just coloured boxes). When I click an image, it moves to a new location above the “collection point”. However, each imag…

---

## [What is the difference between "PBox2D library"and "box2d\_processing library"?](https://discourse.processing.org/t/what-is-the-difference-between-pbox2d-library-and-box2d-processing-library/21915)

<div class="topic-metadata">

**Author:** [@huahua](https://discourse.processing.org/u/huahua)\
**Replies:** 3\
**Last updated:** [April 27, 2022, 1:32am UTC](https://discourse.processing.org/t/what-is-the-difference-between-pbox2d-library-and-box2d-processing-library/21915 "2022-04-27T01:32:20Z")

</div>

i am confused about the “PBox2d” in book The Nature of Code. when i tried run the example , the main tab import pbox2d.\*; import org.jbox2d.collision.shapes.\*; import org.jbox2d.common.\*; import org.jbox2d.dynamics.\*;…

---

## [Jagged lines in Processing 4](https://discourse.processing.org/t/jagged-lines-in-processing-4/35929)

<div class="topic-metadata">

**Author:** [@ALF](https://discourse.processing.org/u/ALF)\
**Replies:** 1\
**Last updated:** [April 26, 2022, 2:55am UTC](https://discourse.processing.org/t/jagged-lines-in-processing-4/35929 "2022-04-26T02:55:53Z")

</div>

Hello so, I’m using windows 10 on a 1920x1080 laptop and the lines just look horribly jagged also, smooth() is not working in any of its modes. I checked back in v. 3.5 and everything looks fine. I apologize if Im miss…

---

## [Python Processing with Trinket - saving graphics file](https://discourse.processing.org/t/python-processing-with-trinket-saving-graphics-file/36530)

<div class="topic-metadata">

**Author:** [@simonc8](https://discourse.processing.org/u/simonc8)\
**Replies:** 0\
**Last updated:** [April 22, 2022, 7:06pm UTC](https://discourse.processing.org/t/python-processing-with-trinket-saving-graphics-file/36530 "2022-04-22T19:06:50Z")

</div>

I want to use the processing library with Python in Trinket to create very simple graphics files, for example, some national flags. (This is for a Code Club to teach the students about pixels, RGB colours etc.) I would l…

---

## [Ball doesn't appear](https://discourse.processing.org/t/ball-doesnt-appear/36568)

<div class="topic-metadata">

**Author:** [@maya](https://discourse.processing.org/u/maya)\
**Replies:** 2\
**Last updated:** [April 24, 2022, 4:46am UTC](https://discourse.processing.org/t/ball-doesnt-appear/36568 "2022-04-24T04:46:11Z")

</div>

Hi, for some reason, the ball in my code doesn’t show up. Do you know why? add\_library('sound') import sys count = 0 ball = 0 countdown = 6 dogs = \[\] def setup(): global sf, x, bgImage, y, speed, acceleration, c…

---

## [Python Mode needs a new project owner](https://discourse.processing.org/t/python-mode-needs-a-new-project-owner/36399)

<div class="topic-metadata">

**Author:** [@pheinberg](https://discourse.processing.org/u/pheinberg)\
**Replies:** 1\
**Last updated:** [April 23, 2022, 12:41pm UTC](https://discourse.processing.org/t/python-mode-needs-a-new-project-owner/36399 "2022-04-23T12:41:24Z")

</div>

Hello from Jonathan Feinberg, the creator of Python Mode for Processing. Python Mode needs a new owner, someone with the time, energy, and expertise to take the mode into full Processing 4 compatibility and beyond. To …

---

## [Countdown and image moveDown() and random()](https://discourse.processing.org/t/countdown-and-image-movedown-and-random/36499)

<div class="topic-metadata">

**Author:** [@maya](https://discourse.processing.org/u/maya)\
**Replies:** 8\
**Last updated:** [April 23, 2022, 2:51am UTC](https://discourse.processing.org/t/countdown-and-image-movedown-and-random/36499 "2022-04-23T02:51:53Z")

</div>

Hi there, I would like the countdown timer to disappear when it reaches 0, and at that point, only then the dog starts moving down, but right now the dog moves down at the beginning already. Also, there is only one dog i…

---

## [Random colors for circle - red/blue/green](https://discourse.processing.org/t/random-colors-for-circle-red-blue-green/36442)

<div class="topic-metadata">

**Author:** [@maya](https://discourse.processing.org/u/maya)\
**Replies:** 4\
**Last updated:** [April 19, 2022, 5:45pm UTC](https://discourse.processing.org/t/random-colors-for-circle-red-blue-green/36442 "2022-04-19T17:45:42Z")

</div>

Hello all, I am starting a processing project for school and I want the circle to randomly change color (either red, blue or green) everytime it is mousepressed. def setup(): size(500, 500) global x, y, speed, a…

---

## [Hi i am new here. Everytime I run my code, it plays for a second, then stops playing and red text comes up, but it doesn't say the specific problem. Can you help?](https://discourse.processing.org/t/hi-i-am-new-here-everytime-i-run-my-code-it-plays-for-a-second-then-stops-playing-and-red-text-comes-up-but-it-doesnt-say-the-specific-problem-can-you-help/36438)

<div class="topic-metadata">

**Author:** [@maya](https://discourse.processing.org/u/maya)\
**Replies:** 1\
**Last updated:** [April 19, 2022, 10:21am UTC](https://discourse.processing.org/t/hi-i-am-new-here-everytime-i-run-my-code-it-plays-for-a-second-then-stops-playing-and-red-text-comes-up-but-it-doesnt-say-the-specific-problem-can-you-help/36438 "2022-04-19T10:21:30Z")

</div>

“”" This is my program Hit.it. The player is the ball and the aim of the game is to hit the dogs coming from the sky. If the player hits more than 10 dogs, they win. If not, they lose. “”" add\_library(“sound”) ellX =…

---

## [Where are the stubs or interface definitions for python?](https://discourse.processing.org/t/where-are-the-stubs-or-interface-definitions-for-python/36380)

<div class="topic-metadata">

**Author:** [@SNitaine](https://discourse.processing.org/u/SNitaine)\
**Replies:** 0\
**Last updated:** [April 16, 2022, 12:39pm UTC](https://discourse.processing.org/t/where-are-the-stubs-or-interface-definitions-for-python/36380 "2022-04-16T12:39:33Z")

</div>

I can’t find any stub or interface definitions in the Processing.py folder. Can someone please point me in the right direction :smiley: I googled and came across this https://github.com/Abdulla060/Processing.py-intellis…

---

## [How to repeat code?](https://discourse.processing.org/t/how-to-repeat-code/36276)

<div class="topic-metadata">

**Author:** [@snakey](https://discourse.processing.org/u/snakey)\
**Replies:** 2\
**Last updated:** [April 14, 2022, 6:30am UTC](https://discourse.processing.org/t/how-to-repeat-code/36276 "2022-04-14T06:30:24Z")

</div>

Hi! I’m having trouble with a simple project. :arrow\_right: The aim is to move an image to a designated box. Once the image is in the box, it snaps into place. By clicking a reset button, the image will return to its st…

---

## [ClassCastException](https://discourse.processing.org/t/classcastexception/36290)

<div class="topic-metadata">

**Author:** [@XSun](https://discourse.processing.org/u/XSun)\
**Replies:** 0\
**Last updated:** [April 12, 2022, 2:31am UTC](https://discourse.processing.org/t/classcastexception/36290 "2022-04-12T02:31:03Z")

</div>

Hi everyone, I’m trying to import a class from a separate file. I got ClassCast Exception message. Can anyone help me out? Thank you! add\_library('pdf') from Sq import Sq colorList=\["#F5AD27","#D86D6D","#9CFCA1","#C3CB…

---

## [Countdown timer in python](https://discourse.processing.org/t/countdown-timer-in-python/36243)

<div class="topic-metadata">

**Author:** [@snakey](https://discourse.processing.org/u/snakey)\
**Replies:** 2\
**Last updated:** [April 10, 2022, 10:03am UTC](https://discourse.processing.org/t/countdown-timer-in-python/36243 "2022-04-10T10:03:06Z")

</div>

Hi! I’m having trouble with a program that will start a countdown timer when a button is clicked. The problem is that the timer will start regardless if I clicked the button. buttonPressed = False start = False def set…

---

## [The pictures are not displaying](https://discourse.processing.org/t/the-pictures-are-not-displaying/36190)

<div class="topic-metadata">

**Author:** [@muffininwinter](https://discourse.processing.org/u/muffininwinter)\
**Replies:** 2\
**Last updated:** [April 7, 2022, 1:07pm UTC](https://discourse.processing.org/t/the-pictures-are-not-displaying/36190 "2022-04-07T13:07:32Z")

</div>

def drawGamePlayLevel1(): global life, time, score, stageNum image(palace, 0, 0, width, height) if (millis()-startTime)/1000 == 2: alive\[0\] = True if (millis()-startTime)/1000 == 4: ali…

---

## [Python Processing 3](https://discourse.processing.org/t/python-processing-3/17057)

<div class="topic-metadata">

**Author:** [@heyitsme](https://discourse.processing.org/u/heyitsme)\
**Replies:** 4\
**Last updated:** [April 7, 2022, 2:47am UTC](https://discourse.processing.org/t/python-processing-3/17057 "2022-04-07T02:47:41Z")

</div>

My code isn’t working and I don’t know why. My start button and my control button works fine, but the arrow button, to go back to the menu, at my control button wouldn’t work. Please help! Here is my code: def setup(…

---

## [Error message when using PFont](https://discourse.processing.org/t/error-message-when-using-pfont/36147)

<div class="topic-metadata">

**Author:** [@adora](https://discourse.processing.org/u/adora)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 6:52pm UTC](https://discourse.processing.org/t/error-message-when-using-pfont/36147 "2022-04-06T18:52:53Z")

</div>

So I wanted to add another font to my python project, but I keep getting an error message for the PFont line. Here is my code: def setup(): size(1600, 900) PFont headerFont # Error message: Maybe there's an u…

---

## [Background music issue](https://discourse.processing.org/t/background-music-issue/35976)

<div class="topic-metadata">

**Author:** [@muffininwinter](https://discourse.processing.org/u/muffininwinter)\
**Replies:** 6\
**Last updated:** [March 31, 2022, 2:04pm UTC](https://discourse.processing.org/t/background-music-issue/35976 "2022-03-31T14:04:26Z")

</div>

Not sure why these codes don’t work, there is an error message \[mismatched input ‘\*’ expecting set null\] :frowning: I have installed the sound library and add the mp3 in the sketch folder… Anyone can do me a favor ;( im…

---

## [Proce55ing graphics don't last longer than a blink](https://discourse.processing.org/t/proce55ing-graphics-dont-last-longer-than-a-blink/35857)

<div class="topic-metadata">

**Author:** [@Nomamesse](https://discourse.processing.org/u/Nomamesse)\
**Replies:** 8\
**Last updated:** [March 23, 2022, 9:58pm UTC](https://discourse.processing.org/t/proce55ing-graphics-dont-last-longer-than-a-blink/35857 "2022-03-23T21:58:20Z")

</div>

Hi everyone, here’s a small code that I’ve tried on Python with Processing vizualisation. #coding:utf-8 from turtle import \* forward(100) shape('turtle') My problem is that vizualisation lasts shorter than a blink of …

---

## [Issue with using PShapes in py5](https://discourse.processing.org/t/issue-with-using-pshapes-in-py5/35762)

<div class="topic-metadata">

**Author:** [@Setsuna](https://discourse.processing.org/u/Setsuna)\
**Replies:** 9\
**Last updated:** [March 17, 2022, 11:16am UTC](https://discourse.processing.org/t/issue-with-using-pshapes-in-py5/35762 "2022-03-17T11:16:48Z")

</div>

Hello everyone! I have started to use py5, and I love it, especially the way it’s a python library and the way to handle vectors. Good job and thank you to everyone here who created or contributed to this project. I ha…

---

## [How to access 'system variable' directly in Python code?](https://discourse.processing.org/t/how-to-access-system-variable-directly-in-python-code/35550)

<div class="topic-metadata">

**Author:** [@sweetart](https://discourse.processing.org/u/sweetart)\
**Replies:** 5\
**Last updated:** [March 7, 2022, 7:38pm UTC](https://discourse.processing.org/t/how-to-access-system-variable-directly-in-python-code/35550 "2022-03-07T19:38:51Z")

</div>

Dear All, I’m using the processing-py 0.3.7 library directly in visual studio code. The because I want to combine the results with other code/libraries. The thing i’m stuck with is how do I access a ‘system variable’ su…

---

## [Processing 4 not working in Python mode with Windows 10](https://discourse.processing.org/t/processing-4-not-working-in-python-mode-with-windows-10/35253)

<div class="topic-metadata">

**Author:** [@fransua](https://discourse.processing.org/u/fransua)\
**Replies:** 3\
**Last updated:** [March 4, 2022, 8:07pm UTC](https://discourse.processing.org/t/processing-4-not-working-in-python-mode-with-windows-10/35253 "2022-03-04T20:07:04Z")

</div>

Python mode for Processing 4 installed correctly. Execution mode with simple instruction gives : Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: 'java.lang.String processing.app.Sketch.getMainProgra…

---

## [No display on Windows, many student problems, any thoughts?](https://discourse.processing.org/t/no-display-on-windows-many-student-problems-any-thoughts/7529)

<div class="topic-metadata">

**Author:** [@mjadud](https://discourse.processing.org/u/mjadud)\
**Replies:** 16\
**Last updated:** [March 3, 2022, 5:57pm UTC](https://discourse.processing.org/t/no-display-on-windows-many-student-problems-any-thoughts/7529 "2022-03-03T17:57:53Z")

</div>

Dear all, I just deployed Processing to a class of 48 students. I have a lot of students with issues where their sketches will apparently run, but no drawing will appear. I have not yet had a chance to see this happen; …

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

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