473,503 Members | 10,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic character substitution.

Hello all,

I've been using Ansys which is a commercial FEA package which can be
controlled through its own scripting language they call APDL. Now I'm
trying to write some stand alone code in Python to supplement my current
efforts.

In Ansys I can do something like this.

*do,n,1,3 #loop
through n

*dim,data%n%,1000,2 #creates variables
arrays data1(1000,2), data2(1000,2)..

*vread,data%n%,filename%n% #fills arrays with data
from filename1,.

Thanks

john
Sep 27 '05 #1
3 1828
"John Bausano" <jb******@vt.edu> wrote:

Hello all,

I've been using Ansys which is a commercial FEA package which can be
controlled through its own scripting language they call APDL. Now I'm
trying to write some stand alone code in Python to supplement my current
efforts.

In Ansys I can do something like this.

*do,n,1,3 #loop through n

*dim,data%n%,1000,2 #creates variables
arrays data1(1000,2), data2(1000,2)..

*vread,data%n%,filename%n% #fills arrays with data
from filename1,.


Generally, you need to think about your problem in a slightly different
way. Instead of thinking about creating variables called data1 and data2,
think about creating a dictionary called "data" which contains three
elements. For example:

data = {}
for n in range(3):
data[n] = read_from( 'filename%d' % n )

It IS possible to create variables on the fly, but except in very special
situations, it is almost never the right way to do things.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Sep 27 '05 #2
On Mon, 26 Sep 2005 21:09:51 -0400, "John Bausano" <jb******@vt.edu> wrote:
Hello all,


....
Funny enough, some people have wanted to substitute a more dynamic character
for me on occasion <g>.
Sep 27 '05 #3
John Bausano <jb******@vt.edu> wrote:
Hello all,

I've been using Ansys which is a commercial FEA package which can be
controlled through its own scripting language they call APDL. Now I'm
trying to write some stand alone code in Python to supplement my current
efforts.

In Ansys I can do something like this.

*do,n,1,3 #loop
through n

*dim,data%n%,1000,2 #creates variables
arrays data1(1000,2), data2(1000,2)..

*vread,data%n%,filename%n% #fills arrays with data
from filename1,.

I await English translation of the above.

--
William Park <op**********@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/
Sep 29 '05 #4

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

Similar topics

9
12552
by: MSUTech | last post by:
Hello, What is the best way to check each character within a string? For doing something like encryption, where you check character 1 and replace it with a different character.. then check...
7
4565
by: Dave Ohlsson | last post by:
Hi, In ISO C/C++, a string constant prefixed by the letter `L' is a wide string constant and is of type "array of wchar_t". Consider the following C program fragment: #include <stdio.h>...
21
2220
by: Marky C | last post by:
atof is not working. double a = atof("12.345"); a gets set to 12.000 I am working on a toshiba micro. The data map has no space allocated to it for dynamic memory. Does anyone have an...
18
4582
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
5
4398
by: Murali | last post by:
In Python, dictionaries can have any hashable value as a string. In particular I can say d = {} d = "Right" d = "Wrong" d = "test" In order to print "test" using % substitution I can say
4
1725
by: Kirk McDonald | last post by:
If you have a link such as, e.g.: <a href="index.py?title=Main Menu">Main menu!</a> The space will be translated to the character code '%20' when you later retrieve the GET data. Not knowing...
10
2647
by: Ognen Duzlevski | last post by:
Hi, I have a "language definition" file, something along the lines of: page :: name : simple caption : simple function : complex function :: name : simple code : simple
2
2462
by: Jukka Aho | last post by:
When converting Unicode strings to legacy character encodings, it is possible to register a custom error handler that will catch and process all code points that do not have a direct equivalent in...
0
2697
by: tickle | last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2 * copybook - celg02u3.sql SIR 24265 * * updates dt_deny for all rows in * * ...
0
7194
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
7267
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
6976
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
5566
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
4666
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
3160
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
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.