unable to import os

2005-10-07 Thread ktxn1020
Hi Experts,

I built a scrip file which cleans up the old log files starting from
the oldest till the necessary free space on the drive reaches.

The script ran well independently using Python's Integrated
Development Environment version 2.4.1. When it is called from Borland
C++ Builder 5 with python for delphi version 3.16, it is complained at
the line "import os", but not at the line "import nt". How can
I resolve this?

I wonder if there is a built_in command in NT OS specific to get date
and time of a file. The following command is what I used in my script
mtime = os.stat(Path + file_name)[os.path.stat.ST_MTIME]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: unable to import os

2005-10-11 Thread ktxn1020
It works fine independently, but still not work when run with Python
for Delphi.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: unable to import os

2005-10-11 Thread ktxn1020
I had the following code run with Python for Delphi. It works.

while IsCDriveNotEnoughSpace():
  dirlist = nt.listdir(CPath)
  listsize = len(dirlist)
  if listsize > 2:
 file = dirlist[0]
 nt.remove(CPath + dirlist[0])
 PyLog(file + " in C:\logs has been deleted.")
  if listsize == 2:
  break

When I added the line "mtime = nt.stat(CPath+file)[8]", it failed.
Do you have any idea or suggestion?




ktxn1020 wrote:
> It works fine independently, but still not work when run with Python
> for Delphi.

-- 
http://mail.python.org/mailman/listinfo/python-list