i’m new to blenders python scripting language and i just want to ask the pro’s here some more or less stupid questions about it…
how can i comment out multiple lines without using a # each line? just like in c language with /* */.
what’s the best way to slow down a running script, if i want to watch what it does? (in the console for example) is there a function which performs a delay? or what would you do, if you want to follow a fast running program?
is there a function to stop a script such as “break”, “halt” or “return()” in other languages?
To comment out multiple lines, use either ‘’’ or “”". If you’re confused with what I just wrote, look at it as ’ 3 times or " 3 times.
i.e.
def OkCode():
return something
“”"
def CommentedOutCode():
return somethingElse
“”"
Slowing down scripts: NO. You’d be better off putting print statements through the code at different places, then running the program, then checking what it did, what values equaled at certain points in time, etc.
how can i comment out multiple lines without using a # each line? just like in c language with /* */.
Just FYI, I don’t know of a single python editor that doesn’t allow you to comment out blocks of code all at once. You should check your editor to see what your options are. In IDLE (the default Python editor), for example, you select the text and hit Alt-3 (uncomment is Alt-4). Check the Format menu. It’s also useful for indenting regions, which is something you’ll want to be able to do in Python.