Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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; 'package,': 0.03; 'that?': 0.05; 'affected': 0.07; 'globally.': 0.07; 'facts': 0.09; 'lawrence': 0.09; 'matplotlib': 0.09; 'meaningful': 0.09; 'statements': 0.09; 'subject:module': 0.09; 'thats': 0.09; 'wrapper': 0.09; 'developer': 0.10; 'cc:addr :python-list': 0.11; 'python': 0.11; 'language.': 0.14; 'question.': 0.14; '>>': 0.16; '12:38,': 0.16; 'called.': 0.16; 'etc...': 0.16; 'group?': 0.16; 'helps.': 0.16; 'imports': 0.16; 'numpy': 0.16; 'pylab': 0.16; 'so)': 0.16; 'username.': 0.16; '\xc2\xa0i': 0.16; 'folder': 0.16; 'language': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'wed,': 0.18; 'module': 0.19; 'campus': 0.19; 'mechanism': 0.19; 'thu,': 0.19; 'written': 0.21; 'machine': 0.22; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; '>>>': 0.24; 'module,': 0.24; '---': 0.24; 'cc:2**0': 0.24; 'developers': 0.25; '>': 0.26; 'first,': 0.26; 'logging': 0.26; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'host': 0.29; 'feature': 0.29; 'on,': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; "skip:' 10": 0.31; 'that.': 0.31; 'file': 0.32; 'figure': 0.32; 'run': 0.32; 'another': 0.32; 'url:python': 0.33; 'everyone': 0.33; 'skip:& 30': 0.33; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'located': 0.36; 'really': 0.36; 'module.': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'url:org': 0.36; 'so,': 0.37; 'list': 0.37; 'list.': 0.37; 'fact': 0.38; 'pm,': 0.38; 'does': 0.39; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'remove': 0.60; 'easy': 0.60; 'skip:\xc2 10': 0.60; 'tell': 0.60; 'free': 0.61; 'affect': 0.61; 'viruses': 0.61; 'times': 0.62; "you'll": 0.62; 'protection': 0.63; 'our': 0.64; 'more': 0.64; 'details': 0.65; 'here': 0.66; 'antivirus': 0.68; 'to,': 0.72; 'jul': 0.74; 'rita': 0.84; 'to:addr:yahoo.co.uk': 0.84; 'mean.': 0.91; 'mount': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A31tiNrT/IVguWqII7aG6OTVXZV5taDBxNL5ys9084Q=; b=TZrQwc7FzMQPKHLIq3py7dM0kQa8CFZxxuxa+z1f2sn+Uc/zN0xJpK2nJjhetV6ohp c+VjSuXf4HCnjJhLGGS+QATWuXsNV6aMRkKlNpEIirWHyEooiA3uvVJEFvgRq8vd5oFK QXDACY9QGzXLRbaL18IdRWGemntZ/+ERpoLSNORQpFYEyI9x4/wIeDPlAZNoact4ABKU 8BpL33ReLevpHw9QrOvU7cwOc8RwDHpZtWUyFJMKjhl1wdW29/gsVLzsqNFrgwrX2E9d w4oeJKzYWzAxvbvCGz2MnCm478SFrD8rg2A9t49wmq7oqJhIkvYEnv3gK0dntcOUUTCy yrvA== MIME-Version: 1.0 X-Received: by 10.182.104.66 with SMTP id gc2mr8052805obb.17.1404428955451; Thu, 03 Jul 2014 16:09:15 -0700 (PDT) In-Reply-To: References: <53b2fae4$0$2878$e4fe514c@news.xs4all.nl> <53b4539b$0$2901$e4fe514c@news.xs4all.nl> Date: Thu, 3 Jul 2014 19:09:15 -0400 Subject: Re: general module auditing From: Rita To: Mark Lawrence Content-Type: multipart/alternative; boundary=089e0122efac00865704fd52190c Cc: "python-list@python.org" 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: 360 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404428964 news.xs4all.nl 2939 [2001:888:2000:d::a6]:55993 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73924 --089e0122efac00865704fd52190c Content-Type: text/plain; charset=UTF-8 On Thu, Jul 3, 2014 at 8:36 AM, Mark Lawrence wrote: > On 03/07/2014 10:27, Rita wrote: > >> >> >> >> On Thu, Jul 3, 2014 at 2:54 AM, Mark Lawrence > > wrote: >> >> On 03/07/2014 02:17, Rita wrote: >> >> >> On Wed, Jul 2, 2014 at 2:46 PM, Irmen de Jong >> >> > >> __>> wrote: >> >> On 2-7-2014 4:04, Rita wrote: >> > yes, this helps. But I want to know who uses the module, >> serpent. >> So, when >> > I upgrade it or remove it they won't be affected >> adversely. >> >> (Please don't top-post, it makes the discussion harder to >> follow.) >> >> > On Tue, Jul 1, 2014 at 2:16 PM, Irmen de Jong >> >> > >__>> >> >> >> > wrote: >> > >> >> On 1-7-2014 12:38, Rita wrote: >> >>> i work in a group of developers (15 or so) who are >> located >> globally. I >> >>> would like to know what modules everyone is uses if I >> ever have to >> >> upgrade >> >>> my python. Is there mechanism which will let me see who >> is >> using what? >> >>> >> >>> ie, >> >>> >> >>> tom,matplotlib >> >>> bob, pylab >> >>> nancy, numpy >> >>> nancy, matplotlib >> >>> >> >>> etc... >> >>> >> >>> >> >> >> >> Well, if your group is all using Pip (and perhaps even >> virtualenv), you >> >> could use pip >> >> list. In my case: >> >> >> >> $ pip list >> >> [...] >> >> >> Why would the fact that you upgrade or remove a package, >> affect >> another developer in >> your group? Are you all using the same machine to develop >> on, with >> one Python installation? >> >> I think you'll have to tell us some more details about the >> way you >> work together before >> we can give a meaningful answer to your question. >> >> Irmen >> >> -- >> https://mail.python.org/__mailman/listinfo/python-list >> >> >> >> we have a shared mount point which has our python install. we >> have 3 >> servers on one part of the campus and 2 in another part. >> >> I want to find out what packages our user base is using thats >> the final >> goal. I can figure out who is using python by writing a wrapper >> but not >> what module. >> >> -- >> --- Get your facts first, then you can distort them as you >> please.-- >> >> >> You can check every users's program for import statements but do you >> really need to, why not check what's in the site-packages folder for >> your python install? >> >> -- >> My fellow Pythonistas, ask not what our language can do for you, ask >> what you can do for our language. >> >> Mark Lawrence >> >> how can i get frequency of the module usage? thats the end goal. >> >> -- >> --- Get your facts first, then you can distort them as you please.-- >> >> >> > Count the number of imports or count the times a given program gets run > for the number of imports depending on what you mean. > > > -- > My fellow Pythonistas, ask not what our language can do for you, ask what > you can do for our language. > > Mark Lawrence > > --- > This email is free from viruses and malware because avast! Antivirus > protection is active. > http://www.avast.com > > > -- > https://mail.python.org/mailman/listinfo/python-list > here is what I am doing now, egrep 'from|import' *.py | wc -l which is giving me that. But this does not give me the number of times the particular module gets called. I was thinking of adding a logging feature to all of my modules so every time they get called it will be written to a log file with corresponding host and username. Is there an easy way to do that? -- --- Get your facts first, then you can distort them as you please.-- --089e0122efac00865704fd52190c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Thu, Jul 3, 2014 at 8:36 AM, Mark Lawrence <= ;breamoreboy@y= ahoo.co.uk> wrote:
On 03/07/2014 10:27, Rita wr= ote:



On Thu, Jul 3, 2014 at 2:54 AM, Mark Lawrence <breamoreboy@yahoo.co.uk
<mailto:bre= amoreboy@yahoo.co.uk>> wrote:

=C2=A0 =C2=A0 On 03/07/2014 02:17, Rita wrote:


=C2=A0 =C2=A0 =C2=A0 =C2=A0 On Wed, Jul 2, 2014 at 2:46 PM, Irmen de Jong =C2=A0 =C2=A0 =C2=A0 =C2=A0 <irmen.NOSPAM@xs4all.nl <mailto:irmen.NOSPAM@xs4all.nl&g= t;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <mailto:irmen.NOSPAM@xs4all.nl

=C2=A0 =C2=A0 =C2=A0 =C2=A0 <mailto:irmen.NOSPAM@xs4all.nl>__>> wro= te:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0On 2-7-2014 4:04, Rita wrot= e:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > yes, this helps. But = I want to know who uses the module,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 serpent.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0So, when
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > I upgrade it or remov= e it they won't be affected adversely.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(Please don't top-post,= it makes the discussion harder to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 follow.)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > On Tue, Jul 1, 2014 a= t 2:16 PM, Irmen de Jong
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<irmen.NOSPAM@xs4all.nl <mailto:= irmen.NOSPAM@xs= 4all.nl>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <mailto:irmen.NOSPAM@xs4all.nl <mailto:irmen.NOSPAM@xs4all.nl>__>>


=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > wrote:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> On 1-7-2014 12:38= , Rita wrote:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> i work in a g= roup of developers (15 or so) =C2=A0who are
=C2=A0 =C2=A0 =C2=A0 =C2=A0 located
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0globally. I
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> would like to= know what modules everyone is uses if I
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ever have to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> upgrade
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> my python. Is= there mechanism which will let me see who is
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0using what?
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> ie,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> tom,matplotli= b
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> bob, pylab =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> nancy, numpy<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> nancy, matplo= tlib
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>> etc...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> Well, if your gro= up is all using Pip (and perhaps even
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0virtualenv), you
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> could use pip
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> list. In my case:=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> $ pip list

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[...]


=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Why would the fact that you= upgrade or remove a package, affect
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0another developer in
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0your group? Are you all usi= ng the same machine to develop
=C2=A0 =C2=A0 =C2=A0 =C2=A0 on, with
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0one Python installation?
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I think you'll have to = tell us some more details about the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 way you
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0work together before
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0we can give a meaningful an= swer to your question.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Irmen

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--
=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://mail.python.org/__mail= man/listinfo/python-list

=C2=A0 =C2=A0 =C2=A0 =C2=A0 <https://mail.python.org/mail= man/listinfo/python-list>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 we have a shared mount point which has our pyth= on install. we have 3
=C2=A0 =C2=A0 =C2=A0 =C2=A0 servers on one part of the campus =C2=A0and 2 i= n another part.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 I want to find out what packages our user base = is using thats
=C2=A0 =C2=A0 =C2=A0 =C2=A0 the final
=C2=A0 =C2=A0 =C2=A0 =C2=A0 goal. I can figure out who is using python by w= riting a wrapper
=C2=A0 =C2=A0 =C2=A0 =C2=A0 but not
=C2=A0 =C2=A0 =C2=A0 =C2=A0 what module.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 --
=C2=A0 =C2=A0 =C2=A0 =C2=A0 --- Get your facts first, then you can distort = them as you please.--


=C2=A0 =C2=A0 You can check every users's program for import statements= but do you
=C2=A0 =C2=A0 really need to, why not check what's in the site-packages= folder for
=C2=A0 =C2=A0 your python install?

=C2=A0 =C2=A0 --
=C2=A0 =C2=A0 My fellow Pythonistas, ask not what our language can do for y= ou, ask
=C2=A0 =C2=A0 what you can do for our language.

=C2=A0 =C2=A0 Mark Lawrence

how can i get frequency of the module usage? thats the end goal.

--
--- Get your facts first, then you can distort them as you please.--



Count the number of imports or count the times a given program gets run for= the number of imports depending on what you mean.


--
My fellow Pythonistas, ask not what our language can do for you, ask what y= ou can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protec= tion is active.
http://www.avast.com=


--
https://mail.python.org/mailman/listinfo/python-list

here is what I am doing now,=C2=A0=

egrep '= from|import' *.py | wc -l which is giving me that. But this does not gi= ve me the number of times the particular module gets called. I was thinking= of adding a logging feature to all of my modules so every time they get ca= lled it will be written to a log file with corresponding host and username.= Is there an easy way to do that?



--
--- Get your facts first, then you can= distort them as you please.--
--089e0122efac00865704fd52190c--