Posts

Showing posts from June, 2020

Solved - ValueError: invalid literal for int() with base 10:

amount = '10,000' # Convert to integer amount_to_int = int(amount) ValueError: invalid literal for int() with base 10: '10,000' Solution: amount = '10,000' # Convert to integer amount_to_int = int(amount.replace(',','')) print(amount_to_int)

Solved - OSError("(10060, 'WSAETIMEDOUT')" in Requests package in Python

Code which return error import json import requests url = 'https://www1.nseindia.com' r = requests.get(url) print (r.text) Error Traceback (most recent call last):   File "D:\PythonLearn\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen     chunked=chunked)   File "D:\PythonLearn\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request     six.raise_from(e, None)   File "<string>", line 2, in raise_from   File "D:\PythonLearn\lib\site-packages\urllib3\connectionpool.py", line 383, in _make_request     httplib_response = conn.getresponse()   File "D:\PythonLearn\lib\http\client.py", line 1331, in getresponse     response.begin()   File "D:\PythonLearn\lib\http\client.py", line 297, in begin     version, status, reason = self._read_status()   File "D:\PythonLearn\lib\http\client.py", line 258, in _read_status     line = str(self.fp.readline(_MAXLINE + 1), "...