x27;
else:
prefix = ' X '
print (('%s got: %s expected: %s') % (prefix, repr(got), repr(expected)))
Only 'None' gets passed on to parameter 'got' instead of the expected value
of 4.
Any idea why 'None' is getting passed even though call
ut of a function return
something specific.
* return 'Number of donuts: ',countreturns a tuple like:
('Number of donuts: ',9)
* To just print the string without returning it as tuple , use string
formatting.
Thanks again,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
#return b+c
return d
front_x(['bbb', 'ccc', 'axx', 'xzz', 'xaa'])
Why is return d or return b+c not returning anything??
The d's value is confirmed by the print statement.
Thanks,
Shiva.
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico gmail.com> writes:
>
> On Fri, Oct 3, 2014 at 9:35 PM, Shiva
> yahoo.com.dmarc.invalid> wrote:
> > Why is return d or return b+c not returning anything??
> >
>
> On what basis do you believe it's not returning anything? When you
> call i
Hi All,
I have written a function that
-reads a file
-splits the words and stores it in a dictionary as word(key) and the total
count of word in file (value).
I want to print the words with top 20 occurrences in the file in reverse
order - but can't figure it out. Here is my function:
def prin
How does textstorage.get(w,0)+1 give the count of the word??
Thanks,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
Larry Hudson yahoo.com.dmarc.invalid> writes:
>
> On 10/04/2014 10:36 AM, Shiva wrote:
> >
> > What I don't understand is:
> >
> > for w in eachword:
> > textstorage[w]=textstorage.get(w, 0) + 1
> >
> > How does textstora
ename,'r')
line = fileextract.readlines()
for l in line:
texts = re.search(r'1\d\d\d', line)
print(texts.group())
None is returned. Why is it not iterating through each line of the file and
doing a search? - It seems to return none.
Thanks,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
return texts.group()
fileextract.close()
extract_names('NOTICE.txt')
Thanks,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
' doesn't seem to evaluate.
Thanks,
Shiva.
--
https://mail.python.org/mailman/listinfo/python-list
> The loop will continue while either part is true - that's what "or"
> means. Is that what you intended it to be doing?
>
> ChrisA
>
Yes..however, the second part of the or condition doesn't get evaluated.
So if I enter a 'y' - I expect the second part to evaluate and the loop to
break -
Bit confusing to use in While loop - Should have used the 'and' condition
instead of OR- then it works fine.
for OR both condition need to be false to produce a false output and break
the loop.
More of SET operations.
Thanks,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
ltodownload in matches[0:50]:
imagename=urltodownload[-12:]
urllib.request.urlretrieve(urltodownload,imagename)
print('Done!')
Thanks,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
condition statement - and execute the script
in terminal - for each find, the print() prints in new line instead of a
constantly incrementing counter.
Thanks,
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
>
> Python3:
>print(counter, end='\r')
>
> Gary Herron
>
>
Thanks, that is what I was looking up - \r carriage return without linefeed.
Thanks again!
Shiva
--
https://mail.python.org/mailman/listinfo/python-list
webpage - http;//elemotor.blogspot.com/
The difference sports gambling online sport book
The difference sports gambling online sport book no doubt partly
sports gambling
online sport book to the fact sports gambling online sport book our
first
glimpses sports gambling online sport book of He
I want to create notification box using python just like I get when battery is
running low or something similar. I can do it using libnotify in linux, but I
cant figure out how to do it in windows. I got some codes on internet for this
like:
https://gist.github.com/wontoncc/1808234, however it d
https://gist.github.com/anonymous/4baa67aafd04555eb4e6
I wrote the above code to display a toasterbox, and I didnt want it to display
any frames on the screen, just a toasterbox. The problem with this code is that
it runs fine when I run it the first time, but when I run it next time it shows
s
On Friday, January 15, 2016 at 10:35:57 PM UTC+5:30, Shiva Upreti wrote:
> https://gist.github.com/anonymous/4baa67aafd04555eb4e6
>
> I wrote the above code to display a toasterbox, and I didnt want it to
> display any frames on the screen, just a toasterbox. The problem with thi
On Friday, January 15, 2016 at 10:55:59 PM UTC+5:30, Ian wrote:
> On Fri, Jan 15, 2016 at 10:05 AM, Shiva Upreti
> wrote:
> > https://gist.github.com/anonymous/4baa67aafd04555eb4e6
> >
> > I wrote the above code to display a toasterbox, and I didnt want it to
>
On Friday, January 15, 2016 at 10:55:59 PM UTC+5:30, Ian wrote:
> On Fri, Jan 15, 2016 at 10:05 AM, Shiva Upreti
> wrote:
> > https://gist.github.com/anonymous/4baa67aafd04555eb4e6
> >
> > I wrote the above code to display a toasterbox, and I didnt want it to
>
On Saturday, January 16, 2016 at 2:22:24 AM UTC+5:30, Mark Lawrence wrote:
> On 15/01/2016 17:05, Shiva Upreti wrote:
> > https://gist.github.com/anonymous/4baa67aafd04555eb4e6
> >
> > I wrote the above code to display a toasterbox, and I didnt want it to
> > displ
On Saturday, January 16, 2016 at 4:39:12 AM UTC+5:30, Dietmar Schwertberger
wrote:
> On 15.01.2016 18:05, Shiva Upreti wrote:
> > Please help me solve these issues.
> Please decide first on which list or forum you want your questions to be
> answered. Once people find out that you
I am trying to send audio using sockets to a different PC, but audio is not
clear on the other end and I cant understand why.
Here is the code:
import socket
import pyaudio
import wave
import sys
import pickle
import time
HOST=""
PORT=1061
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
CHU
Hi
I am new to linux. I tried various things in attempt to install kivy. I
installed python 2.7.10 (I think python3 was already installed in ubuntu
14.04). Then i downloaded kivy from
https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted it
and tried to execute "python set
I wrote this code in python for submitting a login form:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get('some url')
elem = driver.find_element_by_name("username")
elem.send_keys('13103666')
elem = driver.find_element_by_nam
I wrote this code in python for submitting a login form:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get('some url')
elem = driver.find_element_by_name("username")
elem.send_keys('13103666')
elem = driver.find_elemen
I am learning python. I wrote a script using requests module.
The scripts runs fine for sometime, but after a while it hangs. When I press
CTRL+C it shows ConnectionError even though I have included exception handling.
I am not sure as to why it cant handle ConnectionError when the script runs for
https://ideone.com/BPflPk
Please tell me why 'print s' statement is being executed inside loop, though I
put it outside.
Please help. I am new to python.
--
https://mail.python.org/mailman/listinfo/python-list
On Sunday, September 20, 2015 at 1:33:57 PM UTC+5:30, Chris Warrick wrote:
> On 20 September 2015 at 09:55, shiva upreti wrote:
> > https://ideone.com/BPflPk
> >
> > Please tell me why 'print s' statement is being executed inside loop,
> > though I put it
On Sunday, September 20, 2015 at 1:34:32 PM UTC+5:30, paul.ant...@gmail.com
wrote:
> On Sunday, September 20, 2015 at 9:56:06 AM UTC+2, shiva upreti wrote:
> > https://ideone.com/BPflPk
> >
> > Please tell me why 'print s' statement is being executed inside loo
On Sunday, September 20, 2015 at 8:11:18 PM UTC+5:30, Laura Creighton wrote:
> The discussion about why or why not to use a bare except has gotten us
> away from the problem reported, which is "why is my script hanging?"
>
> In a message of Sat, 19 Sep 2015 17:18:12 +0100, Mark Lawrence writes:
>
Thank you. I didnt know about keyboard interrupt exception.
It means my code hangs without raising any exceptions, what should i do in this
case?
--
https://mail.python.org/mailman/listinfo/python-list
Thank you Cameron.
I think the problem with my code is that it just hangs without raising any
exceptions. And as mentioned by Laura above that when I press CTRL+C, it just
catches that exception and prints ConnectionError which is definitely a lie in
this case as you mentioned.
As my code doesnt
On Thursday, September 24, 2015 at 4:09:04 PM UTC+5:30, Laura Creighton wrote:
> In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes:
> >Hi
> >If my script hangs because of the reasons you mentioned above, why doesnt it
> >catch ConnectionError?
> >My s
On Thursday, September 24, 2015 at 4:09:04 PM UTC+5:30, Laura Creighton wrote:
> In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes:
> >Hi
> >If my script hangs because of the reasons you mentioned above, why doesnt it
> >catch ConnectionError?
> >My s
On Friday, September 25, 2015 at 10:55:45 AM UTC+5:30, Cameron Simpson wrote:
> On 24Sep2015 20:57, shiva upreti wrote:
> >Thank you Cameron.
> >I think the problem with my code is that it just hangs without raising any
> >exceptions. And as mentioned by Laura above that wh
On Friday, September 25, 2015 at 12:55:01 PM UTC+5:30, Cameron Simpson wrote:
> On 24Sep2015 22:46, shiva upreti wrote:
> >On Friday, September 25, 2015 at 10:55:45 AM UTC+5:30, Cameron Simpson wrote:
> >> On 24Sep2015 20:57, shiva upreti wrote:
> >> >Thank you Came
38 matches
Mail list logo