What does ''''true ....'''' mean??? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: What does ''''true ....'''' mean??? (/thread-5729.html) |
What does ''''true ....'''' mean??? - wuming79 - Oct-18-2017 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. RE: What does ''''true ....'''' mean??? - sparkz_alot - Oct-18-2017 Is this a Python or bash script? RE: What does ''''true ....'''' mean??? - wuming79 - Oct-18-2017 I thought it's python? The file is named as pox.py. RE: What does ''''true ....'''' mean??? - ichabod801 - Oct-18-2017 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 ("""). RE: What does ''''true ....'''' mean??? - wavic - Oct-18-2017 The file could be a Python code but inside """ ... """ string is bash. RE: What does ''''true ....'''' mean??? - Larz60+ - Oct-18-2017 I'd be weary of any script named 'pox' RE: What does ''''true ....'''' mean??? - wuming79 - Oct-20-2017 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? RE: What does ''''true ....'''' mean??? - ichabod801 - Oct-20-2017 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. RE: What does ''''true ....'''' mean??? - Skaperen - Oct-20-2017 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. |