Python Forum
What does ''''true ....'''' mean???
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What does ''''true ....'''' mean???
#1
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.
Reply
#2
Is this a Python or bash script?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
I thought it's python? The file is named as pox.py.
Reply
#4
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 (""").
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#5
The file could be a Python code but inside """ ... """ string is bash.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#6
I'd be weary of any script named 'pox'
Reply
#7
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?
Reply
#8
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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#9
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.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Returning True or False vs. True or None trevorkavanaugh 6 9,282 Apr-04-2019, 08:42 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020