• What's your solution?
    33 replies, posted
[QUOTE=lavacano;26720237][url=http://docs.python.org/tutorial/controlflow.html#pass-statements]The term you're looking for is pass.[/url][/QUOTE] Ah. I tried continue but apparently that doesn't work
Continue restarts the loop's cycle (read: only works with loops) from the point it is found, ignoring the code that you can find later Break kills the loop's cycle from the point where it is found (so no need to check conditions) Pass works anywhere you don't have code to fill with. You can use it in a function definition, an if, a loop, a class. Anywhere. [editline]16th December 2010[/editline] Anyway did you manage to do what you wanted to do?
[QUOTE=TerabyteS;26729335]Continue restarts the loop's cycle (read: only works with loops) from the point it is found, ignoring the code that you can find later Break kills the loop's cycle from the point where it is found (so no need to check conditions) Pass works anywhere you don't have code to fill with. You can use it in a function definition, an if, a loop, a class. Anywhere. [editline]16th December 2010[/editline] Anyway did you manage to do what you wanted to do?[/QUOTE] Yea thanks to you
[QUOTE=supersnail11;26613608]It was more of that I'm lazy and wanted to use the letters I had already done... Anyways, [b]I converted it[/b] and it works[/QUOTE] You could have written a program to do it for you. And I'm not even kidding, when you have a lot of repetitive work to do it can be faster to just write a program for it. Also it's much more fun. Just a few days ago I've encoded many of my flac songs to mp3 so I could put them on my music player, but as a result I had 2 copies of all songs in every folder, one .flac and one .mp3, which was annoying because they showed doubled up in foobar2000's music library as well. So i wrote a Python script to sweep through all subfolders of a folder, then move only the .mp3s to a new location, while creating appropriate subfolders for the files. It was only about 10 folders alltogether, so I could've easily done it by hand, but hey, I learned how to do basic file/folder manipulation along the way. :buddy:
Sorry, you need to Log In to post a reply to this thread.