473,652 Members | 2,965 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%,10 00,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 1835
"John Bausano" <jb******@vt.ed u> 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%,10 00,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.ed u> 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.ed u> 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%,10 00,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**********@y ahoo.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
12593
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 character 2 and replace it with a different character.... etc.... until completing the string? thanks....
7
4581
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> int main() {
21
2263
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 idea? Could it be due to the lack of dynamic
18
4611
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 has some different characters in it that I am trying to remove. The small a with two dots over it and the small y with two dots over it. Here is my code so far to remove the small y: Private Sub Button2_Click(ByVal sender As System.Object, ByVal...
5
4414
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
1733
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 if there was a library function that would convert these back to their actual characters, I've written the following: import re
10
2667
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
2477
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 the target encoding (as described in PEP 293). The thing to note here is that the error handler itself is required to return the substitutions as Unicode strings - not as the target encoding bytestrings. Some lower-level gadgetry will silently...
0
2708
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 * * the removal_eligibility_link table for all persons * * in all stages associated with the victim who has * * has had a specific legal status change * EXEC SQL EXECUTE
0
8367
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8467
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4145
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
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 we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.