Re: trying to make a simple program help please :)

2016-10-14 Thread BartC
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

Re: trying to make a simple program help please :)

2016-10-14 Thread Irmen de Jong
Right, another troll. plonk Irmen -- https://mail.python.org/mailman/listinfo/python-list

Re: trying to make a simple program help please :)

2016-10-14 Thread LongHairLuke
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("

Re: trying to make a simple program help please :)

2016-10-14 Thread Irmen de Jong
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

Re: trying to make a simple program help please :)

2016-10-14 Thread 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("Your guess: ") if userGuess == randomNumber: print("You got it") else: pr

trying to make a simple program help please :)

2016-10-14 Thread LongHairLuke
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

Re: py2exe crashes on simple program

2016-07-05 Thread John Nagle
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

Re: py2exe crashes on simple program

2016-07-04 Thread Steven D'Aprano
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'.

py2exe crashes on simple program

2016-07-04 Thread John Nagle
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.

Re: common mistakes in this simple program

2016-03-15 Thread Ganesh Pal
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

Re: common mistakes in this simple program

2016-03-01 Thread Steven D'Aprano
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

Re: common mistakes in this simple program

2016-02-29 Thread Ian Kelly
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

Re: common mistakes in this simple program

2016-02-29 Thread Rob Gaddi
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

Re: common mistakes in this simple program

2016-02-29 Thread Cameron Simpson
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

Re: common mistakes in this simple program

2016-02-29 Thread Martin A. Brown
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

Re: common mistakes in this simple program

2016-02-29 Thread Marko Rauhamaa
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:

Re: common mistakes in this simple program

2016-02-29 Thread Joel Goldstick
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

Re: common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
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

Re: common mistakes in this simple program

2016-02-29 Thread sohcahtoa82
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

Re: common mistakes in this simple program

2016-02-29 Thread Chris Angelico
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

Re: common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
>> 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

Re: common mistakes in this simple program

2016-02-29 Thread Ian Kelly
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

Re: common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
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 >

Re: common mistakes in this simple program

2016-02-29 Thread Ian Kelly
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

common mistakes in this simple program

2016-02-29 Thread Ganesh Pal
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

Re: Python Simple program

2014-01-18 Thread Roy Smith
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

Re: Python Simple program

2014-01-18 Thread indar kumar
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

Re: Python Simple program

2014-01-18 Thread Roy Smith
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

Re: Python Simple program

2014-01-18 Thread Chris Angelico
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

Python Simple program

2014-01-18 Thread indar kumar
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

Re: Simple program question.

2013-06-11 Thread russ . pobox
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...

Re: Simple program question.

2013-06-10 Thread eschneider92
No. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple program question.

2013-06-09 Thread Chris Angelico
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

Simple program question.

2013-06-09 Thread eschneider92
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

Re: getting a "simple" program to work

2009-08-14 Thread John Haggerty
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

Re: getting a "simple" program to work

2009-08-12 Thread John Haggerty
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,

Re: getting a "simple" program to work

2009-08-11 Thread John Haggerty
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

Re: getting a "simple" program to work

2009-08-11 Thread Chris Rebert
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

Re: getting a "simple" program to work

2009-08-11 Thread John Haggerty
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

Big money in a simple program!!!

2008-10-19 Thread [EMAIL PROTECTED]
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

simple program

2008-04-11 Thread shawn s
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

Re: printing dots in simple program while waiting

2008-01-09 Thread Alex VanderWoude
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

Re: printing dots in simple program while waiting

2008-01-09 Thread John Machin
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 = '.' >

Re: printing dots in simple program while waiting

2008-01-09 Thread John
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: > &

Re: printing dots in simple program while waiting

2008-01-09 Thread Santiago Romero
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 = '.' >

RE: printing dots in simple program while waiting

2008-01-09 Thread Reedick, Andrew
> -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:

Re: printing dots in simple program while waiting

2008-01-09 Thread John
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 >

Re: printing dots in simple program while waiting

2008-01-09 Thread Tim Chase
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

Re: printing dots in simple program while waiting

2008-01-09 Thread Martin Marcher
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

printing dots in simple program while waiting

2008-01-09 Thread John
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

Re: [pygame] Very simple program fails. Why?

2005-04-27 Thread Sizer
"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

Re: [pygame] Very simple program fails. Why?

2005-04-26 Thread Lee Harr
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

[pygame] Very simple program fails. Why?

2005-04-26 Thread Brent W. Hughes
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