#python - Sun 18 Feb 2007 between 14:40 and 15:02

NY Lost Funds



Peperhow can I change "foo-match foo-dont" to "bar-match foo-dont" where match and dont can be matched with some regex ?
sreeramAndares: you can get the module object like this: sys.modules[__name__]
Andares: you can also access the current module's globals as a dictionary with the globals() function
Andaressreeram, thanks.
padtAndares: code inside a module, has the module as it's namespace, so no extra self-like var is neccessary. see py manual 6.1 : Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the module. Thus, the author of a module can use global variables in the module without worrying about accidental clashes with a user's global variables.
actionAndares will manual 6.1
Andareswill manual 6.1
Peperany suggestions to my question?
padtPeper: the re modules has everything you need for that, no?
Peperpadt: I suppose so, but I don't know how to do that
wolvessomeone knows where can I find a list of these special chars? like &amp, &gt ?
padtPeper: look at the module docs for re. in particular re.sub
robertj_hey all, I'v got three arrays containing values and I want to spit out a table containing all the possible combinations, is there an easy way to do this before I go & reinvent the wheel?
ivan`wolves: htmlentitydefs ?
htmlentitydefs.entitydefs
wolvesI will take a look, tks
steveireAny Tkinter experts around? I want to change the behavoiur of a menubutton.
Peperpadt: ok, I can sub a specific group. that's a start
kovanwhy does re.search("[.-0-9]",s) match and re.search("[-.0-9]",s) doesn't? (notice the order of - and .)
padtPeper: and note that repl can be a function if you need it, so for eacth possible substitution, the repl func is called, and whatever it returns is the replacement value
Peperpadt: repl?
ohh I see
padtPeper: The second argument to re.sub
mgrantooh, that's awesome, didn't know that
Peperpadt: and the functions is called with what args?
padtPeper: check the docs or try it in a python interpreter
AzMooHey, how can I get the index of an item in a list?
Skailany guru here got a minute or two for a guy in a desperate situation who made drunken promises to a boss?
Cowmoomylist.index(item)
Peperpadt: hmm I misunderstood the group subing, can I change just one group, not just use it in the repl?
AzMooCowmoo, thanks.
Cowmoonp
Skailmysterious error : "AttributeError: 'App' object has no attribute 'import_file'" <- thing works on windows, but not linux
both python 2.4
masterdriverzSkail: what is the App class from?
Skailthe line causing it is doing a <importedmodule>.<variable> = <dictobject>
padtPeper: you want to change one single group?, then you can pass the number of uf subs you want as the 4th argument to the sub method
Skailmasterdriverz: the app class is my "main program" class.. gets instanced at the end of the file..
masterdriverz: the erroring line is in __init__ of App
masterdriverzSkail: please paste the file then, and gimme the line number :)
Skailmasterdriverz: err... I can't post the entire file... it has 'confidential info' ... I'll paste the main parts

Page: 4 11 18 25 32 39 

IrcArchive

NY Lost Funds