Re: [Tutor] class initialization with a lot of parameters

2009-11-11 Thread C.T. Matsumoto
Hello Alan, I see a new way to look at this design so I'm pretty excited to refactor the code. I've also been looking for an example to use 'overloading operators' as the Learn Python book calls it. I think its time to close this discussion because the parameters question has gotten much advice,

[Tutor] moving directories into directories

2009-11-11 Thread Christopher Spears
I'm trying to move a bunch of files and directories into another directory. Unfortunately, I keep getting an error message: Traceback (most recent call last): File "checkDeviceType.py", line 46, in ? cdt.moveFiles(barcodeList) File "checkDeviceType.py", line 40, in moveFiles shutil.m

Re: [Tutor] django python Version 1.1.1 - Internacionalization

2009-11-11 Thread Wayne Werner
On Wed, Nov 11, 2009 at 10:10 PM, andré palma wrote: > Hi all! > I'm developing a django web application but i'm having a trouble with > the internationalization. I don't know much about Django, and I suspect that's more the norm here - you may have better luck on the Django users list: http:/

[Tutor] django-python Version 1.1.1 - Internacionalization

2009-11-11 Thread andré palma
Hi all! I'm developing a django web application but i'm having a trouble with the internationalization. The problem is that translation somehow doesn't work. i followed these steps: - on my project folder (./translation ) i run the command: "django-admin makemessages -l en-US" and

[Tutor] django python Version 1.1.1 - Internacionalization

2009-11-11 Thread andré palma
Hi all! I'm developing a django web application but i'm having a trouble with the internationalization. The problem is that translation somehow doesn't work. i followed these steps: - on my project folder (./translation ) i run the command: "django-admin makemessages -l en-US" and

[Tutor] os.environ question

2009-11-11 Thread Khalid Al-Ghamdi
hi, can anyone tell me why on python 2.6 i can enter *os.environ* and then get all the items that that pertain to the os while on python 3 you just get the following: with no items? thanks ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] module name completion suggestions drop down?

2009-11-11 Thread Alan Gauld
"Kristin Wilcox" wrote I was wondering about something I've seen in people's video tutorials -- these people are using IDLE like I am, but they get these drop down suggestions for module names that I'm not experiencing. Try hitting Control-Space while typing a method name... Does that work?

Re: [Tutor] class initialization with a lot of parameters

2009-11-11 Thread Emile van Sebille
On 11/11/2009 10:19 AM Alan Gauld said... what we actually do in Python is if number1.__eq__(number2): In other words we call the special method __eq__() of number1 passing in number2. So == is actually a method of the object on the left hand side. ... and sometimes the right hand side. Co

Re: [Tutor] module name completion suggestions drop down?

2009-11-11 Thread Sander Sweers
On Wed, 2009-11-11 at 13:11 -0800, Kristin Wilcox wrote: > I was wondering about something I've seen in people's video tutorials > -- these people are using IDLE like I am, but they get these drop down > suggestions for module names that I'm not experiencing. This is done by holding ctrl and press

[Tutor] module name completion suggestions drop down?

2009-11-11 Thread Kristin Wilcox
Hello, I was wondering about something I've seen in people's video tutorials -- these people are using IDLE like I am, but they get these drop down suggestions for module names that I'm not experiencing. The user starts typing a built-in method and suggestions of possible methods that start with

Re: [Tutor] Querying a module's package path?

2009-11-11 Thread Eric Pavey
> > Eric Pavey wrote: >> >>> Presume I have a package 'a' like this: >>> >>>* /pystuff (added to sys.path) >>> o /a (start of my package) >>> >>>+ __init__.py >>>+ /b# __init__.py >>> # module.py >>> >>> to

Re: [Tutor] Iterator Merging

2009-11-11 Thread Alan Gauld
"Kent Johnson" wrote > What I'm trying to work out is how to feed the data I have - 6 streams > of timestamp, entry into imerge. merged = imerge(*magpie.logs) for timestamp, entry in itertools.islice(merged, 3): print timestamp, entry And stating the obvious, test it with smaller test

Re: [Tutor] class initialization with a lot of parameters

2009-11-11 Thread Alan Gauld
"C.T. Matsumoto" wrote The Table object you described I find more complicated if each table stands on its own it is decoupled from its compare partner. I suppose a function that pairs the tables, feeding a Table object to its partner Table.compare method. Kind of. Think about something s

Re: [Tutor] TimeOut in

2009-11-11 Thread OkaMthembo
Hi Somnath, I think the exception simply means that the thread object or class does not have a cancel function. maybe read docs on Python threads to see what functions can be called on those? On Sun, Nov 8, 2009 at 9:09 PM, somnath chakrabarti < chakrabarti.somn...@gmail.com> wrote: > Hi Alan, >

Re: [Tutor] Querying a module's package path?

2009-11-11 Thread Eric Pavey
On Tue, Nov 10, 2009 at 11:15 PM, Lie Ryan wrote: > Eric Pavey wrote: > >> Presume I have a package 'a' like this: >> >>* /pystuff (added to sys.path) >> o /a (start of my package) >> >>+ __init__.py >>+ /b# __init__.py >>

Re: [Tutor] Logfile multiplexing

2009-11-11 Thread ALAN GAULD
> Why would that be admitting defeat? > > Well, it mean admitting defeat on solving the problem in python. Yes You could still use Python to do the sorting. But it breaks the problem into two separate and simpler processes. One simply sorts a file given a particular data layout and sort algo

Re: [Tutor] Iterator Merging

2009-11-11 Thread Kent Johnson
On Wed, Nov 11, 2009 at 7:54 AM, Stephen Nelson-Smith wrote: > So, following Kent and Alan's advice, I've preprocessed my data, and > have code that produces 6 LogFile iterator objects: > import magpie magpie.logs[1] > for timestamp, entry in itertools.islice(magpie.logs[1], 3): > .

Re: [Tutor] Logfile multiplexing

2009-11-11 Thread Dave Angel
Stephen Nelson-Smith wrote: Hi, On Wed, Nov 11, 2009 at 10:05 AM, Alan Gauld wrote: "Stephen Nelson-Smith" wrote I don't really want to admit defeat and have a cron job sort the logs before entry. Anyone got any other ideas? Why would that be admitting defeat? Well, i

Re: [Tutor] Re ading List from File

2009-11-11 Thread Shashwat Anand
Samir-16 wrote: > > > > Hi Everyone, > > > > I am trying to read a comma-delimitted list ("aaa","bbb","ccc") from a > > text > > file and assign those values to a list, x, such that: > > > > x = ["aaa", "bbb", "ccc"] > > > > The code that I have come up with looks like this: > > > x = [] >

[Tutor] Iterator Merging

2009-11-11 Thread Stephen Nelson-Smith
So, following Kent and Alan's advice, I've preprocessed my data, and have code that produces 6 LogFile iterator objects: >>> import magpie >>> magpie.logs[1] >>> dir(magpie.logs[1]) ['__doc__', '__init__', '__iter__', '__module__', 'date', 'logfile', 'timestamp'] >>> for timestamp, entry in iter

Re: [Tutor] Logfile multiplexing

2009-11-11 Thread Kent Johnson
On Wed, Nov 11, 2009 at 4:46 AM, Stephen Nelson-Smith wrote: > Hi Kent, > >> See the Python Cookbook recipes I referenced earlier. >> http://code.activestate.com/recipes/491285/ >> http://code.activestate.com/recipes/535160/ >> >> Note they won't fix up the jumbled ordering of your files but I don

[Tutor] Alok Mishra wants to stay in touch on LinkedIn

2009-11-11 Thread Alok Mishra
LinkedIn Alok Mishra requested to add you as a connection on LinkedIn: -- Valdemaras, I'd like to add you to my professional network on LinkedIn. - Alok Mishra Accept invitation from Alok Mishra http://www.linkedin.com/e/IZPPfNL6humFkJadIejj

Re: [Tutor] Re ading List from File

2009-11-11 Thread furblender
Hello everyone, I to had the same problem and it pestered me to the nth degree. I had that many problems I went to the python site and copied an example and used that to test why it wasn't working -see below example and traceback report. I wasted a lot of time trying to figure my issue out. Then

Re: [Tutor] Logfile multiplexing

2009-11-11 Thread Stephen Nelson-Smith
Hi, On Wed, Nov 11, 2009 at 10:05 AM, Alan Gauld wrote: > "Stephen Nelson-Smith" wrote >> >> I don't really want to admit defeat and have a cron job sort the logs >> before entry.  Anyone got any other ideas? > > Why would that be admitting defeat? Well, it mean admitting defeat on solving the

Re: [Tutor] class initialization with a lot of parameters

2009-11-11 Thread C.T. Matsumoto
Great, I do see my objects working as functions so my OOP understanding needs development. I've got to roll this around to come up with a design which will be more OOP centered and change the code accordingly. To start I could move CompareTableList into DB. This will make a list of tables that nee

Re: [Tutor] Logfile multiplexing

2009-11-11 Thread Alan Gauld
"Stephen Nelson-Smith" wrote I don't really want to admit defeat and have a cron job sort the logs before entry. Anyone got any other ideas? Why would that be admitting defeat? Its normal when processing large data volumes to break the process into discrete steps that can be done in bulk an

Re: [Tutor] Logfile multiplexing

2009-11-11 Thread Stephen Nelson-Smith
Hi Kent, > See the Python Cookbook recipes I referenced earlier. > http://code.activestate.com/recipes/491285/ > http://code.activestate.com/recipes/535160/ > > Note they won't fix up the jumbled ordering of your files but I don't > think they will break from it either... That's exactly the probl

Re: [Tutor] class initialization with a lot of parameters

2009-11-11 Thread Alan Gauld
"C.T. Matsumoto" wrote First I've got a db class class DB(object): """ This does all the database handling. """ That's fine. Then I've got a class to filter a list of potential tables to be compared. These tables need to be tested. OK, Could that be a method of your database? cl