Giter VIP home page Giter VIP logo

grpc-cpp-python's Introduction

C++, How to communicate with Python?

Communicate with the cpp program while the Python server is running.

using gRPC protocols

Installation

  1. CPP

    > git clone https://github.com/Microsoft/vcpkg.git vcpkg
    > cd .\vcpkg
    > powershell.exe .\bootstrap-vcpkg.bat
    
    # c++ 17
    > git checkout be1e1b72e7c5a9a07268c99c4a50d2ace0e2b469 -- ports/abseil
    > cd .\triplets
    # in x64-windows-static.cmake, x64-windows.cmake
    # append belows
    > set(VCPKG_CXX_FLAGS "/std:c++17")
    > set(VCPKG_C_FLAGS "")
    > cd ..
    
    > .\vcpkg install abseil:x64-windows
    > .\vcpkg install grpc:x64-windows
    > .\vcpkg integrate install
  2. Python

    > python -m venv my_env
    > my_env\Scripts\activate
    (my_env) > pip install grpcio
    (my_env) > pip install grpcio-tools

Compile, Build

  1. Client

    > %CD%\..\vcpkg\installed\x64-windows\tools\protobuf\protoc.exe --proto_path=%CD% --cpp_out=%CD% --grpc_out=%CD% --plugin=protoc-gen-grpc=%CD%\..\vcpkg\installed\x64-windows\tools\grpc\grpc_cpp_plugin.exe %CD%\service.proto
  2. Server

    (my_env) > python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. service.proto

Usage

alt text

grpc-cpp-python's People

Contributors

ce-dric avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.