Re: [Tutor] "alias" instance of logger

2007-10-05 Thread Robert Jackson
By the way, I could have SWORN that I've done this successfully in the past in another program. I am relatively certain I have used log.LEVEL() in some of my programs in the past, but I can't figure out how I did it. /r - Original Message ---- From: Robert Jackson <[EMAIL P

[Tutor] "alias" instance of logger

2007-10-05 Thread Robert Jackson
I'm working with an instance of a Python logger. Some code: log = logging.basicConfig(level=logging.DEBUG,filename="/home/richard/templog",filemode='w') Later in my program I do: log.info("finished step 4.") Python spits out this error: Traceback (most recent call last): File ""

[Tutor] linux terminal coloring in python

2007-09-29 Thread Robert Jackson
I'm trying to get some pretty colored output for a Linux console / terminal window. Google searches only reveal the curses module to colorize output. Is there a simpler way? Curses seems to be FAR too powerful for what it is I want to do (simply to colorize a few 'print' outputs to the console

[Tutor] strategy in dealing with user input

2007-09-29 Thread Robert Jackson
I have a few lines of code as follows: CONFIGFILE = raw_input("Enter config location: ") while CONFIGFILE == "": CONFIGFILE = raw_input("You must enter configuration file location: ") Let's say the user hits enter past the initial raw_input request. The user will then be in the whi

[Tutor] Check if root

2007-09-29 Thread Robert Jackson
I'm trying to write a function that checks to see if the user that is running the python script is 'root' (I'm obviously running this Python program on Linux). Using os.system(), I have done something like this: >>> import os >>> os.system("whoami") robert 0 >>> If I try to assign the o