• Strassboom

    Thanks to @tomkirn for providing the solution at this earlier question: https://forum.omz-software.com/topic/5835/crash-on-open

    If you wanna access the file contents again, in the same directory do:

    with open("{filename}.py","r") as r:
        oldcontent = r.readlines()
        with open("{otherfilename}.txt","w+") as f:

    To Ensure your editor doesn’t load it as a py file and crash, and also so that you may pick out the part of the file you believe is causing the crash to occur!

    posted in Pythonista read more
  • Strassboom

    I was decoding some base64 strings in Pythonista while in debug, when my app suddenly crashed. Now whenever I attempt to reopen the app, it tries to load this tab of code, and will crash before it recognizes any of my tapping to close said tab.

    All access to my code written within Pythonista is now cut off and neither swiping the app up in the multitasking view nor shutting down and turning on my iPhone has yielded any changes.
    My specs:

    iPhone 7
    iOS 13.1.2

    posted in Pythonista read more
  • 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

Internal error.

Oops! Looks like something went wrong!