擅长:python、mysql、java
<p>如果我理解您的要求,那么您希望能够在select周围使用引号,并且还可以对进程周围的单引号进行转义。在</p>
<p>尝试使用<a href="http://docs.python.org/tutorial/introduction.html#strings" rel="nofollow">triple quotes</a>:</p>
<pre><code>line=""" "select (select count(*) from v$session)/(select value from v$parameter where name = \'processes\')*100 Percent from dual" """
</code></pre>
<p>…打印:</p>
^{pr2}$