Skip to Content
Perl To Python Migration
book

Perl To Python Migration

by Martin C. Brown
November 2001
Beginner
320 pages
5h 53m
English
Pearson Business
Content preview from Perl To Python Migration

OTHER METHODS

There are of course methods for executing Python statements. Like the eval function within Perl we can execute another Python script from within an existing script using the execfile function:

>>> script = 'hello.py'
>>> execfile(script)
Hello!!

The Python language was written as much more than just a simple interpreter. We can embed the Python interpreter into a C or C++ application, and therefore execute Python statements and even entire modules within the confines of another application. This is too advanced for this manual, so we won't into any detail, but it is another practical and indeed very useful way of executing Python applications.

If you want to embed Python into an application, see the standard documentation set ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl by Example

Perl by Example

Ellie Quigley
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 0201734885Purchase book