I'm trying to write a python script which will run when Maya loads. The script should check a number stored in the file somewhere, possibly just a names object, and compare it to the latest revision of the file in perforce. 
if the number stored in maya is not the latest revision, it should show a warning. is this possible?
To ask if the contents of your file on your workstation matches the content of the current head revision of the file on the server, you can do something like 'p4 diff -f //depot/path/to/file#head'.
get the revision number of a specific file in perforce from a python script