Created
July 22, 2011 16:42
-
-
Save skhaz/1099818 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import pyttsx | |
def main(): | |
engine = pyttsx.init() | |
for root, dirs, filenames in os.walk('.'): | |
for filename in filenames: | |
basename, extension = os.path.splitext(filename) | |
fullpath = os.path.abspath(os.path.join(root, filename)) | |
if extension in [".cpp", ".h", ".py"]: | |
fp = open(fullpath, 'r') | |
for line in fp.xreadlines(): | |
engine.say(line) | |
engine.runAndWait() | |
fp.close() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment