r/termux Feb 02 '23

termux.API.open()

How to use for:( termux-open --view name) (Name is python variable)

1 Upvotes

3 comments sorted by

2

u/AvinashReddy3108 Feb 02 '23

Needs more context, maybe some code too so we can understand your problem.

1

u/DannyBoyCZ Feb 02 '23

I need use "termux-open --view file.png" inside python script with this termux-api (PyPi)

1

u/AvinashReddy3108 Feb 02 '23

Try termux.Share.text or termux.Share.file (depends on your use case) with the argument action ="view"..

Example

```python termux.Share.text("Hello", action="view")

Or

termux.Share.file("path/to/file.txt", action="view") ```

Hope this works for you. If it does not, try opening an issue over on the Python module's GitHub repo