Re: How much introspection is implementation dependent?

2007-02-03 Thread James Stroud
George Sakkis wrote: > On Feb 2, 6:56 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I wanted to automagically generate an instance of a class from a >> dictionary--which might be generated from yaml or json. I came up with this: >> >> (snip) >> >> == >> >> #! /usr/bin/env python >>

Re: How much introspection is implementation dependent?

2007-02-03 Thread James Stroud
George Sakkis wrote: > On Feb 2, 6:56 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I wanted to automagically generate an instance of a class from a >> dictionary--which might be generated from yaml or json. I came up with this: >> >> (snip) >> >> == >> >> #! /usr/bin/env python >>

How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread John Nagle
How do I suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead". A library is triggering this message, the library is being fixed, but I need to make the message disappear from the output of a CGI program. John Nagle -- http://mail.p

nokia pys60 contacts + calendar

2007-02-03 Thread worlman385
anyone could give a hint on adding new entry to nokia phone's contact list and calendar what function in pys60 python modules would make this working or any examples on how to make this work thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Where Does One Begin?

2007-02-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > pygame is probily a good program to start with as long as you keep in > mind that it is possible that up to 50% of the p.c. laptops may not be > able to run it. Huh? Care to explain this? Ciao, Marc 'BlackJack' Rintsch -- http://mail.p

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-03 Thread John Barrett
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 2, 10:32 pm, "John Barrett" <[EMAIL PROTECTED]> wrote: >> <[EMAIL PROTECTED]> wrote in message > >> >> > [snip] >> >> > Run your "experiment" again but add some pure oxygen such as was >> >> > escaping from the on-board breathi

Regd. Regular expressions PyQt

2007-02-03 Thread vishal
Hello All: I am trying to work out a regular expression in a PyQt environment for time in hh:mm:ss format. Any suggestions? Thanks, Vishal -- http://mail.python.org/mailman/listinfo/python-list

Re: Build Python 2.5 wit VC6.0 ?

2007-02-03 Thread Martin v. Löwis
Alexander Eisenhuth schrieb: > does somebody have experience in building with VC6.0. On my first try > there where missing C-Modules. Is that true. VC6.0 is not supported? It is supported, but not actively maintained. Contributions are welcome. Try the 2.5 maintenance branch first, though; it may

Re: main

2007-02-03 Thread Ben Finney
[EMAIL PROTECTED] writes: > is the main function in python is exact compare to Java main method? > all execution start in main which may takes arguments? There's no such thing in Python; a module is executed sequentially, with no particular regard to the names of any of the attributes. There is,

Re: main

2007-02-03 Thread Gabriel Genellina
En Sat, 03 Feb 2007 02:37:11 -0300, Paddy <[EMAIL PROTECTED]> escribió: >> and what is >> __name__ >> __main__ >> >> use for in terms of Java? >> > > With respect, (hehe), maybe you need to indicate that you've searched > the Python documentation on __name__ and __main__? > (Hah! I did that with

Re: from __future__ import absolute_import ?

2007-02-03 Thread Peter Otten
Ron Adam wrote: > Peter Otten wrote: >> Ron Adam wrote: >> >>> from __future__ import absolute_import >>> >>> Is there a way to check if this is working? I get the same results with >>> or without it. >>> >>> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) >>> [MSC v.1310 32 bit (Intel

Re: Regd. Regular expressions PyQt

2007-02-03 Thread Paddy
On Feb 3, 8:24 am, [EMAIL PROTECTED] wrote: > Hello All: > I am trying to work out a regular expression in a PyQt environment for > time in hh:mm:ss format. Any suggestions? > Thanks, > Vishal Yep, Use Kodos! http://kodos.sourceforge.net/ - It's Fab. - Paddy. -- http://mail.python.org/mailman/

Re: Python does not play well with others

2007-02-03 Thread Ben Finney
Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes: > Since Python is being touted as good for web apps as a competitor to > PHP Python is being touted as a good language for *many* purposes, not just web applications. Python is also a "competitor" to Java, to Ruby, to Perl, to many other languag

Regd. Kodos

2007-02-03 Thread vishal
I am trying to use Kodos..but not getting thru'..dont know whats goin on..does anyone have a regular expression for time in hh:mm:ss -Vishal -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-03 Thread John Barrett
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 2, 10:32 pm, "John Barrett" <[EMAIL PROTECTED]> wrote: >> <[EMAIL PROTECTED]> wrote in message > >> >> > [snip] >> >> > Run your "experiment" again but add some pure oxygen such as was >> >> > escaping from the on-board breathi

Re: python bracket

2007-02-03 Thread Gabriel Genellina
En Sat, 03 Feb 2007 02:48:45 -0300, <[EMAIL PROTECTED]> escribió: > there is no bracket in python > > how can i know where a loop or a function ends? You should read some introductory texts at least. You can find the Python Tutorial inside your Python install, or you can read it online at http:

Re: main

2007-02-03 Thread Paddy
On Feb 3, 8:51 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 03 Feb 2007 02:37:11 -0300, Paddy <[EMAIL PROTECTED]> > escribió: > > >> and what is > >> __name__ > >> __main__ > > >> use for in terms of Java? > > > With respect, (hehe), maybe you need to indicate that you've searched >

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-03 Thread John Barrett
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 2, 10:32 pm, "John Barrett" <[EMAIL PROTECTED]> wrote: >> <[EMAIL PROTECTED]> wrote in message > >> >> > [snip] >> >> > Run your "experiment" again but add some pure oxygen such as was >> >> > escaping from the on-board breathi

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread Peter Otten
John Nagle wrote: >How do I suppress "DeprecationWarning: Old style callback, use >cb_func(ok, > store) instead". A library is triggering this message, the library is > being fixed, but I need to make the message disappear from the output of a > CGI program. import warnings warnings.filt

Re: Regd. Kodos

2007-02-03 Thread Paddy
On Feb 3, 8:59 am, [EMAIL PROTECTED] wrote: > I am trying to use Kodos..but not getting thru'..dont know whats goin > on..does anyone have a regular expression for time in hh:mm:ss > -Vishal Well, with just knowing the above, the following raw string when used as a regular expression will capture

Re: Regd. Kodos

2007-02-03 Thread Paddy
On Feb 3, 9:17 am, "Paddy" <[EMAIL PROTECTED]> wrote: > On Feb 3, 8:59 am, [EMAIL PROTECTED] wrote: > > > I am trying to use Kodos..but not getting thru'..dont know whats goin > > on..does anyone have a regular expression for time in hh:mm:ss > > -Vishal > > Well, with just knowing the above, the f

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread Gabriel Genellina
En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: > John Nagle wrote: > >>How do I suppress "DeprecationWarning: Old style callback, use >>cb_func(ok, >> store) instead". A library is triggering this message, the library is >> being fixed, but I need to make

pyYaml community

2007-02-03 Thread Imbaud Pierre
I began using pyYaml. I found no place where pyYaml users exchange ideas, know-how, etc (as here for python). There is a wiki, a bug tracker, documentation, but such a place (mailing list, newsgroup, forum, or even IRC) is a must (IMHO) to smooth the learning curve. Does someone know better? My c

Create a cookie with cookielib

2007-02-03 Thread Alessandro Fachin
Hi, i am trying to forge a new cookie by own with cookielib. But i don't still have success. This a simply code: import cookielib, urllib, urllib2 login = 'Ia am a cookie!' cookiejar = cookielib.CookieJar() urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar)) values = {'user':l

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread Neil Cerutti
On 2007-02-03, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]> > escribió: > >> John Nagle wrote: >> >>>How do I suppress "DeprecationWarning: Old style callback, use >>>cb_func(ok, >>> store) instead". A library is trigg

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread Peter Otten
Gabriel Genellina wrote: > En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]> > escribió: > >> John Nagle wrote: >> >>>How do I suppress "DeprecationWarning: Old style callback, use >>>cb_func(ok, >>> store) instead". A library is triggering this message, the library is

Re: nokia pys60 contacts + calendar

2007-02-03 Thread cyberco
You can most likely find an answer on Nokia's Python forum: http://discussion.forum.nokia.com/forum/forumdisplay.php?f=102 And if there's no answer there you should post the question there :) -- http://mail.python.org/mailman/listinfo/python-list

wxPython: TextCtrl delayed update when using TE_RICH(2)

2007-02-03 Thread citronelu
I made a small wxPython app that retrieves web data; for visual logging I use a TextCtrl widget, and stdout is redirected to it, something like this: class RedirectOutput: def __init__(self, objectTxtCtrl): self.out = objectTxtCtrl def write(self, string): self.out.WriteTe

HELP NEEDED ... Regd. Regular expressions PyQt

2007-02-03 Thread vishal
Hello All: I am trying to work out a regular expression in a PyQt environment for time in hh:mm:ss format. Any suggestions? Thanks, Vishal -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP NEEDED ... Regd. Regular expressions PyQt

2007-02-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello All: > I am trying to work out a regular expression in a PyQt environment for > time in hh:mm:ss format. Any suggestions? Yes. Read the manual to the re-module. There is _nothing_ special about PyQt and regexes. And provide code. But the most important thing - r

Python 2.5 Quick Reference

2007-02-03 Thread Dick Moores
Is this reliable? (Looks good to me, but...) Thanks, Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

Re: compound statement from C "?:"

2007-02-03 Thread Jussi Salmela
[EMAIL PROTECTED] kirjoitti: > Jussi Salmela: >> In this particular case you don't need the ternary operator: >> print "I saw %d car%s\n" % (n, ("", "s")[n != 1]) > > The last newline is probably unnecessary. This seems be a bit more > readable: > print "I saw", n, "car" + ("", "s")[n != 1] > > W

Re: Python 2.5 Quick Reference

2007-02-03 Thread Robin Becker
Dick Moores wrote: > > Is this reliable? (Looks good to me, but...) > . I really like these for a good overview -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Where Does One Begin?

2007-02-03 Thread Michael
George Sakkis wrote: > On Feb 2, 3:39 pm, Mister Newbie <[EMAIL PROTECTED]> wrote: > >> I have no programming experience. I want to learn Python so I can make >> simple, 2D games. Where should I start? Can you recommend a good book? >> >> Thank you. > > http://www.amazon.com/Game-Programming-Pyt

Re: Where Does One Begin?

2007-02-03 Thread Michael
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > >> pygame is probily a good program to start with as long as you keep in >> mind that it is possible that up to 50% of the p.c. laptops may not be >> able to run it. > > Huh? Care to explain this? I'd apprec

Re: Find and replace in a file with regular expression

2007-02-03 Thread Frederic Rentsch
TOXiC wrote: > Hi everyone, > First I say that I serched and tryed everything but I cannot figure > out how I can do it. > I want to open a a file (not necessary a txt) and find and replace a > string. > I can do it with: > > import fileinput, string, sys > fileQuery = "Text.txt" > sourceText = '

Vim scripting with python

2007-02-03 Thread Tool69
Hi, I saw several old posts speaking of vim scripting in Python. This one in particular : http://www.velocityreviews.com/forums/t351303-re-pythonising-the-vim-eg-syntax-popups-gt-vimpst.html But I didn't find where to put this "vimrc.py" on my Windows machine. My "normal" _vimrc file is in C:\Doc

Re: Python 2.5 Quick Reference

2007-02-03 Thread Dick Moores
At 04:02 AM 2/3/2007, Robin Becker wrote: >Dick Moores wrote: > > > > Is this reliable? (Looks good to me, but...) > > >. > >I really like these for a good overview So it looks accurate? Dick Moores -- http://mail.python.org/mailman/listinfo/python-

strange test for None

2007-02-03 Thread karoly.kiripolszky
in my server i use the following piece of code: ims = self.headers["if-modified-since"] if ims != None: t = int(ims) and i'm always getting the following error: t = int(ims) ValueError: invalid literal for int(): None i wanna know what the hell is goi

strange test for None

2007-02-03 Thread karoly.kiripolszky
in my server i use the following piece of code: ims = self.headers["if-modified-since"] if ims != None: t = int(ims) and i'm always getting the following error: t = int(ims) ValueError: invalid literal for int(): None i wanna know what the hell is goi

Re: strange test for None

2007-02-03 Thread karoly.kiripolszky
forgot to mention my interpreter version: 2.4.4 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 Quick Reference

2007-02-03 Thread skip
Dick> Respondent> I really like these for a good overview Dick> So it looks accurate? He's been doing it awhile: http://rgruet.free.fr/ I think he's got the drill down pretty well by now... ;-) Skip -- http://mail.python.org/mailman/l

Re: Python 2.5 Quick Reference

2007-02-03 Thread Peter Otten
Dick Moores wrote: > At 04:02 AM 2/3/2007, Robin Becker wrote: >>Dick Moores wrote: >> > >> > Is this reliable? (Looks good to me, but...) >> > >>. >> >>I really like these for a good overview > > So it looks accurate? After perusing it, I dare say t

Re: strange test for None

2007-02-03 Thread skip
> "karoly" == karoly kiripolszky writes: karoly> in my server i use the following piece of code: karoly> ims = self.headers["if-modified-since"] karoly> if ims != None: karoly> t = int(ims) karoly> and i'm always getting the followi

Re: compound statement from C "?:"

2007-02-03 Thread Peter Otten
Jussi Salmela wrote: > [EMAIL PROTECTED] kirjoitti: >> Jussi Salmela: >>> In this particular case you don't need the ternary operator: >>> print "I saw %d car%s\n" % (n, ("", "s")[n != 1]) >> >> The last newline is probably unnecessary. This seems be a bit more >> readable: >> print "I saw", n, "

Re: strange test for None

2007-02-03 Thread Peter Otten
karoly.kiripolszky wrote: > in my server i use the following piece of code: > > ims = self.headers["if-modified-since"] > if ims != None: > t = int(ims) > > and i'm always getting the following error: > > t = int(ims) > ValueError: invalid literal for

Re: Regd. Regular expressions PyQt

2007-02-03 Thread David Boddie
On Saturday 03 February 2007 09:52, Paddy wrote: > On Feb 3, 8:24 am, [EMAIL PROTECTED] wrote: >> I am trying to work out a regular expression in a PyQt environment for >> time in hh:mm:ss format. Any suggestions? > > Yep, > Use Kodos! > http://kodos.sourceforge.net/ > > - It's Fab. There's al

Re: Python does not play well with others

2007-02-03 Thread Szabolcs Nagy
Paul Rubin wrote: > "George Sakkis" <[EMAIL PROTECTED]> writes: > > > What does "batteries included" mean to you? To me, it means you don't > > > have to install add-ons. > > > > So let's make a 500MB executable and add Numpy, Zope, Django, PIL, > > pretty much everything actually. Even better, m

Re: strange test for None

2007-02-03 Thread rzed
"karoly.kiripolszky" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > in my server i use the following piece of code: > > ims = self.headers["if-modified-since"] > if ims != None: > t = int(ims) > > and i'm always getting the following error: > >

Re: urllib2 hangs "forever" where there is no network interface

2007-02-03 Thread John J. Lee
(I'm having news trouble, sorry if anybody sees a similar reply three times...) "dumbkiwi" <[EMAIL PROTECTED]> writes: > On Feb 2, 5:02 am, [EMAIL PROTECTED] (John J. Lee) wrote: > > "dumbkiwi" <[EMAIL PROTECTED]> writes: [...] > > > If there is no network interface, urllib2 hangs for a very long

Re: What is the Decisive "Clash" of Our Time?

2007-02-03 Thread Overlord
Another conspiracy theory nutterYou guys are so boring. OL <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Forget about the lunacy ... just enjoy these fun movies that are also > on optics education. You can also save them by right clicking the > links and saving them as flv f

Re: newbie question: ftp.storbinary()

2007-02-03 Thread Ayaz Ahmed Khan
"Scott Ballard" typed: > Sorry for the lame question, I'm still trying to pick up Python and new to > the list here. > > Question: > I'm trying to write a python script that will access an FTP site and upload > some files. I've gotten everything working except for the actual uploading > of the

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-03 Thread stj911
On Feb 3, 1:08 am, "John Barrett" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > On Feb 2, 10:32 pm, "John Barrett" <[EMAIL PROTECTED]> wrote: > >> <[EMAIL PROTECTED]> wrote in message > > >> >> > [snip] > >> >> > Run your "experiment" again b

Re: compound statement from C "?:"

2007-02-03 Thread Jussi Salmela
Peter Otten kirjoitti: > Isn't that obvious? Don't do it in one line: > > if n == 1: > print "I saw a car" > else: > print "I saw %d cars" % n > > I guess that most of us will have read, understood, and verified (are there > any errors or cases that should be covered but aren't) those fou

Re: What is the Decisive "Clash" of Our Time?

2007-02-03 Thread stj911
On Feb 3, 7:09 am, "Overlord" <[EMAIL PROTECTED]> wrote: > Another conspiracy theory nutterYou guys are so boring. > > OL > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Forget about the lunacy ... just enjoy these fun movies that are also > > on optics education. You

How can I access data from MS Access?

2007-02-03 Thread Finger . Octopus
How to access data from MS Access? I tried ADOdb for Python but it doesn't seems to work. Even the official examples dont work, like this one: import adodb conn = adodb.NewADOConnection('access') # mxodbc required dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\inetpub\\adodb\ \northwind.

Re: compound statement from C "?:"

2007-02-03 Thread Peter Otten
Jussi Salmela wrote: > It's naturally clear that a combination of if-elifs-else is more > adaptable to different situations, but the OP's question was: > > I would like to do the equivalent if python of the C line: > printf("I saw %d car%s\n", n, n != 1 ? "s" : "") And my answer, triggered by yo

Re: Python does not play well with others

2007-02-03 Thread Paul Rubin
Ben Finney <[EMAIL PROTECTED]> writes: > > Since Python is being touted as good for web apps as a competitor to > > PHP > > Python is being touted as a good language for *many* purposes, not > just web applications. Python is also a "competitor" to Java, to Ruby, > to Perl, to many other languages

Re: Python does not play well with others

2007-02-03 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > This is simply not true. J2SE doesn't include a web-framework. J2EE > does, but it's a separate multi-megabyte-download. I thought J2SE comes with JSP. Maybe that's not a "framework" in the fancy sense though. > PHP _is_ a web centered language, s

Re: Python does not play well with others

2007-02-03 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I can't speak authoritatively for either PHP or J2SE, but I suspect the > latter at least has some signifiant monetary support (if not outright gobs > of human resources) from Sun. PHP seems to have a more limited application > domain (web apps) from which it has expand

CTypes

2007-02-03 Thread [EMAIL PROTECTED]
I'm trying to install PyWinAuto for Python 2.4. It said that one of the required libraries that I need to install would be CTypes. So I head over to CTypes's SourceForge page and I installed CTypes for Python 2.4. I go to run the PyWinAuto installation file and it throws up this error: C:\WINDOWS\

Re: Python does not play well with others

2007-02-03 Thread Paul Rubin
[EMAIL PROTECTED] writes: > iceberg.) The Pylons, web.py, Karrigell, Webware and TurboGears people > might (rightly) feel slighted if you include Django but not their > frameworks. Yeah well, the Wxpython, PyQt, PyGTK etc. people may feel slighted that Tkinter got included and their stuff didn't,

Message ("Your message dated Sat, 3 Feb 2007 10:40:10 -0500...")

2007-02-03 Thread SLACK Incorporated LISTSERV Server (14.3)
Your message dated Sat, 3 Feb 2007 10:40:10 -0500 with no subject has been submitted to the moderator of the IDN-L list: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Jython

2007-02-03 Thread Boris Ozegovic
Hi Why this doesn't work: def go(): for line in open("bobo.txt", "r"): print line go() python FileReader.py: everything ok jython FileReader.py: Traceback (innermost last): File "FileReader.py", line 6 File "FileReader.py", line 3 AttributeError: __getitem__ -- "A

Re: Jython

2007-02-03 Thread gregturn
On Feb 3, 11:21 am, Boris Ozegovic <[EMAIL PROTECTED]> wrote: > Hi > > Why this doesn't work: > > def go(): > for line in open("bobo.txt", "r"): > print line > > go() > > python FileReader.py: everything ok > jython FileReader.py: > > Traceback (innermost last): > File "Fi

Re: Jython

2007-02-03 Thread Boris Ozegovic
[EMAIL PROTECTED] wrote: > Files aren't lists and thus don't have the functions for iteration. They do have iterator: C:\Documents and Settings\Silovana Vjeverica\Desktop>python FileReader.py 'import site' failed; use -v for traceback boris ozegovic vedran ozegovic -- "A mi smo stranci u vlast

Re: Jython

2007-02-03 Thread Boris Ozegovic
Boris Ozegovic wrote: > [EMAIL PROTECTED] wrote: > >> Files aren't lists and thus don't have the functions for iteration. > > They do have iterator: > > C:\Documents and Settings\Silovana Vjeverica\Desktop>python FileReader.py > 'import site' failed; use -v for traceback > boris ozegovic > vedr

Re: Python does not play well with others

2007-02-03 Thread Kirk Sluder
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > I do think the core should have more stuff than it does, so that its > functionality can be on a par with competing language distros like > J2SE and PHP. Both of those distros include database connectvity > modules an

Re: from __future__ import absolute_import ?

2007-02-03 Thread Ron Adam
Peter Otten wrote: > Ron Adam wrote: > >> >> work >> | >> |- foo.py# print "foo not in bar" >> | >> `- bar >> | >> |- __init__.py >> | >> |- foo.py# print "foo in bar" >> | >> |- absolute.py # from __futer__ import absolute_import >>

Re: Jython

2007-02-03 Thread Boris Ozegovic
[EMAIL PROTECTED] wrote: > Files aren't lists and thus don't have the functions for iteration. > > Try: > > def go(): > for line in open("bobo.txt", "r").readlines(): > print line > > go() For example, you can do even this: import sys for line in sys.stdin: pr

Re: HELP NEEDED ... Regd. Regular expressions PyQt

2007-02-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, vishal wrote: > I am trying to work out a regular expression in a PyQt environment for > time in hh:mm:ss format. Any suggestions? Maybe don't use a re for something that simple. Splitting at ``:`` characters, converting to `int` and checking the value ranges isn't that h

Re: Jython

2007-02-03 Thread Peter Otten
Boris Ozegovic wrote: > Boris Ozegovic wrote: > >> [EMAIL PROTECTED] wrote: >> >>> Files aren't lists and thus don't have the functions for iteration. >> >> They do have iterator: >> >> C:\Documents and Settings\Silovana Vjeverica\Desktop>python FileReader.py >> 'import site' failed; use -v fo

Re: LDAP/LDIF Parsing

2007-02-03 Thread Bruno Desthuilliers
Hallvard B Furuseth a écrit : > Bruno Desthuilliers writes: > >>Hallvard B Furuseth a écrit : >> else: # all LDAP attribs are multivalued by default, # even when the schema says they are monovalued if len(data) == 1: return data[0]

Re: Can a jet fuel/hydrocarbon fire collapse a steel structure? An experiment.

2007-02-03 Thread Jonathan Curran
I've been seeing this topic for a day or two so far. Why don't we stick to discussing python on this mailing list? I'm sure there are other mailing lists specifically for discussing chemistry. =\ - Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-03 Thread Diez B. Roggisch
Paul Rubin schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> This is simply not true. J2SE doesn't include a web-framework. J2EE >> does, but it's a separate multi-megabyte-download. > > I thought J2SE comes with JSP. Maybe that's not a "framework" in the > fancy sense though. JSP is

Re: How can I access data from MS Access?

2007-02-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > How to access data from MS Access? I tried ADOdb for Python but it > doesn't seems to work. > > Even the official examples dont work, like this one: > > import adodb > conn = adodb.NewADOConnection('access') # mxodbc required > dsn = "Driver={Microsoft Access Driver

Re: Python does not play well with others

2007-02-03 Thread Diez B. Roggisch
Paul Rubin schrieb: > [EMAIL PROTECTED] writes: >> I can't speak authoritatively for either PHP or J2SE, but I suspect the >> latter at least has some signifiant monetary support (if not outright gobs >> of human resources) from Sun. PHP seems to have a more limited application >> domain (web apps

Re: Python does not play well with others

2007-02-03 Thread Kirk Sluder
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Where would you stop? At the boundaries of your particular application > > interests? > > If the Pythonistas are serious > about such a claim, competitive analysis says they should be wi

Re: Python does not play well with others

2007-02-03 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > And they certainly require special treatment like putting them in the > classpath, setting up the project directory and the like - no simple > import will work out of the box, as it would witch python standard lib > drivers. Well, that's nowhere nea

Re: How can I access data from MS Access?

2007-02-03 Thread Finger . Octopus
On Feb 3, 10:27 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit :> How to access data from MS Access? I tried ADOdb > for Python but it > > doesn't seems to work. > > > Even the official examples dont work, like this one: > > > import adodb > > conn = adodb.NewADOCon

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread John Nagle
Gabriel Genellina wrote: > En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]> > escribió: > >> John Nagle wrote: >> >>>How do I suppress "DeprecationWarning: Old style callback, use >>>cb_func(ok, >>> store) instead". A library is triggering this message, the library is

Re: strange test for None

2007-02-03 Thread Michael Bentley
On Feb 3, 2007, at 7:47 AM, karoly.kiripolszky wrote: > in my server i use the following piece of code: > > ims = self.headers["if-modified-since"] > if ims != None: > t = int(ims) > > and i'm always getting the following error: > > t = int(ims) > Value

Re: How can I access data from MS Access?

2007-02-03 Thread Peter Otten
[EMAIL PROTECTED] wrote: > On Feb 3, 10:27 pm, Bruno Desthuilliers >> "doesn't work" is the worst possible description of a problem. Did it >> print out some insults in a foreign language ? wipe out your HD ? Else ? > I havn't said "doesn't work", I rather doesn't seem to work. Bruno, admit th

PYTHONPATH or any other way to set seachpath (winXP) ?

2007-02-03 Thread Stef Mientki
Is it possible to change the searchpath for modules on the flight, under winXP ? Most preferred is some command to extend the searchpath. (the environment variable PYTHONPATH needs a reboot) thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-03 Thread Jorge Godoy
Paul Rubin writes: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> And they certainly require special treatment like putting them in the >> classpath, setting up the project directory and the like - no simple >> import will work out of the box, as it would witch pyth

Re: strange test for None

2007-02-03 Thread karoly.kiripolszky
the tested variable was really a string containing "None" instead of simply None. this is the first time i ran into this error message confusion. :) thanks for the help! On Feb 3, 6:29 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Feb 3, 2007, at 7:47 AM, karoly.kiripolszky wrote: > > > in

Re: Checking default arguments

2007-02-03 Thread George Sakkis
On Feb 2, 1:30 pm, [EMAIL PROTECTED] (Igor V. Rafienko) wrote: > Hi, > > I was wondering whether it was possible to find out which parameter > value is being used: the default argument or the user-supplied one. > That is: > > def foo(x, y="bar"): > # how to figure out whether the value of y is

Re: Jython

2007-02-03 Thread bearophileHUGS
[EMAIL PROTECTED]: > Files aren't lists and thus don't have the functions for iteration. > Try: > def go(): > for line in open("bobo.txt", "r").readlines(): > print line > go() CPython 2.1 has xreadlines, maybe Jython has it too. Bye, bearophile -- http://mail.python.org

Re: Create a cookie with cookielib

2007-02-03 Thread Matthew Franz
I'm not sure what you mean be forge, but if you mean set an arbitrary cookie manually (vs. one that was provided by the server). just use add_header() in http://docs.python.org/lib/request-objects.html It may be possible to use CookieJar for this purpose but I've only used it for manipulating coo

confused about resizing array in Python

2007-02-03 Thread Ruan
My confusion comes from the following piece of code: memo = {1:1, 2:1} def fib_memo(n): global memo if not n in memo: memo[n] = fib_memo(n-1) + fib_memo(n-2) return memo[n] I used to think that the time complexity for this code is O(n) due to its use of memoization. However, I was told recently

Re: nokia pys60 contacts + calendar

2007-02-03 Thread worlman385
On 3 Feb 2007 02:38:02 -0800, "cyberco" <[EMAIL PROTECTED]> wrote: >You can most likely find an answer on Nokia's Python forum: >http://discussion.forum.nokia.com/forum/forumdisplay.php?f=102 > >And if there's no answer there you should post the question there :) cyberco, do you knwo the answer?

Decimating Excel files

2007-02-03 Thread gonzlobo
No, I don't want to destroy them (funny how the word 'decimate' has changed definition over the years) :). We have a data acquisition program that saves its output to Excel's .xls format. Unfortunately, the programmer was too stupid to write files the average user can read. I'd like some advice o

Determining encoding of a file

2007-02-03 Thread Tony Houghton
In Linux it's possible for filesystems to have a different encoding from the system's setting. Given a filename, is there a (preferably) portable way to determine its encoding? -- TH * http://www.realh.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about resizing array in Python

2007-02-03 Thread Roel Schroeven
Ruan schreef: > My confusion comes from the following piece of code: > > memo = {1:1, 2:1} > def fib_memo(n): > global memo > if not n in memo: > memo[n] = fib_memo(n-1) + fib_memo(n-2) > return memo[n] > > I used to think that the time complexity for this code is O(n) due to its > use of memoiz

Re: PYTHONPATH or any other way to set seachpath (winXP) ?

2007-02-03 Thread Sick Monkey
If you need to extend your PATH variable, I have used this in the past. ~~ def AddSysPath(new_path): new_path = os.path.abspath(new_path) do = -1 if os.path.exists(new_path): do = 1 # check against all paths currently available

SndObj-Pysonic-omde-MusicKit-Jack-Alsa

2007-02-03 Thread Silver Rock
Greetings, I've been studiyng python and some things are not that clear: 1- Is python too slow to efectivelly communicate with Jack? PyJack did not seem to work right, so i tried PySndObj's JackIO object. It did not behave as good as with connection with ALSA. (btw, I could not acess lots of ob

Re: Determining encoding of a file

2007-02-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Tony Houghton wrote: > In Linux it's possible for filesystems to have a different encoding from > the system's setting. Given a filename, is there a (preferably) portable > way to determine its encoding? No. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.o

Re: asyncore DoS vulnerability

2007-02-03 Thread billie
On 2 Feb, 17:09, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > Thats like asking why you should have to move your fingers to type or > why you should have to eat food in order to not starve. Windows is > placing a limit of 512 descriptors per process. Call Microsoft if you > want to go over that. ?

wave

2007-02-03 Thread Silver Rock
hallo, supose i´ve opened a sound with the wave module: import wave sound=wave.open(filename,'rb') now this is strange: sound.getnframes() != len(sound.readframes(sound.getnframes()) True Why so? thanks in advance, Claire -- http://mail.python.org/mailman/listinfo/python-list

ctypes.com.IUnknown

2007-02-03 Thread Robin Becker
I find that ctypes.com has disappeared from the ctypes extension bundled with Python 2.5. I think I only need the IUnknown, I was playing with building a dialog using venster, but it needs IUnknown, STDMETHOD, HRESULT, GUID from ctypes.com. Any ideas what should replace those or is venster now

  1   2   >