Instant 0.9
Sponsored Links
Instant 0.9 Ranking & Summary
File size:
0.034 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
1030
Date added:
2007-01-03
Publisher:
Magne Westlie & Kent-Andre Mardal
Instant 0.9 description
Instant is a Python module that allows for instant inlining of C and C++ code in Python. Instant is a small Python module built on top of SWIG.
Example of use:
>>> c_code = """
double sum(double a, double b){
return a+b;
}
"""
>>> import Instant
>>> ext = Instant.Instant()
>>>
>>> # create the wrapper code, compile and link it to a shared library
>>> ext.create_extension(code=c_code, module=test1_ext)
>>>
>>> # use the C code
>>> from test1_ext import sum
>>> print sum(3.7, 4.8)
8.5
Example with NumPy arrays converted to C double arrays:
>>> import Instant
>>> import Numeric
>>> import sys
>>> import time
>>>
>>> ext = Instant.Instant()
>>>
>>> c_code = """
/* add function for vectors with all safety checks removed ..*/
void add(int n1, double* array1, int n2, double* array2, int n3, double* array3){
for (int i=0; i
array3[i] = array1[i] + array2[i];
}
}
>>>"""
>>>
>>> ext.create_extension(code=c_code, headers=["arrayobject.h"],
>>> include_dirs=[sys.prefix + "/include/python" + sys.version[:3] + "/Numeric"],
>>> init_code=import_array();, module=test3_ext,
>>> arrays = [[n1, array1],[n2, array2],[n3, array3]])
>>>
>>> from test3_ext import add
>>> a = Numeric.arange(10000); a = Numeric.sin(a)
>>> b = Numeric.arange(10000); b = Numeric.cos(b)
>>> c = Numeric.arange(10000); c = Numeric.cos(c)
>>>
>>>add(a,b,c)
Example of use:
>>> c_code = """
double sum(double a, double b){
return a+b;
}
"""
>>> import Instant
>>> ext = Instant.Instant()
>>>
>>> # create the wrapper code, compile and link it to a shared library
>>> ext.create_extension(code=c_code, module=test1_ext)
>>>
>>> # use the C code
>>> from test1_ext import sum
>>> print sum(3.7, 4.8)
8.5
Example with NumPy arrays converted to C double arrays:
>>> import Instant
>>> import Numeric
>>> import sys
>>> import time
>>>
>>> ext = Instant.Instant()
>>>
>>> c_code = """
/* add function for vectors with all safety checks removed ..*/
void add(int n1, double* array1, int n2, double* array2, int n3, double* array3){
for (int i=0; i
}
}
>>>"""
>>>
>>> ext.create_extension(code=c_code, headers=["arrayobject.h"],
>>> include_dirs=[sys.prefix + "/include/python" + sys.version[:3] + "/Numeric"],
>>> init_code=import_array();, module=test3_ext,
>>> arrays = [[n1, array1],[n2, array2],[n3, array3]])
>>>
>>> from test3_ext import add
>>> a = Numeric.arange(10000); a = Numeric.sin(a)
>>> b = Numeric.arange(10000); b = Numeric.cos(b)
>>> c = Numeric.arange(10000); c = Numeric.cos(c)
>>>
>>>add(a,b,c)
Instant 0.9 Screenshot
Instant 0.9 Keywords
Instant 0.9
Python
python module that allows
module that allows
python module
in python
for instant
C++ code
instant
c
code
import
module
double
Instant 0.9
Libraries
Bookmark Instant 0.9
Instant 0.9 Copyright
WareSeeker periodically updates pricing and software information of Instant 0.9 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Instant 0.9 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Version History
Related Software
Ini.py is a Python module/class that allows developers to utilize Windows .INI files quickly and easily. Free Download
slang is a powerful interpreted language. Free Download
Python PNG encoder/decoder Free Download
Psg is a Python module that lets you create PostScript files by embedding EPS files. Free Download
Interactive Decompiler decompiles by the successive application of low-level refactorings, ultimately leading to high-level code Free Download
discord project is a Python module for converting dates from Gregorian to Discordian. Free Download
Pydiction offers you a powerful and very useful utility which allows you to Tab-complete Python code in Vim, including: standard, custom and third-party modules and packages. Free Download
This provides simple settings for initialization for third party apps and libraries in Python. Free Download
Latest Software
Popular Software
Favourite Software