Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63634

Re: Constructive Criticism

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'sys': 0.07; 'welcome.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'typed': 0.09; 'def': 0.12; '-1):': 0.16; 'imports': 0.16; 'once.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sys.exit(0)': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'pointed': 0.19; 'example': 0.22; 'import': 0.22; 'coding': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; "i've": 0.25; 'script': 0.25; 'second': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "i'm": 0.30; 'code': 0.31; 'usually': 0.31; 'prints': 0.31; 'beginning': 0.33; 'but': 0.35; 'christopher': 0.36; 'from:addr:live.com': 0.36; 'done': 0.36; 'hi,': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'email addr:gmail.com': 0.63; 'myself': 0.63; 'teaching': 0.64; 'here': 0.66; '(i)': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Christopher Welborn <cjwelborn@live.com>
Subject Re: Constructive Criticism
Date Thu, 09 Jan 2014 14:54:44 -0600
References <8574fa07-af12-4e62-9cbc-3bd00802b6e2@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 68-113-89-245.dhcp.leds.al.charter.com
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <8574fa07-af12-4e62-9cbc-3bd00802b6e2@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5286.1389300899.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1389300899 news.xs4all.nl 2843 [2001:888:2000:d::a6]:48523
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:63634

Show key headers only | View raw


On 01/08/2014 11:56 PM, jeremiahvalerio123@gmail.com wrote:
> Hi, hows it going I've been self teaching myself python, and i typed up this small script now i know its not the best the coding is not the best but i would like to know of ways to make a small script like this better so all constructive critisim is Welcome.
>
>
>
> Here is the link to the code
>
>     " http://pastebin.com/5uCFR2pz "
>

I'm not sure if someone already pointed this out, but imports only need
to be done once. Usually at the beginning of the file, but not always.
In your case I would say yes, at the beginning.

import sys
import time

def countdown(seconds):'
     # start at 'seconds' and count down with a for-loop
     for i in range(seconds, 0, -1):
         # print the current second (i)
         print('closing in {} seconds.'.format(i))
         # sleep for one second (no need to import time again).
         time.sleep(1)

# Example usage:
print('hello')
# Prints the countdown.
countdown(10)
sys.exit(0)
-- 

- Christopher Welborn <cjwelborn@live.com>
   http://welbornprod.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Constructive Criticism jeremiahvalerio123@gmail.com - 2014-01-08 21:56 -0800
  Re: Constructive Criticism Paul Pittlerson <menkomigen6@gmail.com> - 2014-01-08 22:06 -0800
  Re: Constructive Criticism Ben Finney <ben+python@benfinney.id.au> - 2014-01-09 17:09 +1100
    Re: Constructive Criticism jeremiah valerio <jeremiahvalerio123@gmail.com> - 2014-01-08 22:16 -0800
      Re: Constructive Criticism Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-09 07:03 +0000
  Re: Constructive Criticism Peter Otten <__peter__@web.de> - 2014-01-09 10:56 +0100
    Re: Constructive Criticism jeremiah valerio <jeremiahvalerio123@gmail.com> - 2014-01-09 12:08 -0800
  Re: Constructive Criticism Christopher Welborn <cjwelborn@live.com> - 2014-01-09 14:54 -0600
    Re: Constructive Criticism jeremiah valerio <jeremiahvalerio123@gmail.com> - 2014-01-09 13:05 -0800
      Re: Constructive Criticism Alister <alister.ware@ntlworld.com> - 2014-01-10 08:56 +0000
        Re: Constructive Criticism jeremiah valerio <jeremiahvalerio123@gmail.com> - 2014-01-10 12:26 -0800
          Re: Constructive Criticism Chris Angelico <rosuav@gmail.com> - 2014-01-11 07:34 +1100
          Re: Constructive Criticism Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-10 21:24 +0000

csiph-web