Hi Corey,
This is just a shot in the dark, as I don’t know the py extension code, but how 
about having your procedure return the file name of the image rather than the 
image itself.

  *   Aaron

--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling


From: netlogo-devel@googlegroups.com <netlogo-devel@googlegroups.com> on behalf 
of Brady, Corey <corey.br...@mail.smu.edu>
Date: Monday, May 6, 2024 at 1:13 PM
To: Jeremy Baker <jeremy.ba...@northwestern.edu>, netlogo-devel 
<netlogo-devel@googlegroups.com>
Subject: Re: [netlogo-devel] Re: Python returning image to NetLogo for 
"import-drawing" or "import-pcolors"
Hi Jeremy –

Thanks for your note!  Clarification below…

In the py extension, there is only the py:runresult  primitive for getting 
information back from python processes.

In the scenario I’m working with, I have created an image (actually, it’ll be 
many frames)..  that I want to bring into netlogo via import-drawing and/or 
import-pcolors.

If I use py:runresult, I get an error that the image is not JSON serializable.

Have others run into this or similar problem & solved it?

Thanks!
-Corey


Corey Brady
Associate Professor, Mathematics Education and the Learning Sciences
corey.br...@smu.edu<mailto:corey.br...@smu.edu>
Department of Teaching and Learning
Simmons School of Education and Human Development
[A blue and red logo    Description automatically generated]

From: <netlogo-devel@googlegroups.com> on behalf of 
"jeremy...@northwestern.edu" <jeremy.ba...@northwestern.edu>
Date: Monday, May 6, 2024 at 11:00 AM
To: netlogo-devel <netlogo-devel@googlegroups.com>
Subject: [netlogo-devel] Re: Python returning image to NetLogo for 
"import-drawing" or "import-pcolors"

You don't often get email from jeremy.ba...@northwestern.edu. Learn why this is 
important<https://urldefense.com/v3/__https:/aka.ms/LearnAboutSenderIdentification__;!!Dq0X2DkFhyF93HkjWTBQKhk!RAnCnEvfBb6CRLSAPt-_1kMJgFyCYaOfURebd13k4jod_ecBFHv2pYl2RIRoTns4H5eR58FvYhBy249OaEWZeC21WAgjhtLP-Z8$>
Hey Corey,

Do you have more details on what the problem you're having is?  What isn't 
working about just using the import primitives as-is?  Do you mean importing 
image data that's generated in the Python extension in a NetLogo model, or just 
generally from Python?

Thanks.

-Jeremy
On Sunday, May 5, 2024 at 3:19:01 PM UTC-5 Brady, Corey wrote:
Hello !
I was wondering if anyone has solved the problem of getting an image created in 
python to NetLogo’s import-xx primitives.
I imagine there are several possible approaches, but it seems like a common 
enough need that someone might have solved the problem already.
Any word of solutions?
Thanks!
-Corey

Corey Brady
Associate Professor, Mathematics Education and the Learning Sciences
corey...@smu.edu
Department of Teaching and Learning
Simmons School of Education and Human Development
[Image removed by sender. A blue and red logo    Description automatically 
generated]
--
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
netlogo-devel+unsubscr...@googlegroups.com<mailto:netlogo-devel+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netlogo-devel/573498f5-65f4-4312-81f8-41013412f1dbn%40googlegroups.com<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/netlogo-devel/573498f5-65f4-4312-81f8-41013412f1dbn*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!Dq0X2DkFhyF93HkjWTBQKhk!RAnCnEvfBb6CRLSAPt-_1kMJgFyCYaOfURebd13k4jod_ecBFHv2pYl2RIRoTns4H5eR58FvYhBy249OaEWZeC21WAgjo5wFpdI$>.
--
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
netlogo-devel+unsubscr...@googlegroups.com<mailto:netlogo-devel+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netlogo-devel/3C0ACB63-9800-4600-AA23-FDCF69691100%40smu.edu<https://urldefense.com/v3/__https:/groups.google.com/d/msgid/netlogo-devel/3C0ACB63-9800-4600-AA23-FDCF69691100*40smu.edu?utm_medium=email&utm_source=footer__;JQ!!Dq0X2DkFhyF93HkjWTBQKhk!RAnCnEvfBb6CRLSAPt-_1kMJgFyCYaOfURebd13k4jod_ecBFHv2pYl2RIRoTns4H5eR58FvYhBy249OaEWZeC21WAgjIPT8zTY$>.

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netlogo-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netlogo-devel/MN2PR05MB6253522DA7012184184BCDC9931C2%40MN2PR05MB6253.namprd05.prod.outlook.com.

Reply via email to