0

The code:

win32api.ShellExecute(0, "print", "D:/prints/2.pdf" , None,  ".",  0)

The above code is working fine under Django server. But it is not working under apache2.2

what to do please help.

Gopi Krishna
  • 108
  • 2
  • 16
  • Various failure modes. Step 1 is to do some debugging. You might need to learn how to do that. For a start ShellExecuteEx is needed for sane error checking. So to begin with, use that function and check for errors as described in the docs. – David Heffernan May 16 '15 at 09:32
  • i have written the code in try excpet block but still it is coming in try block but no error is displaying – Gopi Krishna May 16 '15 at 09:58
  • 1
    Don't guess at how errors are handled. Read the documentation. This is not a Python function. It won't throw exceptions. It's a Win32 function. Read the docs on MSDN. And don't use `ShellExecute` since it cannot report errors properly. Use `ShellExecuteEx`. – David Heffernan May 16 '15 at 10:03
  • I have just gone through it there it returned like "If the function succeeds, it returns a value greater than 32. If the function fails, it returns an error value that indicates the cause of the failure." . so now i am getting 42 the return value is greater than 32 means it is success , but i am not getting any print – Gopi Krishna May 16 '15 at 10:20
  • 1
    I still can't agree with you using ShellExecute. All the same, what's different about the execution environments? – David Heffernan May 16 '15 at 10:52
  • I am not much ware of these win32api, could you give me suggestion of how to excute the above command by uising ShellExecuteEx – Gopi Krishna May 16 '15 at 10:59
  • 1
    What's different about the execution environments? – David Heffernan May 17 '15 at 06:09

0 Answers0