Open khaven opened 10 months ago
This code works well on normal compiler but doesn't work on android.
`import subprocess import traceback import sys
code = "import numpy as np\nprint(1/0)" # Example code with a division by zero error
python_executable = sys.executable # Get the path to the current Python interpreter
try: result = subprocess.run( [python_executable, "-c", code], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True, ) except subprocess.CalledProcessError as e: print(e.stderr)`
It shows "[Errno 13] Permission denied:"
subprocess
won't work on Android. Mobiles don't allow spawning new processes.
Is it possible to directly run a file and get it's stacktrace? I see a function "runProgram" is available but is it possible to get the stacktrace from it?
Working on that: https://github.com/flet-dev/flet/issues/2352 It's #1 priority right now.
Thank you! :)
Hi, I'm testing the new ^0.7.0 version. I'm trying to get the stacktrace from a file. This file was created runtime and not exists in asset. But i'm getting a message instead of a stacktrace. Is it supposed to work like that?
and if i put print("Hello")
in the file and no errors then it returning empty string. Am i doing something wrong here?
Hi, Is it possible to get full stacktrace of exception in python REPL flask example code. Right now the code is like this
`class PythonRunner: globals = {} locals = {}
I've managed to get the full stacktrace but is it possible to exclude the info about the main.py file in the stacktrace? I want the stacktrace to look like the code was run from a file on a command line.