0
C++ Builder에서 데이터 파일을 생성하는 기능이 있습니다 :읽기 파일
int HandleFile;
if (!FileExists(fnm))
{HandleFile = FileCreate(fnm);FileClose(HandleFile);}
HandleFile = FileOpen(fnm,fmOpenWrite);
if(! HandleFile) {return 0;}
AnsiString str = IntToStr(num)+"#" +IntToStr(GetLastError())+": "+ AnsiLastError();
FileSeek(HandleFile,0,2);
FileWrite(HandleFile, &str, sizeof(str));
FileClose(HandleFile);
return 1;
파이썬에서 그것을 읽을 수있는 방법이 있나요? 메모장으로 파일을 열면 알 수없는 기호 만 표시됩니다.
이 코드는 다시 쓸 수 없으며 나를 작성하지 않았습니다. 그것의 데이터는 바이너리 형식입니다! 나는 numpy로 다음과 같이 읽으려고했다 : numpy를 np로 가져 오기 f = open ("1.dbo", "r") a = np.fromfile (f, dtype = np.uint32). 문자열을 얻는 방법은 어디 문자열 및 int 어디 int 무엇입니까? – user3216321
@ user3216321 파일에는'string' /'int'가 없으며 단지'AnsiString'의 private 데이터 멤버를 인코딩하는 바이트 시퀀스입니다. 포함 할 파일은 무엇입니까? – manlio
날짜와 값 (int, float), simbols '#'은 (') 일 수 있습니다. excactly 모르겠다 – user3216321