Executing a python script with arguments from a python script

2005-12-12 Thread olaufr
Hi, I need to call a python script, with command line arguments (it is an autonomous script with a __main__), from within another python script. Can I use exec() or execfile() for this? How to pass the arguments? Thanks, Olivier. -- http://mail.python.org/mailman/listinfo/python-list

Pattern matching with string and list

2005-12-12 Thread olaufr
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I have a list, as below: sentence = "the color is $red" patterns = ["blue","red","yellow"] pos = sentenc