473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

unable to import os

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]

Oct 7 '05 #1
1 3233
"ktxn1020" wrote:
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?
that means that the python path is messed up, so Python cannot
find it's support libraries (usually found under c:/python24/Lib).

I have no idea what "Python for Delphi 3.16" is, so things may be
different for that distribution (if that's what it is).

adding

import sys
print sys.path

and comparing that to the actual file structure may help you figure
out what's going on.
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]


fwiw, that's usually spelled os.path.getmtime in contemporary python.

if you cannot import os, you can use

mtime = nt.stat("q.py")[8]

but it's probably better to fix the path issue; Python doesn't work well
without the support library.

</F>

Oct 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: StephenRichter | last post by:
I have installed the trial of db2 enterprise server on my w2k PC. Have also installed fix pack 8 of that product. I am using it to connect from an asp.net web page to an IBM as400. the 400 is...
0
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import...
2
by: Carmit | last post by:
Hi, I'm trying to build a proxy for this webservice: http://webservices.sabre.com/wsdl/sabreXML1.0.00/tpf/EndTransactionLLSRQ.wsdl I'm getting the following error: Error: Unable to import...
0
by: kent.anderson | last post by:
I am getting the following error when attempting to generate C# proxy code with the wsdl.exe tool: Error: Unable to import binding 'XtractSoapBinding' from namespace 'http://xtrac...
1
by: kent.anderson | last post by:
I am getting the following error when attempting to generate C# proxy code with the wsdl.exe tool: Error: Unable to import binding '...' from namespace '...'. - Unable to import operation '...'....
0
by: brian.mills | last post by:
I'm having trouble with a web service I've been using since I've change computers. The project was in source safe, and i've pulled it out, but I can now not change beetween static and dynamic on a...
0
by: John Jenkins | last post by:
Hi, any help on this would be greatly apprciated. I have been given a wsdl file from a customer generated by Oracle 10g Web Services tools. When I use wsdl.exe to attempt to produce proxy classes I...
2
by: Michael | last post by:
Running DB2 v7 UDB ("DB2 v7.1.0.93", "n031208" and "WR21333") on Windows XP, I am unable to find out why the "Build for Debug" option within Stored Procedure Builder is not enabled on Java stored...
5
by: funkybrown | last post by:
When adding a Web Reference to a new project before I even add any code to test the service I thought i would build the project to see if it would complie and following error occured: Custom...
0
by: berkcansiz | last post by:
Hello All, I am trying to use a web service hosted at ajax 1.3. Ehen I try to add this web reference into my project(.NET) I got an error saying; Error 9 Custom tool error: Unable to import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.