• Strassboom

    @JonB I love you! Deleting asyncio from site-packages solved my problem with no side effects so far, and I’ve had to change nothing about the file that works on my laptop to run it on my phone (though I forgot if there are any libraries I needed to install between the two systems besides ‘pip install discord’ and ‘pip install pychal’

    I’ll try to reset my Pythonista app in the future and make a guide for this kind of stuff once I get the free time but until then, you’ve helped free up a new world of Pythonista programming capabilities for me!

    🙏 😆 🖥📲💯!

    posted in Pythonista read more
  • Strassboom

    @mikael thank you for tagging it here but alas, I could not find anything anywhere (even there) while scraping the web since I encountered this issue 5 days ago 😅.

    posted in Pythonista read more
  • Strassboom

    My discord bot will not run on Pythonista, while the exact same code runs fine on my PC. It says I need a coroutine or future and while the type of on_ready() is class coroutine and I’ve decorated it with @asyncio.coroutine and added async to the function def, it won’t work and I still get a TypeError.

    I couldn’t care less if my Token shows up, it’s useless if I can’t get the code to run. I’m going off of good faith here so let me know if any of you nerds can figure out what’s wrong ❤️🙏😁!
    If you need to see any of the actual code in the file, please specify and I’ll post!
    Thanks in advance!

    Traceback (most recent call last):
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/Programming Practice Files/Bots/challongebots/PCSuccessfulTourney.py", line 148, in <module>
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/discord/client.py", line 519, in run
    self.loop.run_until_complete(self.start(*args, **kwargs))
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/asyncio/base_events.py", line 316, in run_until_complete
    return future.result()
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/asyncio/futures.py", line 275, in result
    raise self._exception
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/asyncio/tasks.py", line 238, in _step
    result = next(coro)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/discord/client.py", line 490, in start
    yield from self.login(*args, **kwargs)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/discord/client.py", line 416, in login
    yield from getattr(self, 'login' + str(n))(*args, **kwargs)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/discord/client.py", line 346, in _login_1
    data = yield from self.http.static_login(token, bot=is_bot)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/discord/http.py", line 258, in static_login
    data = yield from self.request(Route('GET', '/users/@me'))
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/discord/http.py", line 137, in request
    r = yield from self.session.request(method, url, **kwargs)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/aiohttp/client.py", line 366, in _request
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/aiohttp/connector.py", line 445, in connect
    proto = await self._create_connection(req, traces, timeout)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/aiohttp/connector.py", line 757, in _create_connection
    req, traces, timeout)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/aiohttp/connector.py", line 843, in _create_direct_connection
    traces=traces), loop=self._loop)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/asyncio/tasks.py", line 643, in shield
    inner = async(arg, loop=loop)
    File "/private/var/mobile/Containers/Shared/AppGroup/F593CC7F-EBE7-4157-91D6-DF1EBDABA21A/Pythonista3/Documents/site-packages-3/asyncio/tasks.py", line 516, in async
    raise TypeError('A Future or coroutine is required')
    TypeError: A Future or coroutine is required

    posted in Pythonista read more
  • Strassboom

    @ccc I’m trying to work with coroutines and asyncio and would like the comfortability of the asyncio.run() function, as I cannot get my bot to run due to a how much I’ve failed at figuring out why a ‘class coroutine’ type object called main() is not a coroutine object.

    posted in Pythonista read more
  • Strassboom

    I am trying to figure out how to set the local time zone in pythonista. Whether it is just for the duration of a program’s runtime or if it’s for until I change it again for another reason, a solution to handle either would be greatly appreciated.

    posted in Pythonista read more
  • Strassboom

    @JonB it works perfectly! Thank you!

    posted in Pythonista read more
  • Strassboom

    @JonB thank you! I actually ended up spending an hour just finding the bounds of the buttons I made manually and then having the update method check the touch’s location against the bounds of the buttons in a 4 part if-elif-else block. Thank you for the solution earlier, it helped immensely! I will test this one as well tonight/tomorrow and get back to you on my results!

    posted in Pythonista read more
  • Strassboom

    @JonB thank you for the swift response. I’ve been trying to figure out the box for the last hour or so. Any advice on bboxes? So far all attempts of the classic “< x < “ tuple comparison don’t work, as it’s giving me an error about how a dict values object does not support indexing, even though it displays as a tuple.

    posted in Pythonista read more
  • Strassboom

    Hello all!
    I’m looking for a way to have a push button action be performed repeatedly until a button is released. I’m making a game where the player character will move by pressing buttons, and would like them to move continuously in a direction according button they’re pressing I.e. pressing the left button will make the character move left until it is released, or pressing the right button will make the character move right until it is released. I’ve followed these forums since fall 2016 since I’ve been unable to find any questions like this or pythonista games that implement this feature, I’ve finally made an account.

    Methods attempted:
    Looping touch_began and touch_ended functions for the scene module, with the exit condition being whether a stack containing the most recent touch action was a press or release.

    Integrating these conditions into the update function.

    Using a SceneView. However upon finding the delegates for the uiButton, I realised there are no delegate functions besides button_tapped.

    Much thanks!

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!