Python Forum

Full Version: What does ''''true ....'''' mean???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I saw a code that started as follows

''''true
export OPT='-u"
.
.
.
exec python2.7 $OPT "$0" $FLG "$@"
'''

I can't tell that the '''' and ''' means. How should I google it? I can't find anything on ' other then it can represent a string.
Is this a Python or bash script?
I thought it's python? The file is named as pox.py.
That's not Python code. It might be a multi-line string within Python code. Multi-line strings start and end with three quotes (''') or three double quotes (""").
The file could be a Python code but inside """ ... """ string is bash.
I'd be weary of any script named 'pox'
Reference: https://github.com/noxrepo/pox/blob/carp/pox.py

the triple single quote started at line 23 and ended with 4 single quotes at line 40. Is line 23 to 40 just comments? Did I miss the last single quote?
I don't know why that is there. It's just a multiline string, but it's not a comment. And it's not assigned to a variable name, so Python will just ignore it.
i have seen a few cases where an unused multi-line string is used to effectively be a multi-line comment.  then you can put anything in there ... even the bash code once used when rewriting a script into python.  i have seen java code put in such an unused multi-line string.