Author Topic: [Python] Run a Python script without Python  (Read 2462 times)

0 Members and 3 Guests are viewing this topic.

Offline Ragehottie

  • Knight
  • **
  • Posts: 313
  • Cookies: -9
  • Hack to learn, not learn to hack.
    • View Profile
[Python] Run a Python script without Python
« on: May 15, 2012, 02:18:47 am »
Hello. I would like someone to tell me how to run a python script without python installed on the computer. I don't care what it is, I just want it to run on windows. I am fine with it being an exe, but Py2Exe is bull shit.
Blog: rexmckinnon.tumblr.com

Offline F1.z3ro

  • Peasant
  • *
  • Posts: 108
  • Cookies: 1
    • View Profile
Re: [Python] Run a Python script without Python
« Reply #1 on: May 15, 2012, 04:17:51 am »
Have you tried Pyinstaller? 


You can create stand alone executables to use on computers without python installed.

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: [Python] Run a Python script without Python
« Reply #2 on: May 15, 2012, 04:36:00 am »
Py2Exe is the best method. The only reason you think it is bullshit is because you don't know how to use it, or it is too complicated for you to understand.


If Py2Exe is such bullshit, switch to a native language like VB.NET or C#.
>>>import this
-----------------------------

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: [Python] Run a Python script without Python
« Reply #3 on: May 15, 2012, 05:07:23 am »
You will also need to know a bit about distutils and how python packages everything.


Here is a link that might help a bit more.


And here is an example of the setup.py


Code: [Select]
from distutils.core import setup
import py2exe


setup = (version = "1.0",
              description = "My App",
              name = "Hello World",
              console = ["myapp.py"],
              options = {"py2exe" : {"bundle_files" : 1}})


Also, sometimes the compile process doesn't grab the DLL required, and you might need to include that with the distribution of your app. But then you get into the legality of shit and most all the DLLs required are proprietary, on the windows side anyway, and you could get into some serious shit if they find you just passing them around.


But as I said before, doing things in a native language is much better for coding, compiling, and legal reasons. If you insist on python, install the interpreter on the OS or learn a new language.
>>>import this
-----------------------------

Offline Lionofgod

  • Knight
  • **
  • Posts: 164
  • Cookies: 6
    • View Profile
Re: [Python] Run a Python script without Python
« Reply #4 on: May 15, 2012, 01:30:04 pm »
Portable python is also pretty cool, I use it at school.
It works well, comes with some built in handy modules like wxpython : D

Area_13org

  • Guest
Re: [Python] Run a Python script without Python
« Reply #5 on: May 20, 2012, 02:14:53 pm »
Have you tried Pyinstaller? 


You can create stand alone executables to use on computers without python installed.

Pyinstaller is no 'real' standalone executable. It's a self-extracting executable,that first extracts the files into the temp folder,and then runs the real executeable...

Offline F1.z3ro

  • Peasant
  • *
  • Posts: 108
  • Cookies: 1
    • View Profile
Re: [Python] Run a Python script without Python
« Reply #6 on: May 21, 2012, 05:00:25 am »
True, but if he doesn't want to use Py2exe or portable python...it's an option.     ;)

Offline centizen

  • Peasant
  • *
  • Posts: 70
  • Cookies: 8
  • Certified Evil Genius
    • View Profile
Re: [Python] Run a Python script without Python
« Reply #7 on: May 21, 2012, 06:19:23 pm »
There is no reason for him to not want to use py2exe other than being lazy. There is also no other easy way to make a single file executable that I know of which will include the python interpreter. Py2EXE can put everything in to one executable nice and easily, you just have to spend 15 minutes reading the documentation and experiment a bit.

Offline flowjob

  • Knight
  • **
  • Posts: 327
  • Cookies: 46
  • Pastafarian
    • View Profile
Re: [Python] Run a Python script without Python
« Reply #8 on: May 21, 2012, 06:39:27 pm »
It would be way more professionally to just compile the converted files to a self-extracting archieve with iexpress.exe ;)
But this works only if there's no folder created,as iexpress doesn't allow folders, but just files...
« Last Edit: May 21, 2012, 06:43:58 pm by Area_13 »
Quote
<phil> I'm gonna DDOS the washing machine with clothes packets.
<deviant_sheep> dont use too much soap or youll cause a bubble overflow