title: Packing custom .py files into .exe
body: <p>I've made a little project that includes importing various python files into another python files. Here's my directory structure.</p>
  
  <pre><code>Main_Folder
  |_ my_main_file.py
  |_ Sites (a directory inside Main_Folder)
    |_ __init__.py
    |_ some_other.py
  </code></pre>
  
  <p>This is basically my directory structure. This <code>some_other.py</code> is imported inside my <code>my_main_file.py</code> by the following command :</p>
  
  <p><code>from Sites import *</code></p>
  
  <p>I'm importing everything from that directory. So, what I wanted to do was make this whole project into a <strong>standalone binary</strong>. I use pyintaller to convert my <code>.py</code> files into <code>.exe</code>. But, I've only written scripts that have everything in 1 file, which makes the task easy. But, this time, I'm trying to do something new.</p>
  
  <p>My python script takes command line arguments and it is working. The python script will not work without command line arguments. I can convert to exe, but that exe is doing nothing even when I give arguments.</p>
  
  <p>So, I got a <code>.spec</code> file from pyinstaller and modified it to get my <code>some_other.py</code> file. SPEC file looks like this :</p>
  
  <pre><code># -*- mode: python -*-
  
  block_cipher = None
  
  
  a = Analysis(['my_main_file.py'],
               pathex=['C:\\Users\\User Name\\Main_Folder'],
               binaries=None,
               datas=[('Sites/*.py','Sites')],
               hiddenimports=[],
               hookspath=[],
               runtime_hooks=[],
               excludes=[],
               win_no_prefer_redirects=False,
               win_private_assemblies=False,
               cipher=block_cipher)
  pyz = PYZ(a.pure, a.zipped_data,
               cipher=block_cipher)
  exe = EXE(pyz,
            a.scripts,
            a.binaries,
            a.zipfiles,
            a.datas,
            name='my_main_file',
            debug=False,
            strip=False,
            upx=True,
            console=True )
  </code></pre>
  
  <p>This makes an <code>.exe</code>, but that exe won't work.The exe won't show anything. But, it is like 11 MB in size. Got anything for this?
  I tried <code>nuitka</code>, but that one gives out an error about not being able to find <code>gendef.exe</code> and I'm not really interested in installing minGW.</p>
  
  <p>Btw, I'm on a 64 bit machine and py2exe's <code>bundle_file:1</code> won't work for me.</p>