Python indenting not consistent between UE installations

Python indenting not consistent between UE installations

2
NewbieNewbie
2

    Nov 22, 2005#1

    My colleague and I both write Python in UltraEdit. However, when I open a python script he's developed the indenting appears differently on my UltraEdit than his. We both work on Windows NT and I'm running UE version 10.2 and he 10.1. Even the reported column for a for loop will report differently on the same file. My display will say a for loop begins on column 16 and his will say column 52. More importantly when I open his file the loops appear to be incorrectly indented which is everything in Python. For loops appearing outside the above if loop when it should be nested underneath. Anyone run into this? Any suggestions?

    2
    NewbieNewbie
    2

      Nov 23, 2005#2

      This is probably a result of different tab settings between you and your colleague.

      I recommend that first, you standardize on tabs vs spaces, and if I recall correctly, it is recommended to use spaces with Python.

      I do not have version 10.* so I cannot tell you the exact items to click on (maye somebody with a better memory of that version will be more specific). But here is what I would do:

      Go to Advanced -> Configuration.
      You need to find the Word Wrap and Tab settings. You can search the help for "Tabs" to figure out where to make the setting changes.

      Once you have found the section for Tab settings, you will see a drop down list labeled "Select Extension for Settings or Default" which will contain "Default" as the first item. I would add an item for Python files by clicking the "Change List" button. Add the .py extension (or whatever extension you use). Then, making sure that the new extension is selected in the drop down list, change the "tab stop" and "indent spaces" settings to what you have agreed upon.

      Additionally, you might need to perform some cleanup of the files to make sure that your indentation is not corrupted any further than it already is.

      I hope this helps!

      2
      NewbieNewbie
      2

        Nov 23, 2005#3

        That did help. That's exactly what we figured out after some poking around. Thanks for the reply.