File: __init__.py

package info (click to toggle)
psychtoolbox-3 3.0.15.20190207.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,848 kB
  • sloc: ansic: 174,133; cpp: 11,232; objc: 4,832; sh: 1,874; python: 1,047; php: 384; makefile: 189; java: 113
file content (25 lines) | stat: -rw-r--r-- 997 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# __init__.py
#
# Import Psychtoolbox-3 "mex files" for use in Python and make them available
# under the same names and syntax as people are used to from Octave and Matlab.
#
# Usage in Python script/module:
#
#           from psychtoolbox import *
#
# Copyright (c) 2018 Mario Kleiner. Licensed under MIT license.
#

# Import all PTB modules already ported to Python extension modules:
from . import WaitSecs, GetSecs, PsychPortAudio, PsychHID, IOPort

# Extract their "main" function, which is named just like the module,
# and assign its function handle to a variable named just like the module.
# This will cause the function handles to shadow the original module, so
# now the module can be called with (almost) identical syntax as one is
# used to from Octave or Matlab:
WaitSecs = getattr(WaitSecs, 'WaitSecs');
GetSecs = getattr(GetSecs, 'GetSecs');
PsychPortAudio = getattr(PsychPortAudio, 'PsychPortAudio');
PsychHID = getattr(PsychHID, 'PsychHID');
IOPort = getattr(IOPort, 'IOPort');