473,486 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What is Python?!

hi

I'm learning python since 3 days. I' ve some programming experience in
BASIC, Pascal, C, C++ and Java. Actually I want to add a scripting
language to this repertoire (I have virtually no experience with
scripting).

Having read that python is object orientated, I start wondering if
python is the right choice and what it is...

a scripting language or a "normal" language like C++ etc.

So please tell me what python is, what are it's strength, what is it
good for and when should I use it and not one of the other languages.

other questions:
What about graphic? Can I create graphical interfaces with python?

Python is interpreted but is it compiled to something like the java byte
code or are there other ways to prevent the user to read my code?

further hints for learning python and recommendations on books,
tutorials, exampels, etc. are also welcome.

thanks
Aug 10 '05 #1
16 1789
Robert Wierschke ha scritto:
....
Reading the FAQ at the python website too difficult? I don't think you
missed any of the most frequently asked... Good job.

--
Adriano Varoli Piazza
The Inside Out: http://moranar.com.ar
MSN: ad*******@hotmail.com
ICQ: 4410132
Aug 10 '05 #2
Adriano Varoli Piazza schrieb:
Robert Wierschke ha scritto:
...
Reading the FAQ at the python website too difficult? I don't think you
missed any of the most frequently asked... Good job.


sorry I 've forgetten the FAQ
Aug 10 '05 #3
Robert Wierschke wrote:
Having read that python is object orientated, I start wondering if
python is the right choice and what it is...

a scripting language or a "normal" language like C++ etc.
Ignore the "scripting language" label and just treat Python as a general
purpose "normal" language like C++, Java, Ruby, and so forth. Judge a
language by what is done with it, not by the implementation details.
So please tell me what python is, what are it's strength, what is it
good for and when should I use it and not one of the other languages.
Easily findable with some web searching... Google is your friend.
Python is interpreted but is it compiled to something like the java byte
code or are there other ways to prevent the user to read my code?


The simple answer is yes, it's like Java byte code, but it's Python byte
code instead... As with any other language, relying on this to hide
your code is inadvisable and ultimately a waste of time.

-Peter
Aug 10 '05 #4
Robert Wierschke <wi****@gmx.de> wrote:
a scripting language or a "normal" language like C++ etc.
It is difficult to define exactly what a "scripting language" is and isn't,
but I think most people would classify it as a scripting language.
So please tell me what python is, what are it's strength, what is it
good for and when should I use it and not one of the other languages.
I think it's biggest strengths are that it's easy to learn and easy to use.

There is no separate compile stage, so testing things out is quick and
easy. The language does compile to byte code (just like Java does), but
unlike Java, the compile stage happens completely automatically. You just
run your program, and the system figures out if it needs to compile (or
re-compile) your source for you.

The ability to fire up an interactive session is key. If I'm unsure of
something, it's usually faster to just run python and try something out
(or, use the built-in help system, or use dir() to get a listing of all of
an objects methods) than to look in the manual. If your interpreter was
built properly, it's even got input editing and history built in via the
GNU readline library.
What about graphic? Can I create graphical interfaces with python?
There are several GUI libraries. I don't do that kind of work, so I'll
leave it to others to explain them.
Python is interpreted but is it compiled to something like the java byte
code or are there other ways to prevent the user to read my code?


It is exactly like Java. In fact, it's so close, there's a system called
Jython, which lets you compile Java source to Python byte code. Yes, this
means it will always be possible for users to re-create your source code
from the byte-code object files you ship. How much of an issue this is to
you is a business decision.
Aug 10 '05 #5
On Wed, 10 Aug 2005 13:14:26 +0200, Robert Wierschke <wi****@gmx.de> wrote:
hi

I'm learning python since 3 days. I' ve some programming experience in
BASIC, Pascal, C, C++ and Java. Actually I want to add a scripting
language to this repertoire (I have virtually no experience with
scripting).

Having read that python is object orientated, I start wondering if
python is the right choice and what it is...

a scripting language or a "normal" language like C++ etc.
Both.
So please tell me what python is, what are it's strength, what is it
good for and when should I use it and not one of the other languages.

other questions:
What about graphic? Can I create graphical interfaces with python?
There are several GUIs available, for example Tkinter.
Python is interpreted but is it compiled to something like the java byte
code


Yes. It is compiled to .pyc files which are then interpreted;
exactly the same idea that java uses.

--
Email: zen19725 at zen dot co dot uk
Aug 10 '05 #6
Roy Smith wrote:
Robert Wierschke <wi****@gmx.de> wrote:
a scripting language or a "normal" language like C++ etc.

It is difficult to define exactly what a "scripting language" is and isn't,


You can tell buy the most common use. bash is a scripting language,
javascript is a scripting language, perl is a scripting language, php is
a scripting language, Python is *not* a scripting language !-)
but I think most people would classify it as a scripting language.


It can be used for scripting too, yes.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Aug 10 '05 #7
Roy Smith wrote: "there's a system called Jython, which lets you
compile Java source to Python byte code."

Don't you have that the wrong way 'round? From the Jython website:
"Jython is an implementation of the high-level, dynamic,
object-oriented language Python written in 100% Pure Java, and
seamlessly integrated with the Java platform. It thus allows you to run
Python on any Java platform."

In the case of Jython you could perhaps say that Python bytecode is
"exactly like Java". However, in the case of regular Python, it's
closer to say that Python bytecode is much the same _idea_ as Java
bytecode.

Jason

Aug 10 '05 #8
In article <11**********************@g43g2000cwa.googlegroups .com>,
"Jason Drew" <ja*********@gmail.com> wrote:
Roy Smith wrote: "there's a system called Jython, which lets you
compile Java source to Python byte code."

Don't you have that the wrong way 'round?


Duh, of course I do! Thanks for the correction.
Aug 11 '05 #9
bruno modulix wrote:
You can tell buy the most common use. bash is a scripting language,
javascript is a scripting language, perl is a scripting language, php is
a scripting language, Python is *not* a scripting language !-)


Perhaps a better definition - the term 'scripting language' is
increasingly being used by CTOs as a justification for saving money by
putting large chunks of their workforces on lower pay scales - an
attitude of 'scripters aren't as skilled as real programmers, so don't
deserve the same pay'.

To me, the term is archic. What 'scripting language' means to me is:
1. insufficient facilities for general purpose or 'serious' programming
2. ability to get simple useful programs up and working quickly
3. absence of a hack/compile/link/test cycle.

What makes 1 and 3 redundant is that linkage mechanisms have diversified
over the years. For instance, java and python's 'import' statements,
java's CLASSPATH and python's 'sys.path'.

I guess a language could be called a 'scripting language' if:
- the source code can be executed directly, and/or
- source need not be converted to a separate file in a
non-human-readable format before it can be executed, and/or
- a change to the source file automatically causes a change in
runtime behaviour

By these, Python is most definitely a scripting language, and joins Perl
and PHP. Whereas changes to java source files don't change runtime
behaviour.

OTOH, Python is also a compiled language, since it can be 'fixed' into a
n executable binary format.

--
Cheers
EB

--

One who is not a conservative by age 20 has no brain.
One who is not a liberal by age 40 has no heart.
Aug 11 '05 #10
bruno modulix wrote:
bash is a scripting language,
Bash is a shell. It is frequently used for scripting, but that is only
a secondary purpose.
javascript is a scripting language,
Yes, but it's a particularly specialized one.
perl is a scripting language,
Blasphemy! Perl is a dynamic language, entirely suitable for large
applications. I've written some pretty big programs entirely in Perl,
and extended it with C and C++ to make it fit nicely into existing
application frameworks.
php is a scripting language,
OK, but it's also awfully specialized.
Python is *not* a scripting language !-)


It's a scripting language, among other things. Why do you think
non-imported source files are not automatically compiled to pyc's?
Aug 11 '05 #11
On Thu, 11 Aug 2005 15:51:45 +1200, Evil Bastard <sp**@me.please>
declaimed the following in comp.lang.python:
To me, the term is archic. What 'scripting language' means to me is:
1. insufficient facilities for general purpose or 'serious' programming
2. ability to get simple useful programs up and working quickly
I fear I was spoiled by the Amiga in the late 80s, where ARexx
qualified as a true scripting language; since most good applications
included an ARexx port... (and some also included a ARexx compatible
function library).

{pseudo example -- its been over 10 years and I don't want to dig up
manuals to recall what the editor commands really were, so this is sort
of "vi"; $ is <esc>}

address ed
"3dw"
"iThis text is inserted$"
"$ZZ"
address command
"copy " file "PRT:"

To me, that is "scripting" -- using one program to feed commands
to another. Those applications that supplied a function library allowed
for usage closer to VBA/COM style... import the library, then call
functions directly.
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Aug 11 '05 #12
On 2005-08-11, Dennis Lee Bieber <wl*****@ix.netcom.com> wrote:
On Thu, 11 Aug 2005 15:51:45 +1200, Evil Bastard <sp**@me.please>
declaimed the following in comp.lang.python:
To me, the term is archic. What 'scripting language' means to me is:
1. insufficient facilities for general purpose or 'serious' programming
2. ability to get simple useful programs up and working quickly

[...]
To me, that is "scripting" -- using one program to feed commands
to another. Those applications that supplied a function library allowed
for usage closer to VBA/COM style... import the library, then call
functions directly.


To me, a "scripting language" is one intended to "sumulate" a
user: a language that is used to run other programs in
more-or-less the same manner a normal user would. Something
that is intended to be used to automate a sequence of
operations that would otherwise be performed by a user typing or clicking
in a UI.

Bash is a scripting language. Python isn't.

When compared with something like bash, in Python it's not
particularly easy to run other programs and manipulate the
programs' input/output streams. It can be done, but the
semantics used to do so are identical to C (which nobody seems
to think is a scripting language).

Python is a general purposeprogramming language.

--
Grant Edwards grante Yow! Hey, I LIKE that
at POINT!!
visi.com
Aug 11 '05 #13
On Thu, 11 Aug 2005 15:51:45 +1200, Evil Bastard <sp**@me.please> wrote:

I guess a language could be called a 'scripting language' if:
- the source code can be executed directly, and/or
- source need not be converted to a separate file in a
non-human-readable format before it can be executed, and/or
- a change to the source file automatically causes a change in
runtime behaviour

By these, Python is most definitely a scripting language, and joins Perl
and PHP. Whereas changes to java source files don't change runtime
behaviour.


It wouldn't be particularly difficult to invoke Java by a shell
script that checks to see if source has changed and if so
recompiles it. If such a script became part of standard Java, would
Java then be a scripting language?

--
Email: zen19725 at zen dot co dot uk
Aug 11 '05 #14
Evil Bastard wrote:
bruno modulix wrote:
You can tell buy the most common use. bash is a scripting language,
javascript is a scripting language, perl is a scripting language, php is
a scripting language, Python is *not* a scripting language !-)
Perhaps a better definition - the term 'scripting language' is
increasingly being used by CTOs as a justification for saving money by
putting large chunks of their workforces on lower pay scales - an
attitude of 'scripters aren't as skilled as real programmers, so don't
deserve the same pay'.

To me, the term is archic. What 'scripting language' means to me is:
1. insufficient facilities for general purpose or 'serious' programming
2. ability to get simple useful programs up and working quickly
3. absence of a hack/compile/link/test cycle.


My view too.
What makes 1 and 3 redundant is that linkage mechanisms have diversified
over the years. For instance, java and python's 'import' statements,
java's CLASSPATH and python's 'sys.path'.

I guess a language could be called a 'scripting language' if:
- the source code can be executed directly, and/or
- source need not be converted to a separate file in a
non-human-readable format before it can be executed, and/or
- a change to the source file automatically causes a change in
runtime behaviour

By these, Python is most definitely a scripting language, and joins Perl
and PHP. Whereas changes to java source files don't change runtime
behaviour.


Though they prefer to be called "agile languages" nowadays.

Reinhold
Aug 11 '05 #15
Evil Bastard wrote:
I guess a language could be called a 'scripting language' if:
- the source code can be executed directly, and/or
- source need not be converted to a separate file in a
non-human-readable format before it can be executed, and/or
- a change to the source file automatically causes a change in
runtime behaviour


That kind of a language is typically called an interpreted
language, in contrast to a compiled. But it's really not an
aspect of the language, but rather of the tools being used
to convert the source code to "action" on a computer. I've
used both interpreted and compiled versions of Pascal and
BASIC, and I know of interpreted versions of C etc.

In a way, I guess Python's problem in achieving the popularity
it deserves is due to its versitility. Python works well as
an embedded macro language, and is used like that in both off
the shelf software and bespoke systems. It's useful as a scripting
language and is used in that way by NASA, ILM etc. It's also
very useful for building all sorts of software without mixing in
other languages or programs, and can replace VB, C++, COBOL, Java
or what have you. How do you sell this without making it sound
like snake oil? (Particularly with that name! :)

While other P-languages are used beyond their intended use, Perl
*is* basically a scripting language. The strong point of Perl is
that it's a "unified" replacement for a whole bunch of Unix tools.
PHP is for embedding functionality in web pages. Free cross
platform ASP. They explaining Python in two sentences!
Aug 12 '05 #16
Magnus Lycka wrote:
<cut>
or what have you. How do you sell this without making it sound
like snake oil? (Particularly with that name! :)

<cut>
<JediMindTrick>
This *is* the languange you are looking for ...
</JediMindTrick>

Stops the argument every time, although afterwards they look kind a
funny at me.

--
mph
Aug 12 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
18799
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
6496
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
226
12312
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
4
7061
by: Ruud de Jong | last post by:
The question I have is: how safe / future proof / portable is the use of the __subclasses__ method that exists for new-style classes? Background: I thought I had found an easy-to-understand...
7
3537
by: Michele Simionato | last post by:
So far, I have not installed Prothon, nor I have experience with Io, Self or other prototype-based languages. Still, from the discussion on the mailing list, I have got the strong impression that...
92
6324
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
137
6921
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
31
2476
by: N.Davis | last post by:
I am very new to Python, but have done plenty of development in C++ and Java. One thing I find weird about python is the idea of a module. Why is this needed when there are already the ideas of...
23
3583
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
34
3556
by: emrahayanoglu | last post by:
Hello Everyone, Now, I'm working on a new web framework. I tried many test on the other programming languages. Then i decided to use python on my web framework project. Now i want to listen...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.