10 Replies - 2153 Views - Last Post: 12 March 2013 - 10:51 AM Rate Topic: -----

#1 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Run Python on a computer without python installed

Posted 11 March 2013 - 10:17 PM

I have recently seen an installer (I forgot what it was) that was just a batch file that called a python file (foo.py). I did not have python installed on my computer at the time, but the program ran fine. Did the program install python automatically? How does this work, and how can I do this?
I am sure it did not involve py2exe because the file called was something.py

This post has been edited by Limecore: 11 March 2013 - 10:17 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Run Python on a computer without python installed

#2 Takk  Icon User is offline

  • D.I.C Head

Reputation: 40
  • View blog
  • Posts: 111
  • Joined: 08-March 13

Re: Run Python on a computer without python installed

Posted 11 March 2013 - 11:12 PM

afaik Python is an interpreted language and needs python of some sort to make it run, if you can find the installer again, you can crack the batch file open and see what exactly its doing, but beyond interpreting python commands, I couldn't see this working. Feel free to correct me if you manage to turn up otherwise, just sounds like some trickery was involved.
Was This Post Helpful? 0
  • +
  • -

#3 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Run Python on a computer without python installed

Posted 11 March 2013 - 11:28 PM

I'll go look for it, but the batch file was only 1 or 2 lines long
Was This Post Helpful? 0
  • +
  • -

#4 Mekire  Icon User is offline

  • D.I.C Head

Reputation: 116
  • View blog
  • Posts: 212
  • Joined: 11-January 13

Re: Run Python on a computer without python installed

Posted 11 March 2013 - 11:30 PM

I have never used any myself, but there are supposedly ways to make usable python interpreters that require no installation out of thumb drives. Of course by extension if you could do it with a thumb drive there is no reason you couldn't also include it with a program. I would guess this is what is happening.

Check out Movable Python

-Mek
Was This Post Helpful? 0
  • +
  • -

#5 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Run Python on a computer without python installed

Posted 11 March 2013 - 11:37 PM

I found the batch file
@echo off
runtime\bin\python\python_mcp runtime\decompile.py %*
pause


Oh, an exe is included in runtime\bin\python\python_mcp, which is probably a custom version of python

I also found this in their documentation which is interesting

Quote

You need to install Python 2.7 on OSX and Linux to use this version. On Windows installing Python 2.7 is optional. If you have python 3.x installed it will not work, this will be fixed soon.
Feedback is appreciated.

This post has been edited by Limecore: 11 March 2013 - 11:38 PM

Was This Post Helpful? 0
  • +
  • -

#6 Takk  Icon User is offline

  • D.I.C Head

Reputation: 40
  • View blog
  • Posts: 111
  • Joined: 08-March 13

Re: Run Python on a computer without python installed

Posted 12 March 2013 - 12:53 AM

Mekire: Yeah, I did some researching after I posted earlier and found this too, it says they average around 150mb a piece, and I assume is just python on a thumbdrive without the file extensions installed on the system.

That almost makes sense given the packaged exe wouldn't run on either of those, however, definitely interesting that 3.0 wont run code designed for 2.7, but.. who am I to judge the python guys :)
Was This Post Helpful? 0
  • +
  • -

#7 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Run Python on a computer without python installed

Posted 12 March 2013 - 01:26 AM

View PostTakk, on 12 March 2013 - 05:53 PM, said:

Mekire: Yeah, I did some researching after I posted earlier and found this too, it says they average around 150mb a piece, and I assume is just python on a thumbdrive without the file extensions installed on the system.

That almost makes sense given the packaged exe wouldn't run on either of those, however, definitely interesting that 3.0 wont run code designed for 2.7, but.. who am I to judge the python guys :)/>

Yeah, python 3.0 changed some syntax from 2. I was learning python 2 at some stage earlier but I got distracted by java. Now that I'm coming back, I think I will just learn 3.0 instead of learning 2, and then having to learn 3 in a year or so
Was This Post Helpful? 0
  • +
  • -

#8 Mekire  Icon User is offline

  • D.I.C Head

Reputation: 116
  • View blog
  • Posts: 212
  • Joined: 11-January 13

Re: Run Python on a computer without python installed

Posted 12 March 2013 - 03:07 AM

Limecore said:

I think I will just learn 3.0 instead of learning 2, and then having to learn 3 in a year or so
Just so you know this philosophy won't get you very far. I started with the exact same philosophy about 3 years ago. The primary user base is still using 2.7 and tons of libraries still haven't even made cursory attempts to upgrade. Currently I try to write all my code so that it runs on both (which kind of defeats the point imo).

Anyway...

-Mek
Was This Post Helpful? 0
  • +
  • -

#9 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Run Python on a computer without python installed

Posted 12 March 2013 - 03:23 AM

Thanks for the advise. I'm learning python more for a hobby than work, and I prefer writing my own libraries when I can so I can find out how they work, and for the challenge, so this shouldn't be too much of a problem for me
Was This Post Helpful? 0
  • +
  • -

#10 Dietrich  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 02-March 13

Re: Run Python on a computer without python installed

Posted 12 March 2013 - 10:17 AM

I have used this myself, and it works well (needs Windows OS) ...
Portable Python installs a portable version of Python right on your USB flash drive (plan on 150MB for each version). You can use the flash drive now on Windows computers that do not have Python installed. It comes in Python27 and Python32 flavors. All come with the PyScripter IDE and some popular modules/packages. For the free download and info see:
http://www.portablep...n.com/releases/
Was This Post Helpful? 0
  • +
  • -

#11 Dietrich  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 02-March 13

Re: Run Python on a computer without python installed

Posted 12 March 2013 - 10:51 AM

python_mcp is associated with the Minecraft game
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1