पायथन ट्यूटोरियल

अजगर घर पायथन परिचय पायथन आरंभ करें पायथन सिंटेक्स पायथन टिप्पणियाँ पायथन वेरिएबल्स पायथन डेटा प्रकार अजगर संख्या पायथन कास्टिंग पायथन स्ट्रिंग्स पायथन बूलियन्स पायथन ऑपरेटर्स पायथन सूचियाँ पायथन टुपल्स पायथन सेट पायथन डिक्शनरी अजगर अगर... और पाइथन जबकि लूप्स लूप्स के लिए पायथन पायथन कार्य अजगर लैम्ब्डा पायथन एरेज़ पायथन क्लासेस/ऑब्जेक्ट्स पायथन इनहेरिटेंस पायथन इटरेटर्स पायथन स्कोप पायथन मॉड्यूल अजगर तिथियाँ पायथन मठ पायथन JSON पायथन रेगेक्स पायथन पीआईपी अजगर का प्रयास करें... को छोड़कर पायथन उपयोगकर्ता इनपुट पायथन स्ट्रिंग स्वरूपण

फ़ाइल रखरखाव

पायथन फ़ाइल हैंडलिंग पायथन फ़ाइलें पढ़ें पायथन लिखें/फाइलें बनाएं पायथन फ़ाइलें हटाएं

पायथन मॉड्यूल

न्यूमपी ट्यूटोरियल पांडा वॉकथ्रू स्काइप ट्यूटोरियल

पायथन माटप्लोटलिब

माटप्लोटलिब परिचय माटप्लोटलिब आरंभ करें माटप्लोटलिब पाइप्लॉट माटप्लोटलिब प्लॉटिंग माटप्लोटलिब मार्कर माटप्लोटलिब लाइन माटप्लोटलिब लेबल माटप्लोटलिब ग्रिड माटप्लोटलिब सबप्लॉट्स माटप्लोटलिब स्कैटर माटप्लोटलिब बार्स माटप्लोटलिब हिस्टोग्राम Matplotlib पाई चार्ट

यंत्र अधिगम

शुरू करना मध्यमान मध्यम मोड मानक विचलन प्रतिशतता डेटा वितरण सामान्य डेटा वितरण स्कैटर प्लॉट रेखीय प्रतिगमन बहुपद प्रतिगमन बहु - प्रतिगमन स्केल ट्रेन / टेस्ट निर्णय वृक्ष

पायथन मायएसक्यूएल

MySQL प्रारंभ करें MySQL डेटाबेस बनाएँ MySQL तालिका बनाएँ MySQL सम्मिलित करें MySQL चुनें MySQL कहाँ MySQL ऑर्डर बाय MySQL हटाएं MySQL ड्रॉप टेबल MySQL अद्यतन MySQL सीमा मायएसक्यूएल जॉइन

पायथन मोंगोडीबी

मोंगोडीबी आरंभ करें MongoDB डेटाबेस बनाएँ MongoDB संग्रह बनाएँ मोंगोडीबी डालें मोंगोडीबी खोजें मोंगोडीबी क्वेरी मोंगोडीबी सॉर्ट मोंगोडीबी हटाएं MongoDB ड्रॉप संग्रह मोंगोडीबी अपडेट मोंगोडीबी सीमा

पायथन संदर्भ

पायथन अवलोकन पायथन बिल्ट-इन फंक्शन्स पायथन स्ट्रिंग तरीके पायथन सूची के तरीके पायथन डिक्शनरी के तरीके पायथन टुपल तरीके पायथन सेट मेथड्स पायथन फ़ाइल तरीके पायथन कीवर्ड पायथन अपवाद पायथन शब्दावली

मॉड्यूल संदर्भ

यादृच्छिक मॉड्यूल अनुरोध मॉड्यूल सांख्यिकी मॉड्यूल गणित मॉड्यूल सीमैथ मॉड्यूल

पायथन कैसे करें

सूची डुप्लिकेट निकालें एक स्ट्रिंग को उल्टा करें दो नंबर जोड़ें

पायथन उदाहरण

पायथन उदाहरण पायथन कंपाइलर अजगर व्यायाम अजगर प्रश्नोत्तरी पायथन प्रमाणपत्र

पायथन अनुरोध। प्रतिक्रिया वस्तु

अनुरोध मॉड्यूल


उदाहरण

एक वेब पेज के लिए एक अनुरोध करें, और स्थिति कोड वापस करें:

import requests

x = requests.get('https://w3schools.com')
print(x.status_code)

परिभाषा और उपयोग

ऑब्जेक्ट में HTTP अनुरोध के requests.Response()लिए सर्वर की प्रतिक्रिया होती है।


गुण और तरीके

Property/Method Description
apparent_encoding Returns the apparent encoding
close() Closes the connection to the server
content Returns the content of the response, in bytes
cookies Returns a CookieJar object with the cookies sent back from the server
elapsed Returns a timedelta object with the time elapsed from sending the request to the arrival of the response
encoding Returns the encoding used to decode r.text
headers Returns a dictionary of response headers
history Returns a list of response objects holding the history of request (url)
is_permanent_redirect Returns True if the response is the permanent redirected url, otherwise False
is_redirect Returns True if the response was redirected, otherwise False
iter_content() Iterates over the response
iter_lines() Iterates over the lines of the response
json() Returns a JSON object of the result (if the result was written in JSON format, if not it raises an error)
links Returns the header links
next Returns a PreparedRequest object for the next request in a redirection
ok Returns True if status_code is less than 400, otherwise False
raise_for_status() If an error occur, this method returns a HTTPError object
reason Returns a text corresponding to the status code
request Returns the request object that requested this response
status_code Returns a number that indicates the status (200 is OK, 404 is Not Found)
text Returns the content of the response, in unicode
url Returns the URL of the response

अनुरोध मॉड्यूल