Author Topic: including .bat in python script  (Read 654 times)

0 Members and 1 Guest are viewing this topic.

Offline shimomura

  • Peasant
  • *
  • Posts: 57
  • Cookies: 0
    • View Profile
    • Shanaynay
including .bat in python script
« on: March 10, 2014, 07:17:08 pm »
Playing around with Tkinter and Subprocess modules in Python. Created a button that when pressed, runs a .bat file. First question is how I go about packaging my program as an installation? Ex) Installs the created python program and drops the .bat in a folder where the program can find it. Any link to documentation on this kind of stuff would be awesome.
Who gives a fuck what color the dress is...

Offline M1lak0

  • Peasant
  • *
  • Posts: 129
  • Cookies: 10
    • View Profile
Re: including .bat in python script
« Reply #1 on: March 10, 2014, 07:21:44 pm »
If this is possible then we can create a multi platform application! :D
wow..
"Security is just an illusion"

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: including .bat in python script
« Reply #2 on: March 10, 2014, 07:34:51 pm »
Never used it, but heard it's great: http://www.py2exe.org/

Offline shimomura

  • Peasant
  • *
  • Posts: 57
  • Cookies: 0
    • View Profile
    • Shanaynay
Re: including .bat in python script
« Reply #3 on: March 10, 2014, 11:16:31 pm »
Thanks guys. Just used it to pack the files up. The only pain in the ass is bundling Microsoft's runtime DLLs but besides that the module is beautiful.
Who gives a fuck what color the dress is...

Offline shimomura

  • Peasant
  • *
  • Posts: 57
  • Cookies: 0
    • View Profile
    • Shanaynay
Re: including .bat in python script
« Reply #4 on: March 13, 2014, 06:16:04 am »
In order to pack the files as a distributable folder:
    -Download py2exe from http://www.py2exe.org/
    -Create setup script by importing py2exe and write the proper script.
    -Run the script which will pack the files into a "dist" folder minus Microsoft's runtime files.


The dlls are included in most VB installs as well as with python but if the intended user doesn't have these files the program will obviously with throw a code.


The py2exe website outlines all of this in a more detailed fashion under the tutorial section in the top nav.
Who gives a fuck what color the dress is...