mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
enum helper
This commit is contained in:
20
python/examples/use_enum.py
Normal file
20
python/examples/use_enum.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Most settings are represented as enums that can be
|
||||
# explicitly imported
|
||||
|
||||
from slsdet import Detector, fileFormat
|
||||
d = Detector()
|
||||
d.fformat = fileFormat.BINARY
|
||||
|
||||
# Altough not recommended for convenience all enums
|
||||
# and some other things can be impored using *
|
||||
|
||||
from slsdet import *
|
||||
d.speed = speedLevel.FULL_SPEED
|
||||
|
||||
# To list the available enums, use dir()
|
||||
|
||||
import slsdet.enums
|
||||
for enum in dir(slsdet.enums):
|
||||
# filter out special memebers
|
||||
if not enum.startswith('_'):
|
||||
print(enum)
|
Reference in New Issue
Block a user