: I have been working at python and have come across dificulties.
: I am ok with the very basics and I am using activestates 2.2.2 Python
: I want the time a file in a windows machine was last accessed and as yet have not accumplished it.
>>> from os import stat
>>> from time import ctime
>>> st = stat("c:\\autoexec.bat")
>>> last_access = st.st_atime
>>> print ctime(last_access)
Mon Mar 10 12:41:01 2003
: I have tried with the win32file module the getfiletime and type commands but they refer to PyHandle. What is and how does the PyHandle and associated stuff work? The help files just say what it is ot how to use it.
:
: Can you tell where an example of creating/finding/using PyHandle is or am I stupid and should just convert the output to denary from hex?
Unless you know the windows API well, I'd avoid using PyHandles. They are object wrappers around Win32 handles. Win32 uses handles for everything from devices to processes to windows to brushes, practically everything is represented by a 32 bit handle (long integer).
:
: I also want to mess with the cursor buttons and windows using the win32api win32gui stuff. I have been able to track the cursor - Hurrar
: with
:
: import win32api
: x = 1
: while x < 1000:
: x,y = win32api.GetCursorPos()
: print x,y
:
: but have failed misrabilly to Enum any windows to a list or even return the current handle of a window or set an active window.
: I tend to have to learn by example so anything on any of the above would be a great help.
Here's the first link I found. Might help a bit. I didn't check it out myself.
http://aspn.activestate.com/ASPN/Python/Reference/Products/ActivePython/PythonWin32Extensions/PythonWin32Extensions.html
I know very little about the windows api but if I find anything I'll post back here.
: Oh, one more thing.
: I want a very simple python prog to run on a number of machines.
: What is the minimum files to install manually to get this to happen
: Python.exe
: Python22.dll in the system32 dir is what I've gleaned so far...
: Once again thanks for any replies.
Why not just run the Python installer on each machine?
infidel