Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'languages,': 0.04; 'languages.': 0.04; 'interpreter': 0.05; 'subject:Python': 0.06; 'encoded': 0.07; 'json': 0.07; '*is*': 0.09; 'compact': 0.09; 'parameter': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'gui': 0.12; 'jan': 0.12; 'suggest': 0.14; 'itself.': 0.14; '(unlike': 0.16; '23,': 0.16; 'declaration': 0.16; 'personally,': 0.16; 'readable': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'those,': 0.16; 'unnecessary.': 0.16; 'xml),': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'things.': 0.19; 'thu,': 0.19; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'specify': 0.24; '(see': 0.26; 'compiled': 0.26; 'least': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '[1]': 0.29; 'am,': 0.29; 'xml': 0.29; "doesn't": 0.30; '(like': 0.30; 'code': 0.31; 'that.': 0.31; '(unless': 0.31; 'file': 0.32; 'languages': 0.32; 'quite': 0.32; 'text': 0.33; 'sense': 0.34; 'could': 0.34; "can't": 0.35; 'common': 0.35; 'created': 0.35; 'case,': 0.35; 'objects': 0.35; 'but': 0.35; 'add': 0.35; 'effort': 0.37; 'application': 0.37; 'las': 0.37; 'two': 0.37; 'easily': 0.37; 'represent': 0.38; 'ahead': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'that,': 0.38; 'structure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'easy': 0.60; 'most': 0.60; 'received:173': 0.61; 'simple': 0.61; "you're": 0.61; 'making': 0.63; 'kind': 0.63; 'such': 0.63; 'more': 0.64; 'construction': 0.72; 'fantastic': 0.74; 'received:fios.verizon.net': 0.84; 'technically': 0.84; 'transmitting': 0.84; 'beneficial': 0.91; 'composite': 0.91; 'novice': 0.91; 'superb': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Python declarative Date: Wed, 22 Jan 2014 23:08:06 -0500 References: <8fde6d34-47c5-49a1-a6d0-9ffe3df2d401@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-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390450100 news.xs4all.nl 2863 [2001:888:2000:d::a6]:52834 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64563 On 1/22/2014 9:29 PM, Chris Angelico wrote: > On Thu, Jan 23, 2014 at 8:16 AM, Asaf Las wrote: >> i am novice in python, but let me suggest you something: >> it would be beneficial to use json text file to specify >> your gui so composite data structure can be created using >> json and then your program can construct window giving >> its content will be based on simple text file? >> You can add every parameter to json encoded window system >> once your window construction will be using as interpreter >> for that. JSON is very structured and quite presentable for >> such kind of things. > JSON is better than XML for that, but in my opinion, both are > unnecessary. Python code is easy to edit. (See [1] for more on Python > and XML.) When you're writing compiled code, it makes good sense to > drop out of code and use a simple text file when you can; but when > your code *is* a simple text file, why go to the effort of making a > JSON-based window builder? (Unless you already have one. GladeXML may > well be exactly what you want, in which case, go ahead and use it. But > personally, I don't.) JSON is a fantastic format for transmitting > complex objects around the internet; it's compact (unlike XML), > readable in many languages (like XML), easily readable by humans > (UNLIKE XML!), and can represent all the most common data structures > (subtly, XML can't technically do this). It's superb at what it > does... but it doesn't do Python GUIs. For those, use Python itself. I would only use JSON if I wanted a declaration format that was independent of implementation languages, that could be read and turned into application objects by as least two languages. -- Terry Jan Reedy