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


Groups > comp.lang.python > #78317

Re: how to make return(self.res) not to output the content of list ?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <elearn2014@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'output': 0.05; 'skip:` 10': 0.07; 'sys': 0.07; 'rewrite': 0.09; 'python': 0.11; 'def': 0.12; 'code?': 0.16; 'lambda': 0.16; 'subject:make': 0.16; 'to:addr:web.de': 0.16; 'import': 0.22; 'header:User-Agent:1': 0.23; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'function': 0.29; 'subject:) ': 0.29; 'subject:list': 0.30; 'code': 0.31; 'class': 0.32; 'table': 0.34; 'subject:the': 0.34; 'display': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'list': 0.37; 'received:10': 0.37; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:x 10': 0.40; 'how': 0.40; 'fulfill': 0.68; 'grow': 0.77; 'received:10.32': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=47qOzl8J+x1+BaN5PJBQr9SOI5kbO2xjt5uY7SHYDX8=; b=eoG2K2p6EMNltBu+BFot1G84yvc3Y8kMGMbeIc6iXJbyHJo+FxTAbxjEWmHI9j97nZ TlRbQQ06/5UOOgRFND457vhwmCpwynVVbEeF1fjFOaleOl2O2RgVIPLHc8PuyV2oEQVx QOwunIjg+CW/XmK+2P1IhCua9iuqA6ufx1NZeV2illLWHt1y2SFwZfcyQ7ocNG4fRJmk JobDQ3HG1lTkK4QjADFYfZxSr/AWATp4AG39fQld72IXyLTUWl/aYjMU5x8aB7wpswPC ZJaKjhs6f7Blf8jouRLTPhk7Odwrcrk2ID5CcSprXBo8F3ekpmwWqBtzyZw+KNxRfHOz UYJA==
X-Received by 10.68.201.138 with SMTP id ka10mr13631610pbc.23.1411603919442; Wed, 24 Sep 2014 17:11:59 -0700 (PDT)
Date Thu, 25 Sep 2014 08:11:18 +0800
From luofeiyu <elearn2014@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0
MIME-Version 1.0
To Peter Otten <__peter__@web.de>, python-list@python.org
Subject Re: how to make return(self.res) not to output the content of list ?
References <5422CD52.8060501@gmail.com> <lvurpl$fcv$1@ger.gmane.org>
In-Reply-To <lvurpl$fcv$1@ger.gmane.org>
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14335.1411603928.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1411603928 news.xs4all.nl 2936 [2001:888:2000:d::a6]:50456
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78317

Show key headers only | View raw


`sys.displayhook = lambda obj: None ` will block everything to be displayed on the interactive python console .

i rewrite my code as the following :

import sqlite3,os,jinja2
db = r'data.sqlite'
con = sqlite3.connect(db)
cur = con.cursor()

class status():
      def __init__():
          import sys
          sys.displayhook=mydisplay
      
      def mydisplay(x):
          if (x is not the result of an method grow of class status ) : x  #how to do in python code?
          else : pass
  
      def grow(self):
          self.res=  a data ananlyse process
          return(self.res)
     
      def display(self):
          #to display it in the html table



how to fulfill the mydisplay function in python code to make x.grow() in the following not to output the list of self.res??


import analyse
x=analyse.status()
x.grow()

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


Thread

Re: how to make return(self.res) not to output the content of list ? luofeiyu <elearn2014@gmail.com> - 2014-09-25 08:11 +0800

csiph-web