This file contains hidden or 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 sys,os | |
import curses | |
def draw_menu(stdscr): | |
k = 0 | |
cursor_x = 0 | |
cursor_y = 0 | |
# Clear and refresh the screen for a blank canvas | |
stdscr.clear() |
This file contains hidden or 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
def run_command(cmd_to_run): | |
""" | |
Wrapper around subprocess that pipes the stderr and stdout from `cmd_to_run` | |
to temporary files. Using the temporary files gets around subprocess.PIPE's | |
issues with handling large buffers. | |
Note: this command will block the python process until `cmd_to_run` has completed. | |
Returns a tuple, containing the stderr and stdout as strings. | |
""" |
This file contains hidden or 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 the os module, for the os.walk function | |
import os | |
# Set the directory you want to start from | |
rootDir = '.' | |
for dirName, subdirList, fileList in os.walk(rootDir): | |
print('Found directory: %s' % dirName) | |
for fname in fileList: | |
print('\t%s' % fname) |