On 27/12/16 15:22, Mysore Ventaka Rama Kumar wrote:
> Please review and comment/correct my error!
Rather than expect us to read through many lines of code
it would help id you posted the entire error message
which will tell us exactly where the problem lies.
Also tell us for completeness which
Please review and comment/correct my error!
Many thanks in advance.
# Required module
import os
# Function for getting files from a folder
def fetchFiles(pathToFolder, flag, keyWord):
''' fetchFiles() requires three arguments: pathToFolder, flag and
keyWord flag must be
Hi all
I just started to learn python language.
I'm trying to figure out the reason of error but i couldn't find it.
first imports short.txt(is attached to this mail)
and read in dictionary named gpdic1
Traceback (most recent call last):
File /home/ercsb/test.py, line 11, in module
hgene =
Myunggyo Lee wrote:
I'm trying to figure out the reason of error but i couldn't find it.
first imports short.txt(is attached to this mail)
and read in dictionary named gpdic1
Traceback (most recent call last):
File /home/ercsb/test.py, line 11, in module
hgene = lines[1]
Myunggyo Lee somrsa...@gmail.com Wrote in message:
You apparently posted this in html, and you tried to attach a data
file. Each of those will cause problems for some readers.
Please tell your email program to use text mail, and paste in
your data, don't attach it.
gpdic1={}
while 1:
On 26/06/14 09:18, Myunggyo Lee wrote:
Hi all
I just started to learn python language.
Welcome.
I'm trying to figure out the reason of error but i couldn't find it.
first imports short.txt(is attached to this mail)
and read in dictionary named gpdic1
Others have pointed out the specific
I have a script that makes use of the Google speech recognition API as
follows:
import shlex
print say something
os.system('sox -r 16000 -t alsa default recording.flac silence 1 0.1 1% 1
1.5 1%')
cmd='wget -q -U Mozilla/5.0 --post-file recording.flac
--header=Content-Type: audio/x-flac;
On Fri, Nov 29, 2013 at 08:17:54PM -0500, richard kappler wrote:
I have a script that makes use of the Google speech recognition API as
follows:
[...]
args = shlex.split(cmd)
output,error = subprocess.Popen(args,stdout = subprocess.PIPE, stderr=
subprocess.PIPE).communicate()
if not error:
Here's another reason for avoiding eval(). Presumably a['hypotheses'] is
set by the code you download and then eval. That makes it completely
opaque -- you can't easily see what it is doing, and if it plays up, you
can't do anything about it. It's a complete black box that either works
or
On Fri, Nov 29, 2013 at 8:17 PM, richard kappler richkapp...@gmail.com wrote:
args = shlex.split(cmd)
output,error = subprocess.Popen(args,stdout = subprocess.PIPE, stderr=
subprocess.PIPE).communicate()
Output to stderr doesn't necessarily mean a command failed. The
process returncode is
Hi all,
I have wriiten the following code:
[Segment]
def survivor(names, step):
index = step - 1
next = names
while len(next) 1:
next.remove (next[index])
However when ever i run it i get this error message:
Traceback (most recent call last):
File pyshell#46, line
On Tue, Nov 22, 2011 at 12:28 AM, John nidia...@hotmail.com wrote:
Hi all,
I have wriiten the following code:
[Segment]
def survivor(names, step):
index = step - 1
next = names
while len(next) 1:
next.remove (next[index])
However when ever i run it i get this
On 22/11/11 05:28, John wrote:
def survivor(names, step):
index = step - 1
next = names
while len(next) 1:
next.remove (next[index])
However when ever i run it i get this error message:
next.remove (next[index])
IndexError: list index out of range
Any ideas about whats causing this error?
On 11/22/2011 12:28 AM, John wrote:
Hi all,
I have wriiten the following code:
I can't provide any more clues about your code than the two excellent
replies you've already gotten. But it'd be really good if you could fix
your time machine, so you're not posting in the future. Really hard
John wrote:
Hi all,
I have wriiten the following code:
[Segment]
def survivor(names, step):
index = step - 1
next = names
while len(next) 1:
next.remove (next[index])
What is the intention of this function? The name given doesn't mean
anything to me. The parameters
, Deidre, Edward,
Felicity, Greg, Harriet], 3)
He answer should be ‘Greg’
Date: Tue, 22 Nov 2011 10:02:01 +1100
From: st...@pearwood.info
To: tutor@python.org
Subject: Re: [Tutor] IndexError: list index out of range
John wrote:
Hi all,
I have wriiten the following code:
[Segment
On Tue, Nov 22, 2011 at 4:32 AM, Steven D'Aprano st...@pearwood.infowrote:
John wrote:
Hi all,
I have wriiten the following code:
[Segment]
def survivor(names, step):
index = step - 1
next = names
while len(next) 1:
next.remove (next[index])
What is the
bhaaluu [EMAIL PROTECTED] wrote
of it. But the search worked even when stackB
and stackC were empty. Interesting.
You never checked stackB or stackC when they were
empty because it always found something in a prior
stack first.
I could see, all three conditionals in popNum(num)
were the
On 9/20/07, Alan Gauld [EMAIL PROTECTED] wrote:
bhaaluu [EMAIL PROTECTED] wrote
of it. But the search worked even when stackB
and stackC were empty. Interesting.
You never checked stackB or stackC when they were
empty because it always found something in a prior
stack first.
I could
Greetings,
I'm working with Python 2.4.3 on the GNU/Linux platform.
I'm currently playing with functions and stacks, and am
using the Towers of Hanoi as a test game to play with.
Note: This game is not a recursive programming exercise,
it is meant to be solved by the player, manually.
The
You should check if the stack is empty before you access it:
def popNum(num):
if len(stackA) 0 and num == stackA[-1]:
stackA.pop()
#etc
--Michael
--
Michael Langford
Phone: 404-386-0495
Consulting: http://www.TierOneDesign.com/
Entertaining:
bhaaluu wrote:
def popNum(num):
if num == stackA[-1]:
stackA.pop()
What happens here if stackA is empty?
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 9/19/07, Kent Johnson [EMAIL PROTECTED] wrote:
bhaaluu wrote:
def popNum(num):
if num == stackA[-1]:
stackA.pop()
What happens here if stackA is empty?
Kent
This was how I was looking for the number.
It seems to me that if the list was EMPTY
or didn't have the sought
--- Danny Yoo [EMAIL PROTECTED] wrote:
I get the error for set
set((1,1,1,2,2,2,2,2,3,4,4,5))
Traceback (most recent call last):
File stdin, line 1, in ?
NameError: name 'set' is not defined
Hi John,
For Python 2.3.4, you'll need to add the line:
##
from
Hi Brian
It was a excellent tutorial, Thanks a
lot for the advice I got my concepts of def of
functions , sort functions , count , cleared for me
I was able to do and understand all the
function example , except item_comparison function
I get the
John Joseph said unto the world upon 09/01/06 03:47 AM:
Hi Brian
It was a excellent tutorial, Thanks a
lot for the advice I got my concepts of def of
functions , sort functions , count , cleared for me
I was able to do and understand all the
function
Brian van den Broek wrote:
Your python is a version before set was a built-in type (2.4, I
believe). So, the iteration_comparison *and* dupe_detector_5 functions
won't work for you.
2.3 did include the sets module, though.
So, stick
from sets import set
at the top of the code and
lot for the advice I got my concepts of def of functions , sort
functions , count , cleared for me
I was able to do and understand all the
function example , except �item_comparison� function
I get the error for set
set((1,1,1,2,2,2,2,2,3,4,4,5))
Traceback
Hi All
I am trying to find out the duplicates in a list
, as for beginning I wanted to compare the adjacent
elements in list , for this purpose I wrote a script
for checking the adjacent elements in a list, if same
, it prints the result that , the adjacent numbers are
same , it not it
Hi,
Look at this:
i=[1,2,3]
i[len(i)]
Traceback (most recent call last):
File stdin, line 1, in ?
IndexError: list index out of range
This means that I have tried to access an element that is out of the
list, in this case i[3], that is, the 4th element of the list.
You are doing the
--- Guillermo Fernandez Castellanos
[EMAIL PROTECTED] wrote:
Hi,
Look at this:
i=[1,2,3]
i[len(i)]
Traceback (most recent call last):
File stdin, line 1, in ?
IndexError: list index out of range
This means that I have tried to access an element
that is out of the
list, in
John Joseph said unto the world upon 08/01/06 06:36 AM:
--- Guillermo Fernandez Castellanos
[EMAIL PROTECTED] wrote:
Hi,
Look at this:
i=[1,2,3]
i[len(i)]
Traceback (most recent call last):
File stdin, line 1, in ?
IndexError: list index out of range
This means that I have tried to
32 matches
Mail list logo