Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Use python to torrent?
-
@briarfox The offending line was "from os import symlink". Does that work for you? If not, then it must mean that you are not running "from twisted.internet import protocol, reactor" which is part of an example on the twisted web site.
-
@ihf just ran the example without a simlink error. It worked. Ran the server, ran the client and received a response.
<pre>
Server said: hello, world!
connection lost
Connection lost - goodbye!
</pre> -
Interesting. So what happens if you just type
from os import symlink
If that works then there must be a difference between our Pythonista libraries. If that fails then I would expect twisted/python/lockfile.py to fail (you can also try running that). If that fails then I wonder how you are getting
from twisted.internet import protocol, reactor
to work?
From my reading of the code,it only executes the import of symlink if it thinks the running system is not windows, otherwise it defines symlink in the lockfile module.
I presume that if you type
platform.isWindows() it returns FALSE. -
@ihf Your right I can not import symlink but I have no issue importing twisted.python.lockfile.
-
I don't understand that since I get the ImportError when I import twisted.python.lockfile and you get it when you import symlink. Since that module does the import symlink why would it import correctly for you?
-
@ihf I do not see an import of symlink in twisted.python.lockfile.
-
line 24.
-
I think I see the reason for the discrepancy. I am running the latest version of Twisted v1.4.0. Based on your post above, you are running v1.3.0. Lockfile changed.
-
@ihf you are correct. Sorry that I didn't pick up on that sooner.
-
@mtello1700 Python is a versatile programming language that can be used to work with torrents, primarily through third-party libraries. There are libraries such as libtorrent and python-libtorrent that provide Python bindings for the popular BitTorrent client, allowing you to create custom torrent clients or automation scripts. These libraries enable you to download and upload torrent files, control torrent sessions, and manage various aspects of BitTorrent communication. While working with torrents in Python, it's essential to consider legal and ethical aspects and ensure that you are using torrents and torrent-related technology in a responsible and lawful manner, respecting copyright and intellectual property rights.