Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: allow code execution without editing (2 ways) #945

merged 3 commits into from Aug 12, 2015


Copy link

@jeremygray jeremygray commented Aug 11, 2015

Idea: allow execution of code without the possibility of either the subject or experimenter inadvertently typing something that would end up in the script. See #943

  1. -x option: Use the PsychoPy app to invoke StandAlone python to execute a .py script passed as an argument.
  2. User pref: make Coder files read-only

Other use cases for -x option = programmatic invoking of python scripts using StandAlone's python (Craig Stark, users' list)

Use app to invoke StandAlone python to execute a .py script passed as an argument
- new Coder pref can help prevent accidental modification of .py files
- easier to use than command-line -x option
- syntax highlighting turned off (black / white only) when in read-only mode
- not feasible to do on a per-file basis (would need meta-data for each .py file), so use a user pref for all files
- easy to reverse: change the pref & reload the file
@jeremygray jeremygray changed the title ENH: new command line option -x ENH: allow code execution without editing (2 ways) Aug 11, 2015

This comment has been minimized.

Copy link

@peircej peircej commented on 9e32c34 Aug 12, 2015

This makes it fairly laborious to switch. Maybe we need a menu item as well. For ShowOutput window we have a preference for long-term use and a menu-item so we can switch without having to restart the app.

This comment has been minimized.

Copy link
Owner Author

@jeremygray jeremygray replied Aug 12, 2015

Its not terribly laborious. You don't need to restart the app to stop the read-only feature. You do need to close the .py script, change the pref, and re-open the .py script. I am thinking that this feature is mainly intended to be used on testing-room computers, where things should stay read-only basically all the time. I don't think a menu item is needed for this, but happy to add one if you want it.

peircej added a commit that referenced this pull request Aug 12, 2015
ENH: allow code execution without editing (2 ways)
@peircej peircej merged commit 554cfe2 into psychopy:master Aug 12, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage increased (+0.002%) to 50.379%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants