擅长:python、mysql、java
<p>我可能错了,但你试过这个吗:</p>
<pre><code>def coord2index(hres, vres, hdiv, vdiv, x, y):
return hdiv + x + 1, (-1) * y + vdiv
</code></pre>
<p>你可以在<a href="http://docs.python.org/2/tutorial/controlflow.html#defining-functions" rel="nofollow">functions defining in python tutorial</a>上阅读更多内容</p>