Python scripts prone to errors as text input?

I am just getting into learning how to modify scripts and I’m finding that copied text, edited in notepad and saved as *.py often has errors, usually with indents. THis shows up when you try to run the python scripts in the text window. However, the same errors in indents in a script that has already run are tollerated withour errors.

Why the difference?

Any tips on using text editors - eg is there one that is better than notepad for py scripts?

That is very strange indeed. Could you list the exact steps that made this occur?

BTW, Indentating errors can be fixed by the Format->Convert Whitespace menu

as for other editors: all are a matter of personal taste as no external editor can be integrated seemlessly into Blender.(You have to import the scripts) My advice is to stick to the built-in editor for a while: it may not be perfect, but once you get to know it it pretty much has everything a programmer need, including syntax highlighting and autocompletion (both have to be enabled by clicking on the ‘ab’ and ‘snake’ buttons repsectively)

Thanks for all your help. I’ve never seen anything quite as fussy about indents and spaces as Python seems to be. Right now the only script I’m playing with is the nodetextchanger by Holly
http://blenderartists.org/forum/showthread.php?t=155800
that allows you to script changes in a texture in a material node bsed on frame number {my first challenge is to make it run / multiplex with 20 rather than 10 textures}

right here seems to be the position where the indent error keeps occuring at the 2 def calls:

def call(self):
def checkframes(frameno, FrameArray):
Texno=-1
found=0
for Lnum in range(0,len(FrameArray)):
for Fnum in range(0,len(FrameArray[Lnum])/2):
if found==0:
if int(frameno) >= FrameArray[Lnum][(Fnum)*2] and int(frameno) < FrameArray[Lnum][((Fnum)*2)+1]:
Texno=Lnum
found=1
return Texno

->Arrgh indents are smashed in forum messages <-
the text/ run python script wants the def indents at different levels it seems and when you edit them in notepad and save as a py file sometimes the indents are preserved and sometimes they aren’t! Perhaps I am misunderstanding, sigh. Anyway the script runs fine if it can run once even if the first def is indented or not! HEad scratch. Since you need to change frame numbers all the time, you need to edit this one frequently. Looks like I’ll edit it in the Blend file as that seems to be working best.

Last Q for the moment-> I can’t get text window text to zoom in using ctrl scroll wheel and the font is really small, any hints on how I can zoom in on the text while editing in Blender?