cwrap is a Python wrapper around C code, building upon ctypes.
See examples/
pip install cwrap
Clone this repo and cd into it, then:
pip install -r requirements.txt
python -m pytest -v -s tests
cwrap is a Python wrapper around C code, building upon ctypes.
License: Other
Travis is deprecated.
Should support:
ImportError Traceback (most recent call last)
in ()
----> 1 import cwrap
D:\WPy-x64-3662\python-3.6.6.amd64\lib\site-packages\cwrap_init_.py in ()
44 from .basecvalue import BaseCValue
45
---> 46 from .cfile import CFILE, copen as open
47 from .clib import load, lib_name
48
D:\WPy-x64-3662\python-3.6.6.amd64\lib\site-packages\cwrap\cfile.py in ()
89 from .clib import load as cwrapload
90
---> 91 class LibcPrototype(Prototype):
92 lib = cwrapload(None)
93
D:\WPy-x64-3662\python-3.6.6.amd64\lib\site-packages\cwrap\cfile.py in LibcPrototype()
90
91 class LibcPrototype(Prototype):
---> 92 lib = cwrapload(None)
93
94 def init(self, prototype, bind=False, allow_attribute_error=False):
D:\WPy-x64-3662\python-3.6.6.amd64\lib\site-packages\cwrap\clib.py in load(lib, so_version, path, so_ext)
107 # """ % LD_LIBRARY_PATH
108 # raise ImportError(error_msg)
ImportError:
Failed to load shared library:None
dlopen() error: LoadLibrary() argument 1 must be str, not None
This used to be possible before:
with open("grid.grdecl" , "w") as f2:
f2.write("SPECGRID\n")
f2.write(" 10 10 10 'F' /\n")
coord_kw = f["COORD"][0]
coord_kw.write_grdecl( f2 )
Now it isn't.
open cannot be exhanged with copen, because CWrapFIle does not have a "write" member function.
Describe the bug
When prototype.call is used on a function expecting an int and you give it an instance of basecenum it will give you a ValueError in python3.11, due to stricter type enforcements.
To Reproduce
Run resdata tests onprem, or run this script:
from cwrap import BaseCEnum
from resdata.resfile import ResdataFile
from resdata import FileMode
f1 = ResdataFile("some_file.some", index_filename="index")
will faile with TypeError on python3.11 while it fails on file not found for python3.8.
At the moment, travis is not run on osx as python is not natively supported on osx.
On python 3.6
Line 226 in f5cd749
AttributeError: ArgumentError object has no attribute 'message'.
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.