Personal tools
You are here: Home Forum How to use Salome? Exit Salome by python script, Bug?

Exit Salome by python script, Bug?

Up to How to use Salome?

Exit Salome by python script, Bug?

Posted by zedd at October 20. 2011

Hello,

I try to start Salome in TUI Mode, run a script, and close Salome.

It works fine in Salome 5.1.5 but not at 6.1.3.

Is this a bug? 

Or are there other ways to end Salome in version 6.1.3?

 

My Script is in the attachment.

To run it: just enter your paths in config.py and run Start_5_1_5/_6_1_3

 

best regards

zedd

Attachments

Re: Exit Salome by python script, Bug?

Posted by oleg at October 21. 2011

Exeuse me Zedd, I have problem to  close  Salome  prosess on windows. May bee you help me? Thanks


C:\Salome5.1.2_ForTestsOnWindows\release\salome.bat -t  C:\ASTER\release\qw.py

[code]

# -*- coding: iso-8859-1 -*-

 

###

### This file is generated automatically by SALOME v5.1.5 with dump python functionality

###

 

import sys

import salome

 

salome.salome_init()

 

import salome_notebook

notebook = salome_notebook.notebook

sys.path.insert( 0, r'C:/ASTER/release')

 

import qw_GEOM

qw_GEOM.RebuildData(salome.myStudy)

import qw_SMESH

qw_SMESH.RebuildData(salome.myStudy)

 

 

# If launched in text mode, we quit Salome

if not salome.sg.hasDesktop():

    sys.exit()

else:

    # we update the object browser

    salome.sg.updateObjBrowser(0)

 

[/code]

Re: Exit Salome by python script, Bug?

Posted by Richard S. at October 21. 2011

Hello,

I had similar problems when running salome in batch mode.

Try this command at the end of your script to shut salome down:

os._exit(0)

THis works for me in any case.

Regards,

Richard

Re: Exit Salome by python script, Bug?

Posted by zedd at October 24. 2011

Thanks for the answer,

 

i tryed it, but there are some processes still open.

I figured out that Salome has a killSalome.py which really kills all processes.

This works, but I'm not happy with this solution. Is there a way to shutdown Salome?

 

@oleg

I don't know if Salome 5.1.2 has also the killSalome.py file.

Code:

import killSalome

killSalome.killAllPorts()

 

Best Regards,

 

zedd

Re: Exit Salome by python script, Bug?

Posted by zedd at October 24. 2011

*import killSalome.py

Powered by Ploneboard
Document Actions