Post code and ask specific questions, read forum rules and/or pytony's signature.
Yes, show some effort. (Here you can click in my version of 'Daniweb for dummies' from my signature, if you wish)
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
import os # Not used
import sys # Not used.
import time # Not used.
import zipfile # hint from teacher to use this? Not used.
import fnmatch # hint from teacher to use this? Not used.
from logalert import log # ?? Python has not standard module called logalert
......................
def getPromptList():
# NO THE prompt list should be local and returned, like your task description said
#promptList is a list in the global scope that will contain the name of each file
#that the CSV file says to install
#global promptList
promptList = []
#------------------------------------------------------------------------------
#This looks at the first item in each of the lists in csvContents, and appends
#the fourth item (name of the files to be installed) to promptList if
#the first item in the list is 'add'
try:
for x in range(0,len(csvContents)):
if csvContents[x][0] == 'add':
promptList.append(csvContents[x][3] + '.vox')
# should we really return None?
return
except Exception as error:
log(logFile, 'An error has occurred getPromptList function: ' + str(error))
raise
def copyLiveToPrompt():
#This function will copy all of the appropriate files based on promptList returned #from getPromptList() function from livePromptDir directory to promptDir directory
try:
except Exception as error: ## indention error
log(logFile, 'An error has occurred in the copyLiveToPrompt function: ' + str(error))
raise
(Naming is not according to Python convention of small_with_underlines for variables and Capitalized_for_objects)
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
You must show effort, start by reading fnmatch documentation. And do not bump your thread with empty of meaning posts, please.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852