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

Home Posts Topics Members FAQ

adding python scripting to my application

Hi, first of all, I have to say I am new to Python. I have been working
with a finite element analysis program written in c++. now, I am trying
to 'rebuild' this code (possibly a full re-write) with scripting
capability. I did some reading on the web, and found that there are two
ways to do this : extending and embedding. and I still haven't figured
out what I should be using. I guess the first thing is to figure out
what I am to do with the scripting capability - at the very least, I
would like to run parametric analyses - run multiple analysis models by
changing certain parameters using for loops.
i found that the commercial fea package - abaqus uses python as well -
I don't know whether they embedded or extended ? is there any way to
find out?
another fea application called OOF2
(http://www.ctcms.nist.gov/oof/oof2/#features) says "OOF2 is completely
scriptable in Python". and I don't really understand what that means...
maybe I haven't grasped the full potential of what python scripting
could do for an fea program.

can you tell me how to decide what path I should take - embed or extend
? or maybe some one could point me to some document/webpage that talks
about this.

thanks a lot,
Julian.

PS, my fea program uses its own script to read the analysis model
information using the c++ iostream and our own parsing functions - but
I don't have to stick to those function when I am writing the new code.

Nov 6 '06 #1
4 2111
I am not a Python guru by any means, but I believe that when an
application says that you can "script" their application with Python,
it means that you can actually write Python code to interact with the
application. Embedding may be the same thing. Extending (as I read
it) involves writing portions of your program in Python and have do the
logic portions.

If you would like to allow users to write small scripts that interact
with your program and control it (a la VBScript or AppleScript), then I
believe embedding Python in your program is what you want.

If you would like Python to run various parts of your program in order
to make some portions easier to write/manage/whatever, then you want to
"extend" your program using Python.

The key difference being that you aren't providing a way for someone
else to interact with your program using Python if you are extending.

Again, I am not a guru and a read through the docs on python.org would
probably be the best place to get sound technical advice on these
subjects.

--
Jerry

Nov 6 '06 #2
Jerry wrote:
I am not a Python guru by any means, but I believe that when an
application says that you can "script" their application with Python,
it means that you can actually write Python code to interact with the
application. Embedding may be the same thing. Extending (as I read
it) involves writing portions of your program in Python and have do the
logic portions.

If you would like to allow users to write small scripts that interact
with your program and control it (a la VBScript or AppleScript), then I
believe embedding Python in your program is what you want.

If you would like Python to run various parts of your program in order
to make some portions easier to write/manage/whatever, then you want to
"extend" your program using Python.

The key difference being that you aren't providing a way for someone
else to interact with your program using Python if you are extending.

Again, I am not a guru and a read through the docs on python.org would
probably be the best place to get sound technical advice on these
subjects.

--
Jerry

I'm not sure either, but I though Extending was making the C/C++ Code
available from Python, while Embedding was making Python Code Available
in your app.

Nov 6 '06 #3
Take a look at:

http://www.swig.org/

Julian wrote:
Hi, first of all, I have to say I am new to Python. I have been working
with a finite element analysis program written in c++. now, I am trying
to 'rebuild' this code (possibly a full re-write) with scripting
capability. I did some reading on the web, and found that there are two
ways to do this : extending and embedding. and I still haven't figured
out what I should be using. I guess the first thing is to figure out
what I am to do with the scripting capability - at the very least, I
would like to run parametric analyses - run multiple analysis models by
changing certain parameters using for loops.
i found that the commercial fea package - abaqus uses python as well -
I don't know whether they embedded or extended ? is there any way to
find out?
another fea application called OOF2
(http://www.ctcms.nist.gov/oof/oof2/#features) says "OOF2 is completely
scriptable in Python". and I don't really understand what that means...
maybe I haven't grasped the full potential of what python scripting
could do for an fea program.

can you tell me how to decide what path I should take - embed or extend
? or maybe some one could point me to some document/webpage that talks
about this.

thanks a lot,
Julian.

PS, my fea program uses its own script to read the analysis model
information using the c++ iostream and our own parsing functions - but
I don't have to stick to those function when I am writing the new code.
Nov 6 '06 #4

"martdi" <ma*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Jerry wrote:
>I am not a Python guru by any means, but I believe that when an
application says that you can "script" their application with Python,
it means that you can actually write Python code to interact with the
application. Embedding may be the same thing. Extending (as I read
it) involves writing portions of your program in Python and have do the
logic portions.

If you would like to allow users to write small scripts that interact
with your program and control it (a la VBScript or AppleScript), then I
believe embedding Python in your program is what you want.

If you would like Python to run various parts of your program in order
to make some portions easier to write/manage/whatever, then you want to
"extend" your program using Python.

The key difference being that you aren't providing a way for someone
else to interact with your program using Python if you are extending.

Again, I am not a guru and a read through the docs on python.org would
probably be the best place to get sound technical advice on these
subjects.

--
Jerry


I'm not sure either, but I though Extending was making the C/C++ Code
available from Python, while Embedding was making Python Code Available
in your app.
Like I mentioned in my first post, one of the purposes of linking to python
would be to run multiple cases in a for loop.
that would mean passing information from the python script to my c++
application. mean python would have to be the top-level program.
so, I think I should be looking at extending my program. I am going to look
at using swig for this..

thanks,
Julian.
Nov 13 '06 #5

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

Similar topics

4
by: The_Incubator | last post by:
As the subject suggests, I am interested in using Python as a scripting language for a game that is primarily implemented in C++, and I am also interested in using generators in those scripts... ...
2
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an...
33
by: Quest Master | last post by:
I am interested in developing an application where the user has an ample amount of power to customize the application to their needs, and I feel this would best be accomplished if a scripting...
217
by: gyromagnetic | last post by:
The following url points to an article written by Damian Conway entitled "Ten Essential Development Practices": http://www.perl.com/pub/a/2005/07/14/bestpractices.html Althought the article has...
6
by: Wolfgang Keller | last post by:
Hello, I'm looking for a spreadsheet application (MacOS X prefered, but Windows, Linux ar available as well) with support for Python scripting (third-party "plug-ins" are ok) and a database...
18
by: qwweeeit | last post by:
Hi all, when I moved from Windows to Linux I choosed Python as my language of reference and as GUI, Qt (not much investigated up to now). Till now I didn't regret but one thing: Python can't act...
118
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely...
2
by: robert | last post by:
When employing complex UI libs (wx, win32ui, ..) and other extension libs, nice "only Python stack traces" remain a myth. Currently I'm hunting again a rare C-level crash bug of a Python based...
17
by: chewie54 | last post by:
Hello, As an electronics engineer I use some very expensive EDA CAD tool programs that are scriptable using Tcl. I was wondering why these companies have choose to use Tcl instead of Python. ...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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
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
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.