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: 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 Subject: Re: Creating a Simple User Interface for a Function Date: Thu, 25 Jul 2013 19:00:50 -0400 References: <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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