It was an indent problem - everything works fine now.
Announcement
Collapse
No announcement yet.
Python - Trouble moving variables between functions
Collapse
X
-
Hmmm... You set LoggingEnabled=1 in the .ini? It should create a number of logs in the logs folder every time you run the game.Originally posted by vovan
Trip, I might just be stupid, but... Could you explicitly say how to enable these logs you speak of?
I enabled all the logging options in the ini file (changed to 1, except hidepythonexceptions which I set to 0) but nothing ever showed up in the My Games\Civ4\Logs directory. Am I looking in the wrong place? Or is it because no logs were generated, so there's nothing to look at?
Comment
-
Is that only for CivilizationIV.ini file, or is it supposed to work also if you set it in a particular mod ini file?Originally posted by Trip
Hmmm... You set LoggingEnabled=1 in the .ini? It should create a number of logs in the logs folder every time you run the game.
Comment
-
I see. Well, I only wanted logging to be enabled for this one mod I was playing around with, but when I enabled logging in that mod's ini file, no logs showed up. I haven't tried the CivIV.ini file, actually.Originally posted by Trip
You should only want/need it in the main CivIV.ini file.
Comment
-
You are right. I was thinkining about that from the parser point of view, and not the programmer point of view. It is much far easier for a parser to distinguish between blocks when using characters to delimit them, than by using indentation.Indenting is actually rather helpful. If you had misplaced a { or } in C++, or (worse) a ( or ) in LISP, it wouldn't have been more obvious, would it?
That is why i prefer to work with tools like Visual Assist X that place { } ( ) " etc. automatically and indent the code accordingly.
Comment
-
a) get a proper python ide. That does it for youOriginally posted by stud1294
You are right. I was thinkining about that from the parser point of view, and not the programmer point of view. It is much far easier for a parser to distinguish between blocks when using characters to delimit them, than by using indentation.
That is why i prefer to work with tools like Visual Assist X that place { } ( ) " etc. automatically and indent the code accordingly.
b) you still can use () {} in comments
Code:if bla condition: #{ do something #}
Comment
Comment