Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. convert types from IronPython to C#

convert types from IronPython to C#

Scheduled Pinned Locked Moved C#
questioncsharppythontoolstutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lune12
    wrote on last edited by
    #1

    Hi, I have a C# code that include a python script one of my python function return a Tuple, let say:

    def Example():
    a = 3
    b = 4
    return a, b

    now I want to call the Example function from my C# code, but this function return a tuple. How do I handle this? Thanks

    A S 2 Replies Last reply
    0
    • L lune12

      Hi, I have a C# code that include a python script one of my python function return a Tuple, let say:

      def Example():
      a = 3
      b = 4
      return a, b

      now I want to call the Example function from my C# code, but this function return a tuple. How do I handle this? Thanks

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      If the order of the values being returned is not important, you could try returning an array in C# code.

      1 Reply Last reply
      0
      • L lune12

        Hi, I have a C# code that include a python script one of my python function return a Tuple, let say:

        def Example():
        a = 3
        b = 4
        return a, b

        now I want to call the Example function from my C# code, but this function return a tuple. How do I handle this? Thanks

        S Offline
        S Offline
        Sentenryu
        wrote on last edited by
        #3

        i've find that, from ironPython documentation: Appendix - Type conversion rules http://ironpython.net/documentation/dotnet/dotnet.html#appendix-type-conversion-rules[^] tuple with T-typed elements -> System.Collections.Generic.IEnumerable or System.Collections.Generic.IList i guess that when you reference the ironPython code into your C# code, you should use a IEnumerable the full integration documentation: http://ironpython.net/documentation/dotnet/[^] sorry by the english, i'm brazilian and aren't fluent.. :((

        L 1 Reply Last reply
        0
        • S Sentenryu

          i've find that, from ironPython documentation: Appendix - Type conversion rules http://ironpython.net/documentation/dotnet/dotnet.html#appendix-type-conversion-rules[^] tuple with T-typed elements -> System.Collections.Generic.IEnumerable or System.Collections.Generic.IList i guess that when you reference the ironPython code into your C# code, you should use a IEnumerable the full integration documentation: http://ironpython.net/documentation/dotnet/[^] sorry by the english, i'm brazilian and aren't fluent.. :((

          L Offline
          L Offline
          lune12
          wrote on last edited by
          #4

          Thanks

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups