저는 python을 배우고 ctype 및 ctypes와 혼동합니다. 강연에서 강사는 ctype을 사용하여 검색했지만 모듈 결과 만 ctypes. 그래서 파이썬에서 ctype과 ctypes가 같은지 확실치 않습니다. 공식 문서에서는 ctypes
을 가져와야하지만 가져 오지 않았습니다. 파이썬에서 ctype과 ctypes가 다른가요?
이 내 코드
, 서로 다른 경우, 어떤 종류 내가 두 사람 사이 비교 봐야한다from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import cgi
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
def do_POST(self):
try:
if self.path.endswith('/edit'):
ctype, pdict = cgi.parse_header(
self.headers.getheader('content-type')
)
if ctype=='multipart/form-data':
fields = cgi.parse_multipart(self.rfile, pdict)
messagecontent = fields.get('newRestaurantName')
restaurantIDPath = self.path.split("/")[2]
myRestaurantQuery= session.query(Restaurant).filter_by(
if=restaurantIDPath).one()
if myRestaurantQuery!=[]:
myRestaurantQuery.name = messagecontent[0]
session.add(myRestaurantQuery)
session.commit()
self.send_response(301)
self.send_header('Content-type','text/html')
self.send_header('Location','/restaurants')
self.end_headers()
? 미리 감사드립니다!
실제로 사용하고있는 자료에 대한 설명서를 읽으려고 했습니까? –
@ IgnacioVazquez-Abrams 예, 있습니다. 나는 공개 강의를 통해 파이썬을 배우고 있으며, 물건을 모르는 매번 문서를 읽습니다. 'ctype'과'ctypes'가 뜬 문서를 검색했습니다. 나는 그것을 읽었고'ctypes'가이 코드에서 어색하다고 느꼈다. 그래서 내가 물었다. 불행히도 나는'ctype'이 정확히 무엇을 가리키는 지 알 수 없었다. – jaykodeveloper
... 이름입니다. 여기에는 코드가 바인딩되는 모든 내용이 포함됩니다. –