Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
I am running this python script on R-studio. I have Python 3.5 installed on my system. count = 10 while (count > 0): try : # read line from file: print(file.readline()) # parse parse_json(file.readline()) count = count - 1 except socket.error as e

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
On Friday, February 5, 2016 at 1:08:11 PM UTC-7, Nathan Hilterbrand wrote: > On Feb 5, 2016 15:01, wrote: > > > > I am running this python script on R-studio. I have Python 3.5 installed > on my system. > > > > count = 10 > > while (count > 0): > > try : > > # read line from file: > >

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
On Friday, February 5, 2016 at 1:11:19 PM UTC-7, shaunak...@gmail.com wrote: > On Friday, February 5, 2016 at 1:08:11 PM UTC-7, Nathan Hilterbrand wrote: > > On Feb 5, 2016 15:01, wrote: > > > > > > I am running this python script on R-studio. I have Python 3.5 installed > > on my system. > > > >

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
On Friday, February 5, 2016 at 1:09:35 PM UTC-7, Martin A. Brown wrote: > >except socket.error as e > > >line 53 except socket.error as e ^ SyntaxError: invalid syntax > > > >I tried changing socket.error to ConnectionRefusedError. and still > >got the same error. > > >Please tell me if the

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
On Friday, February 5, 2016 at 2:09:11 PM UTC-7, Bernardo Sulzbach wrote: > On 02/05/2016 07:01 PM, Chris Angelico wrote: > > On Sat, Feb 6, 2016 at 6:58 AM, wrote: > >> I am running this python script on R-studio. I have Python 3.5 installed > >> on my system. > >> > > > > Let's just try a quic

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
On Friday, February 5, 2016 at 12:58:37 PM UTC-7, shaunak...@gmail.com wrote: > I am running this python script on R-studio. I have Python 3.5 installed on > my system. > > count = 10 > while (count > 0): > try : > # read line from file: > print(file.readline()) > # pa

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-05 Thread shaunak . bangale
On Friday, February 5, 2016 at 12:58:37 PM UTC-7, shaunak...@gmail.com wrote: > I am running this python script on R-studio. I have Python 3.5 installed on > my system. > > count = 10 > while (count > 0): > try : > # read line from file: > print(file.readline()) > # pa

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-06 Thread Shaunak Bangale
Hi Martin, Thanks for the detailed reply. I edited, saved and opened the file again. Still I am getting exactly the same error. Putting bigger chunk of code and the error again: # create socket s = socket.socket(socket.AF_INET) #create a SSL context with the recommended security settings for c

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-06 Thread Shaunak Bangale
Hi Martin, Answering your questions below: On Fri, Feb 5, 2016 at 1:50 PM, Shaunak Bangale wrote: > Hi Martin, > > Thanks for the detailed reply. I edited, saved and opened the file again. > Still I am getting exactly the same error. > > Putting bigger chunk of code a

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-06 Thread Shaunak Bangale
I do have the initiation command defined. Just that I am not allowed to make the username, pwd public. I am absolutely sure I am running the same code. Now opened the same file with Python 3.5 shell and I get following error: from _ssl import RAND_status, RAND_egd, RAND_add ImportError: cannot

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-08 Thread shaunak . bangale
On Sunday, February 7, 2016 at 1:23:32 AM UTC-7, dieter wrote: > Shaunak Bangale writes: > > ... > > while (count > 0): > > try : > > # read line from file: > > print(file.readline()) > > # parse > > parse_jso

ImportError: cannot import name 'RAND_egd'

2016-02-09 Thread shaunak . bangale
Hi, I am trying to run a 60 lines Python code which is running on a mac machine but on windows machine, I am getting this error when I run on it on shell(open file and run module). I have Python 3.5 installed. from _ssl import RAND_status, RAND_egd, RAND_add ImportError: cannot import name '

Re: ImportError: cannot import name 'RAND_egd'

2016-02-10 Thread shaunak . bangale
On Tuesday, February 9, 2016 at 1:33:23 PM UTC-7, Ian wrote: > On Tue, Feb 9, 2016 at 7:55 AM, wrote: > > Hi, > > > > I am trying to run a 60 lines Python code which is running on a mac machine > > but on windows machine, I am getting this error when I run on it on > > shell(open file and run m

Re: Exception handling for socket.error in Python 3.5/RStudio

2016-02-19 Thread shaunak . bangale
On Monday, February 8, 2016 at 1:05:08 AM UTC-7, shaunak...@gmail.com wrote: > On Sunday, February 7, 2016 at 1:23:32 AM UTC-7, dieter wrote: > > Shaunak Bangale writes: > > > ... > > > while (count > 0): > > > try : > > > # read l