Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
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