#!/usr/bin/python3
# -*- coding: UTF-8 -*-

"""Extract a .blend file of a Windows executable (.exe)
Author:  Ricardo Silva Veloso (Ricvelozo)
Website: http://ricvelozo.blogspot.com/
"""

import os
import re
import sys

def extract_blend(executable_url):
    blend_dir, exe_name = os.path.split(executable_url)
    blend_name = exe_name[0:-3] + "blend"

    try:
        executable_file = open(executable_url, "rb")
        print("Processing \"" + exe_name + "\"...")

        line = b""
        while True:
            line_temp = executable_file.read(1024)
            if line_temp == b"":
                print("The file \"" + exe_name + "\" does not have a " \
                      ".blend file")
                break

            line = line + line_temp
            pos = re.search(b"BLENDER_[v|V][0-9]{3}REND", line)
            if not pos == None:
                try:
                    blend_file = open(os.path.join(blend_dir, blend_name),
                                      "wb")
                    pos = pos.start()

                    print("Extracting \"" + exe_name + "\"...")
                    blend_file.write(line[pos:len(line)])

                    while True:
                        line_temp = executable_file.read(1024)
                        if line_temp == b"":
                            break

                        blend_file.write(line_temp)

                    blend_file.close()
                    print(".blend file extracted: \"" + blend_name + "\"")

                except IOError:
                    print("Could not create the .blend file \"" + blend_name +
                          "\"!")

                break
            
            line = line_temp[-32:len(line_temp)]

    except IOError:
        print("Could not open the file \"" + exe_name + "\"")
        return False


if len(sys.argv) > 1:
    args = sys.argv[1:len(sys.argv)]

    # Extract the .blend file(s)
    for arg in args:
        extract_blend(arg)

else:
    while True:
        executable_url = input("Enter the URL of the executable file, or " \
                               "ENTER to exit:\n>>> ")

        # Empty line on Unix-like and Windows, respectively
        if len(executable_url) == 0 or executable_url == '\r':
            break

        else:
            # Remove the '\r' character on Windows
            if executable_url[-1] == '\r':
                executable_url = executable_url[0:-1]

            # Extract the .blend file
            extract_blend(executable_url)

@@ -430,26 +430,25 @@
 %22Processing 
-%5C%22
+'
 %22 + exe_name
@@ -447,26 +447,25 @@
 exe_name + %22
-%5C%22
+'
 ...%22)%0A%0A     
@@ -606,34 +606,33 @@
 print(%22The file 
-%5C%22
+'
 %22 + exe_name + %22
@@ -631,18 +631,17 @@
 name + %22
-%5C%22
+'
  does no
@@ -649,16 +649,23 @@
  have a 
+.blend 
 %22 %5C%0A    
@@ -683,23 +683,16 @@
        %22
-.blend 
 file%22)%0A 
@@ -1062,18 +1062,17 @@
 racting 
-%5C%22
+'
 %22 + exe_
@@ -1079,18 +1079,17 @@
 name + %22
-%5C%22
+'
 ...%22)%0A  
@@ -1462,18 +1462,17 @@
 racted: 
-%5C%22
+'
 %22 + blen
@@ -1481,18 +1481,17 @@
 name + %22
-%5C%22
+'
 %22)%0A%0A    
@@ -1574,26 +1574,25 @@
 .blend file 
-%5C%22
+'
 %22 + blend_na
@@ -1627,11 +1627,9 @@
    %22
-%5C%22!
+'
 %22)%0A%0A
@@ -1772,18 +1772,17 @@
 he file 
-%5C%22
+'
 %22 + exe_
@@ -1793,10 +1793,9 @@
  + %22
-%5C%22
+'
 %22)%0A 
@@ -1815,17 +1815,32 @@
  False%0A%0A
-%0A
+def main():%0A    
 if len(s
@@ -1857,16 +1857,20 @@
  1:%0A    
+   
+ 
 args = s
@@ -1891,24 +1891,28 @@
 sys.argv)%5D%0A%0A
+    
     # Extrac
@@ -1932,16 +1932,20 @@
 file(s)%0A
+    
     for 
@@ -1957,32 +1957,36 @@
 n args:%0A        
+ 
+   
 extract_blend(ar
@@ -1989,16 +1989,20 @@
 d(arg)%0A%0A
+    
 else:%0A  
@@ -1999,24 +1999,28 @@
   else:%0A    
+  
+  
 while True:%0A
@@ -2011,32 +2011,36 @@
     while True:%0A
+    
         executab
@@ -2092,19 +2092,16 @@
 le file,
- or
  %22 %5C%0A   
@@ -2128,17 +2128,24 @@
         
-%22
+    %22or 
 ENTER to
@@ -2168,16 +2168,20 @@
         
+  
+  
 # Empty 
@@ -2224,16 +2224,20 @@
 ctively%0A
+    
         
@@ -2283,32 +2283,36 @@
 le_url == '%5Cr':%0A
+    
             brea
@@ -2318,30 +2318,38 @@
 ak%0A%0A        
+    
 else:%0A
+    
             
@@ -2399,16 +2399,20 @@
         
+ 
+   
 if execu
@@ -2426,32 +2426,36 @@
 rl%5B-1%5D == '%5Cr':%0A
+    
                 
@@ -2497,32 +2497,36 @@
 1%5D%0A%0A            
+  
+  
 # Extract the .b
@@ -2535,16 +2535,20 @@
 nd file%0A
+    
         
@@ -2565,24 +2565,63 @@
 t_blend(executable_url)%0A
+%0Aif __name__ == %22__main__%22:%0A    main()%0A

Add 'main' function, and use single quotation inside strings