queries

2006-01-06 Thread pravin kumar
hello,      i would like learn how to implement berkeley database in python    i kindly request you to provide help by describing what manuals to refer or other sources to get about that.         thanking you,     

PIL implementation

2006-01-06 Thread circusdei
I wrote this snippet with the intention of -- capturing a section of the screen whenever it changes. It could be implemented to log any sort of messaging system ( by saving consecutive images eg. 1.png...etc). #code import Image import ImageGrab lastchatbound = (21, 504) + (

Re: What's wrong with this code snippet?

2006-01-06 Thread LordLaraby
For what it's worth, GenerateRandomColour does not access any instance variables and therefore needn't even be a member of the class Population. If you wanted it there for encapsulation purposes, consider making it a staticmethod like so: @staticmethod() def GenerateRandomColour():

Re: smtplib error('Connection reset by peer')

2006-01-06 Thread LordLaraby
Do you actually run an SMTP server on your local machine and is it configured to accept mail on the localhost interface and does it allow mail forwarding such as you attempted? LL -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a smaple to create syslog server on Windows.

2006-01-06 Thread LordLaraby
WIndows has a syslog server. It's called the Windows Event Log. No need to build a whole new one. *grin* Now... if you just want an app that listens on a log port and sends it's message to the Event Log, then I can't help you but to suggest that a *nix knowledgable programmer may help you write on

Re: CGI question

2006-01-06 Thread LordLaraby
sophie, If you have the URL in a variable, it's easy to parse it into it's components (one of which is the query string) like so: >>> from urllib2.urlparse import urlparse >>> urlparse( \ "http://[EMAIL PROTECTED]:8080/mytext.php;hellothere?this=test+value&and=that+one#anchor") ('http', '[EMAIL

Re: download full sites?

2006-01-06 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi, does anyone know of any package that will download a full site for > offline viewing? It will change all url to match local urls and follow > a logical structure (the site's structure would be suffice).. Please > tell me if you have heard of such a package.. thanks a

Re: Is 'everything' a refrence or isn't it?

2006-01-06 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > As far as I am concerned "call by object" which is what you > *did* propose implies "call by value" to anyone who is just > learning the language, and that is the audience we're > talking about. >From what I can tell, Liskov proposed *three* different na

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread [EMAIL PROTECTED]
Claudio Grondi wrote: > Martin v. Löwis wrote: > > You can get somewhat faster in Python than your code if you avoid > > producing new long objects all the time, and do the task in chunks of 30 > > bits. > It would be nice if you could explain why you consider chunks of 30 bits > to be superior e.g

Re: Spelling mistakes!

2006-01-06 Thread Alex Martelli
KraftDiner <[EMAIL PROTECTED]> wrote: ... > Frankly how are you ever to know if this type of error is occuring? . Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup fetch help

2006-01-06 Thread ted
Thanks Mike, works like a charm. -Ted "Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "ted" <[EMAIL PROTECTED]> writes: > >> I'm using the BeautifulSoup module and having some trouble processing a >> file. It's not printing what I'm expecting. In the code below, I'm

Re: getting a KeyError:'href' any ideas?

2006-01-06 Thread LordLaraby
You wrote: > i have an > href which looks like this: > > http://www.cnn.com";> > > here is my code > for incident in row('td', {'class':'all'}): > n = incident.findNextSibling('a', {'class': 'btn'}) > link = incident.findNextSibling['href'] + "','" > an

Re: How to Retrieve Data from an HTTPS://URL

2006-01-06 Thread LordLaraby
You might be using ActiveState python on Windows? If so, you most likely do not have the SSL layer that's required to process HTTPS protocol queries. You should install 'standard' Python from python.org to get the SSL handling functionality. I understand that ActiveState can not distribute the SSL

Re: Which is the best GTK

2006-01-06 Thread Terry Hancock
On Sat, 7 Jan 2006 05:21:36 + (GMT) K Satish <[EMAIL PROTECTED]> wrote: > I am a new one to python. I want which is the best gtk. > Tkinter or Tix or etc., . Please suggest me some > documentation. The abbreviation you want (I think) is "GUI" not "GTK". GTK is *a* GUI. If you want to

Re: python speed

2006-01-06 Thread James Tanis
Quite honestly I've never heard of java being faster than.. well.. anything. Faster than Python? I really doubt it. Their are several libraries for game programming specifically as well as opengl, sdl, as well as several different audio systems/daemons.. I'd suggest browsing through the categories

Re: Spelling mistakes!

2006-01-06 Thread skip
>> In fact, googling for "referer" and "referrer" reports a similar >> number of hits, unlike most misspellings. Terry> You know, I almost mentioned that myself. Drives me crazy. Me too. I'm one of those people who, for better or worse, is a good speller. Words just look right or w

Re: Is 'everything' a refrence or isn't it?

2006-01-06 Thread Terry Hancock
On Fri, 06 Jan 2006 20:49:06 +1100 "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Thu, 05 Jan 2006 22:18:39 -0600, Terry Hancock wrote: > >> Consider this: > >> > >> def do_nothing(x): > >> pass > >> > >> huge_tuple = (None,) * 1**4 > >> do_nothing(huge_tuple) > >> > >> If Python made

Re: Spelling mistakes!

2006-01-06 Thread Terry Hancock
On Fri, 6 Jan 2006 19:51:22 -0600 [EMAIL PROTECTED] wrote: > >> > Duh. Next time I use a dictionary before freezing > >an API! > > >> Can you please explain what you mean by that? Use a > >dictionary how? > > Paul> Use a dictionary by looking up words in it to > check the

Which is the best GTK

2006-01-06 Thread K Satish
Hi all,   I am a new one to python. I want which is the best gtk. Tkinter or Tix or etc., . Please suggest me some documentation.   Thanks, Satish. Team Spiderace, www.spiderace.com.  Send instant messages to your online friends http://in.messenger.yahoo.com -- http://mail.python.org/m

Re: Spelling mistakes!

2006-01-06 Thread Terry Hancock
On Sat, 07 Jan 2006 14:03:10 +1100 "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Fri, 06 Jan 2006 17:29:32 -0800, Paul Rubin wrote: > > > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> > Duh. Next time I use a dictionary before freezing an > >API! > Can you please explain what you mean by t

Re: BeautifulSoup fetch help

2006-01-06 Thread Mike Meyer
"ted" <[EMAIL PROTECTED]> writes: > I'm using the BeautifulSoup module and having some trouble processing a > file. It's not printing what I'm expecting. In the code below, I'm expecting > cells with only "bgcolor" attributes to be printed, but I'm getting cells > with other attributes and some

Re: download full sites?

2006-01-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > hi, does anyone know of any package that will download a full site for > offline viewing? It will change all url to match local urls and follow > a logical structure (the site's structure would be suffice).. Please > tell me if you have heard of such a package.. thanks a

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread Tim Peters
[Claudio Grondi] > Let's consider a test source code given at the very end of this posting. > > The question is if Python allows somehow access to the bytes of the > representation of a long integer or integer in computers memory? CPython does not expose its internal representation of longs at the

download full sites?

2006-01-06 Thread randomtalk
hi, does anyone know of any package that will download a full site for offline viewing? It will change all url to match local urls and follow a logical structure (the site's structure would be suffice).. Please tell me if you have heard of such a package.. thanks alot :D -- http://mail.python.org

BeautifulSoup fetch help

2006-01-06 Thread ted
Hi, I'm using the BeautifulSoup module and having some trouble processing a file. It's not printing what I'm expecting. In the code below, I'm expecting cells with only "bgcolor" attributes to be printed, but I'm getting cells with other attributes and some without any attributes. Any help app

writing to DBase III format

2006-01-06 Thread Ngai Kin Wong
Hi,  I want ot create a dbf file, the file is created,it can be opened by Excel but it cannot be opened by Access. Where is the error in my script. My script is as follows: #!/opt/bin/python2.3  import struct, datetime,itertools,time def dbfwriter(f, fieldnames, fieldspecs, records):

Re: Spelling mistakes!

2006-01-06 Thread Steven D'Aprano
On Fri, 06 Jan 2006 17:29:32 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> > Duh. Next time I use a dictionary before freezing an API! >> Can you please explain what you mean by that? Use a dictionary how? > > Use a dictionary by looking up words in it to check the spe

Re: psexec and os.popen help

2006-01-06 Thread [EMAIL PROTECTED]
popen3 did the trick. Thanks Jeff Gercken -- http://mail.python.org/mailman/listinfo/python-list

Re: python speed

2006-01-06 Thread bearophileHUGS
It seems that Java JDK 1.4 (-server) HotSpot compiler sometimes (in this test, on this computer, etc.) can produce programs faster than C and Fortran ones in n-body simulations and similar stuff: http://shootout.alioth.debian.org/gp4/benchmark.php?test=nbody&lang=all http://shootout.alioth.debian.

Help Dialogue

2006-01-06 Thread Dustan
How do I make a help dialogue, like the one seen in IDLE when you go to Help-IDLE Help? -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread Paul Rubin
Claudio Grondi <[EMAIL PROTECTED]> writes: > The question is if Python allows somehow access to the bytes of the > representation of a long integer or integer in computers memory? No it doesn't, and that's a good thing, since the internal representation is a little bit surprising (it stores 15 bit

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Jean-Paul Calderone
On Sat, 07 Jan 2006 00:55:45 GMT, Neil Hodgson <[EMAIL PROTECTED]> wrote: >Paul Watson: > >> Neil Hodgson wrote: >>>It is unlikely that ctypes will be included in the standard Python >>> build as it allows unsafe memory access making it much easier to crash >>> Python. >> Does extending Python

Re: Converting milliseconds to human time

2006-01-06 Thread Harlin Seritt
Thanks Dan, that would be perfect or close enough I should say. :-) Regards, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Martin v. Löwis
Paul Rubin wrote: > http://docs.python.org/lib/module-dl.html > would seem to also do that. That's correct. It has the same (unhealable) flaw. No surprise, though: it provides the same functionality. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: libpython2.4.so

2006-01-06 Thread Martin v. Löwis
Heiko Wundram wrote: >>>what is /usr/lib/libpython2.4.so used for? >> >>Nothing, usually. Things embedding python might use it, such as vim. > > > At least the interpreter uses it on systems where it's enabled... That depends on the system: [EMAIL PROTECTED]:~$ ls -l /usr/lib/libpython2.4.so lr

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Martin v. Löwis
Paul Watson wrote: > I need to call GetVersionInfo() and handle VERSIONINFO information. I > thought that distutils might have something, but I do not see it yet. > Any suggestions? You could write this specific API in VB, and then run cscript.exe in a pipe; or you could write a wrapper module ju

Re: Spelling mistakes!

2006-01-06 Thread skip
>> > Duh. Next time I use a dictionary before freezing an API! >> Can you please explain what you mean by that? Use a dictionary how? Paul> Use a dictionary by looking up words in it to check the spelling. I think the most widely spread API misspelling must be "referer", as in the H

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread Claudio Grondi
Martin v. Löwis wrote: > You can get somewhat faster in Python than your code if you avoid > producing new long objects all the time, and do the task in chunks of 30 > bits. It would be nice if you could explain why you consider chunks of 30 bits to be superior e.g. to chunks of 32 bits? > write

Re: Spelling mistakes!

2006-01-06 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Duh. Next time I use a dictionary before freezing an API! > Can you please explain what you mean by that? Use a dictionary how? Use a dictionary by looking up words in it to check the spelling. -- http://mail.python.org/mailman/listinfo/python-list

Re: Spelling mistakes!

2006-01-06 Thread Steven D'Aprano
On Fri, 06 Jan 2006 17:23:27 -0600, Terry Hancock wrote: > I once misspelled a name in a set of API methods, which was > very embarrassing (I spelled "fovea" as "fovia"). So then I > had to go through and change it, and report it in as an API > change so that a "patch" became a "minor version upg

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Paul Rubin
Neil Hodgson <[EMAIL PROTECTED]> writes: > No. It is the responsibility of the extension author to ensure > that there is no possibility of crashing Python. With ctypes, you have > a generic mechanism that enables Python code to cause a crash. http://docs.python.org/lib/module-dl.html would se

Re: Translate this to python?

2006-01-06 Thread Steven D'Aprano
On Fri, 06 Jan 2006 17:28:22 +0100, Xavier Morel wrote: > Heiko Wundram wrote: >> Xavier Morel wrote: >>> I think that xrange is also soon-to-be deprecated (xrange eats a little >>> less memory and is slightly faster to _create_, but much slower to >>> _iterate over_ than range) >> >> It might be

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Neil Hodgson
Paul Watson: > Neil Hodgson wrote: >>It is unlikely that ctypes will be included in the standard Python >> build as it allows unsafe memory access making it much easier to crash >> Python. > Does extending Python with any C/C++ function not do the same thing? No. It is the responsibilit

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Paul Watson
Martin v. Löwis wrote: > Paul Watson wrote: > >>I need to call some Windows APIs. Is the only way to download ctypes or >>the win32 interfaces? > > > That depends on the specific win32 interface you want to call. > Typically, the answer is "yes". I have used _winreg and I see winsound in the d

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Paul Watson
Neil Hodgson wrote: >Paul Watson: > >> Is there any plan to get ctypes batteries into the standard Python build? > > >It is unlikely that ctypes will be included in the standard Python > build as it allows unsafe memory access making it much easier to crash > Python. Does extending Py

Re: libpython2.4.so

2006-01-06 Thread Shane Hathaway
Levi Campbell wrote: > what is /usr/lib/libpython2.4.so used for? > On many systems, it is the core of Python, and /usr/bin/python2.4 is a small wrapper around it. Here's what I see on my box: [EMAIL PROTECTED] usr]$ ls -l bin/python2.4 lib/libpython2.4.so.1.0 -rwxr-xr-x 1 root root4072 O

Re: python speed

2006-01-06 Thread Jorgen Grahn
On Thu, 29 Dec 2005 00:41:58 +0100, Andreas Kostyrka <[EMAIL PROTECTED]> wrote: [on research supposedly proving that Python is faster than C, Java and Fortran and assembly] > Well, it's easy enough to "prove". > > Take one aspect of Python: Automatic memory management via reference > counting. >

Re: libpython2.4.so

2006-01-06 Thread Heiko Wundram
"Martin v. Löwis" wrote: >> what is /usr/lib/libpython2.4.so used for? > Nothing, usually. Things embedding python might use it, such as vim. At least the interpreter uses it on systems where it's enabled... [EMAIL PROTECTED] ~ $ ldd /usr/bin/python2.4 libpython2.4.so.1.0 => /usr/lib/libp

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Martin v. Löwis
Paul Rubin wrote: >>To my knowledge, ctypes has never been contributed to Python, >>either, so its author apparently has no plan, either. > > > Has anyone from Python.org asked him or her? I can't answer that question. I haven't (and I personally share Neil Hodgson's reservation wrt. to the poss

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread Martin v. Löwis
Claudio Grondi wrote: > The question is if Python allows somehow access to the bytes of the > representation of a long integer or integer in computers memory? Not sure what you mean by "Python", and "allows" here. I allow you :-) To do so, write a C file that is a Python module, and accesses the

Re: Encoding sniffer?

2006-01-06 Thread Neil Hodgson
Ralf Muschall: > Diez B. Roggisch wrote: >>AFAIK iso-8859-1 has all codepoints taken - so you won't go beyond that >>in your example. > IIRC the range 128-159 (i.e. control codes with the high bit set) > are unused. ISO 8859-1 and ISO-8859-1 (extra hyphen) differ in that ISO-8859-1 inclu

Re: JINI service -- Python client

2006-01-06 Thread Roedy Green
On 6 Jan 2006 11:17:58 -0800, [EMAIL PROTECTED] wrote, quoted or indirectly quoted someone who said : >does anybody knows how to use JINI service from Python? IF you use it from JPython, it is almost identical to using it from Java. See http://mindprod.com/jgloss/jini.html http://mindprod.com/j

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > To my knowledge, ctypes has never been contributed to Python, > either, so its author apparently has no plan, either. Has anyone from Python.org asked him or her? -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Neil Hodgson
Paul Watson: > Is there any plan to get ctypes batteries into > the standard Python build? It is unlikely that ctypes will be included in the standard Python build as it allows unsafe memory access making it much easier to crash Python. Neil -- http://mail.python.org/mailman/list

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Martin v. Löwis
Paul Watson wrote: > I need to call some Windows APIs. Is the only way to download ctypes or > the win32 interfaces? That depends on the specific win32 interface you want to call. Typically, the answer is "yes". > Is there any plan to get ctypes batteries into the standard Python build? I don't

Re: question about mutex.py

2006-01-06 Thread m_palmer45
yes, I read it, and I even know about threading's existence. I just thought that if something claims to be atomic, it better should be. -- http://mail.python.org/mailman/listinfo/python-list

Re: Spelling mistakes!

2006-01-06 Thread Terry Hancock
On 6 Jan 2006 07:30:41 -0800 "KraftDiner" <[EMAIL PROTECTED]> wrote: > I've spent hours trying to find a bug that was a simple > spelling mistake. You're not the first. ;-) > in an init method I declare a variable self.someLongName > > later in a different method of the class I use > self.sumLo

Re: libpython2.4.so

2006-01-06 Thread Martin v. Löwis
Levi Campbell wrote: > what is /usr/lib/libpython2.4.so used for? Nothing, usually. Things embedding python might use it, such as vim. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: config errors on Freebsd and python 2.3

2006-01-06 Thread Martin v. Löwis
David Bear wrote: > I don't plan on using curses -- so I'd like to ignore this. But, I'm just > wondering if there is an 'easy' fix... Not really, no. It's safe to ignore. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Calling foreign functions from Python? ctypes?

2006-01-06 Thread Paul Watson
I need to call some Windows APIs. Is the only way to download ctypes or the win32 interfaces? Is there any plan to get ctypes batteries into the standard Python build? -- http://mail.python.org/mailman/listinfo/python-list

Re: MVC programming with python (newbie) - please help

2006-01-06 Thread Gerard Flanagan
bwaha wrote: > I'd appreciate some experience from the gurus out there to help me > understand how to implement MVC design in python code. > Model class Study(object): def __init__(self, name, file): self.name = name self.file = file class Project(object):

Re: question about mutex.py

2006-01-06 Thread Jean-Paul Calderone
On 6 Jan 2006 14:44:39 -0800, [EMAIL PROTECTED] wrote: >Hi, I was looking at the code in the standard lib's mutex.py, which is >used for queuing function calls. Here is how it lets you acquire a >lock: Did you read the module docstring? Of course, no multi-threading is implied -- hence the fu

libpython2.4.so

2006-01-06 Thread Levi Campbell
what is /usr/lib/libpython2.4.so used for? -- http://mail.python.org/mailman/listinfo/python-list

question about mutex.py

2006-01-06 Thread m_palmer45
Hi, I was looking at the code in the standard lib's mutex.py, which is used for queuing function calls. Here is how it lets you acquire a lock: def testandset(self): """Atomic test-and-set -- grab the lock if it is not set, return True if it succeeded.""" if not self.l

Re: MVC programming with python (newbie) - please help

2006-01-06 Thread Frank Niessink
bwaha wrote: > > At some level this seems to me like the class ListDataModel above. I just > need to make a MyTreeControl class. However here GS(et) routines are > implemented in the ProjectFileDecoder class (data model?) whereas in the > earlier advice they are in class MyCoolListControl. So I'm

Re: Help Please: 'module' object has no attribute 'compile'

2006-01-06 Thread Kent Johnson
livin wrote: > my log... > > INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp', > urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On > %2C+100&x=4&y=6'})) > INFO > INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen > INFO File "Q:\python\python23.zli

Re: nesting for statements?

2006-01-06 Thread freeh (sent by Nabble.com)
this seems you are finding tough time to solve a rather easy prob, just use the following idea: L=3 a=1 while a                b=1         while b                                c=1                 while c                                                name = chr(ord('a') + c)                    

Help Please: 'module' object has no attribute 'compile'

2006-01-06 Thread livin
my log... INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp', urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On %2C+100&x=4&y=6'})) INFO INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen INFO File "Q:\python\python23.zlib\urllib.py", line 159, in op

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > I don't know of a way to directly access the internal structure of a > long, but you can speed up your example. > > First, is the order of the commands > > >> i=i>>1 >> lstBitsBitwiseAnd.append(i&0x01) > > > what you intend? The first low order bit is discarded bec

bug in Tkinter (FIX)

2006-01-06 Thread Ed Blake
It's my first time posting to the list so I hope I don't sound like an idiot! The other day I was looking for a way to keep track of whether a user had changed the contents of a Tk text widget. After a little bit of searching I found edit_modified. This should let me get/set the modified flag o

Newbie Question: CSV to XML

2006-01-06 Thread ProvoWallis
Hi, I'm learning more and more about Python all the time but I'm still a real newbie. I wrote this little script to convert CSV to XML and I was hoping to get some feedback on it if anyone was willing to comment. It works but I was wondering if there was anything I could do better. E.g., incorpor

Re: Python based Compiler tools

2006-01-06 Thread Kent Johnson
Doru-Catalin Togea wrote: > Hi! > > I have some experience with PLY. What other alternatives are there, and > which is the "best" (that is most feature rich, easiest to use, ...)? Here is a list: http://www.nedbatchelder.com/text/python-parsers.html pyparsing is easy to use IMO. Kent -- http:

Re: Application architecture (long post - sorry)

2006-01-06 Thread Mike Meyer
[EMAIL PROTECTED] writes: > All these web technologies I don't know where to start, have you got > any suggestions for getting started in the world of web development, > books maybe ? Sorry, but I can't recommend books on this. I learned it before the books existed, so what I learned it from won't

Re: Newbie Question: CSV to XML

2006-01-06 Thread Max Erickson
"ProvoWallis" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi, > > I'm learning more and more about Python all the time but I'm still a > real newbie. I wrote this little script to convert CSV to XML and I was > hoping to get some feedback on it if anyone was willing to comment. > >

Re: Converting milliseconds to human time

2006-01-06 Thread Max Erickson
the hard way(in that you have to do it yourself): def prntime(ms): s=ms/1000 m,s=divmod(s,60) h,m=divmod(m,60) d,h=divmod(h,24) return d,h,m,s >>> print '%d days %d hours %d minutes %d seconds' % prntime(100) 0 days 0 hours 16 minutes 40 seconds >>> pri

Re: Inheritance problem?

2006-01-06 Thread Scott David Daniels
KraftDiner wrote: > So ok I've written a piece of code that demonstrates the problem. > Can you suggest how I change the Square class init? > > class Shape(object): > def __init__(self): > print 'MyBaseClass __init__' > > class Rectangle(Shape): > def __init__(self): > #

psexec and os.popen help

2006-01-06 Thread dennis . scales
I'm trying to wrap a psexec command in a python script so I can capture the results and generate an exception report. The problem I'm having is that when I use x = os.popen("command") to do it, it runs, but the content of x is empty. I know there should be output sent to it, because when I run the

Re: Inheritance problem?

2006-01-06 Thread Pierre Barbier de Reuille
KraftDiner a écrit : > So ok I've written a piece of code that demonstrates the problem. > Can you suggest how I change the Square class init? > > class Shape(object): > def __init__(self): > print 'MyBaseClass __init__' > > class Rectangle(Shape): > def __init__(self):

Re: Filename case-insensitivity on OS X

2006-01-06 Thread Dan Lowe
On Jan 6, 2006, at 1:13 PM, Mark Jackson wrote: > Dan Lowe <[EMAIL PROTECTED]> writes: > >> Think about it - how many things used by average people are case >> sensitive? Passwords? That's about it. (And judging by most user >> passwords I have seen, they're almost all lowercase anyway.) Email >>

Re: Converting milliseconds to human time

2006-01-06 Thread Dan Bishop
Harlin Seritt wrote: > I would like to take milliseconds and convert it to a more > human-readable format like: > > 4 days 20 hours 10 minutes 35 seconds > > Is there something in the time module that can do this? I havent been > able to find anything that would do it. The datetime module has some

Re: Translate this to python?

2006-01-06 Thread Robert Kern
Heiko Wundram wrote: > Xavier Morel wrote: > >>While the deprecation of xrange is not that "soon", it is part of the >>Python 3000 PEP (http://www.python.org/peps/pep-3000.html#id38) along >>with the deprecation of most FP-facilities of Python (filter, map, >>reduce). > > I know this, and that's

Re: Spelling mistakes!

2006-01-06 Thread skip
>> try this: >> class x(object): >>def __init__(self): >> self.someName = "hello" >>def someMethod(self): >> self.sumName = "bye" >> find that bug. Aside from the other responses (unittests, pychecker/pylint), you might also consider using __slots_

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-06 Thread Mike Meyer
Xavier Morel <[EMAIL PROTECTED]> writes: > Ilias Lazaridis wrote: > > thus if I make a typo, I create a new attribute? > Why yes of course, what were you expecting? Actually, it's not quite that way. If you make a typo reading an attribute, you'll create an exception. There are languages where ma

Re: Try Python update

2006-01-06 Thread Mike Meyer
Xavier Morel <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> The url is http://www.mired.org/home/mwm/try_python/. Reports of >> problems would appreciated. >> If you want to try an online P{ython tool that lets you save code, >> try >> Devan L's at http://www.datamech.com/devan/trypython/trypyt

JINI service -- Python client

2006-01-06 Thread asmirnov1234567890
Hi does anybody knows how to use JINI service from Python? Regards, Andrei -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding sniffer?

2006-01-06 Thread Ralf Muschall
Diez B. Roggisch wrote: > AFAIK iso-8859-1 has all codepoints taken - so you won't go beyond that > in your example. IIRC the range 128-159 (i.e. control codes with the high bit set) are unused. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Java or maybe PHP?

2006-01-06 Thread Mike Meyer
Xavier Morel <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> That doesn't sounds like "hates" to me. More like "doesn't like the >> baggage." >> Yet anonymous functions are nice. > > Wouldn't it be possible to change the `def` statement to return a > reference to the function, and allow

Converting milliseconds to human time

2006-01-06 Thread Harlin Seritt
I would like to take milliseconds and convert it to a more human-readable format like: 4 days 20 hours 10 minutes 35 seconds Is there something in the time module that can do this? I havent been able to find anything that would do it. Thanks, Harlin Seritt -- http://mail.python.org/mailman/li

Re: Inheritance problem?

2006-01-06 Thread KraftDiner
So ok I've written a piece of code that demonstrates the problem. Can you suggest how I change the Square class init? class Shape(object): def __init__(self): print 'MyBaseClass __init__' class Rectangle(Shape): def __init__(self): super(self.__clas

Re: Microsoft IronPython?

2006-01-06 Thread Luis M. González
I think that this posted message in Jim Hugunin's weblog clearly shows what are Microsoft intentions regarding Python and other dynamic languages: http://blogs.msdn.com/hugunin/archive/2006/01/05/509812.aspx We're hiring full-time and summer interns! We're looking for a few exceptionally talented

Re: Removing Duplicate entries in a file...

2006-01-06 Thread Mike Meyer
"sri2097" <[EMAIL PROTECTED]> writes: > Hi all, I'm storing number of dictionary values into a file using the > 'cPickle' module and then am retrieving it. The following is the code > for it - > > # Code for storing the values in the file > import cPickle > > book = {raw_input("Name: "): [int(raw_

Re: Translate this to python?

2006-01-06 Thread Heiko Wundram
Xavier Morel wrote: > While the deprecation of xrange is not that "soon", it is part of the > Python 3000 PEP (http://www.python.org/peps/pep-3000.html#id38) along > with the deprecation of most FP-facilities of Python (filter, map, > reduce). I know this, and that's one of the reasons I'm a littl

Re: Copy an Object (Again?)

2006-01-06 Thread Schüle Daniel
I was not very clear about it > or even if you "could" copy instances > > class X: > def __init__(self, filename = "/path/file") > self.file = file(filename, "w+") > def modifyByteAt(offset): > self.file.tell(offset) > self.file.write("X") > > this is untested pse

Re: Copy an Object (Again?)

2006-01-06 Thread Ernst Noch
KraftDiner wrote: > I'm having trouble getting a copy of and object... (a deep copy) > > I'm writing a method that creates a mirror image of an object (on > screen) > In order to do this i need to get a copy of the object and then modify > some > of its attributes. > > I tried: > objs = myListOfO

Re: Filename case-insensitivity on OS X

2006-01-06 Thread Mark Jackson
Dan Lowe <[EMAIL PROTECTED]> writes: > Think about it - how many things used by average people are case > sensitive? Passwords? That's about it. (And judging by most user > passwords I have seen, they're almost all lowercase anyway.) Email > addresses, URLs, the search box in Google, your AO

Re: PythonWin: logging module not showing messages from imported modules

2006-01-06 Thread jmdeschamps
[EMAIL PROTECTED] wrote: > Having the following code: > > Module1.py > import logging > def X(): > logging.error('test') > > If I import it into PythonWin console and call X(), the error message > is not printed. If I do the same in Python console the message is > printed. Do I need to

Re: Filename case-insensitivity on OS X

2006-01-06 Thread Dan Lowe
On Jan 3, 2006, at 9:50 PM, Tom Anderson wrote: > On Tue, 3 Jan 2006, Dan Sommers wrote: > >> On Tue, 03 Jan 2006 15:21:19 GMT, >> Doug Schwarz <[EMAIL PROTECTED]> wrote: >> >>> Strictly speaking, it's not OS X, but the HFS file system that is >>> case >>> insensitive. > > Aaah, of course. Why

Re: Copy an Object (Again?)

2006-01-06 Thread Schüle Daniel
KraftDiner wrote: > I'm having trouble getting a copy of and object... (a deep copy) > > I'm writing a method that creates a mirror image of an object (on > screen) > In order to do this i need to get a copy of the object and then modify > some > of its attributes. > > I tried: > objs = myListOfO

Re: Is 'everything' a refrence or isn't it?

2006-01-06 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I'll tell you what I say: Python passes objects to functions or > assignments. > > Does this mean that the object is copied? No, I didn't say it copies > objects. I left the nature of the passing mechanism unspoken, whi

Missing libpython2.4.so during build of python 2.4.2 on AIX 5.1

2006-01-06 Thread HajoEhlers
Hi folks, maybe somebody can help. I am trying to build python 2.4.2 on AIX 5.1 with gcc 3.3.2 The build option for python are: $ ./configure \ --enable-unicode \ --enable-shared \ --with-gcc \ --mandir=/usr/local/man \ --infodir=/usr/local/info After make i see a libpython2.4

  1   2   >