Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (EternallyCurious, Quad, vicknick), 700 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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 | chip programmers | 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