# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
# open mailboxes
fc2s = open('C2SMBX:', 'w')
fs2c = open('S2CMBX:', 'r')
# write
fc2s.write('Hi from Python!\n')
fc2s.flush()
# read
while fs2c:
   msg = fs2c.readline().rstrip()
   if msg == '*':
       break
   print('|' + msg + '|')
# close mailboxes
fc2s.close()
fs2c.close()
