Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6927831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:22+00:00 2026-05-27T11:06:22+00:00

I have a genetic expression tree program to control a bot. I have a

  • 0

I have a genetic expression tree program to control a bot. I have a GP.py and a MyBot.py. I need to be able to have the MyBot.py access an object created in GP.py

The GP.py is starting the MyBot.py via the os.system() command

I have hundreds of tree objects in the GP.py file and the MyBot.py needs to evaluate them.

I can’t combine the two into one .py file because a fresh instance of MyBot.py is executed thousands of times, but GP.py needs to evaluate the fitness of MyBot.py with each tree.

I know how to import the methods and Class definitions using import GP.py, but I need the specific instance of the Tree class object
Any ideas how to send this tree from the first instance to the second?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:06:23+00:00Added an answer on May 27, 2026 at 11:06 am

    You could serialize the object with the pickle module (or maybe json?)

    If you really want to stick with os.system, then you could have MyBot.py write the pickled object to a file, which GP.py could read once MyBot.py returns.

    If you use the subprocess module instead, then you could have MyBot.py write the pickled object to stdout, and GP.py could read it over the pipe.

    If you use the multiprocessing module, then you could spawn the MyBot process and pass data back and forth over a Queue instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a genetic program that prints the expression tree to a file (it
I have a Java program that runs many small simulations. It runs a genetic
I have a (C#) genetic program that uses financial time-series data and it's currently
I have an expression like this Expression<Func<IInterface, object>> How do i loop/traverse through all
I have written a program that generates random expressions and then uses genetic techniques
I have a generic dictonary which is templated in the following manner: Dictionary<object, IList<ISomeInterface>>
I have the following generic method: public bool Any<TEntity>(Expression<Func<TEntity, bool>> whereCondition) where TEntity :
I have a lambda expression which accepts, a int? (nullable integer), which returns value
I have an XElement with values for mock data. I have an expression to
I have Dim objectsList as List(Of Object) = GetAllObjects() ' Filter from Objects just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.