Jump to content
Sign in to follow this  
Sanchez

[ Dead Download Link ] [HowTo] Use compiled Python files [ We Need You ]

Recommended Posts

Hi everyone,
 
In this thread I will show you how to use the compiled python files in the client. First of all we need to download Python 2.2 or 2.7

Let's start the tutorial:
 
1. Rename system.py to main.py or to anything you want, it doesn't matter.
2. Change these stuffs in main.py:
 
Search for this:

filename = name + '.py'

Replace with this:

filename = name + '.pyc'

Search for this:

newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name)

Replace with this:

newmodule = _process_result(marshal.loads(pack_file(filename,'rb').read()[8:]),name)

Search for this:

RunMainScript("prototype.py")

Replace with this:

RunMainScript("prototype.pyc")

3. Create a new file called system.py
4. Copy this to system.py:

import pack
import imp
import marshal
data = pack.Get('main.pyc')
if data == None:
    raise IOError, 'Error happened...'

if data[:4] != imp.get_magic():
    raise ImportError, 'Error happened...'

exec marshal.loads(data[8:])

5. Let's continue with the compiling. Download this file and put to the Python 2.2 or 2.7 folder. Create a new folder called files and put all .py files from the root and the main.py to the folder. Drop the downloaded Compiler.py to the python.exe and wait few seconds, now it will compile the files. After the compiling finished copy back the .pyc files to the root and delete the old .py files.
6. Copy the system.py to the root. (Example picture)
7. Pack the root.eix/epk

If you have any question or suggestion please just reply to this topic.

Kind Regards,
Sanchez

  • Love 18

Share this post


Link to post

Hi everyone,

 

In this thread I will show you how to use the compiled python files in the client. First of all we need to download Python 2.2 or 2.7

Let's start the tutorial:

 

1. Rename system.py to main.py or to anything you want, it doesn't matter.

2. Change these stuffs in main.py:

 

Search for this:

filename = name + '.py'

Replace with this:

filename = name + '.pyc'

Search for this:

newmodule = _process_result(compile(pack_file(filename,'r').read(),filename,'exec'),name)

Replace with this:

newmodule = _process_result(marshal.loads(pack_file(filename,'rb').read()[8:]),name)

Search for this:

RunMainScript("prototype.py")

Replace with this:

RunMainScript("prototype.pyc")

3. Create a new file called system.py

4. Copy this to system.py:

import pack
import imp
import marshal
data = pack.Get('main.pyc')
if data == None:
    raise IOError, 'Error happened...'

if data[:4] != imp.get_magic():
    raise ImportError, 'Error happened...'

exec marshal.loads(data[8:])

5. Let's continue with the compiling. Download this file and put to the Python 2.2 or 2.7 folder. Create a new folder called files and put all .py files from the root and the main.py to the folder. Drop the downloaded Compiler.py to the python.exe and wait few seconds, now it will compile the files. After the compiling finished copy back the .pyc files to the root and delete the old .py files.

6. Copy the system.py to the root. (Example picture)

7. Pack the root.eix/epk

If you have any question or suggestion please just reply to this topic.

Kind Regards,

Sanchez

Thanks, very useful ;)

Share this post


Link to post

Is it necessary to use the same version of python for compiling like the client supports? (My client uses python 2.2 and I used python 2.7 to compile. it failed with RunMain Error)

Share this post


Link to post

I have resolved the problems it works just fine.I changed but a little bit the tutorial and changed py to pyc to a python22 and python27 client.

This compile is more picky then the normal py i had cuple of errors in the folders that worked in normal.

Share this post


Link to post

5. Let's continue with the compiling. Download this < Link no Files

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.