What is the difference between shlex.split() and re.split()?

shlex.split() is designed to work like the shell’s split mechanism. This means doing things like respecting quotes, etc. >>> shlex.split(“this is ‘my string’ that –has=arguments -or=something”) [‘this’, ‘is’, ‘my string’, ‘that’, ‘–has=arguments’, ‘-or=something’] re.split() will just split on whatever pattern you define. >>> re.split(‘\s’, “this is ‘my string’ that –has=arguments -or=something”) [‘this’, ‘is’, “‘my”, “string'”, … Read more

What’s the reverse of shlex.split?

We now (3.3) have a shlex.quote function. It’s none other that pipes.quote moved and documented (code using pipes.quote will still work). See http://bugs.python.org/issue9723 for the whole discussion. subprocess.list2cmdline is a private function that should not be used. It could however be moved to shlex and made officially public. See also http://bugs.python.org/issue1724822.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)