• shtek

    very useful

    why not merged yet?

    it's utf8 everywhere, why stick to python 2

    posted in Pythonista read more
  • shtek

    perfect. thank you

    posted in Pythonista read more
  • shtek

    hi, I just tried stash on my old iPadPro

    I saw some toolbar icons on top of the keyboard.

    after I clicked that ‘H’ icon, it showed a history panel on right top corner screen.

    but then, I found no way to close this history panel,
    and anywhere else except this panel is unclickable,
    the only way to exit is double Home to kill this App.

    then I checked this on iPhone, I found there’s a close X icon in top left corner of the history panel, which I couldn’t find in iPad.

    known issue?

    posted in Pythonista read more
  • shtek

    a pythonista store to automatic set scripts into Today widget menu

    interested?

    http://tieba.baidu.com/pythonista

    some scripts are copied from here

    download: https://pan.baidu.com/s/1nxem0G4imARqrDQP_GPQLw
    password: 4aqs

    1

    2

    3

    posted in Pythonista read more
  • shtek

    @JonB said:

    in settings app, go to pythonista, and try enabling safemode.

    if that doesnt work, you can try typing pythonista:// into safari.

    barring that, try an uninstall/reinstall

    thank you. I didn't know that there's a safemode.

    before seeing this, I found that I can use this App from share extension console,
    and then I deleted last edited file, which contains only two lines:

    import contacts
    groups = contacts.get_all_groups()
    

    and then the App works again.

    the strange thing is that these lines are normal script lines.
    now I add back these two lines it still works.

    something very strange mush happened.

    posted in Pythonista read more
  • shtek

    hi, why this App always crash? and what should I do to make it run again?

    click this App, it crashed after a flash.

    again and again.

    double tap Home button and close the App, still same problem.

    tried reboot my iPhone, still same problem.

    what should I do?

    it's the latest version 3.2 in iPhone 7

    posted in Pythonista read more
  • shtek

    hi, I just copied your code, and it works properly after providing arguments.

    only that I can only "hit RETURN to continue",
    and I don't know how to press "CTRL-C" on iOS keyboard.

    posted in Pythonista read more
  • shtek

    ok, no need to figure out why now,

    I just deleted this App, and re-downloaded it.
    now it works. all those strange errors are gone.
    the simplest solution.

    although all scripts are lost, those're all for fun, nothing important.

    posted in Pythonista read more
  • shtek

    even a simple test.py with only one line:
    import appex

    still error: AttributeError module 'enum' has no attribute 'IntFlag'"

    posted in Pythonista read more
  • shtek

    all scripts. include those examples.

    if long press RUN button and select python 2.7, error is "TypeError super() takes at least 1argument (0 given)"
    if long press RUN button and select python 3.6, error is "AttributeError module 'enum' has no attribute 'IntFlag'"

    I know little about python. but those all examlpes all work in old version, but after update all failed. strange.

    posted in Pythonista read more
  • shtek

    why not keep compatibility?

    posted in Pythonista read more
  • shtek

    same as pc.

    posted in Pythonista read more
  • shtek

    maybe re replace \n if not \n before or after it
    http://codepad.org/AoDlfeVC
    [

    posted in Pythonista read more
  • shtek

    @zrzka I want to exit after it produce any output, and exit on demand. I know it's not the usual ios way, but why not, if I can? I'm sure I'm not the only one who wants to do so. search this forum and I found there're some posts talking about this.

    @cvp are you serious? nothing happened after that url opened. you have an App named 'crash'?

    oh I see, I don't have a launch App :(

    you see, there's a URL for crash, because someone needs it. I think that's os._exit also? I'm not going anywhere but my Home screen......

    posted in Pythonista read more
  • shtek

    thank you all

    @zrzka I'm thinking of adding script to 3D touch shortcut to quickly execute some task without remaining in the code App after task done.

    when I'm a code developer, I may want to execute a script and then go to code editor to check error or add features.

    after code is done, I just want to execute it and then leave, do not need to enter code editor again.

    posted in Pythonista read more
  • shtek

    hi

    force exit

    I'm looking for some method to force exit pythonista App and return to Home screen.

    It seems that there's no such method existed?

    yesterday I found that sometimes the App crashed and it suddenly exited and retuned to Home screen.

    since this crash always works as expected, maybe this's the method I'm looking for?

    but I wonder if this'd do any harm to my iPhone if I intentionally execute such code to force crash.?

    posted in Pythonista read more
  • shtek

    the sound needs to be part of the main bundle. You can use the names of sounds that come with pythonista, but not outside of the readonly Bundle/Application folder

    @JonB what does this mean?

    just tried this:

    import  notification
    notification.schedule(message='test', delay=5,sound_name='drums:Drums_15')
    

    always got a system default sound.

    is drums:Drums_15 in the readonly Bundle/Application folder?

    some webpage said need to hard reboot :
    http://www.ibtimes.sg/how-fix-ios-10-notifications-sound-alerts-sound-issue-whatsapp-others-3572

    tried but no effect

    posted in Pythonista read more
  • shtek

    edit readme on GH and forget to pull before push, my GH changes are lost

    tested on my git site, same problem.

    never thought this could happen. maybe sometimes this is useful ...... I don't need to delete the repo and rebuild it to change history :)

    posted in Pythonista read more
  • shtek

    just tried git push.
    first generate rsa key using ssh-keygen

    ,
    then add the generated pub key to my site,
    then push:

    [pythonistascripts]$ git push
    Attempting to push to: git@code.mysite.net:shtek/pythonistascripts.git, branch: refs/heads/master
    stash: <type 'exceptions.TypeError'>: expected a string or other character buffer object
    

    I don't know what this error means, but after I check the code site, I find that everything has been successfully pushed.

    so this is an ignorable error?

    posted in Pythonista read more
  • shtek

    invalid base64 encode.
    remove 'data:image/png;base64,' like this:

    data_uri  = base64.b64encode(buffer.getvalue()).decode('ascii')
    

    now it works
    sd

    s

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!