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 P
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 'STARTS_WI
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 pr
Myunggyo Lee 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:
line= inf2.readli
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
> hgene = lines[1]
> Inde
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
hgene = line
On Fri, Nov 29, 2013 at 8:17 PM, richard kappler 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 what you need to insp
>
>
> 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
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
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; rat
On Tue, Nov 22, 2011 at 4:32 AM, Steven D'Aprano wrote:
> 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])
>>
>
>
> W
later on:
survivor(["Andrew", "Brenda", "Craig",
"Deidre", "Edward",
"Felicity", "Greg", "Harriet"], 4)
what should the result be?
In the example
Survivor (["Andrew", "Brenda",
"C
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
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
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 Tue, Nov 22, 2011 at 12:28 AM, 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])
>
>
>
> However when ever i run it i get this e
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 "", line 1, in
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 firs
"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)
> w
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
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
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: http://www.ThisIsYourCruiseDirec
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
--- 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 "", line 1, in ?
> > NameError: name 'set' is not defined
>
> Hi John,
>
> For Python 2.3.4, you'll need to add the line:
>
> 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))
> Trac
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
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
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 er
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 "", line 1, in ?
>>IndexError: list index out of range
>>
>>
>>T
--- Guillermo Fernandez Castellanos
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> Look at this:
> >>> i=[1,2,3]
> >>> i[len(i)]
> Traceback (most recent call last):
>File "", line 1, in ?
> IndexError: list index out of range
>
>
> This means that I have tried to access an element
> that is out o
Hi,
Look at this:
>>> i=[1,2,3]
>>> i[len(i)]
Traceback (most recent call last):
File "", 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
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 wi
32 matches
Mail list logo