我一直在尝试为Upskirt制作 Python 扩展。我认为第一个 C 项目不会太难,因为有示例(Upskirt 代码中的示例程序和 Ruby 扩展)。
扩展有效,它转换了我扔给它的 Markdown,但有时输出在字符串末尾有一些垃圾。而且我不知道是什么原因造成的。
这是一些输出:
python test.py
<module 'pantyshot' from '/home/frank/Code/pantyshot/virtenv/lib/python2.7/site-packages/pantyshot.so'>
<built-in function render>
'<p>This <strong>is</strong> <em>a</em> <code>test</code>. <a href="http://example.com">Test</a>.</p>\n\x7f'
<p>This <strong>is</strong> <em>a</em> <code>test</code>. <a href="http://example.com">Test</a>.</p>
--------------------------------------------------------------------------------
'<p>This <strong>is</strong> <em>a</em> <code>test</code>. <a href="http://example.com">Test</a>.</p>\n\x7f'
<p>This <strong>is</strong> <em>a</em> <code>test</code>. <a href="http://example.com">Test</a>.</p>
--------------------------------------------------------------------------------
我的代码可以在我的 Github repo中找到。我称它为 pantyshot,因为当我听到超短裙时我想到了这个。奇怪的名字,我知道。
我希望有一个人可以帮助我。