https://github.com/kit-parco/networkit
Raw File
Tip revision: 02de60d064527410c0acf8e1c8cb0d403c5c1409 authored by Fabian Brandt on 08 September 2020, 08:28:43 UTC
Merge pull request #587 from cndolo/refactor/edgelist-reader
Tip revision: 02de60d
helpers.pyx
# distutils: language=c++

# Cython helper functions

def stdstring(pystring):
	""" convert a Python string to a bytes object which is automatically coerced to std::string"""
	pybytes = pystring.encode("utf-8")
	return pybytes

def pystring(stdstring):
	""" convert a std::string (= python byte string) to a normal Python string"""
	return stdstring.decode("utf-8")

back to top