Hi everybody,

I'm totally newbie to python I've seen some tutorials and think that is an easy to learn language but I couldn't figure out the real function of scripting language I've read some brief notes about the function being to control an existing application .
But I couldn't understand that after i make a complete project using c++ for instance why should I use another language to do anything about it (why do not i use c++(the same language )?????????)

any explanation please?????
sorry for being long & thanks in advance.

Recommended Answers

All 3 Replies

The main reason is that a 20 lines python program does more job than a 500 lines C++ program.

commented: cool! +0

Well, here is what I figure out while working with a software which has Python integrated as a scripting language. Usually, for an application there is a limited amount of commands you can access when using a GUI. A designer must place in the GUI the commands commonly used by most users - otherwise the GUI gets too crowded. Some of the commands, or of the application functionality is left out of the GUI - so that you, the user can use the scripting language to call them if needed. If the software application you use doesn't imply an IT field then probably the users that make use of the scripting language are called advanced users.
The application can be controlled by the scripts written in that particular scripting language (as you say). But I prefer to say that the application functionality is extended through the scripting language. One general example would be that using scripts you can access some of the software internals which are not available through GUI. Another one is that through scripts you can use that application in very creative ways.

To try to answer to why you should use Python instead of C++: Your question isn't quite clear - I can think of two possible answers:
1) you imply that you can write a software from scratch in C++ and after completion you try to integrate Python as a scripting language. Well at this point it is your choice as a developer - either language would do, especially if you write that piece of software for yourself. I think though that the programs that use C++ as a scripting language are very rare - the only one I know is freefem - but I am not sure if freefem is a program which makes use of the C++ language as a scripting language or it is actually a language based on C++ idioms.

2) you have an application written by someone else which uses Python as a scripting language, in which case you have no choice other than to learn Python.

pts

sorry for being that late but it was out of my hand.
anyway thanks soooooooo much for your replies.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.