Code Monkey home page Code Monkey logo

Comments (4)

tonyroberts avatar tonyroberts commented on September 27, 2024

Python integers don't have a ToString method. Python for .NET allows you to import .NET assemblies into cPython, it doesn't do anything to the native Python types.

The nPython interpreter is a cPython interpreter, it is not running Python code in the CLR. The int in your example is a plain python int, not a .net integer. In Python to convert an int to a string you can use the 'str' function.

from pythonnet.

yuvval avatar yuvval commented on September 27, 2024

Thanks.
That what I thought, but I was hoping I to be wrong.

On Mon, Feb 23, 2015 at 6:33 PM, Tony Roberts [email protected]
wrote:

Python integers don't have a ToString method. Python for .NET allows you
to import .NET assemblies into cPython, it doesn't do anything to the
native Python types.

The nPython interpreter is a cPython interpreter, it is not running Python
code in the CLR. The int in your example is a plain python int, not a .net
integer. In Python to convert an int to a string you can use the 'str'
function.


Reply to this email directly or view it on GitHub
#68 (comment).

from pythonnet.

tonyroberts avatar tonyroberts commented on September 27, 2024

You can construct .net integer types using python for .net, if you need to:

import clr
import System

x = System.Int32(22)
x.ToString()

Maybe that helps?

from pythonnet.

yuvval avatar yuvval commented on September 27, 2024

Thanks.

I just manually updated the code to use '{}'.format(x).

My question was in order to understand the compatibility between iPython
and nPython.

On Mon, Feb 23, 2015 at 8:20 PM, Tony Roberts [email protected]
wrote:

You can construct .net integer types using python for .net, if you need to:

import clr
import System

x = System.Int32(22)
x.ToString()

Maybe that helps?


Reply to this email directly or view it on GitHub
#68 (comment).

from pythonnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.