Comments (4)
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.
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.
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.
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 Systemx = 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)
- Can't use Dictionary<int, float> and .items() together
- Can not import module of custom dll
- Cannot import tkinter in Python.Net code
- Are rich comparisons (PEP 207) implemented?
- Issue working with modules on Ubuntu 22.04 but works on Windows 11
- StackOverflowException when importing third party libraries in .NET on macOS 14.5. HOT 16
- Program shutting down with no error when doing : PythonEngine.Initialize();
- Cannot import references using 'import' command on windows
- PythonEngine fails to initialize in VSIX extension
- Weird behavior of casting nd.ndarray on different types
- Crash when executing script creating tkinter window multiple times and then closing window
- Model training time increase more than 10x in some case
- PyObject.FromManagedObject(value); does not convert C# bool to Python bool HOT 2
- Importing from DLL works only when namespace != assembly name
- What is the best practice for packaging Python in your application?
- InterfaceObjects cannot address properties outside their declaration HOT 2
- Add to the docs that runtimeconfig.json from a self-contained project is not supported HOT 1
- The model slows down on GPU
- Performance question on List conversion from python to c#.
- Update documentation to reflect API changes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonnet.