Mercurial Hosting > traffic-intelligence
view python/tests/storage.txt @ 619:dc2d0a0d7fe1
merged code from Mohamed Gomaa Mohamed for the use of points of interests in mation pattern learning and motion prediction (TRB 2015)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 10 Dec 2014 15:27:08 -0500 |
parents | 36605d843be5 |
children | ef6dd60be2e1 |
line wrap: on
line source
>>> from storage import * >>> from StringIO import StringIO >>> f = openCheck('non_existant_file.txt') File non_existant_file.txt could not be opened. >>> nonexistentFilename = "nonexistent" >>> loadPrototypeMatchIndexesFromSqlite(nonexistentFilename) DB Error: no such table: prototypes [] >>> loadTrajectoriesFromSqlite(nonexistentFilename, 'feature') DB Error: no such table: positions DB Error: no such table: velocities [] >>> from os import remove >>> remove(nonexistentFilename) >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') >>> readline(strio) 'sadlkfjsdlakjf' >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') >>> readline(strio, ['#']) 'sadlkfjsdlakjf' >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') >>> readline(strio, ['%']) '# asdlfjasdlkj0' >>> strio = StringIO('# asdlfjasdlkj0\nsadlkfjsdlakjf') >>> readline(strio, '%*$') '# asdlfjasdlkj0' >>> readline(strio, '%#') 'sadlkfjsdlakjf'