[Python] Compilazione .exe

Marco Mariani marco.mariani a prometeia.it
Mar 17 Nov 2009 11:48:42 CET


Federico wrote:

> Si si era intesto in quel senso certo, scusa non si capiva molto bene.
> Quindi anche dopo compilato è facile vedere il codice interno del
> programma??Giusto?
>   

Giudica tu.

Questo e' il sorgente di posixpath.walk (file .py):


>     warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of 
> os.walk.",
>                       stacklevel=2)
>     try:
>         names = os.listdir(top)
>     except os.error:
>         return
>     func(arg, top, names)
>     for name in names:
>         name = join(top, name)
>         try:
>             st = os.lstat(name)
>         except os.error:
>             continue
>         if stat.S_ISDIR(st.st_mode):
>             walk(name, func, arg)



e questo e' il compilato (file .pyc):


> 219        0 LOAD_GLOBAL              0 (warnings)
>               3 LOAD_ATTR                1 (warnpy3k)
>               6 LOAD_CONST               1 ('In 3.x, os.path.walk is 
> removed in favor of os.walk.')
>               9 LOAD_CONST               2 ('stacklevel')
>
> 220       12 LOAD_CONST               3 (2)
>              15 CALL_FUNCTION          257
>              18 POP_TOP             
>
> 221       19 SETUP_EXCEPT            19 (to 41)
>
> 222       22 LOAD_GLOBAL              2 (os)
>              25 LOAD_ATTR                3 (listdir)
>              28 LOAD_FAST                0 (top)
>              31 CALL_FUNCTION            1
>              34 STORE_FAST               3 (names)
>              37 POP_BLOCK           
>              38 JUMP_FORWARD            23 (to 64)
>
> 223       41 DUP_TOP             
>              42 LOAD_GLOBAL              2 (os)
>              45 LOAD_ATTR                4 (error)
>              48 COMPARE_OP              10 (exception match)
>              51 JUMP_IF_FALSE            8 (to 62)
>              54 POP_TOP             
>              55 POP_TOP             
>              56 POP_TOP             
>              57 POP_TOP             
>
> 224       58 LOAD_CONST               4 (None)
>              61 RETURN_VALUE        
>              62 POP_TOP             
>              63 END_FINALLY         
>
> 225       64 LOAD_FAST                1 (func)
>              67 LOAD_FAST                2 (arg)
>              70 LOAD_FAST                0 (top)
>              73 LOAD_FAST                3 (names)
>              76 CALL_FUNCTION            3
>              79 POP_TOP             
>
> 226       80 SETUP_LOOP             115 (to 198)
>              83 LOAD_FAST                3 (names)
>              86 GET_ITER            
>              87 FOR_ITER               107 (to 197)
>              90 STORE_FAST               4 (name)
>
> 227       93 LOAD_GLOBAL              5 (join)
>              96 LOAD_FAST                0 (top)
>              99 LOAD_FAST                4 (name)
>             102 CALL_FUNCTION            2
>             105 STORE_FAST               4 (name)
>
> 228      108 SETUP_EXCEPT            19 (to 130)
>
> 229      111 LOAD_GLOBAL              2 (os)
>             114 LOAD_ATTR                6 (lstat)
>             117 LOAD_FAST                4 (name)
>             120 CALL_FUNCTION            1
>             123 STORE_FAST               5 (st)
>             126 POP_BLOCK           
>             127 JUMP_FORWARD            25 (to 155)
>
> 230      130 DUP_TOP             
>             131 LOAD_GLOBAL              2 (os)
>             134 LOAD_ATTR                4 (error)
>             137 COMPARE_OP              10 (exception match)
>             140 JUMP_IF_FALSE           10 (to 153)
>             143 POP_TOP             
>             144 POP_TOP             
>             145 POP_TOP             
>             146 POP_TOP             
>
> 231      147 JUMP_ABSOLUTE           87
>             150 JUMP_FORWARD             2 (to 155)
>             153 POP_TOP             
>             154 END_FINALLY         
>
> 232      155 LOAD_GLOBAL              7 (stat)
>             158 LOAD_ATTR                8 (S_ISDIR)
>             161 LOAD_FAST                5 (st)
>             164 LOAD_ATTR                9 (st_mode)
>             167 CALL_FUNCTION            1
>             170 JUMP_IF_FALSE           20 (to 193)
>             173 POP_TOP             
>
> 233      174 LOAD_GLOBAL             10 (walk)
>             177 LOAD_FAST                4 (name)
>             180 LOAD_FAST                1 (func)
>             183 LOAD_FAST                2 (arg)
>             186 CALL_FUNCTION            3
>             189 POP_TOP             
>             190 JUMP_ABSOLUTE           87
>             193 POP_TOP             
>             194 JUMP_ABSOLUTE           87
>             197 POP_BLOCK           
>             198 LOAD_CONST               4 (None)
>             201 RETURN_VALUE        



-- 
This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s). Any use, distribution, reproduction or disclosure by any other person is strictly prohibited. The content of this e-mail does not constitute a commitment by the Company except where provided for in a written agreement between this e-mail addressee and the Company. If you are not an intended recipient(s), please notify the sender promptly and destroy this message and its attachments without reading or saving it in any manner. Any non authorized use of the content of this message constitutes a violation of the obligation to abstain from learning of the correspondence among other subjects, except for more serious offence, and exposes the person responsible to the relevant consequences.



Maggiori informazioni sulla lista Python