Skip to main content

Python, Golang, Rust 프레임워크 사용법

Published 1 min readMarkdown

파이썬 서버 프레임워크 사용법

pip라는 툴로 프레임웍을 빌드한다. pip install ###

파이썬 커맨드로 코드를 실행한다. python xxx.py

python 에서는 메이븐, cmake 처럼 프로젝트를 관리하는 툴이 어떤 게 있을까?

distutils / setuptools 라고 하는군 https://stackoverflow.com/questions/3324108/maven-equivalent-for-python

언어가 비교적 간단해서 그런가;; 커맨드 사용도 간단한 것 같다. 추가로 벤치 후 포스트를 수정할 것


  • Go lang

여기를 참고하여 설치함 https://medium.com/@RidhamTarpara/install-go-1-11-on-ubuntu-18-04-16-04-lts-8c098c503c5f

환경변수로 다음 사항들을 추가함

~/.zshrc

export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

  • Go 에서의 프로젝트 설치

Go 에서는 get 명령어로 깃 저장소를 가져와 저장한다.

go get -u github.com/firstrow/tcp_server

그러면 GOPATH 경로에 해당 저장소가 다운로드된 것을 볼 수 있다.

❯ find / -name '*xtcp*' /root/go/pkg/linux_amd64/github.com/xfxdev/xtcp.a /root/go/src/github.com/xfxdev/xtcp /root/go/src/github.com/xfxdev/xtcp/xtcp.go


  • 러스트

rustup 인스톨러를 이용해 rust 설치 https://actix.rs/book/actix/

러스트는 패키지 관리를 cargo 라는 프로그램으로 한다.

cargo run --example ping

에코서버 예제를 찾았다. https://ayende.com/blog/176577/first-run-with-rust-the-echo-server

예제 코드를 컴파일하고, 실행한다. rustc echo.rs ./echo

No comments yet. Be the first to comment.

More from this blog