calling a fortran dll from python with ctypes module

I'm using ctypes to call a fortran dll from python. I have no problems
passing arguments of integer or double types, both scalars or arrays,
single or double precission, but I have errors with python strings.

For example:

(sorry, is python code)
.....
n = c_int(10)
Vector= c_double * m
f_x=Vector()
for i in range(m):
....f_x[i] = float(1.0)

ap = windll.LoadLibrary(locationDll)
ap.TEST_01(byref(n),byref(f_x),byref(y))
print y.value # ok

Char= c_char_p
mychar=Char('0123456789')
mychar2=Char(m*' ')
ap.TEST_02(mychar) #error

the error text is
ValueError: Procedure probably called with not enough arguments (4
bytes missing)

fortran code (CVF compiler)

subroutine TEST_01(n,x,out)
....!DEC$ ATTRIBUTES DLLEXPORT :: TEST_01
....INTEGER(4) n
....REAL(8), dimension(n):: x
....real(8):: out
....out=sum(x)
....return
END subroutine

subroutine TEST_02(a)
....!DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
....CHARACTER(10):: a
....open(31,file='pru.txt')
....write(31,*) a
....close(31)
....return
END subroutine

Some suggestions are wellcome !

0
solisgb (21)
6/6/2007 6:40:57 AM
comp.lang.fortran 11385 articles. 0 followers. Post Follow

14 Replies
785 Views

Similar Articles

[PageSpeed] 57
Fortran compilers sometimes pass a hidden integer length argument
along with a string. This is typically done for character(*)
arguments, for fixed-len characters it's not necessary, but CVF is
old, so who knows? I suggest you try defining TEST_02 with
CHARACTER(*):: a
and calling it from Python as
ap.TEST_02(mychar,byref(len(mychar)))
No warranty :)

0
highegg (245)
6/6/2007 6:53:12 AM
On Jun 6, 7:53 am, highegg <high...@gmail.com> wrote:
> Fortran compilers sometimes pass a hidden integer length argument
> along with a string. This is typically done for character(*)
> arguments, for fixed-len characters it's not necessary, but CVF is
> old, so who knows? I suggest you try defining TEST_02 with
> CHARACTER(*):: a
> and calling it from Python as
> ap.TEST_02(mychar,byref(len(mychar)))
> No warranty :)

Some compilers add the length argument to the end of the arg list
whilst others (like CVF) add it immediately after the character(*)
argument - and some have options to enable you to choose (ifort I
think).

Simon Geard

0
simon9085 (164)
6/6/2007 8:57:11 AM
On 6 jun, 08:53, highegg <high...@gmail.com> wrote:
> Fortran compilers sometimes pass a hidden integer length argument
> along with a string. This is typically done for character(*)
> arguments, for fixed-len characters it's not necessary, but CVF is
> old, so who knows? I suggest you try defining TEST_02 with
> CHARACTER(*):: a
> and calling it from Python as
> ap.TEST_02(mychar,byref(len(mychar)))
> No warranty :)

I try with your suggestions and the error persists, now with the text
WindowsError: exception: access violation reading 0x00C25000


0
solisgb (21)
6/6/2007 12:04:47 PM
On 6 jun, 10:57, SimonG <s...@whiteowl.co.uk> wrote:
> On Jun 6, 7:53 am, highegg <high...@gmail.com> wrote:
>
> > Fortran compilers sometimes pass a hidden integer length argument
> > along with a string. This is typically done for character(*)
> > arguments, for fixed-len characters it's not necessary, but CVF is
> > old, so who knows? I suggest you try defining TEST_02 with
> > CHARACTER(*):: a
> > and calling it from Python as
> > ap.TEST_02(mychar,byref(len(mychar)))
> > No warranty :)
>
> Some compilers add the length argument to the end of the arg list
> whilst others (like CVF) add it immediately after the character(*)
> argument - and some have options to enable you to choose (ifort I
> think).
>
> Simon Geard

I have coded
ap.TEST_02(byref(len(mychar)),mychar)
and the message error is similar

0
solisgb (21)
6/6/2007 12:08:13 PM
solisgb@gmail.com wrote:
| On 6 jun, 08:53, highegg <high...@gmail.com> wrote:
|| Fortran compilers sometimes pass a hidden integer length argument
|| along with a string. This is typically done for character(*)
|| arguments, for fixed-len characters it's not necessary, but CVF is
|| old, so who knows? I suggest you try defining TEST_02 with
|| CHARACTER(*):: a
|| and calling it from Python as
|| ap.TEST_02(mychar,byref(len(mychar)))
|| No warranty :)
| 
| I try with your suggestions and the error persists, now with the text
| WindowsError: exception: access violation reading 0x00C25000

Should be byval, actually.

Alternatively, on the CVF side, you can add 

!DEC$ATTRIBUTES REFERENCE:: stringarg

to suppress the hidden length argument; in that case, you also have to 
pass the character length by other means (normally, as a separate real
argument) and declare the argument as CHARACTER(length) (as opposed to
CHARACTER(*))


-- 
 Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.
0
jdujic (694)
6/6/2007 3:16:04 PM
On 6 jun, 17:16, "Jugoslav Dujic" <jdu...@yahoo.com> wrote:
> soli...@gmail.com wrote:
>
> | On 6 jun, 08:53, highegg <high...@gmail.com> wrote:
> || Fortran compilers sometimes pass a hidden integer length argument
> || along with a string. This is typically done for character(*)
> || arguments, for fixed-len characters it's not necessary, but CVF is
> || old, so who knows? I suggest you try defining TEST_02 with
> || CHARACTER(*):: a
> || and calling it from Python as
> || ap.TEST_02(mychar,byref(len(mychar)))
> || No warranty :)
> |
> | I try with your suggestions and the error persists, now with the text
> | WindowsError: exception: access violation reading 0x00C25000
>
> Should be byval, actually.
>
> Alternatively, on the CVF side, you can add
>
> !DEC$ATTRIBUTES REFERENCE:: stringarg
>
> to suppress the hidden length argument; in that case, you also have to
> pass the character length by other means (normally, as a separate real
> argument) and declare the argument as CHARACTER(length) (as opposed to
> CHARACTER(*))
>
> --
>  Jugoslav
> ___________www.xeffort.com
>
> Please reply to the newsgroup.
> You can find my real e-mail on my home page above.

I change the fortran subroutine to

subroutine TEST_02(a,n)
!DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
INTEGER(4):: n
CHARACTER(len=n):: a
....
passing a and n by value and by reference from python the error
message is ValueError: Procedure probably called with not enough
arguments (4 bytes missing).

I also have used the /iface:nomixed_str_len_arg compiler option with
the same result


0
solisgb (21)
6/6/2007 4:45:50 PM
You should have cross-posted your message to comp.lang.python from the
beginning. Since you still have a problem, I suggest summarizing what
you have tried so far in a new message to comp.lang.python . Questions
about how to interface Python to other languages (most often C) arise
often there and are considered on-topic.

0
beliavsky (2212)
6/6/2007 4:55:59 PM
On 6 jun, 18:55, Beliavsky <beliav...@aol.com> wrote:
> You should have cross-posted your message to comp.lang.python from the
> beginning. Since you still have a problem, I suggest summarizing what
> you have tried so far in a new message to comp.lang.python . Questions
> about how to interface Python to other languages (most often C) arise
> often there and are considered on-topic.

I did, without a solution. My feeling is:

1.- There are not a simple solution.
2.- Is a problem between C and fortran. In python, the module ctypes
exports python types to c, not to fortran (not is ftypes).

0
solisgb (21)
6/6/2007 8:10:27 PM
On 6 Jun, 21:10, soli...@gmail.com wrote:
> On 6 jun, 18:55, Beliavsky <beliav...@aol.com> wrote:
>
> > You should have cross-posted your message to comp.lang.python from the
> > beginning. Since you still have a problem, I suggest summarizing what
> > you have tried so far in a new message to comp.lang.python . Questions
> > about how to interface Python to other languages (most often C) arise
> > often there and are considered on-topic.
>
> I did, without a solution. My feeling is:
>
> 1.- There are not a simple solution.
> 2.- Is a problem between C and fortran. In python, the module ctypes
> exports python types to c, not to fortran (not is ftypes).

I can reassure you at least that there is no problem cross-calling
between fortran and c if you're using simple data types (real,
character, integer or arrays thereof). CAD systems often have mixtures
of c and fortran and such cross-calling is bread an butter to them. c
interoperability is part of f2003 so you might make life easier for
yourself if you try a compiler that supports that functionality (I
think g95 is one). I suggest you look at the interface between python
and c. If python is passing structs then cross calling gets harder.

Simon Geard

0
simon9085 (164)
6/6/2007 10:10:56 PM
solisgb@gmail.com wrote:
| On 6 jun, 17:16, "Jugoslav Dujic" <jdu...@yahoo.com> wrote:
|| soli...@gmail.com wrote:
|| 
||| On 6 jun, 08:53, highegg <high...@gmail.com> wrote:
|||| Fortran compilers sometimes pass a hidden integer length argument
|||| along with a string. This is typically done for character(*)
|||| arguments, for fixed-len characters it's not necessary, but CVF is
|||| old, so who knows? I suggest you try defining TEST_02 with
|||| CHARACTER(*):: a
|||| and calling it from Python as
|||| ap.TEST_02(mychar,byref(len(mychar)))
|||| No warranty :)
||| 
||| I try with your suggestions and the error persists, now with the text
||| WindowsError: exception: access violation reading 0x00C25000
|| 
|| Should be byval, actually.
|| 
|| Alternatively, on the CVF side, you can add
|| 
|| !DEC$ATTRIBUTES REFERENCE:: stringarg
|| 
|| to suppress the hidden length argument; in that case, you also have to
|| pass the character length by other means (normally, as a separate real
|| argument) and declare the argument as CHARACTER(length) (as opposed to
|| CHARACTER(*))
|| 
|| --
||  Jugoslav
|| ___________www.xeffort.com
|| 
|| Please reply to the newsgroup.
|| You can find my real e-mail on my home page above.
| 
| I change the fortran subroutine to
| 
| subroutine TEST_02(a,n)
| !DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
| INTEGER(4):: n
| CHARACTER(len=n):: a
| ...
| passing a and n by value and by reference from python the error
| message is ValueError: Procedure probably called with not enough
| arguments (4 bytes missing).

But you didn't specify !DEC$ATTRIBUTES REFERENCE:: a. 

CHARACTER(*) and CHARACTER(n) don't make difference from the
caller's perspective. !DEC$ATTRIBUTES REFERENCE specifies
"I don't want the hidden length passed; I'll declare it 
by other means".
 
| I also have used the /iface:nomixed_str_len_arg compiler option with
| the same result

....because you didn't specify REFERENCE, but just swapped the order
of the "real" arguments.

-- 
 Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.
0
jdujic (694)
6/7/2007 9:36:20 AM
solisgb@gmail.com wrote:
| On 6 jun, 18:55, Beliavsky <beliav...@aol.com> wrote:
|| You should have cross-posted your message to comp.lang.python from the
|| beginning. Since you still have a problem, I suggest summarizing what
|| you have tried so far in a new message to comp.lang.python . Questions
|| about how to interface Python to other languages (most often C) arise
|| often there and are considered on-topic.
| 
| I did, without a solution. My feeling is:
| 
| 1.- There are not a simple solution.

There is. You just fail to pick up the correct combination.
To repeat, those are:

1)
ap.TEST_02(mychar,byval(len(mychar))) //or whatever is Python correct syntax
subroutine TEST_02(a)
....!DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
....CHARACTER(*):: a
end subroutine

2)
ap.TEST_02(mychar,byref(len(mychar)))
subroutine TEST_02(a,n)
....!DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
   !DEC$ATTRIBUTES REFERENCE:: a
   INTEGER:: n
....CHARACTER(n):: a
end subroutine

-- 
 Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.
0
jdujic (694)
6/7/2007 9:39:05 AM
On 7 jun, 11:39, "Jugoslav Dujic" <jdu...@yahoo.com> wrote:
> soli...@gmail.com wrote:
>
> | On 6 jun, 18:55, Beliavsky <beliav...@aol.com> wrote:
> || You should have cross-posted your message to comp.lang.python from the
> || beginning. Since you still have a problem, I suggest summarizing what
> || you have tried so far in a new message to comp.lang.python . Questions
> || about how to interface Python to other languages (most often C) arise
> || often there and are considered on-topic.
> |
> | I did, without a solution. My feeling is:
> |
> | 1.- There are not a simple solution.
>
> There is. You just fail to pick up the correct combination.
> To repeat, those are:
>
> 1)
> ap.TEST_02(mychar,byval(len(mychar))) //or whatever is Python correct syntax
> subroutine TEST_02(a)
> ...!DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
> ...CHARACTER(*):: a
> end subroutine
>
> 2)
> ap.TEST_02(mychar,byref(len(mychar)))
> subroutine TEST_02(a,n)
> ...!DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
>    !DEC$ATTRIBUTES REFERENCE:: a
>    INTEGER:: n
> ...CHARACTER(n):: a
> end subroutine
>
> --
>  Jugoslav
> ___________www.xeffort.com
>
> Please reply to the newsgroup.
> You can find my real e-mail on my home page above.


1) runs fine, 2) not

The final example must be:

#Python script calling fortran subroutine
from ctypes import *
ap = windll.LoadLibrary(self.locationDll)
ap.TEST_02.restype=None
myCadena='D:\BBDD\PythonScripts\pru.txt'
strLen=len(myCadena)
pf_myCadena = c_char_p(myCadena)
pf_srLen = c_int(strLen)
ap.TEST_02(pf_myCadena,pf_srLen)

!fortran dll
subroutine TEST_02(s)
  !DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
  !DEC$ATTRIBUTES REFERENCE:: s
  !INTEGER(4):: n
  CHARACTER(*):: s

  open (unit=31,file=trim(s))
  write(31,'(f0.1)') 1.0
  write(31,*) trim(s)
  write(31,'(i0)') len_trim(s)
  close(31)
  return
END subroutine


Thanks

0
solisgb (21)
6/7/2007 3:19:12 PM
solisgb@gmail.com wrote:
| On 7 jun, 11:39, "Jugoslav Dujic" <jdu...@yahoo.com> wrote:
|| soli...@gmail.com wrote:

| 1) runs fine, 2) not
|
| The final example must be:
|
| !fortran dll
| subroutine TEST_02(s)
|  !DEC$ ATTRIBUTES DLLEXPORT :: TEST_02
|  !DEC$ATTRIBUTES REFERENCE:: s
|  !INTEGER(4):: n
|  CHARACTER(*):: s
|
| END subroutine

Uh, you're right; my bad. Sorry, I was so convinced that I didn't
bother looking at the manual. After I did, I discovered that they made
it so complicated that, after 10 years of mixed-language programming
experience with CVF, I got confused (again):

<quote>
1) If REFERENCE (only) is specified for a character argument, the following 
occurs:

 *On Windows systems, hidden lengths immediately follow the variable....
2) If REFERENCE is specified for a character argument, and C (or STDCALL) has 
been specified for the routine, the string is passed with no length. This is 
true even if REFERENCE is also specified for the routine.
3) If REFERENCE and C (or STDCALL) are specified for a routine, but REFERENCE 
has not been specified for the argument, the string is passed with the length.
</quote>

I have always used REFERENCE in combination with C or STDCALL (case 2),
so I naively expected that it also holds to case 1 (i.e. yours). In
other words, in your last version, REFERENCE is spurious :-D

Blame Can^H^H^H Microsoft, as always (AFAIK it's originally their semantics)

And morale: prefer RTFM to random usenet users :-).
-- 
 Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above. 

0
jdujic (694)
6/7/2007 3:38:13 PM
On 6 jun, 18:55, Beliavsky <beliav...@aol.com> wrote:
> You should have cross-posted your message to comp.lang.python from the
> beginning. Since you still have a problem, I suggest summarizing what
> you have tried so far in a new message to comp.lang.python . Questions
> about how to interface Python to other languages (most often C) arise
> often there and are considered on-topic.

I did, without a solution. My feeling is:

1.- There are not a simple solution.
2.- Is a problem between C and fortran. In python, the module ctypes
exports python types to c, not to fortran (not is ftypes).

0
solisgb (21)
6/8/2007 9:06:25 AM
Reply:
Similar Artilces:

Re: call execute crashing #6
hi ... having done this before, it's neat to see other approaches ... this skips both CALL EXECUTE and PROC SQL, but does use PROC DATASETS (as recommended by Richard) ... another idea, * data set with ODD names; data odd; retain qq ww ee rr tt yy .; stop; run; * put the ODD names into a data set; title 'OLD NAMES AND LABELS'; proc contents data=odd out=oddc (keep=name); ods select variables; run; * use a data step to write RENAME and LABEL statements; filename r temp; filename l temp; data _null_; set oddc; file r; put 'rename ' name '= indu' _n_ ';'; ...

SAP tech consultants. modules: FI, MM, PP, CRM, QM, SD, CO (APO also preferred) (45335914403)
SAP tech consultants. modules: FI, MM, PP, CRM, QM, SD, CO (APO also preferred) (45335914403) ============================================================================================== NONE ..45335914403. ...

char * call-by-reference problem
When I call ---->>> SetLog("WinMain", Msg("Loading %s ...", filename)); <<--- TCHAR *Msg(TCHAR *szFormat, ...) { TCHAR szBuffer[1024]=""; // Large buffer for long filenames or URLs const size_t NUMCHARS = sizeof(szBuffer) / sizeof(szBuffer[0]); const int LASTCHAR = NUMCHARS - 1; // Format the input string va_list pArgs; va_start(pArgs, szFormat); // Use a bounded buffer size to prevent buffer overruns. Limit count to // character size minus one to allow for a NULL terminating character. _vsntprintf(szBuffer...

FAQ 8.20 How can I call my system's unique C functions from Perl? #4 1201810
This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.20: How can I call my system's unique C functions from Perl? In most cases, you write an external module to do it--see the answer to "Where can I learn about linking C with Perl? [h2xs, xsubpp]". How...

Python self-evaluating strings
Hi all, An earlier post today got me thinking about "quines" (programs that output themselves) in Python. I tried to find some on the web but didn't find many ([1]). In particular I didn't find any that corresponded to my instinctive (LISP-induced, probably) criterion: def self_evaluating(s): "Return True if string s evaluates to itself" return s == eval(s) Here is the result of my efforts so far: 1. Starting from the classic idea (lambda x:x%x)('lambda x:x%x') I got the following v=(lambda x:x%('"''""'+x+'&...

Amazon api
i've used the Amazon PHP api for several months now to pull amazon data into my affiliate site - but recently i'm starting to get "call to undefined function" errors " Fatal error: Call to undefined function: asinsearchrequest() in" What's strange is that problem is intermittent - and there is no way to reproduce it exactly - it just appears to come and go. I'm using nusoap as well. Whilst googling around , i noticed another site has a similar issue: http://film.de/shophomecinema.php if the page appears normally, just refresh a few times to get the amaz...

Recursive calls with Ellipses
I'm trying to write a wrapper functions for a function that uses the stdarg.h ellipses notation for variable arguments. In essense, if the original function is: void foo(int n, ...){ //body } I want to write a function like: void foo_wrapper (int n, ...){ //some stuff foo(n, ##SOMETHING##); //some other stuff } Where the ##SOMETHING## is exactly what satisfied the "...". How do I do this? I tried naively giving "foo" a va_list, but that lead to some fun segmentation errors. Any other thoughts? -- comp.lang.c.moderated - mo...

OUT param in Function called from JDBC
Hi I am having a problem with a PLSQL function I want to call through JDBC. The function has two OUT params and also returns a ref cursor. FUNCTION FCN_GET_WP(p_policy_ref IN VARCHAR2, p_date IN DATE, p_success OUT NUMBER, p_error_desc OUT VARCHAR) RETURN WP_REF_CURSOR; I am calling it like this in the Java code: cs = connection.prepareCall("? = call FCN_GET_WP(?,?,?,?)"); // set the ref cursor to be the fi...

Beta Testers called
Hi, We are looking for beta testers to test our product, PrintTuner. PrintTuner is available for download from http://www.graphicshighway.com Do contact me for knowing more details of the product. As a gesture, a beta tester would receive a license in exchange for their efforts. Thanks Graphicshighway Team ...

Call for Papers: Special Track on Applied Cryptology and Network Security (STACNS), USA, July 2008 #2
Special Track on Applied Cryptology and Network Security (STACNS) July 14-17, 2008, Las Vegas, USA A number of Special Sessions on Applied Cryptology and Network Security will be organized within the 2008 International Conference on Security and Management (SAM'08), July 14-17, 2008, Monte Carlo Resort, Las Vegas, USA. This conference is an annual meeting on quality papers focusing on the latest developments in security. The goal of these sessions is to explore the research work of graduate students, and junior faculty/researchers. Topics of Interest Topics of interest include, but ar...

OT: Now that's what I *call* a "Fly-Mo"
http://www.jumpingpixels.com/747lawn.html -- K. http://slated.org - Slated, Rated & Blogged This message has not been photoshopped in any way. Fedora Core release 5 (Bordeaux) on sky, running kernel 2.6.16-1.2133_FC5 06:34:25 up 26 days, 6:51, 2 users, load average: 1.45, 1.35, 1.29 __/ [ [H]omer ] on Friday 14 July 2006 06:36 \__ > http://www.jumpingpixels.com/747lawn.html Sh*t. I can no longer argue that Vista will will ship when lawn mowers fly. It was on Friday 14 July 2006 11:09 am, that Roy Schestowitz apparently said: > __/ [ [H]omer ] on Friday 14 July 2006 06:36 ...

Make outgoing call
On a Cisco AS5300 how can I go about making an outgoing test call on a PRI? Do you mean a voice call? If so try "csim start <what ever number you want to dial>" Matt <spammers@are.bad.com> wrote in message news:<cbekev02ii8@enews3.newsguy.com>... > On a Cisco AS5300 how can I go about making an outgoing test call on a PRI? ...

plugin.dll not found :(
Hi, when I start Gimp on WinXP it say : "plugin.dll" not found , a new installation may resolv the problem...I've tried but I've the same problem, I've tried also to install into another directory... PS : it's the version 1.2.5 with library for GIF...before were too instable PS2 : Gimp for linux is too better ;) Xoen <xoenNO@SPAMlibero.it> In article <ltXkb.319957$R32.10591327@news2.tin.it>, Xoen wrote: > Hi, when I start Gimp on WinXP it say : "plugin.dll" not found , a new > installation may resolv the problem...I've tried but...

Issues with Proc::ProcessTable module on Solaris 9
Hi, I have a script using Proc::ProcessTable module to read process table and report stats. The problem is the script hangs when reporting on CPU percent. I'm using 'pctcpu' method to get the CPU utilization. It works fine on other systems such as Linux or Solaris 10. Is anybody aware of issues with Solaris 9. Thanks in advance. Rajesh ...

Call for Papers Reminder (extended): The World Congress on Engineering WCE 2014
Call for Papers Reminder (extended): The World Congress on Engineering WCE 2014 From: International Association of Engineers (IAENG) Draft Paper Submission Deadline (extended): 14 March, 2014 Camera-Ready papers & Registration Deadline: 31 March, 2014 WCE 2014: London, U.K., 2-4 July, 2014 http://www.iaeng.org/WCE2014 The WCE 2014 is organized by International Association of Engineers (IAENG), a non-profit international association for the engineers and the computer scientists. The congress has the focus on the frontier topics in the theoretical and applied engineering and...

driving_site and local function call
oracle 10G R2: I've got this query accessing a lot of remote data via database link. Therefore hint DRIVING_SITE is used to make the query happen on the remote server. Now I've done a change, I call a local package function, which makes the hint being ignored. The query looks something like this select /*+DRIVING_SITE(table1) */ <col1>, ... , local_package.myfunc() from table1@remotedb inner join table2@remotedb on <join condition> ... When I comment the function call everything works as excpected, but when the function call is uncommented the ...

declaring module functions in the module itself
Hello, I am in the process of getting a better grasp on using modules to keep things organized. I ran into something and I was wondering if anyone would care to chime in on the matter. I have a module which contains several subroutines and a function. The function is only to be used by the subroutines. The rules from my textbook state that the calling subroutine/program of a function must declare the type of the function. I was thinking I would be clever: I would declare the type of the function at the top of the module (outside of the contains statement), so that the subroutines would all...

mex - matlab calls fortran which calls matlab which calls fortran
Dear All, I'm trying to link matlab and fortran with mex files and engine matlab, in linux OS. My general purpose is the following: 1) a matlab script A calls a mex function B based upon fortran source code 2) mex function B calls another function in matlab C within matlab engine 3) matlab routine C calls another mex file in fortran D While i'm able to do steps 2) and 3), I can't do step 1). Before to show the code, please reply to this simple question: Is it possible to build the overall process 1-3? On 8 Okt, 16:37, "Michele Catalano" <cata...@yahoo.it> wr...

Python Challenge ahead [NEW] for riddle lovers
For the riddles' lovers among you, you are most invited to take part in the Python Challenge, the first python programming riddle on the net. You are invited to take part in it at: http://www.pythonchallenge.com pythonchallenge wrote: > For the riddles' lovers among you, you are most invited to take part > in the Python Challenge, the first python programming riddle on the net. > > You are invited to take part in it at: > http://www.pythonchallenge.com That was pretty fun. Good for a Friday. Too bad it comes to an abrupt "temporary end". Shane P.S. I ho...

European Grid Conference : EGC2005
European Grid Conference 2005 http://genias.biz/egc2005 February 14 - 16, 2005, Amsterdam Science Park Amsterdam, The Netherlands =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Call for: - Papers in scientific track - Proposals for industrial events - Proposals for special events =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The European Grid Conference EGC2005 is the premier event on Grid Computing in Europe. It will focus on all aspects of Grid computing in Europe and a such will bring together participants from research and industry. EGC 2005 is a follow-up of the AcrossGrids Conferences...

valgrind python 2.3.4
Running python 2.3.4 on valgrind (a tool like purify which checks the use of uninitialized memory, etc), gives a lot of errors. See below. jfj@cluster:~/> python -V Python 2.3.4 jfj@cluster:~/> valgrind python ==10517== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==10517== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. ==10517== Using valgrind-2.0.0, a program supervision framework for x86-linux. ==10517== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. ==10517== Estimated CPU clock rate is 533 MHz ==10517== For more details, rerun w...

Re: Calling program and called program #5
Personally speaking I wouldn't write code this way to update records. My method would be: PROCEDURE DIVISION. ..... ..... PERFORM UPDATE-PARA thru UPDATE-PARA-EXIT. close files here... STOP RUN. UPDATE-PARA. CALL "DBLOCK" using ..... if code not = 0 display error go to UPDATE-PARA-EXIT end-if. CALL "DBFIND" using .... if code = 17 go to UPDATE-PARA-EXIT end-if. if code not = 0 display error go to UPDATE-PARA-EXIT end-if. if chain-length = 0 go to UPDATE-PARA-EXIT end-if. perform DBGET-para thru DBGET-para-exit. CAL...

mysql python Newbie Question
Hi I would like to create a program that accesses mysql from a gui on my local computer "mysql is on a server" but I am fairly new to python and programming GUI's in general What I would like this program to do is be able to access my server and change update add and delete records from my databases without having to write sql. I can create the GUI fairly easily but I do not know how I or what functions and modules would be needed to do this or how to write them "Forgive me if I sound to Newb" If someone out there could help me out maybe offer advice or even better ...

---Module Installation Image::Info
Hi, Dear all I am old starter of per and is showing a program to my boss but the program error without Image::Info I then start to install this module but the result is wrong. The beow is screen copy: Somebody can help me to fix this progrmam. Bill Zhao ==========================Screencopy================================ [root@bz2003 mapivi0144]# perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.59_54) ReadLine support available (try 'install Bundle::CPAN') cpan> install Image::Info CPAN: Storable loaded ok Going to read /root/.cpan/Metadat...

VB Software Registration Module
Hello -- I'm currently working on writin g a program that is near completion and almost ready for distribution. This is a business applicaton that I hope I can sell to a few large companies to be used within their data centers. As a result, I would like to know if there are any sample code modules, or articles, etc., written for implementing a software registration system within VB. I would like something that can have a trial with expiration date or something that may have limited capabilities unless it is registered. In fact, I may want to include some sort of registratio...