Is Installing Manim possible?
You would need to start with https://github.com/ywangd/stash/blob/master/README.md and once that is installed, launch it and use pip there. Avoid installing anything that is already available in Pythonista (like argparse, numpy, scipy, etc.). I doubt that some dependencies of Manim esp. opencv-python, pycairo will work on Pythonista but perhaps they are not vital to the functionality that you need. Pyto has OpenCV so perhaps you will get further with that iOS implementation of Python.
Importing from dynamic library written in C
@sulcud on second thought, I'm not sure what prevents one from re-signing the ipa file with their own provisioning profile, and reinstalling. See also here which has a lot more info, and a script to do the work for you.
It appears that this allows you to update the entitlements plist, and update code signature to match whatever c libraries you are making.
Presumably this means the "new" app gets a different name, and you then have to sideload it.
It would be super interesting to hear if this works -- it might raise the possibility for people with XCode to integrate their own custom compiled dynamic libraries and call them from pythonista (scipy/pandas?)
Pythonista does not support scipy. It does have numpy, which has fft -- you might look up algorithms for the cwt that are based on fft, and roll your own.
Alternatively, sagemath does support scipy. Mateo has a wrench script that takes some code, and runs it on sagecell (cloud sage server). See
Hi, I am looking for CWT lib. ( Continuous Wavelet Transform). When we use normal Python, we can use Scipy lib. In those, there is a CWT function.But, if we use Pythonista, the Scipy cannot be installed. I would like to know, if have we other idea?
Possible to run Psychopy scripts?
Looking at setup.py:
install_requires = requests[security] numpy scipy matplotlib pandas pillow pyglet pyopengl soundfile sounddevice python-bidi arabic_reshaper cffi future json_tricks pyosf xlrd openpyxl pyserial pyyaml gevent msgpack-numpy msgpack-python psutil tables pyzmq moviepy opencv-python python-gitlab gitpython astunparse esprima freetype-py # Platform-specific dependencies. imageio < 2.5; python_version < "3" imageio >= 2.5; python_version >= "3" imageio-ffmpeg; python_version >= "3" pyparallel; platform_system == "Linux" pyWinhook; platform_system == "Windows" pyqmix >= 2018.12.13; platform_system == "Windows" pyqt5; python_version >= "3" wxPython != 4.0.2, != 4.0.3; platform_system != "Linux" pypiwin32; platform_system == "Windows" pyobjc-core; platform_system == "Darwin" pyobjc-framework-Quartz;
A good fraction of these are incompatible with pythonista. For instance scipy.
How to prevent commands execution in Pythonista console
@JonB and @dgelessus, thank you for reply, yes my ultimate target is to write something (I don't know if I will have something working) for the Pythonista console able to send strings to sagemathcell server instead of execute them with internal python interpreter and to post-process the output in order to print the output from sage as string in the console (as described in my first example above).
Example of possible usage:
- user enables the by-pass of internal interpreter with the execution of a specific script A as a wrench script
- in this way the return key, when touched on the keyboard, doesn't call the internal python interpreter but reads the full string (the command written by user) and sends it to sage with all required arguments, waits for output and prints any output (output, warnings, errors, etc...) as string with images if existing.
- user can decide if evaluate the output in order to convert it as a number, array, etc...
- when user wants to return to use internal interpreter, a second script B should be executed always through the wrench menu (or the @JonB's StatusBarOverlay.py).
Like the following command in Pythonista console (as example):
>>> minimize(fun,x0,...) ## from scipy.optimize
and the touch of the return key should send the string "minimize(fun,x0,...)" to server with all explicit arguments (fun, X0, args, method, etc...) after entering in the cell string the string "from scipy.optimize import minimize" for proper importing of the required module.
I asked about the existence of some objc commands to by-pass internal interpreter when user touches the return key after inserting the command in the console. Other option is to be able to install in Pythonista some specific library like fire, for example (but it seems to me not pure python, even if GitHub says it is 100% python: I tried to install it in Pythonista but it doesn't work).
Other option is to program a user key with @JonB StatusBarOverlay.py, it is what I will do. So (I hope) I will have a user defined key in upper status bar that simulates the return key of the built-in keyboard but with a specific pre-processing and post-processing action.
But I still have the curiosity to know if with Pythonista (and its several surprises) user can customize the effect of the return key touching in console environment.
Thank you for numerous tips and explanations.
Analyser and R for IOS
It had been answered many times -- @omz has said he had no plans to implement scipy or pandas in the near future:
There are more that I remember. The basic gist is that he has never said it will absolutely never happen, but also said he is not planning it in the near term, or commit to a date because it may or may not work out.
If I needed to use scipy/pandas on my iPad today, I would be using sagecell to run my work in the cloud. Not quite as convienent, but the wrench script works and makes it somewhat transparent. Any other promises or intentions are not going to help you today, and whining about it won't get it implemented sooner.
How to load '*.mat' file?
Can I load mat file(matlab matrix file extension)?
Usually people use scipy module, but scipy cannot use Pythonista 3, right?
so, I just wonder there is any other option for loading mat file.
Calling all gurus
Hi @reticulated, I'm quite sure omz is still working on Pythonista because I think it's tremendous (and not very smart) that such an application is abandoned. We should know that he knows this fact (I know he knows this fact).
I'm happy when people help people with ideas, codes, examples, informations.
You are talking about things too advanced for me, but I'm sure you are talking in order to give Pythonista more power.
The nice and curious thing is to understand how to give more power to Pythonista without pretending that is omz to give it (that is without need to compile entire Pythonista for new releases).
The best thing in my opinion is to give omz maximum freedom to decide when to give us new releases of his great app, and in the meantime people could continue to give more power to Pythonista, maybe with plug-ins development.
- to extend functions of code editor with find/replace, reformat, code folding... with one click
- to extend functions of file browser with find/replace for files and folders and content (with regex), zip compression, full properties on files and folders (size, last edited data, if file is editable or not, so I'd like to block some files or folder by editing them, ... )
- to extend functions to link Pythonista to any computer for comfortable development of Pythonista/Python scripts using big pc keyboard (my iphone is little and to use WebIDE) we need a wifi shared, not always available, but maybe with bluetooth could be possible using only pure python libraries or scripts,
- to extend a possible free remote connection service/interface if you want to make calculations that require not-pure python libraries not present in Pythonista (scipy, pandas, etc..) and with a full and complete integration with the app environment (example: my script, to run, needs some scipy functions, ok, I write it in Pythonista and I execute the entire script with Pythonista interpreter, and only the code that requires scipy is executed by the server with full working input-output capabilities),
- to extend internal site-packages folder in order to be able to delete not used pure-python libraries, since we can reinstall them with pip (using StaSH for example).
Installing matplotlib-venn issues
@twotoed Hi, do not be discouraged, Pythonista is great, it is maintained by one person and for this reason can't be compared to a PC python environment (don't forgive the limits imposed by Apple about a lot of things...).
Anyway, as @dgelessus and @JonB suggested, a good way is to install in Pythonista the library you need, if it is impossible download and extract it in Pythonista site-package folder. Then find, inside the installed lib you want to use, all names of libraries not installable in Pythonista, like scipy, and comment them: you must find alternatives (in most cases you need to search internet for numerical recipes or for pure-python libs).
I know, in python world I'm also frustrated when I must download a big python lib even if I use only 3% of all features available in that lib.
About the lib matplotlib-venn, the only scipy request is, as @JonB pointed, a numerical root solver that is brentq, that you can replace with a similar one Pythonista has in built-in mpmath lib.
A solution using function findroot that you find in mpmath lib (already implemented in Pythonista) is:
- open _math.py in main folder of matplotlib-venn
- comment the scipy importing and adding in place of it: from mpmath import *
- where you find the command:
return brentq(lambda x: circle_intersection_area(r, R, x) - a, R - r, R + r)modify it by writing
return findroot(lambda x: circle_intersection_area(r, R, x) - a, R)where R is the average between 'R-r' and 'R+r' of the brentq function.
- save _math.py
Now you should be able to run the folowing test example that I found in Stackoverflow:
import matplotlib.pyplot as plt from matplotlib_venn import venn3, venn3_circles v = venn3(subsets=(1,1,0,1,0,0,0)) v.get_label_by_id('100').set_text('First') v.get_label_by_id('010').set_text('Second') v.get_label_by_id('001').set_text('Third') plt.title("Not a Venn diagram") plt.show()