Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 3rd, 2004, 10:06 AM
Admin Admin is offline
Developer Shed
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Posts: 961 Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level)Admin User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Article Discussion: Imagine Python

Quite a cryptic title, but if you haven’t guessed, were talking about Images. This being a Python article that’s what we're using! If you’ve never thought about it, or -- even better -- if you didn’t know it was possible then you’re in for a nice surprise; not only can Python do this but it’s pretty damn good at it, too. Actually, Python works well with graphics in general, but for now we’re sticking to the 2D kind.


Read the full article here: Imagine Python

Reply With Quote
  #2  
Old May 3rd, 2004, 01:27 PM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,293 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 21 h 39 sec
Reputation Power: 305
A good article, but some of the code formatting was lost, which of course totally buggers up Python. I would have expected DevShed to be more careful about this.

Dave - The Developers' Coach

Reply With Quote
  #3  
Old May 4th, 2004, 12:40 PM
gurgeh gurgeh is offline
Snake Handler
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 gurgeh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Some friendly pointers

size = list(image.size)
size.sort()
size[0]

Is just horrible. Use max(image.size) or min(image.size) for that purpose instead. They work on all sequences.

As far as I can tell "image.paste" only needs upper left corner, so you don't have to calculate point3 and point4.

Style matters:
This is nitpicking, but in an article where newbies will learn from your coding style it might be important.

I personally think that the "pass" command is more suitable than "None" in a try-except form. Pass is there for exactly that reason. "None" makes it look like the code is in functional style and that the try-except clause should evaluate to something.

for each in os.listdir() looks like a foreach clause in a lesser language. When reading the code in the loop, "each" gives no hint to what it contains. It is bad coding praxis. Why not use "for filename in ..." instead (or file, name, fname or whatever)?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Article Discussion: Imagine Python


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT