Yes, that will do. I found something similar in the forums when googling for an answer, but yours is a bit shorter...
Thanks! Rich On Oct 4, 2013, at 12:44 PM, Frank Rueter <fr...@beingfrank.info> wrote: > I don't htin kyou can do this, but will this help? > > import re > string = '123 abc$&^' > pattern = re.compile(r'[^\w]') > newString = pattern.sub('_', string) > print newString > > > > On 4/10/13 3:02 PM, Richard Bobo wrote: >> Hi, >> >> I am writing a script that needs some user input name strings. I want to >> keep the names free of spaces and illegal characters. I know that the node >> "name" knob automatically cleans up spaces and unsupported characters as you >> type. If that user input method is accessible, I'd like to be able to use it >> instead of writing my own. Anyone know if it is accessible and how to call >> it, outside the knob name� >> >> Thanks for any help, >> Rich >> >> >> Rich Bobo >> Senior VFX Compositor >> Armstrong-White >> http://armstrong-white.com/ >> >> Email: richb...@mac.com >> Mobile: (248) 840-2665 >> Web: http://richbobo.com/ >> >> "Truth in our ideas means their power to work." >> - William James >> >> >> >> >> >> >> >> _______________________________________________ >> Nuke-python mailing list >> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > > _______________________________________________ > Nuke-python mailing list > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python