[slicer-users] How to run external file from Slicer Scripted Module Example?

Madan Rao rao.lms at gmail.com
Fri Feb 19 01:38:40 EST 2010


Hello Steve,

Thanks. Found it at slicer root.

AM Mohan Rao

On Fri, Feb 19, 2010 at 12:00 AM, Steve Pieper <pieper at bwh.harvard.edu>wrote:

> Hi Mohan -
>
> It looks like 'hello.txt' will be written in the slicer current working
> directory - did you look there?
>
> Maybe try changing the argument to fopen to be 'c:/hello.txt' ?
>
> -Steve
>
>
> On F/18/10 10:36 AM, Madan Rao wrote:
>
>> Hello all,
>>
>> I am trying to run a simple hello.cpp program from slicer3:
>>
>> #include <string.h>
>> #include <stdlib.h>
>> #include <stdio.h>
>>
>> void main(){
>> FILE *fp1;
>> fp1=fopen("hello.txt","w");
>>
>> fprintf(fp1,"Hello how are you?\n");
>> fclose(fp1);
>> }
>>
>> hello.exe file is in C:\vmtktest\plugin folder.
>>
>> I changed the following code in ScriptedModuleExampleGUI.tcl
>>
>> proc ScriptedModuleExampleApply {this} {
>>
>>   exec c:/vmtktest/plugin/hello
>> }
>>
>> When I click the apply button in Scripted Module Example module there is
>> no error but the hello.txt is not printed.
>>
>> I can run successfully:
>>
>> exec c:/windows/system32/cmd.exe /c start /min
>> c:/windows/system32/notepad /p myfile.txt
>>
>> What is the correct tcl code to print hello.txt?
>>
>> AM Mohan Rao
>>
>>
>>
>> _______________________________________________
>> slicer-users mailing list
>> slicer-users at bwh.harvard.edu
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>> To unsubscribe: send email to
>> slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the
>> subject
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://massmail.spl.harvard.edu/pipermail/slicer-users/attachments/20100219/fd3dda8b/attachment.html>


More information about the slicer-users mailing list