extreme newbie

C

cpunerd4

Hello programmers,
I stumbled onto the python language by chance and it looks like a
great language. Although from what I've read so far (which isn't much)
I've guessed that python is purely an interpreted language unless its
compiled into another language (ie. it needs python installed in order
to run programs). Is this correct? If it is, I guess my plan of action
would be to use python embeded in java applets.
Another question I have: Does any one know any really good, really
easy to understand python books? I would prefer one that is avalible
online for free, but I would also like to know my choices in print.
Thanks in advance for any advice,
cpunerd4

P.S. I'm 14 and I know HTML, PHP, and I know about many others!
 
H

Hsuan-Yeh Chang

cpunerd4 said:
Hello programmers,
I stumbled onto the python language by chance and it looks like a
great language. Although from what I've read so far (which isn't much)
I've guessed that python is purely an interpreted language unless its
compiled into another language (ie. it needs python installed in order
to run programs). Is this correct? If it is, I guess my plan of action
would be to use python embeded in java applets.
Another question I have: Does any one know any really good, really
easy to understand python books? I would prefer one that is avalible
online for free, but I would also like to know my choices in print.
Thanks in advance for any advice,
cpunerd4

P.S. I'm 14 and I know HTML, PHP, and I know about many others!


"Dive into Python," availlable both in print and on-line.
"Python - visual quickstart guide," availlable in print only
very good for newbies like me..

HYC
 
P

Paul Rubin

cpunerd4 said:
I stumbled onto the python language by chance and it looks like a
great language. Although from what I've read so far (which isn't much)
I've guessed that python is purely an interpreted language unless its
compiled into another language (ie. it needs python installed in order
to run programs). Is this correct?

Yes, you need to install Python one way or another.
If it is, I guess my plan of action
would be to use python embeded in java applets.

Just install Python and use it. There's a Java/Python implementation
called Jython but don't worry about it for now.
Another question I have: Does any one know any really good, really
easy to understand python books?

Try "Dive Into Python", www.diveintopython.org (site is very slow
right now, try later). Also the online tutorial,

http://docs.python.org/tut/tut.html

is pretty good, though not in as much depth.
P.S. I'm 14 and I know HTML, PHP, and I know about many others!

If you're good at PHP, then Python shouldn't be much trouble.
 
G

Grant Edwards

I've guessed that python is purely an interpreted language unless its
compiled into another language (ie. it needs python installed in order
to run programs). Is this correct?

It's just like Java. It's compiled into bytecode and then the
bytecode is executed on a virtual machine.
If it is, I guess my plan of action would be to use python
embeded in java applets.

There is a Python compiler (usually refered to as Jython) that
generates Java bytecode for execution on a JVM, so that might
be of interest.
 
H

Harlin Seritt

It's just like Java. It's compiled into bytecode and then the
bytecode is executed on a virtual machine.

So true. Am I the only one who wonders this: If Python at runtime runs
very much like Java and has generally about the same speed (or faster),
then why in the world isn't Java becoming more archaic and being
steadily replaced by Python? I ask this not as a rhetorical question,
but --really-- how come developers are still stuck on Java when Python
seems to be a far better language? In context, Python is not a low
level compiled language like C/C++ is but an interpreted one just like
Java.

Bruce Eckel even marvels at the concise syntax of Python:

"In Python, I can process each line in a file by saying:

for line in file("FileName.txt"):
# Process line

I didn't have to look that up, or to even think about it, because it's
so natural. I always have to look up the way to open files and read
lines in Java."

If anyone cares to give an intelligence answer to my question, I'll be
happy to take it in without ridicule but I just don't see it. Sorry for
the rant (and somewhat off-topic but I hear you guys are tolerant of
that in this group ;-)), but this is something that has been weighing
on my mind for the last 6 months.

Harlin Seritt
 
J

John Machin

Harlin said:
Am I the only one who wonders this: If Python at runtime runs
very much like Java and has generally about the same speed (or faster),
then why in the world isn't Java becoming more archaic and being
steadily replaced by Python? I ask this not as a rhetorical question,
but --really-- how come developers are still stuck on Java when Python
seems to be a far better language?

Compare Sun's marketing budget with the PSF's. Why did IBM mainframes
once rule the world?
 
J

Jordan Rastrick

Another thing to keep in mind is that while technically both Python and
Java are converted into intermediate byte-codes, which are then
interpreted, the Java Virtual Machine runs java bytecode significantly
faster. Partly this is because Sun have put a lot of effort into making
Java as fast as possible, in an attempt to lure away
clockcycle-addicted C programmers; and partly its because having your
langugage statically typed makes it easier to do things quickly (for
technical reasons that I don't fully understand ;)) So Java has and
probably always will have an advantage in the execution speed steaks.

That doesnt change the fact that I'd rather code in Python over Java
any day of the wek, though :)
 
C

cpunerd4

thanks all for the advice. The reason I was thinking about using java
(or C or something) was that it is a little more secure than
distributing the source code isn't it? And also, from what I know, the
Java virtual machine is more popular (and installed on more computers).
Although it might take me awhile to get to that stage.
once again thanks for your advice. The Dive into Python book looks
promising.
cpunerd4
 
R

Renato Ramonda

cpunerd4 ha scritto:
thanks all for the advice. The reason I was thinking about using java
(or C or something) was that it is a little more secure than
distributing the source code isn't it?

As in "protecting your code from prying eyes"?

Then java is exactly like python: I can distribute a fully functional
python program using only .pyc or .pyo files (unreadable) just as I can
distribute only .class files (or jars) in java.

And reverse engineering ("de-compiling") both is damn easy. The produced
code won't be beautiful, sure, but don't rely on it if you want to keep
your code secret (for whatever reason).
And also, from what I know, the
Java virtual machine is more popular (and installed on more computers).

And it is also HUGE, so anyone NOT having it will think twice before
downloading it only for your app. Python on the other hand is installed
by default on all linux and OSX machines, and on windows you can use
py2exe and produce packages of 2-3MBs (correct me if I'm wrong) with
everything bundled.
 
G

Grant Edwards

thanks all for the advice. The reason I was thinking about using java
(or C or something) was that it is a little more secure than
distributing the source code isn't it?

A little. Not much. You don't have to distribute Python
source code, you know. You can distribute the compiled
bytecode the same way you do in Java.
And also, from what I know, the Java virtual machine is more
popular (and installed on more computers).

I don't know about that. Python is pretty much required on
most Linux systems. All Redhat systems have had Python
installed since the beginning (the redhat installer and system
admin stuff was all written in Python). Same with Mandrake:
Python is required and Java is optional and not installed by
default in the Linux distros I'm familiar with.

I don't know how many Windows systems have Java installed.
I don't think any of mine do.
 
G

Grant Edwards

And it is also HUGE, so anyone NOT having it will think twice
before downloading it only for your app. Python on the other
hand is installed by default on all linux and OSX machines,
and on windows you can use py2exe and produce packages of
2-3MBs (correct me if I'm wrong). with everything bundled.

That's about right assuming you thrown in a few of the larger
libraries like wxWidgets. A Win32 installer for a simple
Python app with bundled Python .dll starts at about 750K.

Python + py2exe + innoSetup rocks. People have no idea they're
running a Python app. The app installs and runs just like any
other.
 
C

cpunerd4

what is this py2exe thing? I think its what i've been looking
for...(and inno setup was in my plans (or maby null soft
installer...)). Another reason I was thinging java was because you can
run it in the browser.
Is py2exe included? Where can I find it?
thanks,
cpunerd4
 
S

Steven D'Aprano

cpunerd4 ha scritto:

As in "protecting your code from prying eyes"?

Code isn't damaged by prying eyes, so why does it need to be protected?

I don't know what cpunerd4 (or whatever she, or he, prefers to be
called) means by "more secure". But to me, "secure" means "there are no
security holes or bugs with security implications in my software".

Hiding the source code does not make software more secure. Any bugs and
security holes will be there whether the software is distributed in source
code, object code, or something in between.

Anybody who thinks that hiding the source code makes their programs more
secure is in for a rude shock. The basic premise of security by obscurity
is that you try to ensure security by hiding certain facts about the
software or algorithm from regular users, hoping that nobody will find out
what those facts are. This is equivalent to putting an unlocked door in
your house, then draping some branches over it, trusting that the burglars
won't see the secret door and gain access to your house.

Anybody who doesn't understand why keeping source code secret does not
increase security should google for "security by obscurity".
 
C

cpunerd4

what I mean by secure is that no one can steal the code. I want to
create comercial applications eventually. (although I will work on open
source I hope, so don't get mad at me) and calling me cpunerd4 will be
fine.
 
R

Renato Ramonda

Grant Edwards ha scritto:
Python is required and Java is optional and not installed by
default in the Linux distros I'm familiar with.

I don't know how many Windows systems have Java installed.
I don't think any of mine do.

It's pretty much the other way round: java CANNOT be included by default
in any (free) linux distro for license reasons, and it CANNOT be
included by default in Windows as a consequence of court ruling:
Microsoft is actually _not allowed_ to include Java.

The only system (apart from solaris, I guess) that has a JVM by default
is OSX, and it's _NOT_ sun's one, but the internally developed one.
 
D

Diez B. Roggisch

cpunerd4 said:
what I mean by secure is that no one can steal the code. I want to
create comercial applications eventually. (although I will work on open
source I hope, so don't get mad at me) and calling me cpunerd4 will be
fine.

Commercial applications don't suffer from code-stealing. They might
suffer from feature replicating competitors, or from non-paying users.
But your code is usual so tied to your actual design approach that it is
of no or at least limited use to anyone trying to create his own
application. And 98% if not 100% of the code is not actually new or
innovative by itself.

The only part of an app that might be of interest for others is
something like a new algorithm - e.g. a videodecoder. But if it _is_
interesting, it can and will be reverse engineered - even if written in
pure assembly. The only way to protect it is not to release it at all -
by using a RPC mechansim like CORBA or XMLRPC to access it.

So - the bottomline is - don't worry about releasing the code too much.
The question of FOSS or commercial is a license thing - the hindrance is
of legal nature, not technical.

Diez
 
G

Grant Edwards

what I mean by secure is that no one can steal the code.

Distributing bytecode (Java or Python) vs. source only makes
little difference if your code is really worth stealing.
Distributing compiled C code will make it a little more
difficult, but if somebody wants to reverse engineer it, they
can.
I want to create comercial applications eventually.

Most commercial applications are "stolen" simply by copying the
executable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top