Completely INNOCENT Indentation question

Darren Kirby bulliver at badcomputer.no-ip.com
Wed Oct 13 09:51:53 EDT 2004


quoth the valued customer:
> Is there a way in python to indicate that you want your
> "base level of indentation" to be four spaces instead of
> zero?
>
> As far as I know now, the only way is by introducing some
> sort of language statement, for example:
>
> if (1):
>     ### begin python script
>     foo = 1
>     bar = 2
>     print foo
>     print bar
>
> Is there a way to accomplish this without introducing
> the "throwaway if statement" ??

def main():
    #python script here

if __name__ == '__main__':
    main()

Will that work for ya?

-- 
Darren Kirby :: Part of the problem since 1976 :: http://badcomputer.no-ip.com
Get my public key from 
http://keyserver.linux.it/pks/lookup?op=index&search=bulliver
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20041013/e9ba3066/attachment.sig>


More information about the Python-list mailing list