help: code formatter?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • siggi

    #1

    help: code formatter?

    Hi all,

    as a newbie I have problems with formatting code of downloaded programs,
    because IDLE's reformatting capabilities are limited . Incorrect
    indentation, mixing of TAB with BLANKs or eol are often very nasty to
    correct.
    Is there a simple code formatter that first removes all indentations and
    then refomats correctly?

    Please help!

    Thank you,

    siggi




  • Bjoern Schliessmann

    #2
    Re: help: code formatter?

    siggi wrote:
    as a newbie I have problems with formatting code of downloaded
    programs, because IDLE's reformatting capabilities are limited .
    Incorrect indentation, mixing of TAB with BLANKs or eol are often
    very nasty to correct.
    Is there a simple code formatter that first removes all
    indentations and then refomats correctly?
    Why don't you just write one? :)

    Seriously: Try.

    BTW: Guessing to what amount of space TABs must be converted in
    mixed source can be non-trivial.

    Regards,


    Björn

    --
    BOFH excuse #289:

    Interference between the keyboard and the chair.

    Comment

    • Thomas Heller

      #3
      Re: help: code formatter?

      siggi schrieb:
      Hi all,
      >
      as a newbie I have problems with formatting code of downloaded programs,
      because IDLE's reformatting capabilities are limited . Incorrect
      indentation, mixing of TAB with BLANKs or eol are often very nasty to
      correct.
      Is there a simple code formatter that first removes all indentations and
      then refomats correctly?
      >
      Please help!

      Tools\scripts\r eindent.py in your Python distribution.

      Thomas

      Comment

      • Chuck Rhode

        #4
        Re: help: code formatter?

        siggi wrote this on Mon, Jan 08, 2007 at 03:33:21PM +0100. My reply is below.
        Is there a simple code formatter that first removes all indentations
        and then refomats correctly?
        Why, yes, there is:



        --
        ... Chuck Rhode, Sheboygan, WI, USA
        ... 1979 Honda Goldwing GL1000 (Geraldine)
        ... Weather: http://LacusVeris.com/WX
        ... 26° — Wind W 17 mph

        Comment

        • siggi

          #5
          Re: help: code formatter?

          Bjoern wrote:
          Why don't you just write one? :)
          Very funny! Just learning Python :(

          Regards,

          siggi
          siggi wrote:
          >
          >as a newbie I have problems with formatting code of downloaded
          >programs, because IDLE's reformatting capabilities are limited .
          >Incorrect indentation, mixing of TAB with BLANKs or eol are often
          >very nasty to correct.
          >Is there a simple code formatter that first removes all
          >indentations and then refomats correctly?
          >
          Why don't you just write one? :)
          >
          Seriously: Try.
          >
          BTW: Guessing to what amount of space TABs must be converted in
          mixed source can be non-trivial.
          >
          Regards,
          >
          >
          Björn
          >
          --
          BOFH excuse #289:
          >
          Interference between the keyboard and the chair.
          >

          Comment

          • siggi

            #6
            Re: help: code formatter?

            Thomas wrote:
            Tools\scripts\r eindent.py in your Python distribution.
            Thank you Thomas!

            What a bucket full of toolsin \tools! I didn't know that.

            siggi


            "Thomas Heller" <theller@ctypes .orgschrieb im Newsbeitrag
            news:mailman.24 17.1168270685.3 2031.python-list@python.org ...
            siggi schrieb:
            >Hi all,
            >>
            >as a newbie I have problems with formatting code of downloaded programs,
            >because IDLE's reformatting capabilities are limited . Incorrect
            >indentation, mixing of TAB with BLANKs or eol are often very nasty to
            >correct.
            >Is there a simple code formatter that first removes all indentations and
            >then refomats correctly?
            >>
            >Please help!
            >
            >
            Tools\scripts\r eindent.py in your Python distribution.
            >
            Thomas

            Comment

            • siggi

              #7
              Re: help: code formatter?

              Chuck wrote:
              Wow, what a giant of a program! Trying to find out how this works.

              Thank you,

              siggi

              "Chuck Rhode" <CRhode@LacusVe ris.comschrieb im Newsbeitrag
              news:mailman.24 27.1168273761.3 2031.python-list@python.org ...
              siggi wrote this on Mon, Jan 08, 2007 at 03:33:21PM +0100. My reply is
              below.
              >
              >Is there a simple code formatter that first removes all indentations
              >and then refomats correctly?
              >
              Why, yes, there is:
              >

              >
              --
              .. Chuck Rhode, Sheboygan, WI, USA
              .. 1979 Honda Goldwing GL1000 (Geraldine)
              .. Weather: http://LacusVeris.com/WX
              .. 26° - Wind W 17 mph
              >

              Comment

              • Hendrik van Rooyen

                #8
                Re: code formatter?

                "siggi" <smusnmrNOSPAM@ yahoo.comwrote:
                Is there a simple code formatter that first removes all indentations and
                then refomats correctly?
                tabnanny ?

                - Hendrik



                Comment

                • siggi

                  #9
                  Re: code formatter?

                  >tabnanny?
                  not quite!

                  "Hendrik van Rooyen" <mail@microcorp .co.zaschrieb im Newsbeitrag
                  news:mailman.24 73.1168332187.3 2031.python-list@python.org ...
                  "siggi" <smusnmrNOSPAM@ yahoo.comwrote:
                  >
                  >Is there a simple code formatter that first removes all indentations and
                  >then refomats correctly?
                  >
                  tabnanny ?
                  >
                  - Hendrik
                  >
                  >
                  >

                  Comment

                  • Bjoern Schliessmann

                    #10
                    Re: help: code formatter?

                    siggi wrote:
                    Bjoern wrote:
                    >Why don't you just write one? :)
                    >
                    Very funny! Just learning Python :(
                    It isn't funny at all. You'll learn by doing and trying things.
                    That's how all programmers start.

                    Regards,


                    Björn

                    --
                    BOFH excuse #265:

                    The mouse escaped.

                    Comment

                    Working...