matkuki / python3 Goto Github PK
View Code? Open in Web Editor NEWPython 3 wrapper for Nim
Python 3 wrapper for Nim
I am getting this weird error when i try to compile my code (transpiled from the python wiki for interoping with C/C++)
import python3
proc spam_system*(self: PyObjectPtr, args: PyObjectPtr): static PyObjectPtr {.cdecl.} =
var
command: ptr char
sts: int
if PyArg_ParseTuple(args, "s", &command) == 0:
return nil
sts = system(command)
return PyLong_FromLong(sts)
i have no clue why it does that.
The main nim module has stringAsString for accessing a Python string as cstring. I notice this python3 module has equivalent for longAsLong, but I don't see stringAsString. Is there another mechanism for accessing a string that I'm missing?
I see this hasnt been updated in a while, are there any plans on updating it?
Tested a simple example and got the following error when compiling:
python3.nim(1577, 16) Error: undeclared identifier: 'PyUCS4'
Looking at the definition of PyUCS4 I can see the issue if I run this:
echo sizeof(int).`$`
echo sizeof(clong).`$`
Which outputs:
8
8
Hello.
Can this wrapper be used for writing python extensions (which will be compiled to .so files, which are imported by Python) ?
(just like Cython does: it compiles to files, which can be imported as general Python modules)
Thank you.
Best regards,
Vladislav.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.