Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Search Forums
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Showing results 1 to 25 of 25
Search took 0.02 seconds.
Search: Posts Made By: Alan G
Forum: BOOK: Python Projects February 5th, 2019, 11:05 AM
Replies: 1
Views: 308
Posted By Alan G
Thanks for posting the solution. I don't have...

Thanks for posting the solution. I don't have access to a modern Mac so would not have been able to resolve that one.
Forum: BOOK: Python Projects January 27th, 2019, 12:37 PM
Replies: 2
Views: 310
Posted By Alan G
You are quite correct on all counts. The main...

You are quite correct on all counts. The main issue of setting a negative radius on creation should be dealt with by raising a value error in the __init__() method if a negative value is received....
Forum: BOOK: Python Projects August 5th, 2018, 04:11 AM
Replies: 2
Views: 780
Posted By Alan G
Re Bit size: I have no idea why I wrote that the...

Re Bit size:
I have no idea why I wrote that the return type was 16 bits! You are quite right the integers in Python are much bigger than that. Sorry, I can't offer any explanation other than brain...
Forum: BOOK: Python Projects June 26th, 2017, 08:40 PM
Replies: 4
Views: 1,829
Posted By Alan G
You are quite right, I'm not sure why they got...

You are quite right, I'm not sure why they got missed out. I could say it's because the first chapter is supposed top be revision rather than anything new, but they have included loops so i suspect...
Forum: BOOK: Python Projects April 5th, 2017, 11:32 AM
Replies: 4
Views: 687
Posted By Alan G
That's really weird; the book was originally ...

That's really weird; the book was originally written using v3.3 and then retested with 3.4
when it became available, so Python 3.5 should not have made any difference.

Glad you got it working, but...
Forum: BOOK: Python Projects April 4th, 2017, 08:39 PM
Replies: 4
Views: 687
Posted By Alan G
The error is saying that bm3 is an integer. Did...

The error is saying that bm3 is an integer.
Did you carry out the steps immediately prior to the error:

...
>>> bm3 = bm1.shiftleft(3)
>>> bin(bm3)
'0b110000' # did you get this result?
>>> bm1...
Forum: BOOK: Python Projects March 1st, 2016, 07:21 PM
Replies: 7
Views: 2,024
Posted By Alan G
Yep, that's the problem. The book is written for...

Yep, that's the problem. The book is written for Python v3.
The problems you are hitting are due to Python v2.

Properties only work on "new style classes" in v2 (in v3 all
classes are "new...
Forum: BOOK: Python Projects February 29th, 2016, 08:24 PM
Replies: 7
Views: 2,024
Posted By Alan G
> When I do step 5, I don't get the expected...

> When I do step 5, I don't get the expected result, even with the correction.
> The line c2.radius = 12 seems to have no effect. c2.area prints out
> 5541.76476 just as before. c2.radius = -4 does...
Forum: BOOK: Python Projects February 4th, 2016, 09:25 AM
Replies: 1
Views: 808
Posted By Alan G
Oops again. That should of course...

Oops again. That should of course be:

pwd.getpwnam() - with no 'e' at the end. Sorry.
Forum: BOOK: Python Projects December 22nd, 2015, 06:09 PM
Replies: 1
Views: 808
Posted By Alan G
Chapter 2 page 50 - getpwnam function

Thanks to Alex Kleider for pointing out that the os.getpwnam() mentioned
in para 2 of How it Works should in fact be pwd.getpwname()

Apologies. Hopefully that one didn't trip up too many readers.
Forum: BOOK: Python Projects December 21st, 2015, 09:08 PM
Replies: 0
Views: 527
Posted By Alan G
Chapter 1 exercise #7

Another buglet in the solution to Ex 7 in Chapter 1.
The init() method should look like

def __init__(self, start=0):
self.counter = start

Again thanks to Alex Kleider for pointing it...
Forum: BOOK: Python Projects December 21st, 2015, 06:08 PM
Replies: 0
Views: 568
Posted By Alan G
Problem in listbits.py (chapter 1)

Alex Kleider has highlighted a problem with the listbits() function in bitmask.py as described on pages 40/41. The function using default arguments does not print the last bit.

The corrected code...
Forum: BOOK: Python Projects October 17th, 2015, 12:39 PM
Replies: 5
Views: 1,596
Posted By Alan G
Your points are all valid and well made, however...

Your points are all valid and well made, however the purpose of the example was primarily to produce a module/package and I decided I wanted it to be useful rather than just a toy. I considered...
Forum: BOOK: Python Projects October 17th, 2015, 12:21 PM
Replies: 4
Views: 1,829
Posted By Alan G
That's for spotting that. I can only apologize...

That's for spotting that. I can only apologize for the error, not sure how that got
through all the reviews but it obviously did. Your changes are absolutely correct.

Apologies again,

Alan G.
Forum: BOOK: Python Projects August 7th, 2015, 04:07 PM
Replies: 2
Views: 901
Posted By Alan G
Yet again you've caught me out. I suspect a cut...

Yet again you've caught me out.
I suspect a cut 'n paste error, but yes, there should be a 30 result after that line.
I'll try to get the errata updated.

Thanks again.

Alan G
Forum: BOOK: Python Projects August 7th, 2015, 04:03 PM
Replies: 2
Views: 490
Posted By Alan G
I've no idea how that has happened because the...

I've no idea how that has happened because the zip file that I submitted
clearly has the dual import as per the book.

So my apologies for that, but my code which I tested has a

from datetime...
Forum: BOOK: Python Projects August 5th, 2015, 05:33 AM
Replies: 4
Views: 607
Posted By Alan G
Groan! I obviously had a bad day at the office...

Groan! I obviously had a bad day at the office with this one.

Yes value is optional, if not given the default zero should be used.

You are also right that the test for value should be

if 0<=...
Forum: BOOK: Python Projects August 4th, 2015, 06:05 PM
Replies: 5
Views: 737
Posted By Alan G
Not that brave, I have 3 PCs. My main one is...

Not that brave, I have 3 PCs. My main one is Linux(Mint), I also have a
Windows XP box(!) and a Windows 8.1 box. I need them for testing/upgrading
old bits of software and new Windows applications...
Forum: BOOK: Python Projects August 4th, 2015, 06:00 PM
Replies: 4
Views: 607
Posted By Alan G
Quite right. We should have had you as a proof...

Quite right. We should have had you as a proof reader!



But not for this one, although there is a slight error in the text. Where it says "the latter returns the current count and then sets the...
Forum: BOOK: Python Projects August 4th, 2015, 03:13 PM
Replies: 5
Views: 737
Posted By Alan G
You are quite right. It should be double quotes...

You are quite right. It should be double quotes on the outside of the string.



Hmm, I messed this one up didn't I?
The problem is that the first line should not have parens around the
variable...
Forum: BOOK: Python Projects August 2nd, 2015, 05:36 PM
Replies: 7
Views: 2,024
Posted By Alan G
The downloaded code issue is slightly different....

The downloaded code issue is slightly different. If you look closely at the
text you will see that the correct usage is

>>> c2.area

No parens after area.

That's the point of using the...
Forum: BOOK: Python Projects August 2nd, 2015, 05:22 PM
Replies: 7
Views: 2,024
Posted By Alan G
You are quite right. My fault entirely, the error...

You are quite right. My fault entirely, the error is in the original manuscript.
Thanks for pointing it out. The first line should indeed read

>>> c2 = tc.Circle2(42)

My apologies,

Alan G.
Forum: BOOK: Python Projects March 29th, 2015, 04:08 AM
Replies: 1
Views: 1,103
Posted By Alan G
There is an error in the book - a missing line...

There is an error in the book - a missing line with the required PRAGMA statement.
My apologies. Check the code on the download site, it is correct.

If in doubt always look at the download code, the...
Forum: BOOK: Python Projects February 27th, 2015, 01:34 PM
Replies: 5
Views: 1,596
Posted By Alan G
Sorry if it seems a bit (!) hard but I wanted the...

Sorry if it seems a bit (!) hard but I wanted the module/package to be
genuinely useful and because bitmasks crop up all over the OS stuff in
chapter 2, I thought providing an option that was...
Forum: BOOK: Python Projects February 27th, 2015, 01:27 PM
Replies: 5
Views: 1,596
Posted By Alan G
bits.py bug

My apologies, there is indeed a bug in the code in the book.

The download files are (or should be!) correct because they are
the actual files I used in testing. The code in the book has been...
Showing results 1 to 25 of 25

 


All times are GMT -4. The time now is 08:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.