Okay, so it doesn't look like that worked...here is the traceback. I don't understand the second part of your request.
Jons-desktop:whois-0.7 2 jon$ python pythonwhois.py 8.8.8.8 Traceback (most recent call last): File "pythonwhois.py", line 14, in <module> print results.asn_registry AttributeError: 'dict' object has no attribute 'asn_registry' On Sat, Apr 25, 2015 at 11:30 AM, <tutor-requ...@python.org> wrote: > Send Tutor mailing list submissions to > tutor@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with subject or body 'help' to > tutor-requ...@python.org > > You can reach the person managing the list at > tutor-ow...@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tutor digest..." > > > Today's Topics: > > 1. Re: name shortening in a csv module output (Steven D'Aprano) > 2. Re: sig no matter what (eryksun) > 3. whois github package (Juanald Reagan) > 4. Re: whois github package (Steven D'Aprano) > 5. Questions (and initial responses) on using version control > [Was: Introductory questions on test-driven development and > implementing Git version control.] (boB Stepp) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 25 Apr 2015 21:27:55 +1000 > From: Steven D'Aprano <st...@pearwood.info> > To: tutor@python.org > Subject: Re: [Tutor] name shortening in a csv module output > Message-ID: <20150425112751.gf5...@ando.pearwood.info> > Content-Type: text/plain; charset=us-ascii > > On Fri, Apr 24, 2015 at 01:04:57PM +0200, Laura Creighton wrote: > > In a message of Fri, 24 Apr 2015 12:46:20 +1000, "Steven D'Aprano" > writes: > > >The Japanese, Chinese and Korean > > >governments, as well as linguists, are all in agreement that despite a > > >few minor differences, the three languages share a common character set. > > > > I don't think that is quite the way to say it. There are characters, > > which look exactly the same in all three languages, and the linguists > > are mostly in agreement that the reason they look the same is that the > > are the same. > > > > But it is more usual to write Korean, these days, not with Chinese > > characters, (hanja) but with hangul. In the 15th century, the King, > > Sejong the great decided that Koreans needed a phoenetic alphabet, and > > made one. It doesn't look anything like chinese. And it is a phonetic, > > alphabetic langauge, not a stroke-and-character one. > > Thanks for the correction Laura, I didn't know that Korean has two > separate writing systems. But I did know that Japanese has at least two, > one based on Chinese characters and the other not, and that Chinese > itself has traditional and simplified versions of their characters. > Beyond that, it's all Greek to me :-) > > > -- > Steve > > > ------------------------------ > > Message: 2 > Date: Sat, 25 Apr 2015 07:48:06 -0500 > From: eryksun <eryk...@gmail.com> > To: "tutor@python.org" <tutor@python.org> > Subject: Re: [Tutor] sig no matter what > Message-ID: > < > cacl+1at+xgqj0tdny0k4jzz7ae4nh7nqfruvrf-qehmyta2...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > On Fri, Apr 24, 2015 at 10:46 PM, Jim Mooney <cybervigila...@gmail.com> > wrote: > > The docs don't mention that case is immaterial for aliases, when it > usually > > matters in Python. > > Section 7.2.3: > > Notice that spelling alternatives that only differ in case or use a > hyphen > instead of an underscore are also valid aliases > > > So of course my favorite is u8 - less typing, and ubom for decoding if I > get > > those funny bytes ;') > > Less typing, yes, but also less self-documenting. > > > ------------------------------ > > Message: 3 > Date: Sat, 25 Apr 2015 09:46:26 -0400 > From: Juanald Reagan <jon.en...@gmail.com> > To: "tutor@python.org" <tutor@python.org> > Subject: [Tutor] whois github package > Message-ID: > <CAOpmNVHO= > 6gu2doxq2c8kckyb8qq9jcpmuzt9_vu+7x8v9t...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Hello! I have a question regarding how to use/implement a package found at > github. > > https://github.com/secynic/ipwhois > > I am able to run the sample code without any issues but what I don't > understand is how to put all the data that is returned into an indexed > list. I want to be able to pick out some of the returned data through an > index. > > For example: > > from ipwhois import IPWhois > > obj = IPWhois(ipaddy) > results = [obj.lookup()] > print results [0] > > This returns ALL the fields not just the "asn_registry" field. I looked for > documentation on github but did not see anything. Any thoughts/comments are > appreciated, thanks! > > -- > Cheers, > > Jon > > > ------------------------------ > > Message: 4 > Date: Sun, 26 Apr 2015 00:13:39 +1000 > From: Steven D'Aprano <st...@pearwood.info> > To: tutor@python.org > Subject: Re: [Tutor] whois github package > Message-ID: <20150425141338.gg5...@ando.pearwood.info> > Content-Type: text/plain; charset=us-ascii > > On Sat, Apr 25, 2015 at 09:46:26AM -0400, Juanald Reagan wrote: > > > from ipwhois import IPWhois > > > > obj = IPWhois(ipaddy) > > results = [obj.lookup()] > > print results [0] > > > > This returns ALL the fields not just the "asn_registry" field. I looked > for > > documentation on github but did not see anything. Any thoughts/comments > are > > appreciated, thanks! > > I don't have ipwhois installed, so I'm guessing, but try this: > > > obj = IPWhois(ipaddy) > results = obj.lookup() > print results.asn_registry > > If that doesn't work, please copy and paste the entire traceback, and > then run this and show us the result: > > vars(results) > > > > > -- > Steve > > > ------------------------------ > > Message: 5 > Date: Sat, 25 Apr 2015 10:30:02 -0500 > From: boB Stepp <robertvst...@gmail.com> > To: tutor <tutor@python.org> > Subject: [Tutor] Questions (and initial responses) on using version > control [Was: Introductory questions on test-driven development and > implementing Git version control.] > Message-ID: > <CANDiX9JCMPoWNZFaFJO+_amZU+KKdMcxa9+imrwYjp= > 4diy...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > N.B.: This is a manual recreation of portions of the original thread, > "Introductory questions on test-driven development and implementing > Git version control". The portions included here are those relevant to > the version control. Where "[...]" appears, this indicates I did not > include those portions of the original thread here. > > In a message of Fri, 24 Apr 2015 14:09:45 -0500, boB Stepp writes: > > [...] > > >My wife (A teacher.) has been after me a lot lately to write some > >programs to make her teaching life better. So I would like to start > >one of her projects using TDD from the get-go. Also, this sounds like > >a good time to try to implement using version control software. While > >setting up Vim recently, I had to install Git (In order to get Vundle > >going.). So now I have that to play with. And to throw more fuel onto > >the fire of learning, why not jump into OOP for this project as well? > >It's about time! Plus it will make life with Tkinter a bit better, > >too. > > >The project(s) will be coded in Python 3.4 on Windows 7 64-bit on my > >home computer. All projects that I actually complete for my wife will > >be implemented in her classroom, which has quite a variety of hardware > >and OS platforms: lap tops and desk tops, some of which are rather > >old, running Windows XP, Windows 7, and Ubuntu Linux. And possibly > >other combos that I have not been made aware of yet. > > [...] > > >And what would be the best approach to integrating Git with these > >efforts? Just how often does one commit one's code to the version > >control system? Or do I have some GCEs (Gross Conceptual Errors) here? > >Can Git be set up to automatically keep track of my code as I create > >and edit it? > > [...] > > >And I would like to have all of that under version control, too. But > >while I am allowed to write my own programs for this CSA, I am not > >allowed to install anything else, strange as this may sound! Since the > >only functional editors in these bare-bones Solaris 10 environments > >are some simplistic default editor that I do not know the name of and > >vi, I long ago gravitated to doing my actual coding on my Windows PC > >(Being careful to save things with Unix line endings.) and FTPing to > >the environments where these programs will actually run. I AM allowed > >to install anything I want (within reason)on my PC. So I am thinking > >install and use Git there? > ---------------------------------------------------------------------- > In a message of Fri, 24 Apr 2015 at 3:00 PM, Laura Creighton writes: > > >In a message of Fri, 24 Apr 2015 14:09:45 -0500, boB Stepp writes: > > [...] > > >>And what would be the best approach to integrating Git with these > >>efforts? Just how often does one commit one's code to the version > >>control system? Or do I have some GCEs (Gross Conceptual Errors) here? > >>Can Git be set up to automatically keep track of my code as I create > >>and edit it? > > >Depending on what you mean by that, the answer is 'no' or 'that is > >exactly what git does, there is no way to _prevent_ this'. > > >You have to tell git when you would like to save your work. > >It doesn't work like autosaving in an editor -- hah hah, she has typed > >300 chars now, (or it has been 5 minutes now) time to autosave -- if > >you never tell git to save the work, it will never get saved. > > >So what you typically do is write a test, tell git to save it, run the > >test, have it fail, write some more code and run all the tests again, > >have them pass, tell git to save it, write another test ... > > >If in the 'write some more code' part, you get the itch 'it would be > >really bad if my laptop died and I lost all this work' you tell git to > >save immediately and keep on going. > > >There is a whole other layer about 'how to share your code with other > >people, politely, when several of you are working on the same project > >at one time, but if you are a one man team, you won't have to worry > >about that for a while. > > [...] > > >>And I would like to have all of that under version control, too. But > >>while I am allowed to write my own programs for this CSA, I am not > >>allowed to install anything else, strange as this may sound! Since the > >>only functional editors in these bare-bones Solaris 10 environments > >>are some simplistic default editor that I do not know the name of and > >>vi, I long ago gravitated to doing my actual coding on my Windows PC > >>(Being careful to save things with Unix line endings.) and FTPing to > >>the environments where these programs will actually run. I AM allowed > >>to install anything I want (within reason)on my PC. So I am thinking > >>install and use Git there? > > >Are you absolutely certain that you cannot install git on your bare-bones > >Solaris 10 environments? Or plug in a memory stick and run code from > >there? Because it would make your life so much easier ... > ---------------------------------------------------------------------- > On Fri., Apr 24, 2015 at 5:03 PM Alan Gauld wrote: > > >On 24/04/15 20:09, boB Stepp wrote: > > [...] > > >> allowed to install anything else, strange as this may sound! Since the > >> only functional editors in these bare-bones Solaris 10 environments > >> are some simplistic default editor that I do not know the name of and > >> vi, > > [...] > > >And of course it has the original SCCS for source control. > >Which if there's only a few of you is adequate, and easy > >to work with. I used SCCS on several major projects over > >a 10 year period. > ---------------------------------------------------------------------- > On Fri, Apr 24, 2015 at 5:52 PM, boB Stepp wrote: > >On Fri, Apr 24, 2015 at 5:03 PM, Alan Gauld <alan.ga...@btinternet.com> > wrote: > > [...] > > >> And of course it has the original SCCS for source control. > >> Which if there's only a few of you is adequate, and easy > >> to work with. I used SCCS on several major projects over > >> a 10 year period. > > >There is just lil ol' me. I will have to research SCCS. > ---------------------------------------------------------------------- > On Fri, Apr 24, 2015 at 7:36 PM, Steven D'Aprano wrote: > >On Fri, Apr 24, 2015 at 02:09:45PM -0500, boB Stepp wrote: > > [...] > > >> And what would be the best approach to integrating Git with these > >> efforts? Just how often does one commit one's code to the version > >> control system? Or do I have some GCEs (Gross Conceptual Errors) here? > >> Can Git be set up to automatically keep track of my code as I create > >> and edit it? > > >No, that's not how revision control works. You really don't want every > >time you hit save to count as a new revision. That would be ugly. > > >Joel Spolsky has a good introduction to Mercurial (hg). Git is slightly > >different, but the fundamentals are more or less equivalent: > > >http://hginit.com/ > ? > >You can also watch Git For Ages 4 And Up: > > >http://www.youtube.com/watch?v=1ffBJ4sVUb4 > > > >The executive summary of how I use version control: > > >- work on bite-sized chunks of functionality > >- when the tests all pass, commit the work done > >- push changes to the master repo at least once per day > > > >The way I use version control on my own is that I have typically use a > >single branch. I rarely have to worry about contributions from others, > >so it's just my changes. Make sure that all the relevent files (source > >code, documentation, tests, images, etc.) are being tracked. Static > >files which never change, like reference materials, should not be. > > >Starting from a point where all the tests pass, I decide to work on a > >new feature, or fix a bug. A feature might be something as small as "fix > >the documentation for this function", but *not* as big as "control > >remote controlled space ship" -- in other words, a bite-sized chunk of > >work, not a full meal. I write some tests, and write the minimal amount > >of code code that makes those tests pass: > > >- write tests > >- save tests > >- write code > >- save code > >- run tests > >- fix bugs in tests > >- save tests > >- write some more code > >- save code > >- run tests again > >- write some more code > >- save code > >- run tests again > > > >etc. Once the tests pass, then I have a feature and/or bug fix, and I > >commit all the relevent changes to the VCS. hg automatically tracks > >files, git requires you to remind it every single time what files are > >being used, but either way, by the time I run `hg commit` or `git > >commit` I have a complete, and hopefully working, bite-sized chunk of > >code that has an obvious commit message: > > >"fix bug in spam function" > >"correct spelling errors in module docs" > >"rename function ham to spam" > >"change function eggs from using a list to a dict" > >"move class K into its own submodule" > > >etc. Notice that each change is small enough to encapsulate in a short > >description, but big enough that some of them may require multiple > >rounds of back-and-forth code-and-test before it works. > > >I run the tests even after seemingly innoculous changes to comments or > >docstrings, especially docstrings. Edits to a docstring may break your > >doctests, or even your code, if you accidentally break the quoting. > > >Then, when I am feeling satisfied that I've done a sufficiently large > >amount of work, I then push those changes to the master repo (if any). > >This allows me to work from various computers and still share the same > >code base. "Sufficiently large" may mean a single change, or a full > >day's work, or a whole lot of related changes that add up to one big > >change, whatever you prefer. But it shouldn't be less than once per day. > > [...] > > >> And I would like to have all of that under version control, too. But > >> while I am allowed to write my own programs for this CSA, I am not > >> allowed to install anything else, strange as this may sound! Since the > >> only functional editors in these bare-bones Solaris 10 environments > >> are some simplistic default editor that I do not know the name of and > >> vi, I long ago gravitated to doing my actual coding on my Windows PC > >> (Being careful to save things with Unix line endings.) and FTPing to > >> the environments where these programs will actually run. I AM allowed > >> to install anything I want (within reason)on my PC. So I am thinking > >> install and use Git there? > > >Yes. > ---------------------------------------------------------------------- > On Fri, Apr 24, 2015 at 7:46 PM, Alan Gauld wrote: > >On 24/04/15 23:52, boB Stepp wrote: > > >> There is just lil ol' me. I will have to research SCCS. > > > >SCCS is great for a single, small team. It's marginally more complex > >than more modern tools and it only works sensibly with text files > >(binaries are just uuencoded which is pretty pointless!). > > >Basic usage is very simple: > >1) create an SCCS directory in your project space - or you wind up > > with version files all over the place! > >2) use the admin -i command to tell sccs to manage a file > >3) use get to get a read only copy or get -e to get an editable one. > > (use -r to get a specific version) > >4) use delta to save changes (it prompts you for change comments etc) > > >There are a bunch of other reporting and searching and admin > >commands, but the above is all you need 90% of the time. > >More modern versioning systems are better but SCCS should already > >be installed on Solaris 10 if you have the development tools > >installed, which I'm guessing you do or pretty much > >nothing code-wise would work. > ---------------------------------------------------------------------- > On Fri, Apr 24, 2015 at 8:24 PM, boB Stepp wrote: > >On Fri, Apr 24, 2015 at 3:00 PM, Laura Creighton <l...@openend.se> wrote: > >> In a message of Fri, 24 Apr 2015 14:09:45 -0500, boB Stepp writes: > > [...] > > >>>And I would like to have all of that under version control, too. But > >>>while I am allowed to write my own programs for this CSA, I am not > >>>allowed to install anything else, strange as this may sound! Since the > >>>only functional editors in these bare-bones Solaris 10 environments > >>>are some simplistic default editor that I do not know the name of and > >>>vi, I long ago gravitated to doing my actual coding on my Windows PC > >>>(Being careful to save things with Unix line endings.) and FTPing to > >>>the environments where these programs will actually run. I AM allowed > >>>to install anything I want (within reason)on my PC. So I am thinking > >>>install and use Git there? > >> > >> Are you absolutely certain that you cannot install git on your > bare-bones > >> Solaris 10 environments? Or plug in a memory stick and run code from > >> there? Because it would make your life so much easier ... > > >I think that I can get an exception here (See a post in response that > >I made earlier today.). What I am *certain* of, is that I cannot > >install anything on our clinical planning environment. The Solaris > >workstation that I now have all to myself--I'm thinking they will now > >let me do what I want with it. But I must double check... But anything > >I develop there *should* work in the clinical environment. The > >planning software is the same though that may change soon as there are > >plans to go up a version and they may not want to do that on my > >testing/development machine. > ---------------------------------------------------------------------- > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Tutor maillist - Tutor@python.org > https://mail.python.org/mailman/listinfo/tutor > > > ------------------------------ > > End of Tutor Digest, Vol 134, Issue 86 > ************************************** > -- Cheers, Jon S. Engle jon.en...@gmail.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor