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


Groups > comp.lang.python > #51265

Re: Creating a Simple User Interface for a Function

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.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; 'duplicate': 0.07; 'interpreter.': 0.07; 'linux,': 0.07; 'setup.': 0.07; 'tkinter': 0.07; 'string': 0.09; 'integers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'repeated': 0.09; 'subject:Function': 0.09; 'windows,': 0.09; 'python': 0.11; 'jan': 0.12; 'check.': 0.16; 'integers.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'threads.': 0.16; 'tkinter.': 0.16; 'wrote:': 0.18; 'meant': 0.20; 'starts': 0.20; 'command': 0.22; '>>>': 0.22; 'input': 0.22; 'example': 0.22; 'this?': 0.23; 'header:User-Agent:1': 0.23; '2.x': 0.24; 'specify': 0.24; 'looks': 0.24; 'equivalent': 0.26; 'first,': 0.26; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'strongly': 0.30; 'code': 0.31; 'dialog': 0.31; 'file': 0.32; 'interface': 0.32; 'option': 0.32; 'run': 0.32; 'open': 0.33; 'alone': 0.33; 'checking': 0.33; 'core': 0.34; "i'd": 0.34; 'but': 0.35; 'there': 0.35; 'version': 0.36; 'installing': 0.36; 'subject:Simple': 0.36; 'positive': 0.37; 'list': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'how': 0.40; 'future': 0.60; 'helps': 0.61; 'received:173': 0.61; 'simple': 0.61; 'further': 0.61; 'decided': 0.64; 'more': 0.64; 'latest': 0.67; 'determine': 0.67; 'line,': 0.68; 'prompt': 0.68; 'fact,': 0.69; 'increasing': 0.74; "'2',": 0.84; "'3',": 0.84; 'received:fios.verizon.net': 0.84; 'together,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Creating a Simple User Interface for a Function
Date Thu, 25 Jul 2013 19:00:50 -0400
References <cebb4f86-c546-4283-a839-46393571cbb0@googlegroups.com> <mailman.5116.1374779986.3114.python-list@python.org> <97f8224f-e73b-4a4b-bf05-7cc3dba4e9d9@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-251-66.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
In-Reply-To <97f8224f-e73b-4a4b-bf05-7cc3dba4e9d9@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 <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.5122.1374793265.3114.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1374793265 news.xs4all.nl 15867 [2001:888:2000:d::a6]:43442
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:51265

Show key headers only | View raw


On 7/25/2013 4:58 PM, CTSB01 wrote:

> 1) I decided to use Python 2.7, and I will be sure to specify this in
> all future threads.

Given that you are not using any libraries, let alone one that does not
run on Python 3, I strongly recommend using the latest version (3.3).

> 2) It is a list of positive integers.  In fact, it is always going to
> be a list of positive increasing integers.

Your example below starts with 0, which is not positive.
Perhaps you mean that all integers after a single leading 0 have to be 
positive and increasing.

If you run digits together, then the max int is 9. Do you intend this?

> 4) Yes, sorry that's what I meant (if I understood correctly).  I was
> told elsewhere that I might want to try using tkinter.

If users start the program at a command line, the core of an input 
function would be
   input = (raw)input('Enter digits: ')  # Include "raw" on 2.x
You would need a more elaborate prompt printed first, and input checking 
with the request repeated if the input does not pass the check.

It would be pretty simple to do the equivalent with a tkinter dialog box.

> I'd like to be
> able to run send a .exe file that the user can just open up and use
> with no further setup.

There are programs that will package your code with an interpreter. But 
do give people the option to get just the program without installing a 
duplicate interpreter.

> So on top of the user interface I would also it looks like need to
> determine how to make Python change a string 01112345 into a list so
> that it does that automatically when the user clicks 'run'.

 >>> list('01112345')
['0', '1', '1', '1', '2', '3', '4', '5']
 >>> '0,1,1,1,2,3,4,5'.split(',')
['0', '1', '1', '1', '2', '3', '4', '5']

> Would a shebang still be the right way to go?

On Linux, definitely, whether you have user enter on the command line or
in response to a prompt. On windows, it only helps with 3.3+.

-- 
Terry Jan Reedy

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


Thread

Creating a Simple User Interface for a Function CTSB01 <scott.moore270@gmail.com> - 2013-07-25 09:03 -0700
  Re: Creating a Simple User Interface for a Function Dave Angel <davea@davea.name> - 2013-07-25 15:19 -0400
    Re: Creating a Simple User Interface for a Function CTSB01 <scott.moore270@gmail.com> - 2013-07-25 13:58 -0700
      Re: Creating a Simple User Interface for a Function Terry Reedy <tjreedy@udel.edu> - 2013-07-25 19:00 -0400
      Re: Creating a Simple User Interface for a Function Dave Angel <davea@davea.name> - 2013-07-25 19:01 -0400
      Re: Creating a Simple User Interface for a Function Terry Reedy <tjreedy@udel.edu> - 2013-07-25 19:46 -0400
      RE: Creating a Simple User Interface for a Function "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2013-07-26 14:08 +0000

csiph-web