-
Notifications
You must be signed in to change notification settings - Fork 2
/
PiCW.py
executable file
·52 lines (45 loc) · 1016 Bytes
/
PiCW.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python3
# PiCW.py - Morse Code Keyer using GPIO of Raspberry Pi
#
# Yoshihiro Kawamata
# (kaw@on.rim.or.jp, ex JH0NUQ)
import os.path
import InputOutputPort as port
import PaddleKeyer as pdl
import CwUtilities as utl
import MemoryKeyer as mem
import ConsoleCommands as cmd
print("Welcome to PiCW.py")
print(" '?' for the short help.")
print(" <TAB> for command completion.")
# load initial configuration file
#
initfile=os.path.expanduser('~/.picwrc')
try:
if os.path.exists(initfile):
print()
cmd.load_file(initfile)
except:
pass
# command console
#
while True:
# read user's input
#
try:
line=input("\n"+utl.speedstr()+\
('/REC' if mem.recording else '')+\
':')
print()
except KeyboardInterrupt:
continue
except EOFError:
break
if not cmd.parser(line):
break
# termination processes
#
pdl.terminate()
port.terminate()
print()
print("Bye bye...")