Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 17,605 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Python bridge question #476790
04/03/19 10:11
04/03/19 10:11
Joined: Aug 2016
Posts: 27
M
MaskOfZorro Offline OP
Newbie
MaskOfZorro  Offline OP
Newbie
M

Joined: Aug 2016
Posts: 27
I'm trying to use the multiprocessing module in Zorro 2.05 but to no success, ending up with AttributeError: module 'sys' has no attribute 'argv' in the error log.

The script is simply of the form

Quote:
import multiprocessing as mp

def f():
...
p = mp.Process(target = f)
p.start()


where f is some function. Regardless of f or whether I set things up through the .py file in pyStart() or use pyX(), I get the same error.

Googling a bit on this error led me to https://docs.python.org/2.0/api/embedding.html (admittedly for Python 2.0)

Quote:
Py_Initialize() does not set the ``script argument list'' (sys.argv). If this variable is needed by Python code that will be executed later, it must be set explicitly with a call to PySys_SetArgv(argc, argv) subsequent to the call to Py_Initialize().


So I'm wondering if, apart from any possible error on my side, what I'm trying to do is currently just futile.


Last edited by MaskOfZorro; 04/03/19 10:13.
Re: Python bridge question [Re: MaskOfZorro] #476791
04/03/19 11:36
04/03/19 11:36
Joined: Jul 2000
Posts: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
Frankfurt
It is indeed not set since the Zorro argv would make no sense for Python, but can't you directly set sys.argv in your Python script? That should do the same.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1