FCC - TRT 24ª - Técnico Judiciário - Operação de Computador - 2006
Inglês / Vocabulary
Embedding Python in Your C Programs
By William Nagel on Fri, 2005-12-30 02:00.
Software C, meet Python. Python, this is C. With surprisingly little effort, the Python interpreter can be integrated into your program to add features quickly that could take months if written entirely in C.
The language of choice for large, high-performance applications in Linux is almost always C, or somewhat less often C++. Both are powerful languages that allow you to create highperformance natively compiled programs. However, they are not languages that lend themselves to runtime flexibility. Once a C/C++ application is compiled, its code is pretty much static. At times, that can be a real hindrance. For example, if you want to allow users of a program to create plugins easily that extend the application"s functionality, you have to deal with complex dynamic linking issues that can cause no end of headaches. Additionally, your users will have to know C/C++ in order to extend the application, which severely limits the number of people capable of writing extensions.
A much better solution is to provide your users with a scripting language they can use to extend your application. With a scripting language, you will tend to have much more runtime flexibility, as well as shorter development times and a lower learning curve that will extend the base of users capable of creating extensions.
Unfortunately, creating a scripting language is very much a nontrivial task that easily could become a major portion of your program.
Fortunately, you don"t need to create a scripting language. With Python, you can embed the interpreter directly into your application and expose the full power and flexibility of Python ...... adding very much code at all to your application.
(Adapted from www.linuxjournal.com/article/8497)
No texto, hindrance pode ser traduzido por