Anyone understand this syntax error?
Sean Hammond
s0094060 at sms.ed.ac.uk
Sat Dec 2 17:39:50 EST 2006
Anyone understand this?
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def markdown_perl(input):
... """Send 'input' (string) to the markdown perl script, and return
the
... output from markdown (string).
...
... input: a string of markdown-formatted text, including \n's at
the end
... of lines, that will be sent to the markdown process.
...
... returns: a string of valid XHTML from markdown
... """
... import tempfile
... import commands
... file = tempfile.NamedTemporaryFile()
... file.write(input)
... file.flush()
... return commands.getoutput('./markdown.pl '+file.name)
File "<stdin>", line 15
return commands.getoutput('./markdown.pl '+file.name)
^
SyntaxError: invalid syntax
>>>
I don't get it. Syntax seems fine to me, just a normal string
concatenation.
--
More information about the Python-list
mailing list