반응형
반응형

The Visual Studio Code Server is a service you can run on a remote development machine, like your desktop PC or a virtual machine (VM). It allows you to securely connect to that remote machine from anywhere through a local VS Code client, without the requirement of SSH.

 

https://code.visualstudio.com/docs/remote/vscode-server

 

Visual Studio Code Server

Using Visual Studio Code Server

code.visualstudio.com

 

반응형
반응형

영리한 개발자와 현명한 개발자의 차이점

문제를 피하는 것이 문제를 해결하는 것보다 빠릅니다

반응형
반응형

Laptop development is dead: why remote development is the future

https://medium.com/@elliotgraebert/laptop-development-is-dead-why-remote-development-is-the-future-f92ce103fd13

 

Laptop development is dead: why remote development is the future

Using Coder-OSS to demonstrate the power of Kubernetes-based development environments.

medium.com

 

반응형
반응형

Online Typing Practice for Programmers

https://www.speedcoder.net/

 

Typing Practice for Programmers | SpeedCoder

 

www.speedcoder.net

반응형
반응형

변수는 프로그래밍에서 "하나의 데이터(숫자, 문자등)를 저장할 수 있는 메모리 공간"으로, 데이터 타입에 따라 정수, 소수, 문자등을 저장할 수 있다.

변수의 이름을 정의함에 있어 일반적인 룰은 아래와 같다. 

- 파이썬에서 예약어는 사용할 수 없다.

- 변수는 하나의 문자(a letter)나 밑줄(underscore) 시작해야 한다. 

- 변수의 두번째 문자부터는 문자(letter), 숫자(number) 또는 밑줄(underscore)를 사용할 수 있다. 

- 변수는 대, 소문자을 구분한다. 

- 변수명의 타입은 값에 따라 변화한다. 

 

표준 데이터 유형

데이터 유형 할당 구분 아이템 구분 특징
숫자 Number Type      
문자 StringType "" or ''    
셋 Set Type {} , 중복제외, 순서없음
리스트 List Type [] ,  
딕셔너리 Dictionary Type {} , 키와 값으로 분리
튜플 Tuple () , 수정불가

 

 

데이터 형식 변환 (Data Type Conversion)

 

Function Description
int(x) x 값을 정수 타입으로 변환한다.
float(x) x 값을 부동 소수점 타입으로 변환한다.
complex(x) x 값을 복소수 타입으로 변환한다.
str(x) x 값을 문자 타입으로 변환한다.
repr(x) x 값을 표현식 문자 타입으로 변환한다.
eval(str) x 값이 문자 타입인지를 검증한다.
tuple(s) s를 튜플 타입으로 변환한다.
list(s) s 값을 리스트 타입으로 변환한다.
set(s) s 값을 셋 타입으로 변환한다.
dict(d) d 값을 딕셔너리 타입으로 변환한다.
frozenset(s) s 값을 고전 셋 타입으로 변환한다.
chr(x) x 값을 문자 타입으로 변환한다.
ord(x) x 값을 정수 타입으로 변환한다.
hex(x) x 값을 16진수 문자 타입으로 변환한다.
oct(x) x 값을 8진수 문자 타입으로 변환한다.

 

반응형
반응형

[python] 환경변수 관련.  os, sys

import os
import sys
 


print(" os 환경변수 environ \n")
print(" * 모든 시스템 환경 변수 ") 
print(" os.environ()  : ", os.environ)

print('')
for key, value in os.environ.items():
    print('{}: {}'.format(key, value))


print(" * 특정 시스템 환경 변수 ")    
print(" os.environ('JAVA_HOME')  : ", os.environ['JAVA_HOME'])

# 존재하지 않는 환경 변수를 가져오면, 에러는 발생하지 않고 None이 리턴
result = os.environ.get('NOT_EXISTS')
print(result)

print(" * 현재 코드가 실행되는 디렉토리까지 문자열 ")
print(" os.getcwd() : ", os.getcwd())

print(" * 현재 실행 파이썬 스크립트의 PID 출력 ")
print(" os.getpid() : ",  os.getpid() )


print(" * 현재 워킹 디렉토리 변경  ")
print(" os.chdir() : " )
print(" import os ")
print(" print(os.getcwd()) #/Users/projects/workspace ")
print(" os.chdir( os.getcwd()+'/scripts/src' ) ")
print(" print(os.getcwd()) #/Users/projects/workspace/scripts/src ")

print(" * 디렉토리 만들기 : mkdir(path[,mode]) ")
#_result = os.mkdir("test_dir")
#print(_result)


print(" * path에 존재하는 파일과 디렉토리들의 리스트 반환 ")
_result = os.listdir(".")
print(" os.listdir('.') : ",  _result )
print('')
for x in _result:
    print('{}'.format(x))

# 인자로 전달된 디렉토리를 재귀적 생성
#  - 이미 **디렉토리가 생성**되어 있는 경우나 **권한이 없어 생성할 수 없는 경우**는 **예외**발생
print(" * 디렉토리 만들기 : makedirs(path[,mode]) 이미 **디렉토리가 생성**되어 있는 경우나 **권한이 없어 생성할 수 없는 경우**는 **예외**발생")
#_result = os.makedirs("test_dir")


print(" * 하위 폴더를 for문으로 탐색 : os.walk(path) ", " 기본적으로 top-down임. bottom-up으로 하고 싶다면 ")

if __name__ == "__main__":
    root_dir = "./"
    for (root, dirs, files) in os.walk(root_dir):
        print("root : " + root)
        if len(dirs) > 0:
            for dir_name in dirs:
                print("dir: " + dir_name)

        if len(files) > 0:
            for file_name in files:
                print("file: " + file_name)

os.walk(root_dir, topdown=False)  #bottom-up으로 하고 싶다면,

print(" * 'A'+'/'+'B' 로 문자열을 return 한다. : os.path.join('A','B) ")

print(" os.path.isdir(): directory인가? ")
print(os.getcwd(), " ==> " , os.path.isdir(os.getcwd()) )

print(" os.path.abspath(path): abs 경로 반환  ")
print(" 현재 ./sketchpy_001.py 파일의 절대경로 : ", os.path.abspath("./sketchpy_001.py"))


print(" os.path.dirname(path) : 경로의 제일 뒤 빼고 반환  ")

print(" os.path.exists(path) : 지정한 path에 파일, 디렉토리가 존재하는지 유(True)/무(False) 리턴  ")
print("os.path.isfile(path)  ")
print("os.path.isdir(path)  ")
print("os.path.isabs()  ")
print("")

import glob

print( " glob.glob(os.getcwd()) : ls와 유사한 기능을한다, 정규식 사용 가능 (* ? [0-9])" )
print(" (workspace) $ ls = glob.glob(os.getcwd()+'/*'))  ")
print(" list로 return  ")
print( glob.glob(os.getcwd()))
print( glob.glob(os.getcwd() + "/*"))

print( "" )
print(" glob.iglob(path)  ")
print("    - glob.glob와 다르게 iterator로 반환  ")
print("    - list로 담지 않기 때문에 결과가 매우 많다면 유용함  ")
for i in glob.iglob(os.getcwd()+'/*'):
    print(i)
반응형

+ Recent posts