From phil.hornby at accutest.co.uk  Mon Aug  2 11:02:41 2004
From: phil.hornby at accutest.co.uk (Phil Hornby)
Date: Mon Aug  2 11:03:57 2004
Subject: [Compiler-sig] My code runs - but I can't 'compile' it... WHY?!
Message-ID: <E1BrYjb-0000iX-00@mrelayng.kundenserver.de>

Hi out there...

I have what seems to me like a VERY strange situation.

I have some code that I want to compile - i.e. generate a .pyc file for -
because I want to essentially hide the contents from prying eyes. The code
runs fine from a command prompt but when I try to compile it from an
interactive session of the Python interpreter as below I get the error
shown... ANY IDEAS??

"""
import compiler

compiler.compileFile('update1.py')
"""
<FYI update1.py is the file I want to compile>

"""
Traceback (most recent call last):
  File "compile.py", line 3, in ?
    compiler.compileFile('update1.py')
  File "C:\Program Files\Python23\lib\compiler\pycodegen.py", line 42, in
compileFile
    mod.compile(display)
  File "C:\Program Files\Python23\lib\compiler\pycodegen.py", line 111, in
compile
    tree = self._get_tree()
  File "C:\Program Files\Python23\lib\compiler\pycodegen.py", line 77, in
_get_tree
    tree = parse(self.source, self.mode)
  File "C:\Program Files\Python23\lib\compiler\transformer.py", line 50, in
parse
    return Transformer().parsesuite(buf)
  File "C:\Program Files\Python23\lib\compiler\transformer.py", line 120, in
parsesuite
    return self.transform(parser.suite(text))
  File "<string>", line 473

SyntaxError: invalid syntax
"""

If I simply import the code at the interactive prompt then it generates the
.pyc file with no problems - why doesn't it work from the compiler module? 

Thanks...

PS. I am using 2.3.3 - and tied to that version for the immediate future.

--
Phil

From mwh at python.net  Mon Aug  2 15:30:40 2004
From: mwh at python.net (Michael Hudson)
Date: Mon Aug  2 15:30:42 2004
Subject: [Compiler-sig] My code runs - but I can't 'compile' it... WHY?!
In-Reply-To: <E1BrYjb-0000iX-00@mrelayng.kundenserver.de> (Phil Hornby's
	message of "Mon, 2 Aug 2004 10:02:41 +0100")
References: <E1BrYjb-0000iX-00@mrelayng.kundenserver.de>
Message-ID: <2m4qnld5vj.fsf@starship.python.net>

"Phil Hornby" <phil.hornby@accutest.co.uk> writes:

> Hi out there...

This isn't really a very good place to ask this question...

> I have what seems to me like a VERY strange situation.
>
> I have some code that I want to compile - i.e. generate a .pyc file for -
> because I want to essentially hide the contents from prying eyes.

I'll spare you the homily on how much use this is :-)

> The code runs fine from a command prompt but when I try to compile
> it from an interactive session of the Python interpreter as below I
> get the error shown... ANY IDEAS??

Why are you using Lib/compiler and not py_compile?  But it's hard to
say more without ... erm ... seeing some code.  Maybe you can comment
things out and use binary chop to find the syntax that is defeating
Lib/compiler.  This would be interesting in itself as I thought I'd
fixed all of those problems...

Cheers,
mwh

-- 
  To summarise the summary of the summary:- people are a problem.
                   -- The Hitch-Hikers Guide to the Galaxy, Episode 12
From phil.hornby at accutest.co.uk  Mon Aug  2 15:54:29 2004
From: phil.hornby at accutest.co.uk (Phil Hornby)
Date: Mon Aug  2 15:55:46 2004
Subject: [Compiler-sig] My code runs - but I can't 'compile' it... WHY?!
Message-ID: <E1BrdI0-0004Ce-00@mrelayng.kundenserver.de>

>> Hi out there...
>
> This isn't really a very good place to ask this question...

Strange I would think that the Compiler SIG would deal with the compiler
module - maybe I am missing something...

>> I have what seems to me like a VERY strange situation.
>>
>> I have some code that I want to compile - i.e. generate a .pyc file 
>> for - because I want to essentially hide the contents from prying eyes.
>
> I'll spare you the homily on how much use this is :-)

I realise that it is not going to stop a determined person - but it stops
someone simply opening the code in an editor which would be WAY to easy.

>> The code runs fine from a command prompt but when I try to compile it 
>> from an interactive session of the Python interpreter as below I get 
>> the error shown... ANY IDEAS??
>
> Why are you using Lib/compiler and not py_compile?  But it's hard to say
more without ... erm ... seeing some code.  
> Maybe you can comment things out and use binary chop to find the syntax
that is defeating Lib/compiler.  This would 
> be interesting in itself as I thought I'd fixed all of those problems...

Why an I using it - cos it was the first thing I came across when I type
compile into a help search... Seemed a reasonable module to use... I will
try to have a play to see where the problem comes in - could it be the fact
that I use my own modules written in C? I have a work around - I simply
import the module and that creates a .pyc file for me anyway. 

Thanks for your feedback though...

--
Phil

From mwh at python.net  Mon Aug  2 16:09:56 2004
From: mwh at python.net (Michael Hudson)
Date: Mon Aug  2 16:09:57 2004
Subject: [Compiler-sig] My code runs - but I can't 'compile' it... WHY?!
In-Reply-To: <E1BrdI0-0004Ce-00@mrelayng.kundenserver.de> (Phil Hornby's
	message of "Mon, 2 Aug 2004 14:54:29 +0100")
References: <E1BrdI0-0004Ce-00@mrelayng.kundenserver.de>
Message-ID: <2mzn5dbphn.fsf@starship.python.net>

"Phil Hornby" <phil.hornby@accutest.co.uk> writes:

>>> Hi out there...
>>
>> This isn't really a very good place to ask this question...
>
> Strange I would think that the Compiler SIG would deal with the compiler
> module - maybe I am missing something...

It's not a ridiculous assumption -- just an incorrect one!

(Well, it seems to have worked for you, so maybe it wasn't <wink>).

>>> The code runs fine from a command prompt but when I try to compile it 
>>> from an interactive session of the Python interpreter as below I get 
>>> the error shown... ANY IDEAS??
>>
>> Why are you using Lib/compiler and not py_compile?  But it's hard to say
> more without ... erm ... seeing some code.  
>> Maybe you can comment things out and use binary chop to find the syntax
> that is defeating Lib/compiler.  This would 
>> be interesting in itself as I thought I'd fixed all of those problems...
>
> Why an I using it - cos it was the first thing I came across when I type
> compile into a help search... Seemed a reasonable module to use...

Again, not silly, but wrong :-) You want to use py_compile (really).
This uses the builtin compiler to make .pyc files in a way that's very
similar to how it happens when you import the files.

The compiler package is most useful for compiling languages which are
similar to Python but not quite the same, like Quixote's PTL.

> I will try to have a play to see where the problem comes in 

Thanks!

> - could it be the fact that I use my own modules written in C?

Very, very unlikely

Cheers,
mwh

-- 
     ARTHUR:  Why are there three of you?
  LINTILLAS:  Why is there only one of you?
     ARTHUR:  Er... Could I have notice of that question?
                   -- The Hitch-Hikers Guide to the Galaxy, Episode 11
From erica55 at bol.com.br  Fri Aug 13 16:34:26 2004
From: erica55 at bol.com.br (Erica Silveira)
Date: Fri Aug 13 16:34:18 2004
Subject: [Compiler-sig] Mala direta por e-mail - As melhores listas de email
Message-ID: <20040813143417.60E451E434F@bag.python.org>

Mala direta por e-mail. Cadastros selecionados. As melhores listas 
de e-mails selecionados por estados, atividades e profiss?es.
Listas atualizadas para mala direta via e-mail marketing. Visite

http://www.promonet.mx.gs

Cadastros altamente selecionados para divulga??o de produtos por
email marketing. Listas de e-mails e programas gr?tis para divulga??o
via correio eletr?nico. Mala direta por e-mail. Visite agora:

http://www.promonet.mx.gs
From erica55 at bol.com.br  Mon Aug 16 06:20:15 2004
From: erica55 at bol.com.br (Erica Silveira)
Date: Mon Aug 16 06:19:59 2004
Subject: [Compiler-sig] listagem de e-mails
Message-ID: <20040816041958.250291E4004@bag.python.org>

Mais Emails, venda online de listas de email, fazemos mala direta e 
propaganda de sua empresa ou neg?cio para milh?es de emails. Temos listas 
de email Mala Direta, Mala-Direta, Cadastro de Emails, Lista de Emails, 
Mailing List, Milh?es de Emails, Programas de Envio de Email, Email 
Bombers, Extratores de Email, Listas Segmentadas de Email, Emails 
Segmentados, Emails em Massa, E-mails

http://www.promonet.mx.gs

Temos listas de email Mala Direta, Mala-Direta, Cadastro de Emails, Lista 
de Emails, Mailing List, Milh?es de Emails, Programas de Envio de Email, 
Email Bombers, Extratores de Email, Listas Segmentadas de Email, Emails 
Segmentados, Emails em Massa, E-mails

http://www.promonet.mx.gs
From jccarv at hotmail.com  Sun Aug 22 15:17:19 2004
From: jccarv at hotmail.com (John Stovas)
Date: Sun Aug 22 15:17:19 2004
Subject: [Compiler-sig] Olimpics
Message-ID: <20040822131718.56A421E400C@bag.python.org>

An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/compiler-sig/attachments/20040822/0ece8626/attachment.html
From paulagrassi203 at hotmail.com  Mon Aug 23 18:14:53 2004
From: paulagrassi203 at hotmail.com (Paula O. Grassi)
Date: Mon Aug 23 18:14:51 2004
Subject: [Compiler-sig] =?iso-8859-1?q?email=2C_mala_direta=2C_propaganda?=
	=?iso-8859-1?q?_e-mail=2C_marketing_por_e-mails_listas_de_divulga?=
	=?iso-8859-1?q?=E7=E3o?=
Message-ID: <20040823161449.4E5221E4005@bag.python.org>

Visite agora:   http://www.divulgamail.mx.gs

mala direta e-mail, email regi?es, e-mails regi?o, mala direta por email, 
marketing e-mail, regi?es, cadastro e-mails, publicidade por email, emails 
regi?o, divulgar, enviar emails, campanha emails, propaganda emails, email 
cidade, envio an?nimo emails, email estados, divulgar e-mail, programas 
emails, e-mails por estados, e-mails cidade, cadastro e-mail, mala direta 
por e-mail, listas emails, e-mail regi?es, propaganda email, enviar email 
an?nimo, envio mala direta, estados, campanha, cidade, envio, publicidade 
e-mails, 

Visite agora:   http://www.divulgamail.mx.gs 

campanhas e-mail, lista e-mail, programas e-mails, e-mails estado, 
publicidade emails, marketing digital, cidade, divulgar, lista email, 
emails estados, propaganda digital e-mails, e-mail por regi?es, e-mails por 
cidades, email cidades, campanha e-mail, e-mail estado, listas email, lista 
emails, propaganda por e-mails, mala direta email, publicidade, cidades, 
marketing emails, cidade, email por regi?es, envio propaganda, listas 
e-mails, e-mails regi?es, divulgar e-mails, envio mala-direta, e-mail 
cidades, email estado, e-mails por 

Visite agora:   http://www.divulgamail.mx.gs

regi?o, marketing por emails, propaganda, software email em massa, 
propaganda digital e-mail, programas email, email, mala direta, propaganda 
e-mail, marketing e-mails, e-mail, mala-direta email, propaganda digital, 
emails por regi?o, email segmentado, estado, campanhas e-mails, e-mails 
cidades, e-mails segmentados, email por estado, marketing por email, emails 
segmentado, divulga??o, e-mails estados, cidade, campanha e-mails, 
software, email segmentados, regi?o, enviar e-mails an?nimo, enviar emails 
an?nimo, mala direta emails, marketing email, emails segmentados, programas 
e-mail, e-mails por cidade, lista e-mails, propaganda, mala direta por 
e-mails, campanha email, software spam internet, 

Visite agora:   http://www.divulgamail.mx.gs

emails estado, publicidade e-mail, e-mail por cidades, enviar e-mail 
an?nimo, software propaganda internet, emails cidade, emails, campanhas 
emails, mala-direta e-mail, publicidade email, mala direta e-mails, e-mail 
regi?o, listas, listas segmentadas, marketing, marketing digital por 
emails, email regi?o, divulga??o e-mail, emails por cidade, mala-direta por 
email, marketing digital por e-mails, listas email, lista segmentada, 
cidades, cadastro email, divulgue seu produto, mala-direta por e-mails, 
e-mail por estado, segmentos, email por cidades, propaganda por e-mail, 
emails cidades, publicidade por emails, envio e-mail, e-mails por estado, 
mala direta, mala-direta, mala-direta por emails, e-mail segmentado, 
marketing digital emails, cidades, divulga??o e-mails, marketing, e-mail 
estados, cidades, marketing por e-mail, envio emails, marketing digital 
email, propaganda 

Visite agora:   http://www.divulgamail.mx.gs

por email, envio an?nimo email, divulgue sua propaganda, propaganda digital 
emails, cidade, emails por cidades, e-mails segmentado, propaganda por 
emails, divulgar email, e-mail cidade, enviar e-mails, e-mails, cadastro 
emails, e-mail por cidade, envio email, cadastro, lista, envio e-mails, 
propaganda digital email, publicidade por e-mails, marketing digital, 
e-mail por regi?o, email por estados, divulga??o, emails por estados, 
segmentados, mala-direta emails, envio publicidade, campanhas, mala direta 
por emails, e-mail por estados, marketing por e-mails, emails por estado, 
mala-direta e-mails, marketing digital e-mail, divulgar emails, emails 
regi?es, publicidade, email por regi?o, e-mails por regi?es, listas e-mail, 
divulga??o emails, mala-direta por e-mail, enviar e-mail, enviar email, 

Visite agora:   http://www.divulgamail.mx.gs

divulga??o email, cidades, publicidade por e-mail, enviar, emails por 
regi?es, marketing digital por e-mail, email por cidade, campanhas email, 
marketing digital por email, marketing digital e-mails, propaganda e-mails, 
e-mail segmentados, envio an?nimo e-mail, software publicidade internet, 
segmentados, envio an?nimo e-mails, lista mala direta, programa email 
an?nimo, mala direta internet, publicidade email, mala direta segmentada, 
emails segmentados, marketing digital, mala direta email, publicidade, 
spam, mala direta e-mail, email regi?es, e-mails regi?o, mala direta por 
email, marketing e-mail, regi?es, cadastro e-mails, publicidade por email, 
emails regi?o, divulgar, enviar emails, campanha emails, propaganda emails, 
email cidade, envio an?nimo emails, email estados, divulgar e-mail, 
programas emails, e-mails por estados, e-mails cidade, cadastro e-mail, 
mala direta por e-mail, listas emails, e-mail regi?es, propaganda email, 
enviar email an?nimo, envio 

Visite agora:   http://www.divulgamail.mx.gs

mala direta, estados, campanha, cidade, envio, publicidade e-mails, 
campanhas e-mail, lista e-mail, programas e-mails, e-mails estado, 
publicidade emails, marketing digital, cidade, divulgar, lista email, 
emails estados, propaganda digital e-mails, e-mail por regi?es, e-mails por 
cidades, email cidades, campanha e-mail, e-mail estado, listas email, lista 
emails, propaganda por e-mails, mala direta email, publicidade, cidades, 
marketing emails, cidade, email por regi?es, envio propaganda, listas 
e-mails, e-mails regi?es, divulgar e-mails, envio mala-direta, e-mail 
cidades, email estado, e-mails por regi?o, marketing por emails, 
propaganda, software email em massa, propaganda digital e-mail, programas 
email, email, mala direta, propaganda e-mail, marketing e-mails, e-mail, 
mala-direta email, propaganda 

Visite agora:   http://www.divulgamail.mx.gs


digital, emails por regi?o, email segmentado, estado, campanhas e-mails, 
e-mails cidades, e-mails segmentados, email por estado, marketing por 
email, emails segmentado, divulga??o, e-mails estados, cidade, campanha 
e-mails, software, email segmentados, regi?o, enviar e-mails an?nimo, 
enviar emails an?nimo, mala direta emails, marketing email, emails 
segmentados, programas e-mail, e-mails por cidade, lista e-mails, 
propaganda, mala direta por e-mails, campanha email, software spam 
internet, emails 

Visite agora:   http://www.divulgamail.mx.gs


estado, publicidade e-mail, e-mail por cidades, enviar e-mail an?nimo, 
software propaganda internet, emails cidade, emails, campanhas emails, 
mala-direta e-mail, publicidade email, mala direta e-mails, e-mail regi?o, 
listas, listas segmentadas, marketing, marketing digital por emails, email 
regi?o, divulga??o e-mail, emails por cidade, mala-direta por email, 
marketing digital por e-mails, listas email, lista segmentada, cidades, 
cadastro email, divulgue seu produto, mala-direta por e-mails, e-mail por 
estado, segmentos, email por cidades, propaganda por e-mail, emails 
cidades, publicidade por emails, envio e-mail, e-

Visite agora:   http://www.divulgamail.mx.gs


mails por estado, mala direta, mala-direta, mala-direta por emails, e-mail 
segmentado, marketing digital emails, cidades, divulga??o e-mails, 
marketing, e-mail estados, cidades, marketing por e-mail, envio emails, 
marketing digital email, propaganda por email, envio an?nimo email, 
divulgue sua propaganda, propaganda digital emails, cidade, emails por 
cidades, e-mails segmentado, propaganda por emails, divulgar email, e-mail 
cidade, enviar e-mails, e-mails, cadastro emails, e-mail por cidade, envio 
email, cadastro, lista, envio e-mails, propaganda digital email, 
publicidade por e-mails, marketing digital, e-mail por regi?o, email por 
estados, divulga??o, emails por estados, segmentados, mala-direta emails, 
envio publicidade, campanhas, mala direta por emails, e-mail por estados, 
marketing por e-

Visite agora:   http://www.divulgamail.mx.gs


mails, emails por estado, mala-direta e-mails, marketing digital e-mail, 
divulgar emails, emails regi?es, publicidade, email por regi?o, e-mails por 
regi?es, listas e-mail, divulga??o emails, mala-direta por e-mail, enviar 
e-mail, enviar email, divulga??o email, cidades, publicidade por e-mail, 
enviar, emails por regi?es, marketing digital por e-mail, email por cidade, 
campanhas email, marketing digital por email, marketing digital e-mails, 
propaganda e-mails, e-mail segmentados, envio an?nimo e-mail, software 
publicidade internet, segmentados, envio an?nimo e-mails, lista mala 
direta, programa email an?nimo, mala direta internet, publicidade email, 
mala direta segmentada, emails segmentados, marketing digital, mala direta 
email, publicidade, spam