0

I'm facing error

[Errno 22] invalid mode('U') or filename:' ' while creating exe file using cx_

Freeze in Python. my code includes some vbs file which are actually require to interact with Windows features. Those .vbs files are located in same location.

I'm new to this Python. Maybe some silly mistake

Please any help will be really appreciable.

Below is the part of the code. All imports are taken care already.

if s1 == "xx" or s1 == "yy":
    os.system("response.vbs")
else:
    os.system("no.vbs")

Sorry cannot post the overall code.

Jaap
  • 81,064
  • 34
  • 182
  • 193
  • 1
    Could you post the code in which you try and open a file? – tinfoilboy Jan 01 '17 at 07:33
  • 1
    It seems to me that in one of those VBS files loads a file incorrectly. Either that, or the `os.system` call is not loading the VBS file correctly. That is too little code in my mind to diagnose the problem at hand, as with just that tiny snippet there could be a number of issues that aren't seen. – tinfoilboy Jan 01 '17 at 07:50
  • but this file works totally OK with Pycharm IDE – Shivam Sharma Jan 01 '17 at 08:15
  • And the VBS file is also working. Is there any way we can run vbs script inside Python? – Shivam Sharma Jan 01 '17 at 08:18

1 Answers1

0

Well Problem get solved. This was first time I was using cx_freez. If we don't mention the fields under setup this error occurs.

setup( name = "THIS CANNOT BE BLANK", version = "0.1", description = "trigger", executables = [Executable("THIS CANNOT BE BLANK")], )

Thank you Tinfoilboy for your responses.

Silly me :(