Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by jcl. 10/09/26 16:00
Stooq now requires an API key
by cwford. 10/08/26 23:27
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (AndrewAMD, cwford, JeyKey II, 1 invisible), 17,133 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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,140
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,140
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