quarry
quarry copied to clipboard
The skeleton client from readthedocs does not work for me
I copied the code from readthedocs (changed few things, but that should not be the problem), but it does not work. When I try to join server with it, it does not show up on the server's side, even for a second.
Here is the code:
from twisted.internet import defer, reactor from quarry.net.client import ClientFactory, ClientProtocol from quarry.net.auth import OfflineProfile
class ExampleClientProtocol(ClientProtocol): pass
class ExampleClientFactory(ClientFactory): protocol = ExampleClientProtocol
@defer.inlineCallbacks def main(): print("logging in...") profile = OfflineProfile("Walper") factory = ExampleClientFactory(profile) print("connecting...") factory = yield factory.connect("serverIP(should not be the problem too)", 25565) print("connected!")
if name == "main": main() reactor.run()
What is variable name
at line -3?
At a minimum, you should write if __name__ == "__main__":
, otherwise the code will not even start running
Do you have any errors?
What is variable
name
at line -3? At a minimum, you should writeif __name__ == "__main__":
, otherwise the code will not even start running Do you have any errors?
When waiting __ , it makes the letters bold, and makes __ invisible. It accualy is name And main
What is variable
name
at line -3? At a minimum, you should writeif __name__ == "__main__":
, otherwise the code will not even start running Do you have any errors?When waiting __ , it makes the letters bold, and makes __ invisible. It accualy is name And main
If you want to write those name, use ` and write it inside them. Example:
`__main__`
Outputs:
__main__