Re: Why I am getting IndexError: tuple index out of range when converting a float value to a string?

2019-06-11 Thread Terry Reedy
)  # 0.5414720812182742 print(xsd) # 0.15748041033663002 print(str("{6.5f}".format(xm))) I get the following error: IndexError: tuple index out of range Can someone suggest me why I am getting this error and how to overcome this? Show us the full traceback after expanding and reducing t

Re: Why I am getting IndexError: tuple index out of range when converting a float value to a string?

2019-06-11 Thread Rob Gaddi
) # 0.15748041033663002 print(str("{6.5f}".format(xm))) I get the following error: IndexError: tuple index out of range Can someone suggest me why I am getting this error and how to overcome this? Thanks in advance print(str("{:6.5f}".format(xm))) You want to apply the format 6.5

Why I am getting IndexError: tuple index out of range when converting a float value to a string?

2019-06-11 Thread madhavanbomidi
.format(xm))) I get the following error: IndexError: tuple index out of range Can someone suggest me why I am getting this error and how to overcome this? Thanks in advance -- https://mail.python.org/mailman/listinfo/python-list

Re: ftplib throws: IndexError: tuple index out of range

2016-02-15 Thread Peter Otten
Antoon Pardon wrote: >> PS: How did you produce the overview over the local variables? That looks >> nice. > I started from this recipe: > http://code.activestate.com/recipes/52215-get-more-information-from-tracebacks/ > made it more to my liking and turned it into a module. So that instead of >

Re: ftplib throws: IndexError: tuple index out of range

2016-02-15 Thread Peter Otten
Antoon Pardon wrote: >> It looks like the actual error is socket.timeout which is probably raised >> from somewhere inside the stdlib without args. > > I think I know what is going on. I have my own timeout mechanism at work > here, that works with signals and alarm. When the SIGALRM fires I just

Re: ftplib throws: IndexError: tuple index out of range

2016-02-14 Thread Antoon Pardon
Op 14-02-16 om 14:40 schreef Peter Otten: > > PS: How did you produce the overview over the local variables? That looks > nice. > I started from this recipe: http://code.activestate.com/recipes/52215-get-more-information-from-tracebacks/ made it more to my liking and turned it into a module.

Re: ftplib throws: IndexError: tuple index out of range

2016-02-14 Thread Antoon Pardon
>> Can anyone shed some light? >> >> This is the traceback: > > [...] > >> File "/usr/lib/python2.7/socket.py", line 478, in readline >> if e.args[0] == EINTR: >> IndexError: tuple index out of range > > The offending line seems

Re: ftplib throws: IndexError: tuple index out of range

2016-02-14 Thread Peter Otten
s is the traceback: [...] > File "/usr/lib/python2.7/socket.py", line 478, in readline > if e.args[0] == EINTR: > IndexError: tuple index out of range The offending line seems to be part of try: data = self._sock.recv(self._rbufsize) ex

Re: ftplib throws: IndexError: tuple index out of range

2016-02-14 Thread Stephane Wirtel
ib.py", line 186, in getline line = self.file.readline(self.maxline + 1) File "/usr/lib/python2.7/socket.py", line 478, in readline if e.args[0] == EINTR: IndexError: tuple index out of range Locals by frame, innermost last Frame main in /usr/local/lib/python-apps/rmtdump/py

ftplib throws: IndexError: tuple index out of range

2016-02-14 Thread Antoon Pardon
"/usr/lib/python2.7/ftplib.py", line 201, in getmultiline line = self.getline() File "/usr/lib/python2.7/ftplib.py", line 186, in getline line = self.file.readline(self.maxline + 1) File "/usr/lib/python2.7/socket.py", line 478, in readline if e.args[0] =

Re: IndexError: tuple index out of range

2009-05-30 Thread Terry Reedy
t ("{0} is {1} years old {3} and ".format(name, age, append)) IndexError: tuple index out of range dan...@ibex:~/Desktop/python$ Here is my script: #!/usr/bin/python # Filename: str_format2.py age = 23 name = 'Daniel' append = '6 months&#x

Re: IndexError: tuple index out of range

2009-05-30 Thread MRAB
0} is {1} years old {3} and ".format(name, age, append)) IndexError: tuple index out of range dan...@ibex:~/Desktop/python$ Here is my script: #!/usr/bin/python # Filename: str_format2.py age = 23 name = 'Daniel' append = '6 months' print

IndexError: tuple index out of range

2009-05-30 Thread Invert
ld {3} and ".format(name, age, append)) > IndexError: tuple index out of range > dan...@ibex:~/Desktop/python$ > Here is my script: #!/usr/bin/python > # Filename: str_format2.py > > age = 23 > name = 'Daniel' > append = '6 months' > > print (&quo