Python

Moderators: None (Apply to moderate this forum)
Number of threads: 473
Number of posts: 1172

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
please read Posted by infidel on 26 Aug 2003 at 7:32 AM
Everyone please use the [code] and [/code] stylecodes around code sections. It's especially important with Python since indentation has special meaning. Thank you.


infidel
Report
Re: please read Posted by nevc on 26 Aug 2003 at 5:48 PM
: Everyone please use the [code] and [/code] stylecodes around code sections. It's especially important with Python since indentation has special meaning. Thank you.
:
:
: infidel
:

Report
Re: please read Posted by nevc on 26 Aug 2003 at 5:51 PM
: : Everyone please use the [code] and [/code] stylecodes around code sections. It's especially important with Python since indentation has special meaning. Thank you.
: :
: :
: : infidel
: :
:
:
Sorry, forgot to type anything last time !!

Could you give us an example, including a couple of indented blocks, or point me to an existing (on this board) good example.

Thanks
Nev
Report
Re: please read Posted by infidel on 27 Aug 2003 at 7:34 AM
This message was edited by Moderator at 2003-8-27 7:34:57

: : : Everyone please use the [code] and [/code] stylecodes around code sections. It's especially important with Python since indentation has special meaning. Thank you.
: : :
: : :
: : : infidel
: : :
: :
: :
: Sorry, forgot to type anything last time !!
:
: Could you give us an example, including a couple of indented blocks, or point me to an existing (on this board) good example.

Sure. When HTML is rendered by a web browser, whitespace is not preserved. Therefore, tabs and spaces get condensed unless you use special tags like <pre> to tell the browser to use a fixed-width font and maintain whitespace. PH has the [code] and [/code] tags to do just this.

if __name__ == '__main__':
    main()


vs.

if __name__ == '__main__':
main()

Both of these samples have four spaces before the call to main(), but only the first displays them.

If you click on "Reply" to this message, you will be able to see the special tags I entered around the first example.



infidel






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.