On Jul 30, 2010, at 8:32 AM, Michele Comitini wrote:

> This is not possible in general.
> If you do not want anyone to copy something than do not show it.
> Think of writing a book that no one can read...

Right. 

It's worth making a distinction, too, about how an application gets 
distributed. If you're delivering a service over the net, then the .pyc files 
are unreadable, but so are .py files. To the extent that you can embed your IP 
on the server rather than in the code (html or JS) that must be delivered to 
the client, the more you'll protect.

OTOH, if you're delivering the app itself to someone who will run it on their 
own server, then .pyc files are not all that secure against reverse 
engineering. Python compilation must be regarded as a form of obfuscation 
merely.

But do we care?

http://stackoverflow.com/questions/261638/how-do-i-protect-python-code



> 
> Maybe copyright could be the right way to protect you work?
> 
> 2010/7/29 ilovesss2004 <yyiillu...@gmail.com>
> Now I know the web app will work just with the pyc files, and others
> can not view the source code from pyc files. But the source code can
> still be viewed in web browser (I mean the source code of html and
> javascript at the client side). Is there a method to encrypt the
> source code by a language that the web browser knows so that the
> source code will be unreadable but still readable to web browser?
> 
> On Jul 29, 5:41 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > It depends of what you mean by HTML.
> >
> > say you have views/default/index.html which extends views/layout.html.
> >
> > When you bytecode compile the two .html files are merged, turned into
> > a python program and this is bytecode compiled.
> >
> > Now you can distribute your app without the .html files and it will
> > work.
> >
> > You can still somewhat infer the html from the .pyc files but it is
> > not trivial since there is not a 1-1 map.
> >
> > Massimo
> >
> > On Jul 29, 9:23 am, ilovesss2004 <yyiillu...@gmail.com> wrote:
> >
> >
> >
> > > But the html files are also part of the web app. Is there someway to
> > > encrypt them by use of web2py or python programming?
> >
> > > On Jul 29, 4:15 pm, Jean-Guy <jean...@gmail.com> wrote:
> >
> > > > Of course yes! It is the HTML nature and the Web paradigm is based on
> > > > this state of affairs...
> >
> > > > Maybe the python code embeded could be compiled too, but really not sure
> > > > about that... Massimo could be a better help on that.
> >
> > > > Jonhy
> >
> > > > On 2010-07-29 10:12, ilovesss2004 wrote:
> >
> > > > > source code of html files are still viewable.
> 


Reply via email to