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


Groups > comp.lang.python > #46483

Re: User Input

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.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 <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.032
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'assigning': 0.09; 'filename': 0.09; 'function,': 0.09; "wouldn't": 0.14; '"is': 0.16; 'clause.': 0.16; 'defined,': 0.16; 'guess.': 0.16; 'inputs': 0.16; 'made,': 0.16; 'user?': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'meant': 0.20; 'input': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'suggested': 0.26; 'defined': 0.27; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'rest': 0.29; 'chris': 0.29; 'am,': 0.29; 'comments': 0.31; 'usually': 0.31; 'file': 0.32; 'used,': 0.33; 'sense': 0.34; 'maybe': 0.34; "can't": 0.35; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'object,': 0.36; 'possible': 0.36; 'expected': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'name:': 0.61; 'simply': 0.61; 'you.': 0.62; 'information': 0.63; 'confirm': 0.64; 'between': 0.67; 'received:74.208': 0.68; '"not': 0.84; 'received:74.208.4.194': 0.84
Date Thu, 30 May 2013 08:58:32 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version 1.0
To python-list@python.org
Subject Re: User Input
References <e3fd9fdd-efa0-45b8-97b9-b77519012640@googlegroups.com> <864c9d49-9929-43dd-b484-d6be92564cc3@googlegroups.com>
In-Reply-To <864c9d49-9929-43dd-b484-d6be92564cc3@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:YFmfNMnui2pNCjJeFTohGpfv8Mex4aYg6lNouurehmt WhwU3gDPfAmRAjm7a+tmHNsq/vSoXhm2GOve+HVQHRFP/viFtR NdGZ0kdCQql5i/l4u2gIQqmafNjZAaYBVyW5eyAmjXYXZQq3OV Jj1dqrRYGgNRMKRxLtWl41ZDQzGtd9A9bMd8w9xlS+5fIqmY8c bjLqWGqt0d4UouwH2BcZqAHnYus49hesDI4Y3GJGG5XkyCPvM/ lAk4rJTCOrPs73VlnokshXM+bPZy/aKWUVncskU9g9+qudOOQz 22bvHsX/dwM1tuRdLy9TwNrizDvPa62Y6RQDjXtiQ8tO6bHC9P 1xZVZSwcTdTHu4MHZcAA=
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2416.1369918733.3114.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369918733 news.xs4all.nl 16000 [2001:888:2000:d::a6]:58462
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46483

Show key headers only | View raw


On 05/30/2013 08:37 AM, Eternaltheft wrote:
> sorry about that, i got confused xD. yeah it works good now.
> what i meant to say was can i return a function that i made, if the user inputs nothing?
>

There wouldn't be anything to stop you.  However, if you have multiple 
returns from the same function, it's usually wise to return the same 
type of information from each of them.  That's why Chris suggested 
simply assigning to filename in the if clause.

But without the whole function, and maybe even a description of what the 
function is expected to do, we can only guess.

Your comments still make no sense to me,

 > filename = input('file name: ')
 > if not filename:      #i get filename is not defined

But filename IS defined, immediately above. If it were undefined, you'd 
not be able to test it here.  Big difference between "not defined" and 
"is empty string".

 >    return(drawBoard) #possible to return function when no file input 
from user?

If drawBoard is a function object, it's certainly possible to return it. 
  But again, without seeing the rest of the function, and maybe how it's 
intended to be used, I can't confirm whether it makes sense.

-- 
DaveA

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


Thread

User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 04:33 -0700
  Re: User Input Fábio Santos <fabiosantosart@gmail.com> - 2013-05-30 12:45 +0100
  Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 04:48 -0700
    Re: User Input Chris Angelico <rosuav@gmail.com> - 2013-05-30 22:06 +1000
    Re: User Input MRAB <python@mrabarnett.plus.com> - 2013-05-30 13:08 +0100
    Re: User Input Fábio Santos <fabiosantosart@gmail.com> - 2013-05-30 13:10 +0100
  Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 05:19 -0700
    Re: User Input Fábio Santos <fabiosantosart@gmail.com> - 2013-05-30 13:27 +0100
    Re: User Input Chris Angelico <rosuav@gmail.com> - 2013-05-30 22:28 +1000
  Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 05:37 -0700
    Re: User Input Dave Angel <davea@davea.name> - 2013-05-30 08:58 -0400
    Re: User Input Chris Angelico <rosuav@gmail.com> - 2013-05-30 22:59 +1000
  Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 06:10 -0700
    Re: User Input Dave Angel <davea@davea.name> - 2013-05-30 09:37 -0400
      Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 07:03 -0700
        Re: User Input Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-30 15:30 +0100
          Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 07:49 -0700
      Re: User Input Eternaltheft <eternaltheft@gmail.com> - 2013-05-30 07:47 -0700
        Re: User Input Joshua Landau <joshua.landau.ws@gmail.com> - 2013-05-30 16:09 +0100

csiph-web