Stewart Midwinter(e)k dio:
>> From: altern <[EMAIL PROTECTED]>
>> Subject: [Pythonmac-SIG] indentation problem
>> hi all
>>
>> i have been developing some tutorials with PyOxide and now i find that
>> when i open them on Smultron the indentation is wrong.
>
> I use Smultron as well. What do you mean, "the indentation is wrong"?
> Too much indentation, not enough?
>
>> It tried to fix the indentation in one but there is something wrong
>> under the hood because then it complains at end of lines, it says the
>> syntax is wrong,
>
> What complains, Smultron? What's the exact error message?
sorry. the exact problem was that something like this in pyoxide
def a():
if x:
pass
would look like this in smultron
def a():
if x:
pass
if i indented the pass line, then when running the code i got an error
saying there was wrong syntax at the line return after "if x:"
But i solved this by changing the default option to save tabs as spaces
in PyOxide, now Smultron opens them ok.
thanks for the tips
>> I was wondering if there is some way to automatically fix this or if i
>> have to go file by file fixing the indentation and line breaks.
>
> The most common source of problems with indentation is mixed use of
> tabs and space. You should do one or other, preferably spaces.
>
> In Preferences > Advanced, check "Indent with spaces not tabs"
> In View, select Show Invisible Characters.
>
> This should help you track down the problem
>
> If you do have to change the indentation of a file, you don't need to
> edit lines individually. Select all lines in a block, then use
> Option-L to indent by 4 chars, or Option-K to outdent one char at a
> time.
>
>> The funny thing is that when i open them in Kate under debian they look ok.
>
> Kate is not a programming editor, so that proves nothing.
>
> cheers
> Stewart
>
_______________________________________________
Pythonmac-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig