Skip to main content

Reply to "Python code to issue TMCC, Legacy, and PDI Commands"

I've added extensive online help to PyTrain. Here are some examples:

(legacyEnv) davids@Sprucewood-iMac PyLegacy (master) % src/cli/pytrain.py
Sending commands directly to Lionel LCS Ser2...
Listening for client connections on port 5110...
PyTrain, Ver 0.1
>> ?
usage: [h] [accessory | effects | engine | halt | lighting | route | switch | quit]

Valid commands:

options:
h, help show this help message and exit
accessory Issue accessory commands
effects Issue engine or train effects commands
engine Issue engine or train commands
halt Emergency stop
lighting Issue engine or train lighting effects commands
route Fire defined routes
switch Throw switches
quit Quit PyTrain

Commands can be abbreviated, so long as they are unique; e.g., 'en', or 'eng' are the same as typing 'engine'.
Help on a specific command is also available by typing the command name (or abbreviation), followed by '-h',
e.g., 'sw -h'
>> św -h
usage: Fire specified switch (1 - 99) [-h] [-t|-o|-a] Switch Number

positional arguments:
Switch Number switch to throw

options:
-h, --help shows this help message
-t, --through Throw Through
-o, --out Throw Out
-a, --set_address Set switch address
>>


  -- Dave

×
×
×
×
×