Python Forum
Need help making code more efficient
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help making code more efficient
#3
Larz60+, I have tried what you have suggested and have received an error. I type in the following:
def setup():
    size(400, 400)
    
def draw():
    import time
 
    def display_this(my_string):
        cur_str = []
        for character in my_string:
            cur_str.append(character)
            text(cur_str, 10, 30)
            time.sleep(.5)
    
    display_this('this is a test.')
and recieve
Error:
processing.app.SketchException: TypeError: a float is required at jycessing.mode.run.SketchRunner.convertPythonSketchError(SketchRunner.java:252) at jycessing.mode.run.SketchRunner.lambda$2(SketchRunner.java:125) at java.lang.Thread.run(Thread.java:748)
Reply


Messages In This Thread
Need help making code more efficient - by dhbergen - Apr-12-2018, 03:38 AM
RE: Need help making code more efficient - by dhbergen - Apr-12-2018, 11:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A more efficient code titanif 2 573 Oct-17-2023, 02:07 PM
Last Post: deanhystad
  Cleaning my code to make it more efficient BSDevo 13 1,644 Sep-27-2023, 10:39 PM
Last Post: BSDevo
  Making a function more efficient CatorCanulis 9 2,073 Oct-06-2022, 07:47 AM
Last Post: DPaul
  How would you (as an python expert) make this code more efficient/simple coder_sw99 3 1,902 Feb-21-2022, 10:52 AM
Last Post: Gribouillis
Star I was making code for collision for my character izmamonke 2 2,166 Aug-06-2021, 04:30 PM
Last Post: izmamonke
  Making a code.py file to function, does not run hobbyist 6 3,043 Jan-27-2021, 07:50 AM
Last Post: DeaD_EyE
  Making new lines of code AvioxyYT 1 1,880 Jan-22-2021, 07:02 PM
Last Post: buran
  I there a more efficient way of printing ? Capitaine_Flam 7 3,680 Dec-01-2020, 10:37 AM
Last Post: buran
  Simple problem. looking for an efficient way silverchicken24 3 2,442 Oct-14-2019, 07:13 PM
Last Post: Larz60+
  making the code easier, list comprehension go127a 2 2,138 May-26-2019, 06:19 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020