Hi Carlos,

sorry for being to "very precise".

Of course the easiest way is to switch manually to Spyder and run the 
script. But what I am aiming for is an automated workflow. So I will try to 
explain this in more detail.

Our Microscope Control Software (ZEN Blue) is written in C# and used 
IronPython as the internal scripting language. That is the place where the 
user can automate their experiments. And this is where I wnat to start a 
"normal" python script within Spyder. Usually I start python scripts like 
this from inside the ZEN Blue software:

-------------------------IRON PYTHON SCRIPT IN ZEN BLUE  (just parts)   
------------------------
import clr
from System.Diagnostics import Process
...

# this is the location of the script use to plot the data
# use this version for a general approach -->; pass filename, X-column and 
Y-column to plot directly from the macro
script1 = r'C:\My Scripts\PlotData_Example.py' # this is a "normal" python 
script
    
# those are the parameters - filename, (X-Column and Y-Column)
# this one for the general approach
params1 = ' -f ' + csvfile + ' -x 2 -y 0 -r 2'
    
# start the data display script as an external application
app1 = Process();
app1.StartInfo.FileName = script1
app1.StartInfo.Arguments = params1
app1.Start()

----------------------------------------------------------------------------------

Since python script *.py are associated with python.exe the script will be 
started easily this way. But when I do this the data (numpy array, ...) are 
lost unless the script explicitly saves the data somewhere. but what I 
would like to do is starting the same script from our Software within 
Spyder. This way I would not have to save the data and reload again, 
because they would be available within Spyder for further processing.
For me (as a non-expert) the question is how to start my python Script 
within the active Sypder python or Ipython console. But I do not know yet, 
how to do it or even if this is possible at all.

I hope this explains the workflow a bit better.

Cheers,  Sebi 




Am Samstag, 25. Oktober 2014 19:49:44 UTC+2 schrieb Carlos Córdoba:
>
>  Hi,
>
> I'm not sure if I exactly follow you. How does this external app start 
> your script? Do you really need it to do it? I mean, the easiest way would 
> be to switch your external app for Spyder itself but it's a bit hard to 
> give you further advice without knowing more details :-)
>
> Cheers,
> Carlos
>
>  El 25/10/14 a las 04:43, sebastian06 escribió:
>  
> Hi,
>
> I have a python script that uses the python wrapper for the BioFormats 
> library. It works fine for imorting my image data sets, which show up in 
> Spyder as a numpy array.
>
> Now I want uo start this script from an external application within 
> Spyder, because I want to process the array afterwards. Just starting a 
> script is easy, but I do not know how to start it within Spyder from an 
> external app. What would be the easiest way to do this?   
>
> Cheers, Sebi
>
>
>  
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.
>
>
> 

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to