Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Nest more than two types of quotes [duplicate]

Is it possible to nest more than two types of quotation signs? I mean I know ' and " but what if i need more? Is this allowed:

subprocess.Popen('echo "var1+'hello!'+var2"', shell=True)
like image 334
aldorado Avatar asked Sep 04 '13 14:09

aldorado


1 Answers

Triple quotes work. You can use either ''' or """

subprocess.Popen('''echo "var1+'hello!'+var2"''', shell=True)
like image 127
Paco Avatar answered Nov 03 '22 19:11

Paco