Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exit Function - loop
#2
Does this work right?

def songplay(song):
    with outport as output:
        try:
            midifile = MidiFile(song)
            while True:
                for message in midifile.play():    
                    output.send(message)
Reply


Messages In This Thread
Exit Function - loop - by Tetsuo30 - Sep-17-2020, 07:54 AM
RE: Exit Function - loop - by cnull - Sep-17-2020, 08:05 AM
RE: Exit Function - loop - by Tetsuo30 - Sep-17-2020, 09:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python difference between sys.exit and exit() mg24 1 1,928 Nov-12-2022, 01:37 PM
Last Post: deanhystad
  Exit function from nested function based on user input Turtle 5 3,031 Oct-10-2021, 12:55 AM
Last Post: Turtle
  While loop doesn't exit KenHorse 3 2,071 Jun-20-2021, 11:05 PM
Last Post: deanhystad
  function fails to exit harig3 4 2,094 Aug-17-2020, 06:35 PM
Last Post: deanhystad
  Using Function in a For loop vp1989 5 2,882 May-19-2020, 03:53 PM
Last Post: vp1989
  Struggling to exit this while loop fatherted99 5 2,558 Feb-08-2020, 07:46 PM
Last Post: fatherted99
  won't exit a loop, please help hobbyprogrammer 9 4,500 Oct-22-2018, 05:22 PM
Last Post: hobbyprogrammer
  Using break to exit a loop help JJG 4 4,250 Dec-09-2017, 03:02 AM
Last Post: JJG
  How to exit infinite While Loop? Fran_3 3 4,156 Aug-10-2017, 05:29 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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