Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'assign': 0.07; '"if': 0.09; 'filename': 0.09; 'guys.': 0.09; '(which,': 0.16; 'fabio': 0.16; 'filename.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'there?': 0.16; 'user?': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'typing': 0.19; 'input': 0.22; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'originally': 0.30; 'message-id:@mail.gmail.com': 0.30; 'context,': 0.31; 'file': 0.32; 'probably': 0.32; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'thanks': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'name:': 0.61; '30,': 0.65; 'said:': 0.68; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=K2M1lk5hNWJRHn0Zyp7lhJQb0ngYAJmPbJo8MwdVC9k=; b=gkRq+Y5wXYeiKrsTM4TY6VcrZ6kFx+5nRjt32W/EKf3tEAkIgyJvwPak7ewCHnrVyS JZX5zq4lEbIwkmzwPn6j/TPHfcEhgkthBEsFlVB2wScnL4fbE84Tulq2tL/QItAy5aRU JiWVPL9Hk14kaCpS/2+/632zqnzn2K8TB58RgNA64ujkx55Acm+kwttc1s6h37r38HQI vkIo11xFNc0uuLiPoPwieCuGDNU1ZlsYtvJLBIhH9EfODa6N8fKgbKtpk84YJFJNS1vg JT3HXLx1OETyB+BsWEeHWZj3qS5k7XUjkdgPt9o7AGZMgZaNyg/4iItyOpWf1cEmeycI bhPQ== MIME-Version: 1.0 X-Received: by 10.52.117.16 with SMTP id ka16mr4346969vdb.43.1369916919254; Thu, 30 May 2013 05:28:39 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 May 2013 22:28:39 +1000 Subject: Re: User Input From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369916922 news.xs4all.nl 16011 [2001:888:2000:d::a6]:47940 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46470 On Thu, May 30, 2013 at 10:19 PM, Eternaltheft wrote: > Ok thanks guys. but when i use > > filename = input('file name: ') > if not filename: #i get filename is not defined > return(drawBoard) #possible to return function when no file input from user? Do you really want to return there? What function is this defined in? I think you probably want what Fabio originally said: that "if not filename" (which, in this context, means "if the user hit Enter without typing anything"), assign something to filename. ChrisA