Permanent py errors...what´s my misstake?

Gr3yHound

Mr.MapView
Joined
Mar 30, 2004
Messages
396
Hi,
i m really running against a wall atm.

I get errors causing my scripts to fail all the time. Even when i just realign code by adding/deleting spaces or tabs at line start

e.g. when i edit (just removing the spaces to align it more to the left, no other difference)
Code:
              # Religions Column
              screen.setTableColumnHeader( "CityListBackground", 2, localText.getText("Religions", ()).upper(), 130 )
to ... ---->
Code:
# Religions Column
screen.setTableColumnHeader( "CityListBackground", 2, localText.getText("Religions", ()).upper(), 130 )

i m using ultraedit-32 atm, i guess it could be related to a simple setting.

Anyone knows my problem? It´s pretty hard to make progress if you can´t even tell if the error is systax related or caused by something like my errors.

thx in advance.
 
In most programming languages you define blocks of code with brackets. For example:

void doIt( string locationToDoIt, bool doItReallyHard )
{
// code goes here
}

Anything contained within those brackets ({ }) is considered part of the doIt code. To my knowledge this is not the case with Python. In Python, you define blocks of code with indentation. So by changing the indentation you are drastically altering the code itself.
 
ah oki, that explains a lot. Already wondered why editor.exe and ultraedit displayed the code somehow different. I won´t be able to use Ultraedit then any longer, at least as long as i can´t get it to display the indentations properly

in that case i turn my question into: "what tool is best to edit python scripts?"
 
I don't think there is an Integrated Development Environment for Python (then again that could just be ignorance on my part.)

Without an IDE, programmers typically use Vi (vim.org) or Emacs (not sure where to get it, try Google)

Both are great text editors. My preference is Vi. You can also use plain old notepad. The thing about .py files is they are just plain text.

You could use MS Word if you want but I think that would just be annoying.
 
There is an IDE, it's called IDLE -- download the full Python windows installation from python.org -- it includes IDLE as well as a command parser so you can even test commands on the fly.

installing this package will automatically associate .py files with IDLE, so Opening a .py will default to running IDLE for you.

It's a great tool with only one complaint: no horizontal scrollbar. You can still scroll horizontally, but for text that goes beyond the window edge it gets slightly annoying.
 
Back
Top Bottom