On 14/10/2016 19:53, LongHairLuke wrote:
Den fredag 14 oktober 2016 kl. 20:30:20 UTC+2 skrev MRAB:
On 2016-10-14 19:11, LongHairLuke wrote:
Hi, l l am trying to make a simple guess program. This is my script:
def main():
print ("Guess a letter between a and e")
randomNumber = b
us
Right, another troll.
plonk
Irmen
--
https://mail.python.org/mailman/listinfo/python-list
Den fredag 14 oktober 2016 kl. 20:30:20 UTC+2 skrev MRAB:
> On 2016-10-14 19:11, LongHairLuke wrote:
> > Hi, l l am trying to make a simple guess program. This is my script:
> >
> > def main():
> > print ("Guess a letter between a and e")
> > randomNumber = b
> >
> > userGuess = input("
On 14-10-2016 20:11, LongHairLuke wrote:
> Hi, l l am trying to make a simple guess program. This is my script:
>
> def main():
> print ("Guess a letter between a and e")
> randomNumber = b
>
> userGuess = input("Your guess: ")
>
> if userGuess == randomNumber:
> print("You
On 2016-10-14 19:11, LongHairLuke wrote:
Hi, l l am trying to make a simple guess program. This is my script:
def main():
print ("Guess a letter between a and e")
randomNumber = b
userGuess = input("Your guess: ")
if userGuess == randomNumber:
print("You got it")
else:
pr
Hi, l l am trying to make a simple guess program. This is my script:
def main():
print ("Guess a letter between a and e")
randomNumber = b
userGuess = input("Your guess: ")
if userGuess == randomNumber:
print("You got it")
else:
print ("That's not it")
main()
Wh
On 7/4/2016 11:13 PM, Steven D'Aprano wrote:
> If you change it to "library.exe" does it work? Also, I consider this
> a bug in py2exe: - it's an abuse of assert, using it to check
> user-supplied input; - it's a failing assertion, which by definition
> is a bug.
I'm not trying to build "librar
On Tuesday 05 July 2016 14:06, John Nagle wrote:
> I'm trying to create an executable with py2exe.
> The program runs fine in interpretive mode. But
> when I try to build an executable, py2exe crashes with
> an assertion error. See below.
[...]
> Building shared code archive 'dist\library.zip'.
I'm trying to create an executable with py2exe.
The program runs fine in interpretive mode. But
when I try to build an executable, py2exe crashes with
an assertion error. See below.
This is an all-Python program; no binary modules
other than ones that come with the Python 3.5.2
distribution.
On Tue, Mar 1, 2016 at 2:41 AM, Martin A. Brown wrote:
> Please read below. I will take a stab at explaining the gaps of
> understanding you seem to have (others have tried already, but I'll
> try, as well).
>
> I am going to give you four different functions which demonstrate
> how to use excep
On Tue, 1 Mar 2016 03:29 am, Ian Kelly wrote:
> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
>> Iam on python 2.6
>
> Python 2.6 has been unsupported since October 2013. Among other
> things, that means it is no longer receiving security updates like
> more recent versions. Unless you have
On Mon, Feb 29, 2016 at 4:14 PM, Cameron Simpson wrote:
> Another remark here: if you're going to log, log the exception as well:
>
> logging.error("something went wrong: %s", e)
>
> Ian's example code is nice and simple to illustrate "log and then reraise"
> but few things are as annoying as
Cameron Simpson wrote:
> On 29Feb2016 10:45, Ian Kelly wrote:
>>On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote:
>>> On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
> 1. usage of try- expect
try-except in every single f
On 29Feb2016 10:45, Ian Kelly wrote:
On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote:
On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
1. usage of try- expect
try-except in every single function is a code smell. You should only
be us
Greetings Ganesh,
>> You're falling into the trap of assuming that the only exception you
>> can ever get is the one that you're planning for, and then handling.
>
>Ok sure !
This point is very important, so I'll reiterate it. I hope the poor
horse lives.
>> ALL exceptions as though they were
sohcahto...@gmail.com:
> Every time you say "try-expect", my head wants to explode.
>
> It is called a "try-except" block, because you're using the key words
> "try" and "except" when you make one.
Ah, I remember a Python-based test system idea where the "except"
keyword meant "expect":
try:
On Mon, Feb 29, 2016 at 2:49 PM, Ganesh Pal wrote:
> On Mar 1, 2016 12:06 AM, "Chris Angelico" wrote
> >
> > You're falling into the trap of assuming that the only exception you
> > can ever get is the one that you're planning for, and then handling.
>
> Ok sure !
>
> > ALL exceptions as though
On Mar 1, 2016 12:06 AM, "Chris Angelico" wrote
>
> You're falling into the trap of assuming that the only exception you
> can ever get is the one that you're planning for, and then handling.
Ok sure !
> ALL exceptions as though they were that one. Instead catch ONLY the
> exception that you're
On Monday, February 29, 2016 at 10:21:57 AM UTC-8, Ganesh Pal wrote:
> >> How do we reraise the exception in python , I have used raise not
> >> sure how to reraise the exception
> >
> > raise with no arguments will reraise the exception currently being handled.
> >
> > except Exception:
> > l
On Tue, Mar 1, 2016 at 5:21 AM, Ganesh Pal wrote:
>
> In my case the exception is nothing but the error example if we plan
> to run the command say #ifconfig -a and the command fails because of
> a type ( say u ran #igconfig -a).
>
> we will the output as
>
> # Failed to run igconfig -a got Er
>> How do we reraise the exception in python , I have used raise not
>> sure how to reraise the exception
>
> raise with no arguments will reraise the exception currently being handled.
>
> except Exception:
> logging.error("something went wrong")
> raise
Thanks Ian for taking time and lo
On Mon, Feb 29, 2016 at 10:26 AM, Ganesh Pal wrote:
> On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
>> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
>>> Iam on python 2.6
>
>>> 1. usage of try- expect
>>
>> try-except in every single function is a code smell. You should only
>> be using
On Mon, Feb 29, 2016 at 9:59 PM, Ian Kelly wrote:
> On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
>> Iam on python 2.6
>> 1. usage of try- expect
>
> try-except in every single function is a code smell. You should only
> be using it where you're actually going to handle the exception. If
>
On Mon, Feb 29, 2016 at 8:18 AM, Ganesh Pal wrote:
> Iam on python 2.6
Python 2.6 has been unsupported since October 2013. Among other
things, that means it is no longer receiving security updates like
more recent versions. Unless you have an extremely strong reason for
wanting to stay to Python
Iam on python 2.6 , need inputs on the common mistakes in this program
, may be you suggest what need to be improved from
1. usage of try- expect
2. Return of True/ False
3. Other improvement
#!/usr/bin/env python
"""
"""
import os
import shlex
import subprocess
import sys
import time
import lo
In article <60955b74-7bc8-4c72-94e1-849015985...@googlegroups.com>,
indar kumar wrote:
> On Saturday, January 18, 2014 11:00:47 AM UTC-7, indar kumar wrote:
> > Hello, I am a newbie. Can somebody help me write the code for following
> > program?
> >
> >
> >
> >
> >
> > Write a program that
On Saturday, January 18, 2014 11:00:47 AM UTC-7, indar kumar wrote:
> Hello, I am a newbie. Can somebody help me write the code for following
> program?
>
>
>
>
>
> Write a program that takes student grades and prints out the GPA. The
> information is input, one student per line in the forma
In article ,
indar kumar wrote:
> Hello, I am a newbie. Can somebody help me write the code for following
> program?
>
>
> Write a program that takes student grades and prints out the GPA. The
> information is input, one student per line in the format:
> ...
> The number of students is n
On Sun, Jan 19, 2014 at 5:00 AM, indar kumar wrote:
> Hello, I am a newbie. Can somebody help me write the code for following
> program?
>
>
> Write a program that takes student grades and prints out the GPA. The
> information is input, one student per line in the format:
> ...
> The number
Hello, I am a newbie. Can somebody help me write the code for following program?
Write a program that takes student grades and prints out the GPA. The
information is input, one student per line in the format:...
The number of students is not known in advance. You should prompt the user for
input() is a function which returns a string. You can assign this return value
to a variable. That's what variables are for.
option = input()
Now you can use the variable named option in place of all those calls to
input().
i.e:
...instead of..
if input() == 'parry':
# etc
...do this...
No.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Jun 10, 2013 at 1:06 PM, wrote:
> if input()!=('duck', 'parry'):
> if input()=='duck':
> if input()=='parry':
Every time you call input(), it waits for you to type something. You
want to record what the person typed and then use it in each place.
Have you been taught a means of doing thi
How do I make it so I only have to type in 'parry' once?
import random
words=['hemisses', 'hestabsyou']
randomizer=random.choice(words)
if input()!=('duck', 'parry'):
print('try again')
if input()=='duck':
print(randomizer)
if randomizer=='hemisses':
results=['you should have r
I'm checking back with some new info.
Apparently the maintainer of the ogss package indicated that this is
definately an issue with the libgmail package.
Now I have already submtted help to the maintainer of libgmail to get some
help it making his project work again.
I am also interesetd in how
Just checking to see if this is more adequate to what you would have wanted
to see I didn't get any feedback so I wasn't quite sure of this at the
present time.
On Tue, Aug 11, 2009 at 11:02 PM, John Haggerty wrote:
>
>
> On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert wrote:
>
>> On Sun, Aug 9,
On Tue, Aug 11, 2009 at 10:46 PM, Chris Rebert wrote:
> On Sun, Aug 9, 2009 at 8:42 PM, John Haggerty wrote:
> > ok so I know this is one of those "weird" requests but here me out.
> > So far I have an issue with a package for python called "libgmail" which
> is
> > basically a gmail interface fo
On Sun, Aug 9, 2009 at 8:42 PM, John Haggerty wrote:
> ok so I know this is one of those "weird" requests but here me out.
> So far I have an issue with a package for python called "libgmail" which is
> basically a gmail interface for python to send messages remoetly.
> Works ok except that the 'se
just checking to see if there is any input that may have been misdirected to
a spam filter.
Would love to see some feedback if I may
On Sun, Aug 9, 2009 at 6:42 PM, John Haggerty wrote:
> ok so I know this is one of those "weird" requests but here me out.
> So far I have an issue with a package
IT'S SIMPLE AND IT'S LEGAL!!!
Who doesn’t want to make tons of money ridiculously easy? Read this
letter follow the instructions, and like me you’ll never have to worry
about
money again.
I was browsing through news groups just like you are right now and
Came across a article similar to this sa
Hi,
Here is a simple prog that I can run from the Python shell and it runs fine but
when I double click the 'filename.py' ,
it does not execute the ping statement, and seems like it is stuck at the
following output:
Fri Apr 11 12:16:09 2008
Testing 192.168.0.1
The prog is as follows:
impo
John wrote:
> what i want to do is print a 'waiting' statement while a script is
> working-- the multithreading aspect isn't an issue, the printing on
> the same line is. i want to print something like:
>
> (1sec) working...
> (2sec) working
> (3sec) working.
>
>
> where the 'working' l
Of Martin Marcher
> > > Sent: Wednesday, January 09, 2008 11:57 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: printing dots in simple program while waiting
>
> > > John wrote:
>
> > > > import time
> > > > s = '.'
>
L PROTECTED]
> > Subject: Re: printing dots in simple program while waiting
>
> > John wrote:
>
> > > import time
> > > s = '.'
> > > print 'working', # Note the "," at the end of the line
> > > while True:
> &
On 9 ene, 17:48, John <[EMAIL PROTECTED]> wrote:
> i want to print something like:
>
> (1sec) working...
> (2sec) working
> (3sec) working.
>
> where the 'working' line isn't being printed each second, but the dots
> are being added with time.
>
> something like:
>
> import time
> s = '.'
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Martin Marcher
> Sent: Wednesday, January 09, 2008 11:57 AM
> To: python-list@python.org
> Subject: Re: printing dots in simple program while waiting
>
> John wrote:
On Jan 9, 11:56 am, Martin Marcher <[EMAIL PROTECTED]> wrote:
> John wrote:
> > import time
> > s = '.'
> > print 'working', # Note the "," at the end of the line
> > while True:
> > print s
> > time.sleep(1)
>
> see my comment in the code above...
>
> if that's what you mean
>
> /martin
>
Martin Marcher wrote:
> John wrote:
>
>> import time
>> s = '.'
>> print 'working', # Note the "," at the end of the line
>> while True:
>> print s, #Note the "," at the end of this line too...
>> time.sleep(1)
>
> see my comment in the code above...
see my added comment in the code abov
John wrote:
> import time
> s = '.'
> print 'working', # Note the "," at the end of the line
> while True:
> print s
> time.sleep(1)
see my comment in the code above...
if that's what you mean
/martin
--
http://noneisyours.marcher.name
http://feeds.feedburner.com/NoneIsYours
You are
Ok, so this should be a really simple thing to do, but I haven't been
able to get it on the first few tries and couldn't find anything after
searching a bit.
what i want to do is print a 'waiting' statement while a script is
working-- the multithreading aspect isn't an issue, the printing on
the s
"Brent W. Hughes" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> I'm just starting to learn pygame. I write what I think is just about
> the simplest program that should display a window and then quit.
> #---
> import sys
> import time
> import
On 2005-04-26, Brent W. Hughes <[EMAIL PROTECTED]> wrote:
> I'm just starting to learn pygame. I write what I think is just about the
> simplest program that should display a window and then quit.
> #---
> import sys
> import time
> import pygame
>
> py
I'm just starting to learn pygame. I write what I think is just about the
simplest program that should display a window and then quit.
#---
import sys
import time
import pygame
pygame.init()
screen = pygame.display.set_mode((640,480))
pygame.display.se
53 matches
Mail list logo