[Tutor] Need help with saving files to a specific folder...
Matthews James
cooler12001@yahoo.com
Fri, 23 Mar 2001 03:19:46 -0800 (PST)
I need help with saving a file to a specific folder
like this:
#######################################################
List = []
def save_list(numbers,filename):
out_file = open(filename,'w')
out_file.write(get_slip())
out_file.close()
def get_slip():
return '''
___________________________
%s %s
EMP # CAT IN OUT
%s %s %s %s
IN OUT
%s %s
------------------------------------------
''' % (Name, Date, Empnum, CAT, FIRSTIN, FIRSTOUT,
SECIN, SECOUT)
Name = raw_input("What is the employees name: ")
Date = raw_input("What is the Date: ")
Empnum = input("What is the Employees Number: ")
CAT = input("What is the CAT number: ")
FIRSTIN = raw_input("What time did (he, she) come in:
")
FIRSTOUT = raw_input("What time did (he, she) go on
break: ")
SECIN = raw_input("What time did (he, she) come in
from break: ")
SECOUT = raw_input("What time did (he, she) clock out
to go home: ")
print get_slip
filename = raw_input('What do you want to call the
file: ')
save_list(List,filename+'.txt')
######################################################
I am want to save the file to a folder called
Times so that my program will be organized instead
of clumped up all in one place.
This is the setup that i want:
MainFolder
program
dlls
SubFolder
saved files
I cant figure out how to do this
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/