1

When I run any script in QPython, it runs in a console then I get prompted "Press enter to exit", but I want to interact with my just-run script instead of exiting. Is there any configuration option to control this behavior?

Does it have anything to do with the <&& exit> option displayed at the top of the console?

4 Answers4

0

try the following code

Import os os.system("sh")

River
  • 206
  • 1
  • 4
  • When I try that, I don't see the results of my script. For example, if my script is: import os os.system("sh") test = 2; print(test) I just get a shell prompt $. If I remove the os.system call, I get the value 2 printed, before #[QPython] Press enter to exit – Tony Nordstrom Jul 11 '17 at 18:37
0

If you want to access the console, you could try to raise an exception.

ArthurQ
  • 118
  • 1
  • 8
0

You could add it to the default import path and than import it from the interactive shell

import sys
sys.path.append('/storage/emulated/0/qpython/scripts')
sys.path.append('/storage/emulated/0/qpython/projects')

when you are using qpython3 change it to projects3/scripts3.

than do:

import MyScript

or

from MyScript import MyClass
Jrester
  • 11
  • 3
0

I know it is a very old post, but I had the same problem:

You need to switch your keyboard to word based instead of character based. (Enter the three points- preferences-input method-word based) Then you receive a keyboard with an enter-sign.

Press enter and it exits.

Marcel Sonderegger
  • 772
  • 1
  • 8
  • 21