Re: Function within class and in modules

2011-06-16 Thread Zachary Dziura
On Thursday, June 16, 2011 9:02:45 AM UTC-4, Andrew Berg wrote: > On 2011.06.15 08:57 AM, Zach Dziura wrote: > > Just repeat this to yourself: Python ISN'T Java. > class MainClass: > def public static void main(*args): > print('Am I doin' it right?') > > :P > > Or something like that.

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread Zachary Dziura
> On Jun 13, 11:55 pm, zainul franciscus wrote: > I started an open source file organizer called Miranda.  Miranda is > inspired by Belvedere written by Adam Pash of Lifehacker (http:// > lifehacker.com/341950/belvedere-automates-your-self+cleaning-pc). I > know you guys must be thinking "Hmm, Mir

What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Zachary Dziura
I have a dict that I would like to print out in a series of columns, rather than as a bunch of lines. Normally when you do print(dict), the output will look something like this: {'Header2': ['2', '5', '8'], 'Header3': ['3', '6', '9'], 'Header1': ['1', '4', '7'], 'Header4': ['10', '11', '12']} I c

Re: What is the most efficient way to compare similar contents in two lists?

2011-06-13 Thread Zachary Dziura
For this script, it's guaranteed that whatever tables the script goes through and processes, there will be no duplicate headers. I didn't include functionality to deal with duplicates because there won't be any to begin with! I just wanted to find out the most efficient way of checking for similar

Re: What is the most efficient way to compare similar contents in two lists?

2011-06-13 Thread Zachary Dziura
On Jun 13, 11:09 am, Chris Angelico wrote: > On Tue, Jun 14, 2011 at 12:58 AM, Zachary Dziura wrote: > > if set(source_headers) == set(target_headers): > >    similar_headers = len(source_headers) > > Since you're making sets already, I'd recommend using set ope

What is the most efficient way to find similarities and differences between the contents of two lists?

2011-06-13 Thread Zachary Dziura
Hi all. I'm writing a Python script that will be used to compare two database tables. Currently, those two tables are dumped into .csv files, whereby my code goes through both files and makes comparisons. Thus far, I only have functionality coded to make comparisons on the headers to check for sim

What is the most efficient way to compare similar contents in two lists?

2011-06-13 Thread Zachary Dziura
similar_headers = 0 different_headers = 0 source_headers = sorted(source_mapping.headers) target_headers = sorted(target_mapping.headers) # Check if the headers between the two mappings are the same if set(source_headers) == set(target_headers): similar_headers = len(source_headers) else:

Re: best book about Webdesign with Django

2011-06-10 Thread Zachary Dziura
I found that Head First Python gives a really good introduction to Django. It's definitely a beginners book, as are all of the Head First books, but it still teaches the basics in a very good manner. If you're very knowledgeable with Python, you can skip the first few chapters (or read through