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 6944807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:21:19+00:00 2026-05-27T13:21:19+00:00

I have a collection of simple elements in C#. Element is like: public class

  • 0

I have a collection of simple elements in C#. Element is like:

public class Element
{
    public string AName { get; private set; }

    public string PName { get; private set; }

    public string Value { get; set; }
}

I need to pass this collection as a string to a Python script. And in python for each element I need to call function like Func(AName, PName, Value). I’ve done this by serializing collection to JSON in C# and in python write code:

elements = json.loads(JSON)
for element in elements:
    Func(routeLayer, element['AName'], element['PName'], element['Value'])

But now it turns out that I cannot use Python’s json module. So I need a new way to pass this collection to script and dont use any additional modules. I am a real noob in Python, so solutions I can imagine are ugly. Can you give me an advice?

  • 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-27T13:21:20+00:00Added an answer on May 27, 2026 at 1:21 pm

    If there is some character which you can guarantee is not in the strings for AName,PName and Value then you could use that character as a separator.
    In C#, you could “serialize” the information by simply joining the three strings with the separator, e.g. "foo,bar,baz".

    Then in Python, the information could be deserialized with

    aName,pName,value = element.split(',')
    

    PS. Just out of curiosity, why can’t you import modules in the standard library?

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

Sidebar

Related Questions

I have a class CollectionOfThings . As its name suggests its a simple collection
I have a simple class derived from a generic list of string as follows:
Say I have a class, something like the following; class MyClass { public: MyClass();
in my Silverlight 4 project, I have a simple class implementing the interface like:
I have simple XML which I would like to query for mnemonic collection. <?xml
I have a collection of objects to which I'd like to just add a
I have a collection of classes that inherit from an abstract class I created.
I have a collection of elements that I need to operate over, calling member
As in the backbone-todolist example,I have a collection of elements. I made 2 views,
Let's say I have a simple class Cat in C#, with a Name property

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.