Skip to content

abdulniyaspm/py_rust_hostname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

py_rust_hostname

A simple python extension written in Rust to get the name of the localhost.

Usage example

  • Clone the project
  • Build the project using cargo build --release
  • Navigate to the release folder(target/release)
  • On MacOS rename libpy_rust_hostname.dylib to py_rust_hostname.so. On Linux rename libpy_rust_hostname.so to py_rust_hostname.so(Windows is not supported as this extension use libc under the hood)
  • Now you are ready to import the module. Let's test it!.

Open your python interpretter

>>> import py_rust_hostname
>>> py_rust_hostname.get_hostname.__doc__
'Return the name of the localhost'
>>> py_rust_hostname.get_hostname()
'<Your Hostname will be displayed here>'
>>> dir(py_rust_hostname)
['__all__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'get_hostname']

Meta

Abdul Niyas P M – @AbdulNiyas19[email protected]

Github Profile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages