• djl

    @JonB
    Thank you Jon. That worked when I entered the argv statement followed by:

    Package_name.module_name.main()
    

    I'm just learning how all of this fits together.

    posted in Pythonista read more
  • djl

    @cvp there is no script with the functionality of the module invoked in the stash command line. The is a module with sub modules, including init

    Without understanding the answer to my original question, I did discover a workaround. If I import a submodule from the main module, I can reproduce expected output by directly calling some of the included functions. I am just surprised that this is so different than simply invoking the main module in stash.

    posted in Pythonista read more
  • djl

    @cvp thank you for your help, but my original question dealt with the python console command line, not from within a script. If one runs the module itself using the long_press method, it starts the init script and added arguments do nothing. I am just trying to replicate what happens so easily in stash, in the normal Pythonista framework, and I'm not getting anywhere.

    posted in Pythonista read more
  • djl

    @bennr01

    I tried long press to run arguments in a script, and it didn't work. I don't see such an option when using the console command line. I checked python versions and also paths in the console and in stash -- they are the same.

    posted in Pythonista read more
  • djl

    I am trying to understand the use of modules in stash and on the python console. I have a module that runs perfectly in stash with a command like:

    Module_name -s d blabla
    

    "-s d blabla" are necessary arguments in this example . I cannot figure out how to do the same thing from the Pythonista console. I can import the module, but any way I try to add the arguments, I get the error:

    SyntaxError: invalid syntax
    

    posted in Pythonista read more
  • djl

    @frapython
    I also would like to update the preinstalled matplotlib module, but I don't understand how to use

    selfupdate -f dev
    

    If that works, can you be more specific?

    posted in Pythonista read more
  • djl

    I thought of a workaround which is superior for my purposes. Redirect the downloaded file to the console:

    curl "url" -H "X-API-Key: key-goes-here" > &3
    

    Where it can be copied and pasted to a new file. If can be then read like this:

    with open('outfile.json, 'r',encoding='UTF-8') as f:
    

    This has the real advantage of preserving all of the accented vowels, etc. in the rest of the data processing. It turns out the original file was indeed UTF-8, but could not be handled by the ASCII decoder.

    posted in Pythonista read more
  • djl

    I am trying to fetch a json document that has utf-16 accented vowels and convert it to utf-8 on the output file. I have a command line in the format:

    curl "url" -H "X-API-Key: key-goes-here" -o outfile.json
    

    I can't figure out where to add something like ' .encode(utf-8)' on the command line in order to convert to utf-8. Some say this kind of command line could solve the problem:

    curl URL | iconv -f iso8859-1 -t utf-8 > output.xml
    

    But stash curl does not accept iconv , -f, or -t arguments. Is there a way to make this work in stash?

    posted in Pythonista read more
  • djl

    @JonB
    Now everything is hunky-dory. Thanks for your help, Jon. I would have given up long ago.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!