공부,일225 리눅스 c언어 파일 감시 이벤트 inotify https://sysdocu.tistory.com/1461 c언어 파일 이벤트 감시 (inotify) 맨 하단에 있는 Example code 를 확인합니다.해당 코드는 특정 디렉토리 내의 하위 디렉토리 및 파일에 대한 이벤트를 감지하여 줍니다.단일 파일에 대한 감시를 원할 경우 디렉토리를 만들어 그 안 sysdocu.tistory.com 리눅스에서 파일 변경 이벤트 감지하는 방법. 위 블로그에서 소개한 방법을 실습해 본다. 위 블로그에서 코드를 들고 온다. 내가 감시하고 싶은 파일 위치 find명령어로 찾은 후에 INOTIFY_PATH에 입력해주면 된다. pi@raspberrypi:~/C_WorkPlace/fileEvent $ cat fileEvent.c #include #include #include .. 2023. 3. 31. 라즈베리 파이엣 c 언어 컴파일. vi 로 간단한 c 언어 파일 생성... gcc 소스코드 -o 실행 파일이름 위 명령어로 실행 파일 생성. 실행 모습. 2023. 3. 31. txt 편집 하는 프로그램 # with as 위의 함수가 끝나면 자동으로 file을 close 해준다. ( 개발자가 실수로 close 하지 않도록 하는 구문) # 한꺼 번에 가져오기 # with open("example.txt", "r") as f: # example = f.read() # 1줄 씩 가져오기 name_list = [] cnt = 0; with open("example.txt", "r") as f: for line in f: name_list.append([line.strip(),cnt]) # strip 줄바꿈 문자 제거 cnt = cnt + 1 for item in name_list: print(item) 2023. 2. 5. 판다스 사용해보기(엑셀 사용) 판다스 기본 예제 import pandas as pd import numpy as np # 파이썬은 경로가 \ 가아니라 / 로 표시한다 (파일 경로 주의) ''' #기본 data 불러오기. df = pd.read_excel("./input/test.xlsx", engine = "openpyxl") print(df) ''' # 특정 sheet Dataframe 화 하기 ''' df = pd.read_excel("./input/test.xlsx", engine = "openpyxl", sheet_name="Sheet1") print(df) ''' # header 조절 """ df = pd.read_excel("./input/test.xlsx", engine = "openpyxl", sheet_name="Sh.. 2023. 2. 5. 파이썬 배포하기 파이썬은 .py스크립트라서 python을 깔아야지만 스크립트를 실행 할 수 있다. 라이브러리도 따로 다운 해야한다. 떄문에 exe 파일로 만들어서 배포 해서 파이썬이 없는 컴퓨터에서도 사용해보자 . 1. pyinstaller 다운 pip install pyinstaller 2. 생성 pyinstaller --onefile terminal2.py 적당히 visual studio에서 python 스크립트 찾은다음 pyinstaller 설치하고 터미널에서 위 명령어 입력 --onefile 옵션을 줘야지만 input()함수를 사용할 수 있다. 출처:https://stackoverflow.com/questions/69529305/exe-file-created-with-pyinstaller-is-showin-err.. 2022. 11. 14. 파이썬 웹크롤링 시작 ( 참조 웹 사이트 모음) https://coding-kindergarten.tistory.com/24 2022. 7. 3. 2중 포인터 & 포인터 값 대입 아래 코드는 visual studio의 cl 컴파일러를 사용한 결과이다. 포인터에 값을 넣는 방법은 &를 사용하는 방식과 *를 사용하는 방식2가지로 나뉜다. 2중포인터의 경우 &를 직접 이용하는 방식으로 포인터의 값을 넣게 되면 compiler에 따라서 인식하지 못할 수도 있기 때문에 2중포인터의 값을 넣을때는 * 사용을 권한다. ex) *pp = p; #include int main() { // 이중 포인트 공부 int a = 10; int* p; int** pp; // & 이용한 포인터 값 설정 p = &a; pp = &p; printf("using &====================\n"); printf("*p : %d\n", *p); printf("p : %p\n", p); printf("&p.. 2022. 1. 28. c# 엑셀 병합 범위 측정 Excel.Application application = new Excel.Application(); Excel.Workbook readd_wb = application.Workbooks.Open(Filename: @"C:\Users\L\Desktop\test.xlsx"); Excel.Worksheet ws = readd_wb.Worksheets.Item["Sheet1"]; Excel.Range rg1 = ws.Range["B5"]; string c = rg1.MergeArea.get_Address(Excel.XlReferenceStyle.xlA1); string c = "$B$5:$C$7" 2021. 12. 6. winform form 크기 자동조절 public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Normal; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.AutoSize = true; } } 2021. 12. 2. 이전 1 2 3 4 ··· 25 다음