Re: getting name of passed reference

2009-12-28 Thread Gabriel Genellina
En Tue, 29 Dec 2009 00:28:32 -0300, Joel Davis escribió: On Dec 28, 9:37 pm, Joel Davis wrote: my thanks go out to Emile and Mr Hanson for their responses, I think I've found the solution, much shorter as well: > #!/usr/bin/python > import traceback > def testing ( varPassed

Re: getting name of passed reference

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: > my thanks go out to Emile and Mr Hanson for their responses, I think > I've found the solution, much shorter as well: > > > #!/usr/bin/python > > > import traceback > > > def testing ( varPassed ): > > print traceba

Re: How to iterate the input over a particular size?

2009-12-28 Thread Steven D'Aprano
On Tue, 29 Dec 2009 00:49:50 -0500, John Posner wrote: > On Sun, 27 Dec 2009 09:44:17 -0500, joy99 > wrote: > >> Dear Group, >> >> I am encountering a small question. >> >> Suppose, I write the following code, >> >> input_string=raw_input("PRINT A STRING:") >> string_to_word=input_string.split()

Re: How to iterate the input over a particular size?

2009-12-28 Thread Ben Finney
"John Posner" writes: > I haven't found a generator version of the string function split(). Am > I missing something? To my knowledge there isn't one. Both Python 2 and Python 3 document ‘str.split’ as returning a list. -- \ “An idea isn't responsible for the people who believe in it.”

Re: How to iterate the input over a particular size?

2009-12-28 Thread John Posner
On Sun, 27 Dec 2009 09:44:17 -0500, joy99 wrote: Dear Group, I am encountering a small question. Suppose, I write the following code, input_string=raw_input("PRINT A STRING:") string_to_word=input_string.split() len_word_list=len(string_to_word) if len_word_list>9: rest_words=

Re: Python OOP Problem

2009-12-28 Thread Миклухо
On 28 дек, 18:29, "Martin v. Loewis" wrote: > Миклухо wrote: > > Hi, all. My problem is: > > 1) I have a database(postgresql) > > 2)I'm getting some string from database(string is a classname - > > written by me). > > 3)I need to construct new object from this string. > > In java it's done by Clas

Re: Python OOP Problem

2009-12-28 Thread Миклухо
On 28 дек, 18:29, "Martin v. Loewis" wrote: > Миклухо wrote: > > Hi, all. My problem is: > > 1) I have a database(postgresql) > > 2)I'm getting some string from database(string is a classname - > > written by me). > > 3)I need to construct new object from this string. > > In java it's done by Clas

Re: Python OOP Problem

2009-12-28 Thread Миклухо
On 28 дек, 18:29, "Martin v. Loewis" wrote: > Миклухо wrote: > > Hi, all. My problem is: > > 1) I have a database(postgresql) > > 2)I'm getting some string from database(string is a classname - > > written by me). > > 3)I need to construct new object from this string. > > In java it's done by Clas

Re: Python OOP Problem

2009-12-28 Thread Миклухо
On 28 дек, 18:02, Daniel Fetchinson wrote: > > Hi, all. My problem is: > > 1) I have a database(postgresql) > > 2)I'm getting some string from database(string is a classname - > > written by me). > > 3)I need to construct new object from this string. > > In java it's done by Class.forName().newIns

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
On Dec 28, 9:37 pm, Joel Davis wrote: > As far as more positive things are concerned, is anyone aware of what > the support for _getframe(1) the way I used it is? Does steven have a > newer (or older) version than me, maybe? (2.6.2) it seems like the > sort of thing that ought to have pretty unifo

Re: Threading problem / Paramiko problem ?

2009-12-28 Thread MRAB
mk wrote: Hello everyone, I wrote "concurrent ssh" client using Paramiko, available here: http://python.domeny.com/cssh.py This program has a function for concurrent remote file/dir copying (class SSHThread, method 'sendfile'). One thread per host specified is started for copying (with a wo

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
As far as more positive things are concerned, is anyone aware of what the support for _getframe(1) the way I used it is? Does steven have a newer (or older) version than me, maybe? (2.6.2) it seems like the sort of thing that ought to have pretty uniform behavior, but are their certain calls it var

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
On Dec 28, 8:40 pm, Steven D'Aprano wrote: > On Mon, 28 Dec 2009 17:27:21 -0800, Joel Davis wrote: > > For posterity, I figured out a solution: > > >  > #!/usr/bin/python > > >  > import sys > >  > from traceback import extract_stack > > >  > varPassed="varName get" > > >  > def MyFunc(varPassed):

Re: a list/re problem

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 17:35:22 -0800, Aahz wrote: > In article , Ed > Keith wrote: >> >>I have a list call it 'l': >> >>l = ['asc', '*nbh*', 'jlsdjfdk', 'ikjh', '*jkjsdfjasd*', 'rewr'] >> >>Notice that some of the items in the list start and end with an '*'. I >>wish to construct a new list, call

Re: getting name of passed reference

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 17:27:21 -0800, Joel Davis wrote: > For posterity, I figured out a solution: > > > #!/usr/bin/python > > > import sys > > from traceback import extract_stack > > > varPassed="varName get" > > > def MyFunc(varPassed): > > try: > > raise None >

Re: a list/re problem

2009-12-28 Thread Aahz
In article , Ed Keith wrote: > >I have a list call it 'l': > >l = ['asc', '*nbh*', 'jlsdjfdk', 'ikjh', '*jkjsdfjasd*', 'rewr'] > >Notice that some of the items in the list start and end with an '*'. I >wish to construct a new list, call it 'n' which is all the members of l >that start and end wit

Re: getting name of passed reference

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 15:54:04 -0800, Joel Davis wrote: > I'm just curious if anyone knows of a way to get the variable name of a > reference passed to the function. > > Put another way, in the example: > > def MyFunc ( varPassed ): > print varPassed; > > MyFunc(nwVar) > > how would I g

Re: Difference Between Two datetimes

2009-12-28 Thread Ben Finney
"W. eWatson" writes: > It doesn't seem to be standard practice to more or less teach the > environment that Python is in. If they do, it's jumbled around. Most > books start with Python itself and skirt the issues of the environment > and interaction. There are no Python documentation police enf

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
For posterity, I figured out a solution: > #!/usr/bin/python > import sys > from traceback import extract_stack > varPassed="varName get" > def MyFunc(varPassed): > try: > raise None > except: > frame = sys._getframe(1) >

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Steven D'Aprano wrote: On Mon, 28 Dec 2009 23:50:30 +1100, Ben Finney wrote: How does one "unload" this structure to get the seconds and days? It's customary to consult the documentation for questions like that http://docs.python.org/library/datetime.html#datetime.timedelta>. No no no, it's

Re: getting name of passed reference

2009-12-28 Thread Emile van Sebille
On 12/28/2009 3:54 PM Joel Davis said... I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. For curiosity, sure -- but it's real weak... Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVa

Re: getting name of passed reference

2009-12-28 Thread Stephen Hansen
On Mon, Dec 28, 2009 at 3:54 PM, Joel Davis wrote: > I'm just curious if anyone knows of a way to get the variable name of > a reference passed to the function. > > Put another way, in the example: > > def MyFunc ( varPassed ): > print varPassed; > > MyFunc(nwVar) > > how would I get the str

getting name of passed reference

2009-12-28 Thread Joel Davis
I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVar) how would I get the string "nwVar" from inside of "MyFunc"? is it possible? -- http://mai

clean data [was: Simple distributed example for learning purposes?]

2009-12-28 Thread Ethan Furman
Lie Ryan wrote: On 12/28/2009 11:59 PM, Shawn Milochik wrote: With address data: one address may have suite data and the other might not the same city may have multiple zip codes why is that even a problem? You do put suite data and zipcode into different database fields right? The

Re: Difference Between Two datetimes

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 23:22:09 +0100, Peter Otten wrote: > print some_object > > first converts some_object to a string invoking str(some_object) which > in turn calls the some_object.__str__() method. The resulting string is > then written to stdout. In fairness to the OP, that's a misleading wa

Re: Difference Between Two datetimes

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 14:42:21 -0800, W. eWatson wrote: > So as long as I don't print it, it's datetime.datetime and I can make > calculations or perform operations on it as though it is not a string, > but a datetime object? No, it remains a datetime object regardless of whether you print it or n

Re: Difference Between Two datetimes

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 10:54:46 -0800, W. eWatson wrote: > Ben Finney wrote: >> "W. eWatson" writes: >> >>> Lie Ryan wrote: what's strange about it? the difference between 2009/01/02 13:01:15 and 2009/01/04 13:01:15 is indeed 2 days... Can you elaborate what do you mean by 'strange'?

Re: Difference Between Two datetimes

2009-12-28 Thread Peter Otten
W. eWatson wrote: > Peter Otten wrote: >> W. eWatson wrote: >> >>> This is quirky. >>> >>> >>> t1=datetime.datetime.strptime("20091205_221100","%Y%m%d_%H%M%S") >>> >>> t1 >>> datetime.datetime(2009, 12, 5, 22, 11) >>> >>> type(t1) >>> >>> >>> >>> t1: 2009-12-05 22:11:00 >>> >>> but in the

Re: Difference Between Two datetimes

2009-12-28 Thread Steven D'Aprano
On Mon, 28 Dec 2009 23:50:30 +1100, Ben Finney wrote: >> How does one "unload" this structure to get the seconds and days? > > It's customary to consult the documentation for questions like that > http://docs.python.org/library/datetime.html#datetime.timedelta>. No no no, it's customary to annoy

Re: Another Sets Problem

2009-12-28 Thread Steve Holden
Victor Subervi wrote: > On Mon, Dec 28, 2009 at 3:07 PM, Steve Holden > However, when I try that in my current script, the script > > fails. It throws no error, but rather just quits printing > to the > > screen. Here's the code snippet: > > > >

Re: DB Table Processor?

2009-12-28 Thread Ed Leafe
On Dec 27, 2009, at 11:31 AM, A. Shore wrote: > Folks, I'm considering developing a particular app in Python - I've > been working in PHP for some years now - and it will be db-intensive. > Whether it's based on sqllite or mySQL is TBD as of right now. > > One tool that's done me well in the past

Re: eiger replacement?

2009-12-28 Thread Aahz
In article , Robin Becker wrote: >On 12/12/2009 05:38, Tim Roberts wrote: >> Steven D'Aprano wrote: >>> On Fri, 11 Dec 2009 17:45:24 +, Robin Becker wrote: The current hardware CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (2394.01-MHz 686-class CPU) >>> >>> What does this have to do

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread John Bokma
Andrew Jonathan Fine writes: > On Dec 28, 9:20 am, webtourist wrote: >> Andrew I'm very sorry to hear your situation. >> This is, I don't know how else to put it, so hard to believe - that >> someone like you has been jobless since 2005, >> well over 2 years before the "big bust". >> Good luck t

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread Rodrick Brown
Move to NYC, Chicago, or Boston and try to land a job working in the financial industry they're always hiring and Python is getting very popular amongst the quantitative and computation finance sectors. You may need to use head hunters two I recommended are Connections NY, Open Systems, and Tek Sy

Re: zope server on ubuntu 9.10

2009-12-28 Thread Chris Withers
S.Selvam wrote: I am using Ubuntu 9.10 and when i tried to install Zope application server with the following , sudo easy_install -i http://download.zope.org/Zope2/index/2.12.1 Zope2 i got an error as shown below, --- . . Reading http://download.zope.org/Zope2/index/2.12.1/ No loca

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread Andrew Jonathan Fine
On Dec 28, 6:21 am, Steve Holden wrote: > Andrew Jonathan Fine wrote: > > To whom it may concern, > > > I am the author of "Honeywell Avoids Documentation Costs with Python > > and other Open Standards!" > > > I was laid off by Honeywell several months after I had made my > > presentation in the 2

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread eric_dex...@msn.com
On Dec 28, 1:32 am, Andrew Jonathan Fine wrote: > To whom it may concern, > > I am the author of "Honeywell Avoids Documentation Costs with Python > and other Open Standards!" > > I was laid off by Honeywell several months after I had made my > presentation in the 2005 Python Conference. > > Since

Re: Difference Between Two datetimes

2009-12-28 Thread Roy Smith
In article , Roy Smith wrote: > Yes, but how much time has elapsed between "2009/0/04 13:01:15" Typo. Should be "2009/01/04 13:01:15". -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference Between Two datetimes

2009-12-28 Thread Roy Smith
In article , "W. eWatson" wrote: > BTW, all times are local to my city. Same time zone. Yes, but how much time has elapsed between "2009/0/04 13:01:15" and "2009/06/04 13:01:15"? Even if I tell you that both timestamps were done in the same city, you don't have enough information. Hint #1:

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread Propad
Hello Mr. Fine, I just read your mail on the Python Google Group. I've been in situations of searching a job many times now - in the meantime, it's not employments but projects I'm looking for, as I'm working as a contractor. While I'm currently doing reasonably well, I've never been quite comforta

Re: Another Sets Problem

2009-12-28 Thread Victor Subervi
On Mon, Dec 28, 2009 at 3:07 PM, Steve Holden wrote: > Victor Subervi wrote: > > On Mon, Dec 28, 2009 at 1:41 PM, MRAB > > wrote: > > > > Victor Subervi wrote: > > > > Hi; > > I'm using python 2.4.3 which apparently requires that I import >

Re: Another Sets Problem

2009-12-28 Thread Steve Holden
Victor Subervi wrote: > On Mon, Dec 28, 2009 at 1:41 PM, MRAB > wrote: > > Victor Subervi wrote: > > Hi; > I'm using python 2.4.3 which apparently requires that I import Set: > from sets import Set > I've done this. In anothe

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Ben Finney wrote: "W. eWatson" writes: Lie Ryan wrote: what's strange about it? the difference between 2009/01/02 13:01:15 and 2009/01/04 13:01:15 is indeed 2 days... Can you elaborate what do you mean by 'strange'? Easily. In one case, it produces a one argument funcion, and the other 2,

Re: Windows, IDLE, __doc_, other

2009-12-28 Thread Lie Ryan
On 12/29/2009 5:10 AM, W. eWatson wrote: Lie Ryan wrote: If you're on Windows, don't use the "Edit with IDLE" right-click hotkey since that starts IDLE without subprocess. Use the shortcut installed in your Start menu. When I go to Start and select IDLE, Saves or Opens want to go into C:/Python

Re: Another Sets Problem

2009-12-28 Thread Matt Nordhoff
Victor Subervi wrote: > On Mon, Dec 28, 2009 at 1:41 PM, MRAB > wrote: >> DON'T USE BARE EXCEPTS! >> >> (There are 2 in your code.) > > There are times when they are *necessary*. No, there aren't. Even if there were, this is not one of those situations. -- M

Re: the need for 64 bits

2009-12-28 Thread Mensanator
On Dec 28, 9:08 am, casevh wrote: > On Dec 28, 2:13 am, Mark Dickinson wrote: > > > > > > > On Dec 28, 6:50 am, Mensanator wrote: > > > > But with a 64-bit processor, that limitation no longer stops me. > > > > i: 11   bits: 10,460,353,205   decimals:  3,148,880,080 > > > i: 12   bits: 94,143,17

Re: how to register with pypi - no such setup.py

2009-12-28 Thread Phlip
On Dec 26, 4:24 pm, Stefan Krah wrote: > It is quite reasonable that changed archives with the same version number > are not accepted. Very helpful, not condescending. The message helps you remember to bump your version number. Try: "Please either increment your version number, or use your Pack

Re: How to iterate the input over a particular size?

2009-12-28 Thread Peter Otten
Lie Ryan wrote: > On 12/28/2009 8:54 PM, Peter Otten wrote: >> Francesco Bochicchio wrote: >> One with lazy chunks: >> > from itertools import chain, islice > def chunks(items, n): >> items = iter(items) >> for first in items: >> yield chain((first,), isl

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
D'Arcy J.M. Cain wrote: On Mon, 28 Dec 2009 08:20:28 -0800 "W. eWatson" wrote: Sort of the opposite of a stopped clock. It's right twice a day. How does one solve the DST problem? Depends on which DST problem you have. There is more than one solution depending on what the problem is. Store

Re: Simple distributed example for learning purposes?

2009-12-28 Thread Tim Golden
Shawn Milochik wrote: [... suggesting Video rendering and name/address matching ...] Thanks for those, Shawn. The latter's more within my power, but the former certainly has an extra buzz factor. I'll look around to see if I can rustle up some straightforward example of the kind of thing... TJG

Re: Windows, IDLE, __doc_, other

2009-12-28 Thread W. eWatson
Lie Ryan wrote: On 12/22/2009 12:06 PM, W. eWatson wrote: ... You must be starting IDLE without subprocess. Did you see this message IDLE 2.6.1 No Subprocess when starting IDLE. Yes, I usually start in a folder where I have my py program files, and do a right-click for IDLE ed

Re: Another Sets Problem

2009-12-28 Thread Victor Subervi
On Mon, Dec 28, 2009 at 1:41 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I'm using python 2.4.3 which apparently requires that I import Set: >> from sets import Set >> I've done this. In another script I successfully manipulated MySQL sets by >> so doing. Here's the code snippet from the

Re: Windows, IDLE, __doc_, other

2009-12-28 Thread W. eWatson
It the IDLE shell, it's not possible to retrieve lines entered earlier without copying them. Is there an edit facility? I suggest you download a programmers' editor (like Notepad++ or PsPad) for programming work and use the basic Python interpreter for interactive work. The basic interpreter

Re: Another Sets Problem

2009-12-28 Thread MRAB
Victor Subervi wrote: Hi; I'm using python 2.4.3 which apparently requires that I import Set: from sets import Set I've done this. In another script I successfully manipulated MySQL sets by so doing. Here's the code snippet from the script where I was able to call the elements in a for loop:

Re: Python OOP Problem

2009-12-28 Thread Martin v. Loewis
>> name2class = { "MyObject" : MyObject, >>"MyOtherObject" : MyOtherObject, >>"Etc" : Etc } >> >> Then, when you receive the string class_name, you do >> >> o = name2class[class_name] >> o.myfunction() >> > The class needs to be instantiated, so the one line should b

Re: Difference Between Two datetimes

2009-12-28 Thread D'Arcy J.M. Cain
On Mon, 28 Dec 2009 08:20:28 -0800 "W. eWatson" wrote: > Sort of the opposite of a stopped clock. It's right twice a day. How > does one solve the DST problem? Depends on which DST problem you have. There is more than one solution depending on what the problem is. Store and compare in UTC and

Re: How to iterate the input over a particular size?

2009-12-28 Thread joy99
On Dec 28, 5:28 pm, Vlastimil Brom wrote: > 2009/12/27 joy99 : > > > Dear Group, > > Answers were good. But I am looking for a smarter solution like: > > > for i[:2] in list: > > > > > etc. or by doing some looping over loop. > > Do not worry I'll work out the answer. > > > Wishing you a happ

Re: How to iterate the input over a particular size?

2009-12-28 Thread Lie Ryan
On 12/28/2009 8:54 PM, Peter Otten wrote: Francesco Bochicchio wrote: One with lazy chunks: from itertools import chain, islice def chunks(items, n): items = iter(items) for first in items: yield chain((first,), islice(items, n-1)) [list(chunk) for chun

Re: Simple distributed example for learning purposes?

2009-12-28 Thread Shawn Milochik
On Dec 28, 2009, at 11:28 AM, Lie Ryan wrote: > > I agree fuzzy searches is indispensable in certain cases, but from the way > you're describing the issue, it appears that half of your "unsolved" problems > comes due to the poor design of the database. I agree, that the other halves > (e.g. ty

Re: Simple distributed example for learning purposes?

2009-12-28 Thread Lie Ryan
On 12/28/2009 11:59 PM, Shawn Milochik wrote: With address data: one address may have suite data and the other might not the same city may have multiple zip codes why is that even a problem? You do put suite data and zipcode into different database fields right? inc

Re: subprocess returncode is masked

2009-12-28 Thread MRAB
Emmanuel wrote: I'm using Python 2.6 and the new subprocess module to get the exit value of an external executable. It appears the return value given by wait() or poll() operations is masked under Unix: I only get the lower 8 bits. So an exit value of 0x0402 in the C program will be seen as 0x

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Roy Smith wrote: In article , "W. eWatson" wrote: BTW, all times are local to my city. Same time zone. Yes, but how much time has elapsed between "2009/0/04 13:01:15" and "2009/06/04 13:01:15"? Even if I tell you that both timestamps were done in the same city, you don't have enough info

Another Sets Problem

2009-12-28 Thread Victor Subervi
Hi; I'm using python 2.4.3 which apparently requires that I import Set: from sets import Set I've done this. In another script I successfully manipulated MySQL sets by so doing. Here's the code snippet from the script where I was able to call the elements in a for loop: if isinstance(col

Re: subprocess returncode is masked

2009-12-28 Thread webtourist
On Dec 28, 11:12 am, Emmanuel wrote: > I'm using Python 2.6 and the new subprocess module to get the exit value > of an external executable. It appears the return value given by wait() > or poll() operations is masked under Unix: I only get the lower 8 bits. > So an exit value of 0x0402 in the C p

subprocess returncode is masked

2009-12-28 Thread Emmanuel
I'm using Python 2.6 and the new subprocess module to get the exit value of an external executable. It appears the return value given by wait() or poll() operations is masked under Unix: I only get the lower 8 bits. So an exit value of 0x0402 in the C program will be seen as 0x02 in Python. And

Re: Python OOP Problem

2009-12-28 Thread Anthony Tolle
On Dec 28, 7:29 am, "Martin v. Loewis" wrote: > > In this case (you just started to learn Python), I recommend to take > an explicit approach. Create a dictionary that maps class names to > classes: > > name2class = { "MyObject" : MyObject, >                "MyOtherObject" : MyOtherObject, >      

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread Mohammad Tayseer
Hello Andrew, I'm sorry to hear about this. It's really hard to get a job now. I believe that you should try to be more of a "Jack of All Trades" by learning either Java or .net. Try to increase your experience working on these platforms for part-time or freelance projects to convince employers

Re: Difference Between Two datetimes

2009-12-28 Thread Lie Ryan
On 12/29/2009 1:12 AM, Roy Smith wrote: Hint #3: If you don't pay attention to this, you will be bitten twice a year. Not really. Some areas don't have DST and the answer to that is always exactly 5 months. -- http://mail.python.org/mailman/listinfo/python-list

Threading problem / Paramiko problem ?

2009-12-28 Thread mk
Hello everyone, I wrote "concurrent ssh" client using Paramiko, available here: http://python.domeny.com/cssh.py This program has a function for concurrent remote file/dir copying (class SSHThread, method 'sendfile'). One thread per host specified is started for copying (with a working queue

Re: the need for 64 bits

2009-12-28 Thread casevh
On Dec 28, 2:13 am, Mark Dickinson wrote: > On Dec 28, 6:50 am, Mensanator wrote: > > > > > But with a 64-bit processor, that limitation no longer stops me. > > > i: 11   bits: 10,460,353,205   decimals:  3,148,880,080 > > i: 12   bits: 94,143,178,829   decimals: 28,339,920,715 > > > Wow! 94 bill

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread Steve Holden
Andrew Jonathan Fine wrote: > To whom it may concern, > > I am the author of "Honeywell Avoids Documentation Costs with Python > and other Open Standards!" > > I was laid off by Honeywell several months after I had made my > presentation in the 2005 Python Conference. > > Since then I have been

Re: Simple distributed example for learning purposes?

2009-12-28 Thread Shawn Milochik
On Dec 27, 2009, at 1:23 PM, Lie Ryan wrote: > > IMHO, that's a poor example. Rather than writing a fuzzy search algorithm, > it's easier to write a normalizer before entering data to the index (or > before comparing the search string with the corpus' string). > -- > It does seem like that a

Re: Difference Between Two datetimes

2009-12-28 Thread Ben Finney
"W. eWatson" writes: > Lie Ryan wrote: > > what's strange about it? the difference between 2009/01/02 13:01:15 > > and 2009/01/04 13:01:15 is indeed 2 days... Can you elaborate what > > do you mean by 'strange'? > Easily. In one case, it produces a one argument funcion, and the other > 2, possib

Re:

2009-12-28 Thread Simon Brunning
2009/12/24 Yulin : > Hi when I start my Pc I get error “ The specified module could not be found. > LoadLibrary(pythondll)failed > > Please Help once I have enterd I get the following….C:\Documents and > settings\all users\.clamwin\quarentine\python25.DLL > > PLEASE help I cant load most of my prog

Re: Perl to Python conversion

2009-12-28 Thread Simon Brunning
2009/12/25 Aahz : > > I'd write an imperial to metric converter in Python  ;-) Should be possible to use unum () to do the conversions. The SI units are already defined - adding in any necessary imperial units should be easy enough. -- Cheers, Simon B. -- http://mail.pytho

Re: Python OOP Problem

2009-12-28 Thread Martin v. Loewis
Миклухо wrote: > Hi, all. My problem is: > 1) I have a database(postgresql) > 2)I'm getting some string from database(string is a classname - > written by me). > 3)I need to construct new object from this string. > In java it's done by Class.forName().newInstance(); > > For instance: > 1)I receive

Re: How to iterate the input over a particular size?

2009-12-28 Thread Vlastimil Brom
2009/12/27 joy99 : > Dear Group, > Answers were good. But I am looking for a smarter solution like: > > for i[:2] in list: > > > etc. or by doing some looping over loop. > Do not worry I'll work out the answer. > > Wishing you a happy day ahead, > Regards, > Subhabrata. > -- > http://mail.pyt

Re: Python OOP Problem

2009-12-28 Thread Daniel Fetchinson
> Hi, all. My problem is: > 1) I have a database(postgresql) > 2)I'm getting some string from database(string is a classname - > written by me). > 3)I need to construct new object from this string. > In java it's done by Class.forName().newInstance(); > > For instance: > 1)I receive the string: "My

Python OOP Problem

2009-12-28 Thread Миклухо
Hi, all. My problem is: 1) I have a database(postgresql) 2)I'm getting some string from database(string is a classname - written by me). 3)I need to construct new object from this string. In java it's done by Class.forName().newInstance(); For instance: 1)I receive the string: "MyObject". 2)o = My

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
Lie Ryan wrote: On 12/28/2009 5:42 PM, W. eWatson wrote: You're right. Y. Works fine. The produces datetime.datetime(2009, 1, 2, 13, 1, 15). If I now use t2=datetime.datetime.strptime("2009/01/04 13:01:15","%Y/%m/%d %H:%M:%S") I get tw as datetime.datetime(2009, 1, 4, 13, 1, 15) Then t2-t1 gives

Re: easy question, how to double a variable

2009-12-28 Thread Tom Kermode
def twice(parameter = 2) return 4 2009/9/20 daggerdvm : >  Write the definition of a function  twice , that receives an  int > parameter and returns an  int that is twice the value of the > parameter. > > how can i do this > -- > http://mail.python.org/mailman/listinfo/python-list > -- http

Re: (help)Tkinter, how to make labels scrolling?

2009-12-28 Thread Francesco Bochicchio
On 28 Dic, 09:44, Ren Wenshan wrote: > Hi, everyone: > >    I am new to programming and Python and these days I've been working > on a > tiny program for practice and encountered with a problem. > >    My tiny program read a line from a data file one time, and store it > in a list, till the list i

Re: Difference Between Two datetimes

2009-12-28 Thread W. eWatson
BTW, all times are local to my city. Same time zone. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple distributed example for learning purposes?

2009-12-28 Thread Lie Ryan
On 12/27/2009 7:46 AM, Shawn Milochik wrote: The special features of the Shrek DVD showed how the rendering took so much processing power that everyone's workstation was used overnight as a rendering farm. Some kind of video rendering would make a great example. However, it might be a lot of ov

Re: Difference Between Two datetimes

2009-12-28 Thread Roy Smith
In article , "W. eWatson" wrote: > t1=datetime.datetime.strptime("2009/01/02 13:01:15","%y/%m/%d %H:%M:%S") > doesn't do it. > ValueError: time data did not match format: data=2009/01/02 13:01:15 > fmt=%y/%m/%d %H:%M:%S The first thing that jumps out at me is that %y is the two-digit year. Y

Re: Question-Answer based web App

2009-12-28 Thread Daniel Fetchinson
> I am trying to make a web based application which has a set of questions and > answers associated with it such that a report is generated based on the > answers a user chooses for each question.It's like facebook apps where we > have questions , answers and reports . Should i generate the report

Re: the need for 64 bits

2009-12-28 Thread Mark Dickinson
On Dec 28, 6:50 am, Mensanator wrote: > But with a 64-bit processor, that limitation no longer stops me. > > i: 11   bits: 10,460,353,205   decimals:  3,148,880,080 > i: 12   bits: 94,143,178,829   decimals: 28,339,920,715 > > Wow! 94 billion bits! 28 billion decimal digits! > > Of course, once o

Re: How to iterate the input over a particular size?

2009-12-28 Thread Peter Otten
Francesco Bochicchio wrote: > Not sure I understood your question, but if you need just to plit a > big list in sublists of no more than 9 elements, then you can do > someting like: > > def sublists(biglist, n ): > "Splits a big list in sublists of max n elements" > prev_idx = 0;

Re: How to iterate the input over a particular size?

2009-12-28 Thread Francesco Bochicchio
On 27 Dic, 22:29, joy99 wrote: > On Dec 27, 8:42 pm, Benjamin Kaplan wrote: > > > > > On Sun, Dec 27, 2009 at 9:44 AM, joy99 wrote: > > > Dear Group, > > > > I am encountering a small question. > > > > Suppose, I write the following code, > > > > input_string=raw_input("PRINT A STRING:") > > > s

(help)Tkinter, how to make labels scrolling?

2009-12-28 Thread Ren Wenshan
Hi, everyone: I am new to programming and Python and these days I've been working on a tiny program for practice and encountered with a problem. My tiny program read a line from a data file one time, and store it in a list, till the list is full. This is the init. Then when I press Butto

Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread joy99
On Dec 28, 12:32 pm, Andrew Jonathan Fine wrote: > To whom it may concern, > > I am the author of "Honeywell Avoids Documentation Costs with Python > and other Open Standards!" > > I was laid off by Honeywell several months after I had made my > presentation in the 2005 Python Conference. > > Sinc

Re: [ANNOUNCE] PyGTK 2.17.0 - unstable

2009-12-28 Thread Philippe Bouige
Dans comp.lang.python.announce, vous avez écrit : > A new unstable development release of the Python bindings > for GTK+ has been released. > > The new release is available from ftp.gnome.org and its mirrors > as soon as its synced correctly: > > http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.17/