Re: HTML parsing bug?

2006-02-01 Thread Tim Roberts
"Istvan Albert" <[EMAIL PROTECTED]> wrote: > >> this is a comment in JavaScript, which is itself inside an HTML comment > >Don't nest HTML comments. Occasionaly it may break the browsers as >well. Did you read the post? He didn't nest HTML comments. He put a Javascript comment inside an HTML com

Re: simple perl program in python gives errors

2006-02-01 Thread Tim Roberts
Dan Lowe <[EMAIL PROTECTED]> wrote: > >Not sure if you typo'd that, but that should read: > >a += 20 * 14 >print a Did you try to run that? -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

hii guys.

2006-02-01 Thread killer_pulsar
hii buddies, Friends there is a wonderful hacking group...thatz Hackers Lounge...there u can find the practical application of python in hacking and security related issues...guys..have a look and work with professional hackers there. http://groups.yahoo.com/group/hackerslounge -- http://mai

OT: New Python T-shirt available

2006-02-01 Thread Mr t dolton
I created a new Python T-shirt: http://www.cafepress.com/import_re I have been looking for this shirt ever since I fell in love with the slogan a few years ago. I gave up looking and decided to fumble through Photoshop for many hours to make my own. >From today through February 14th, $1.00 from

Re: triple quoted strings as comments

2006-02-01 Thread Magnus Lycka
dmh2000 wrote: > I recently complained elsewhere that Python doesn't have multiline > comments. It seems you have a bad editor if it can't conveniently add and remove comment markers for arbitrary blocks in your source. (Maybe you just didn't find this feature.) That every comment line begins wit

Your message to I18n awaits moderator approval

2006-02-01 Thread i18n-bounces
Your mail to 'I18n' with the subject Mail Delivery (failure [EMAIL PROTECTED]) Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive n

Re: HTML parsing bug?

2006-02-01 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Python 2.3.5 seems to choke when trying to parse html files, because it > doesn't realize that what's inside is a comment in HTML, > even if this comment is inside , especially if it's a > comment inside that script code too. nope. what's inside is not a comment if

python-dev Summary for 2006-01-01 through 2006-01-15

2006-02-01 Thread Tony Meyer
[The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-01-01_2006-01-15.html] = Announcements = QOTF: Quote of the Fortnight Guido, on the crashability of Python: I'm not say

Re: wxPython Conventions

2006-02-01 Thread Magnus Lycka
Jared Russell wrote: > My other question involved the proper location of specific functions. Never mix business with plea^h^h^h^hGUI. I'd suggest that you write a Python module with all your business logic that you can test from the interactive interpreter. Roughly like this: >>> import gmailche

Re: wxPython Conventions

2006-02-01 Thread Iain King
Jared Russell wrote: > To mess around with it, I decided to create a small app to check my > Gmail. I want something that will just sit in my system tray checking > for new emails every ten minutes or so. How do you gain access to the system tray? Iain -- http://mail.python.org/mailman/listi

Re: Request for suggesstions and comments

2006-02-01 Thread Magnus Lycka
Vivek Kumar wrote: > Hi all, > > I have to write a network server (sort of) and I am > looking for your valuable comments. You might want to look at twisted for this. http://twistedmatrix.com/ -- http://mail.python.org/mailman/listinfo/python-list

OpenRTS - new OSS Python game

2006-02-01 Thread Andreas R.
OpenRTS is a new open source project, with the aim of creating a realtime strategy game. The game is developed in Python with Pygame. See http://www.openrts.org for more info about the game if you are interested. -- http://mail.python.org/mailman/listinfo/python-list

Re: OpenRTS - new OSS Python game

2006-02-01 Thread Sybren Stuvel
Andreas R. enlightened us with: > OpenRTS is a new open source project, with the aim of creating a > realtime strategy game. The game is developed in Python with Pygame. > See http://www.openrts.org for more info about the game if you are > interested. To be honest, it looks very much like games f

Re: OpenRTS - new OSS Python game

2006-02-01 Thread Christoph Conrad
Hello Sybren, > To be honest, it looks very much like games from 1995... You should notice: It's a first alpha version. Freundliche Grüße, Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Conventions

2006-02-01 Thread Johan Lindberg
Iain King skrev: > How do you gain access to the system tray? Use wx.TaskBarIcon. See http://wiki.wxpython.org/index.cgi/FlashingTaskbarIcon for snippets. /Johan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why checksum? [was Re: Fuzzy Lookups]

2006-02-01 Thread Tom Anderson
On Tue, 31 Jan 2006, it was written: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> This isn't a criticism, it is a genuine question. Why do people compare >> local files with MD5 instead of doing a byte-to-byte compare? I often wonder that! >> Is it purely a caching thing (once you have th

Re: OpenRTS - new OSS Python game

2006-02-01 Thread Andreas R.
Sybren Stuvel wrote: > To be honest, it looks very much like games from 1995... The game has isometric graphics. It's possible to have nice isometric graphics, ie. look at Civilization 3. Besides, there's a lot more to a good strategy game than good looks. -- http://mail.python.org/mailman/lis

Parsing sizes

2006-02-01 Thread [EMAIL PROTECTED]
I want to be able to parse sizes in bytes in several formats, such as "1048576", "1024K", "1024KB", "1M" etc. Is there a module that will help me with that? /David -- http://mail.python.org/mailman/listinfo/python-list

Re: Why checksum? [was Re: Fuzzy Lookups]

2006-02-01 Thread Steven D'Aprano
On Tue, 31 Jan 2006 13:38:50 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> This isn't a criticism, it is a genuine question. Why do people compare >> local files with MD5 instead of doing a byte-to-byte compare? Is it purely >> a caching thing (once you have the checksu

Test driven programming, was Re: VB to Python migration

2006-02-01 Thread Magnus Lycka
Josh wrote: > As for the testing, that's something we'll need to learn about. I've > read some articles about test driven programming in relation to extreme > programming. Can you give me links to any good sites explaining how this > all works? (Off list may be better for these off-topic links)

wxTreeCtrl Q?

2006-02-01 Thread mitsura
Hi, it is possible to change the font (bold, underline, italic) in the text used in a wxTreeCtrl? I looked in the wxPython demo but I can't find anything. Any help much appreciated. Kris -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Randall Parker wrote: > C++ provides ways to be type unsafe. Does that mean that C++ is type > unsafe period? Most code in C++ is going to be type safe. Some > programmers will never do dangerous casting. Others will do bad things > with casts. Sure, but on the other hand, you are really on your o

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Randall Parker wrote: > I return objects in Python and in C++. In C++ I can see what their > types are right on the m method signature. In Python I've got to write > a comment on the line above it. Ouch! Don't do that! As you've noticed, it's not very maintainable. First of all, if you want to u

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Randall Parker wrote: > Also, compile time errors get caught sooner. They get caught before > tests even get written. Not if you do Test Driven Tevelopment. Then you write the tests before you compile your target code! It's also my experience that the write test - write code - run test cycle in TD

Re: OpenRTS - new OSS Python game

2006-02-01 Thread Sybren Stuvel
Andreas R. enlightened us with: > The game has isometric graphics. It's possible to have nice > isometric graphics, ie. look at Civilization 3. Besides, there's a > lot more to a good strategy game than good looks. True. That's why I only commented on the graphics - that's the only visible thing

Re: triple quoted strings as comments

2006-02-01 Thread Roy Smith
Magnus Lycka <[EMAIL PROTECTED]> wrote: > An editor that adds/removes '# ' in the beginning of each > marked line is fairly bullet proof. Adding e.g. /* to the > beginning of a block you want to comment out, & */ to the > end, breaks if you have /* */ style comments in the block! /* */ also allows

Re: wxTreeCtrl Q?

2006-02-01 Thread Raven
I hope this can help: http://wxwidgets.org/manuals/2.6.1/wx_wxtreectrl.html#wxtreectrlsetitemfont http://wxwidgets.org/manuals/2.6.1/wx_wxtreectrl.html#wxtreectrlsetitembold This pages are from the wxwidgets api reference but the functions are the same in wxPython Bye Ale -- http://mail.pytho

Re: triple quoted strings as comments

2006-02-01 Thread Roel Schroeven
Roy Smith schreef: > Magnus Lycka <[EMAIL PROTECTED]> wrote: >> An editor that adds/removes '# ' in the beginning of each >> marked line is fairly bullet proof. Adding e.g. /* to the >> beginning of a block you want to comment out, & */ to the >> end, breaks if you have /* */ style comments in the

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Jay Parlar wrote: > Well guess what: The *only* code you'll have to change is inside the > function returning the object, none of the callers would have to change. > That's completely different from C++, where you'll have to change not > only the return type and the function, but you'll also hav

Re: Python vs C for a mail server

2006-02-01 Thread Magnus Lycka
Jens Theisen wrote: > Jay wrote: >> How much time in your C/C++ code is spent casting and trying to >>trick the compiler into doing something that it thinks you shouldn't be >>doing? > > Not much frankly. Though I have no doubt that there is a lot of code that > does, but more so in older C++ co

Re: Rur-ple lessons 0.36

2006-02-01 Thread M�ta-MCI
Bonjour ! Il me semblerait sympathique que cette annonce soit dupliquée sur fr.comp.lang.python, et sur quelques autres newsgroups. Par exemple, puis-je répercuter l'annonce sur le newsgroup "programmation.python" de zoo-logique ? @-salutations -- Michel Claveau -- http://mail.python.org/

Re: Rur-ple lessons 0.36

2006-02-01 Thread André
Bonjour ! Je n'ai pas d'objections à ce que tu le fasse. La seule chose qui m'embête, c'est que les leçons ne sont qu'en anglais. C'est un peu pour moi une question de fierté ; au moins l'interface de rur-ple est traduite en français. André Roberge Méta-MCI wrote: > Bonjour ! > > Il me semble

load module named "datetime" and change the directory of output file?

2006-02-01 Thread ye juan
Hi, all I have some questions to ask: 1. How can I add a standard module named "datetime" in Jython when the error happens :"Traceback (innermost last): File "C:\python\test.py", line 3, in ? ImportError: no module named datetime " The line 3 is writen: "from datetime import datetime, tzinfo

howto catch an Exception and still print the TraceBack?

2006-02-01 Thread Saizan
In an event-driven application i'd like to keep the program alive regardless of any exceptions raised by the handlers, but still be able to debug them by reading the appropriate TraceBack from stderr. I can put something like: try: self.call_handler(handler,*args) except Exception, e:

calling a class method in a python module

2006-02-01 Thread rtuhin
Hi I am trying to write a C code to call a class function in a python module. Here's my python module: def fib(n):# write Fibonacci series up to n a, b = 0, 1 while b < n: print b, a, b = b, a+b def fib2(n): # return Fibonacci series up to n result = [] a, b =

Capture Windows command line output - put in text file

2006-02-01 Thread Ernesto
I'm looking for a way to capture command line output from a cmd session. Is there a way to use python to launch the application from the beggining then stream all of the output to a text file ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-02-01 Thread Randall Parker
Magnus Lycka wrote: > Randall Parker wrote: > > Also, compile time errors get caught sooner. They get caught before > > tests even get written. > > Not if you do Test Driven Tevelopment. Then you write > the tests before you compile your target code! It's > also my experience that the write test -

Re: Parsing sizes

2006-02-01 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I want to be able to parse sizes in bytes in several formats, such as > "1048576", "1024K", "1024KB", "1M" etc. > > Is there a module that will help me with that? > > /David > Like this? import re units = {'B':0, 'k':10,'M':20,'G':30,'T':40} def parse(text):

Re: Test driven programming, was Re: VB to Python migration

2006-02-01 Thread Grig Gheorghiu
Magnus, I've been writing TextTest tests lately for an application that will be presented at a PyCon tutorial on "Agile development and testing". I have to say that if your application does a lot of logging, then the TextTest tests become very fragile in the presence of changes. So I had to come u

Re: howto catch an Exception and still print the TraceBack?

2006-02-01 Thread Diez B. Roggisch
Saizan wrote: > In an event-driven application i'd like to keep the program alive > regardless of any exceptions raised by the handlers, but still be able to > debug them by reading the appropriate TraceBack from stderr. I can put > something like: See sys.exc_info() The you can do: try: .

Re: howto catch an Exception and still print the TraceBack?

2006-02-01 Thread Antoon Pardon
Op 2006-02-01, Saizan schreef <[EMAIL PROTECTED]>: > In an event-driven application i'd like to keep the program alive regardless > of any exceptions raised by the handlers, > but still be able to debug them by reading the appropriate TraceBack from > stderr. > I can put something like: > > try:

Re: Capture Windows command line output - put in text file

2006-02-01 Thread Ernesto
Ernesto wrote: > I'm looking for a way to capture command line output from a cmd > session. Is there a way to use python to launch the application from > the beggining then stream all of the output to a text file ? Nevermind. This is a telnet question. I'm trying to get telnet localhost

Re: import datetime

2006-02-01 Thread shaboo
It does say Python 2.4.2 Python 2.4.2 (#2, Jan 30 2006, 20:02:09) [C] on hp-ux11 Type "help", "copyright", "credits" or "license" for more information. >>> I did look at the sys.path but the issue is that I dont see a module name datetime anywhere.

Re: howto catch an Exception and still print the TraceBack?

2006-02-01 Thread Fabio Zadrozny
I find the following very good for most needs: try: raise RuntimeError('err') except: import traceback;traceback.print_exc() -- if you use Pydev, there's a template for that called printexc. Cheers, Fabio Saizan wrote: >In an event-driven application i'd like to keep the program alive

urllib2 - My POST Request just isn't working right

2006-02-01 Thread Gregory Piñero
Hi guys, I'm trying to write a program to get FedEx shipping rates, and I'm following their API as outlined in this document: http://www.fedex.com/us/solutions/wis/pdf/fsm_directmanual.pdf I need specifically to make a POST request to their server as shown on page 12. However I continually get s

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Don't Code Faster Than You Can See
(blogger.com gives the same error if you don't .strip() your password before using it to connect) i noticed one spelling mistake here: > headers = { 'Referer' : 'YourCompany', 'Referrer' could it be that simple? -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Eric Nieuwland
Hi Greg, > values = {'request':xml_request} > headers = { 'Referer' : 'YourCompany', > 'Host':'https://gatewaybeta.fedex.com/GatewayDC', > 'Accept':'image/gif, image/jpeg, image/pjpeg, text/plain, > text/html, */*', > 'Content-Type':'image/gif' > }

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Fuzzyman
That would certainly be an error. *Also*, urllib2 adds the host header for you, no need to set it. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Gregory Piñero
Ok, I tried the changes you guys suggested but same error still: 1. Corrected spelling of referrer. 2. Don't specify host. Here is what they say my request should look like: - POST /GatewayDC HTTP/1.0 Referer: YourCompanyNameG

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Gregory Piñero
Correction: - POST /GatewayDC HTTP/1.0 Referer: YourCompanyNameGoesHere Host: SSLserver.fedex.com Accept: image/gif, image/jpeg, image/pjpeg, text/plain, text/html, */* Content-Type: image/gif Content-length: %d Your FedEx Tra

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread David Wahler
Gregory Piñero wrote: > Ok, I tried the changes you guys suggested but same error still: > 1. Corrected spelling of referrer. > 2. Don't specify host. > > Here is what they say my request should look like: > - > POST /GatewayDC

unicodedata.name

2006-02-01 Thread Szabolcs Nagy
the unicodedata manual sais: " name( unichr[, default]) Returns the name assigned to the Unicode character unichr as a string. If no name is defined, default is returned, or, if not given, ValueError is raised. " what is the difference between "no name defined" and "not given"? eg. '\n' why g

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Eric Nieuwland
Don't forget to substitute the actual Content-length for %d! --eric On 1 feb 2006, at 17:34, Gregory Piñero wrote: > Correction: > --- > -- > POST /GatewayDC HTTP/1.0 > Referer: YourCompanyNameGoesHere > Host: SSLserver.fedex.c

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Fredrik Lundh
Gregory Piñero wrote: > 1 . One thing that is weird is that the data part just says "Your > FedEx Transaction". I know I put the XML here, but I also notice that > urllib2 is putting this as: > > request= > Can I have my xml placed here without that something= part? That > don't specify what par

python printout format

2006-02-01 Thread Yong Wang
Hi, I have a data set like row = [[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]] when I use loop to print out data, I got compile error in printout statment. while j<24: print ' ',string.ljust(str(units[0]), 5), print ' ',string.ljust(str(ports[j], 3), print ' ',string.l

Re: python printout format

2006-02-01 Thread Eric Nieuwland
Yong, Are you sure you indent with the same characters and there is no non-print code there? --eric On 1 feb 2006, at 17:36, Yong Wang wrote: > Hi, >I have a data set like row = [[1,2,3,4,5], [6,7,8,9,10], > [11,12,13,14,15]] >when I use loop to print out data, I got compile error in

Re: python printout format

2006-02-01 Thread Gary Herron
Yong Wang wrote: >Hi, > I have a data set like row = [[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]] > when I use loop to print out data, I got compile error in printout statment. > while j<24: > print ' ',string.ljust(str(units[0]), 5), > print ' ',string.ljust(str(ports[j], 3), >

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Never Code Faster Than You Can See
Gregory Piñero wrote: > Ok, I tried the changes you guys suggested but same error still: > 1. Corrected spelling of referrer. errr, the other chap said the INcorrect spelling is correct for http. sorry about that. > Here is what they say my request should look like: > ---

Re: unicodedata.name

2006-02-01 Thread Fredrik Lundh
Szabolcs Nagy wrote: > the unicodedata manual sais: > " > name( unichr[, default]) > Returns the name assigned to the Unicode character unichr as a > string. If no name is defined, default is returned, or, if not given, > ValueError is raised. > " > what is the difference between "no name def

Re: import datetime

2006-02-01 Thread Fredrik Lundh
"shaboo" wrote: > It does say Python 2.4.2 > > Python 2.4.2 (#2, Jan 30 2006, 20:02:09) [C] on hp-ux11 > Type "help", "copyright", "credits" or "license" for more information. > >>> > > > I did look at the sys.path but the issue is that I dont see

Re: simple perl program in python gives errors

2006-02-01 Thread Dan Lowe
On Feb 1, 2006, at 7:59 AM, Tim Roberts wrote: > Dan Lowe <[EMAIL PROTECTED]> wrote: >> >> Not sure if you typo'd that, but that should read: >> >> a += 20 * 14 >> print a > > Did you try to run that? Well, I did, but I had given 'a' a value first. And now I'm thinking that I may have

Re: Python vs C for a mail server

2006-02-01 Thread Donn Cave
In article <[EMAIL PROTECTED]>, ... > Granted, it is a pain to change type declarations. I see it is time for the bi-monthly reminder that C++ is not the ideal example of strong static typing, unless you just want to make it look bad. Cf. Hindley-Milner type inference. Donn Cave, [EMAIL PROTE

Re: unicodedata.name

2006-02-01 Thread Szabolcs Nagy
thank you (it's so obvious i don't know how i could misunderstand) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-02-01 Thread Paul Boddie
Magnus Lycka wrote: > In C++ it's the opposite. By demanding a particular type, we restrain > ourself to using a set of values which is much smaller than the logic > calls for, or we can throw away all type checks by e.g. casting to void > pointers. The main reason for evading the type system in s

os.remove OSError: [Errno 13] Permission denied

2006-02-01 Thread Joram Agten
Please put me in CC When running the following program I get frequent errors like this one Exception in thread Thread-4: Traceback (most recent call last): File "C:\Python24\lib\threading.py", line 442, in __bootstrap self.run() File "os.remove.py", line 25, in run os.remove(filename)

Re: calling a class method in a python module

2006-02-01 Thread Farshid Lashkari
> Can anybody tell me how to call "f" in my C code? Assuming you already have a handle to an instance of MyClass this should do the trick: PyObject *func = PyObject_GetAttrString(MyClassInst,"f"); if(func) { PyObject *result = PyObject_CallObject(func,NULL); if(result) { //Do

locals() and dictionaries

2006-02-01 Thread JerryB
Hi, I have a dictionary, a string, and I'm creating another string, like this: dict = {} dict[beatles] = "need" str = "love" mystr = """All you %(dict[beatles])s is %(str)s""" % locals() Why do I get keyerror: 'dict[one]'? Is there a way to reference the elements in a dictionary with locals() o

Re: urllib2 - My POST Request just isn't working right

2006-02-01 Thread Gregory Piñero
Thanks for all the help guys, it finally worked! I don't know if I ever would have figured this out on my own... skipping the url encoding is what did the trick. I didn't end up needing to do anything special for ssl. I guess urllib2 just handles that itself. Thanks again, -Greg -- http://ma

Re: Python vs C for a mail server

2006-02-01 Thread Randall Parker
Donn, More generally: One must keep in mind that advantages and disadvantages of specific implementations of language concepts are not always indications of flaws in those concepts. Real languages have real flaws from bad design choices which cause them to fall short of what those languages could

Re: dynamic class instantiation

2006-02-01 Thread Ognen Duzlevski
Volker Grabsch <[EMAIL PROTECTED]> wrote: > Ognen Duzlevski wrote: > > Kent Johnson <[EMAIL PROTECTED]> wrote: > >> Ognen Duzlevski wrote: > >> > Say I got "page" as a string. How do I go about > >> > instantiating a class from this piece of information? To make it > >> > more obvious how do I cr

Re: indentation messing up my tuple?

2006-02-01 Thread localpricemaps
i am using a tuple because i am building lists. if i just use (food + drink) then while drink is unique food remains the same do i get this: (burger, coke) (burger, 7up) (burger, sprite) infidel wrote: > tuple is the name of the built-in type, so it's not a very good idea to > reassign it to som

Re: locals() and dictionaries

2006-02-01 Thread Rocco Moretti
JerryB wrote: > Hi, > I have a dictionary, a string, and I'm creating another string, like > this: > > dict = {} > dict[beatles] = "need" > str = "love" > > mystr = """All you %(dict[beatles])s is %(str)s""" % locals() > > Why do I get > keyerror: 'dict[one]'? > > Is there a way to reference th

Re: Python vs C for a mail server

2006-02-01 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Randall Parker" <[EMAIL PROTECTED]> wrote: ... > More generally: One must keep in mind that advantages and disadvantages > of specific implementations of language concepts are not always > indications of flaws in those concepts. Sure. And of course, the nominal t

Re: indentation messing up my tuple?

2006-02-01 Thread infidel
> i am using a tuple because i am building lists. I don't understand > if i just use (food + > drink) then while drink is unique food remains the same do i get this: > > (burger, coke) > (burger, 7up) > (burger, sprite) I don't understand what you're saying here. food and drink are both string

Re: Sharing database connection from C to Python

2006-02-01 Thread Daniel Dittmar
[EMAIL PROTECTED] wrote: > I'm developing an application using the C language and Python for it's > plugins. The C program connects to a MySQL database and keeps that > connection active. Is it possible to 'share' this connection with the > Python plugins? If so, is there a "standard" way to do tha

PIL and transparent GIFs

2006-02-01 Thread toto
Hi, Does anybody know how to save an image in GIF format preserving transparent background ?? Here's what I tested : import Image, ImageDraw im = Image.open('/path/to/model.gif') # An image with transparent backgroung draw = ImageDraw.Draw(im) draw.polygon([153,106,186,225,340,193,315,81,304,167

Re: How do I dynamically create functions without lambda?

2006-02-01 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Sat, 28 Jan 2006 00:13:28 -0800, Kay Schluehr wrote: > >[snip lambda calculus stuff] > >> In Python you can write: >> >> Y = lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda >> arg: f(f)(arg))) >> >>

Re: import datetime

2006-02-01 Thread Lee Harr
>> I did look at the sys.path but the issue is that I dont see a module >> name datetime anywhere. Only datetime thing that is there is in include >> directory and it is datetime.h, which I think is for C interface. I >> have a python installed on my Windows desktop and it is working fine >> there.

Re: load module named "datetime" and change the directory of output file?

2006-02-01 Thread Lee Harr
> 1. How can I add a standard module named "datetime" in > Jython when the error happens :"Traceback (innermost > last): > File "C:\python\test.py", line 3, in ? > ImportError: no module named datetime " > The line 3 is writen: "from datetime import datetime, > tzinfor" > The datetime module wa

dependencies on subclassing Extensiontypes: tp_richcompare <--> tp_hash

2006-02-01 Thread Uwe Hoffmann
Hi, i have used Pyrex to build some python Extensionclasses. Now i stumbled over the fact that if a subclass has a __hash__ method the __richcmp__ of the base is not called. # pseudocode class Base: def __richcmp__(): print 'hi' class Immutable(Base): def __hash__()

OO conventions

2006-02-01 Thread Daniel Nogradi
I'm relatively new to object oriented programming, so get confused about its usage once in a while. Suppose there is a class Image that has a number of methods, rotate, open, verify, read, close, etc. Then to use this class my natural guess would be to have something like image = Image( ) image.re

Re: PIL and transparent GIFs

2006-02-01 Thread Kamilche
It can only read transparency, it can't write it. I went looking and found that out a couple weeks ago. -- http://mail.python.org/mailman/listinfo/python-list

Re: locals() and dictionaries

2006-02-01 Thread JerryB
Rocco: thanks for your response. The examples were just made up. I don't normally use 'dict' and 'str'. I know I can create a dictionary with the variables I want, etc. My question is not how to solve the problem, or how to come up with a work-around (I'm getting pretty good at this one :), so my q

Re: OO conventions

2006-02-01 Thread Anthony Greene
On Wed, 01 Feb 2006 23:40:37 +0100, Daniel Nogradi wrote: > I'm relatively new to object oriented programming, so get confused > about its usage once in a while. Suppose there is a class Image that > has a number of methods, rotate, open, verify, read, close, etc. Then > to use this class my natur

Re: OO conventions

2006-02-01 Thread Anthony Greene
On Wed, 01 Feb 2006 23:40:37 +0100, Daniel Nogradi wrote: > I'm relatively new to object oriented programming, so get confused > about its usage once in a while. Suppose there is a class Image that > has a number of methods, rotate, open, verify, read, close, etc. Then > to use this class my natur

Re: OO conventions

2006-02-01 Thread Claudio Grondi
Daniel Nogradi wrote: > I'm relatively new to object oriented programming, so get confused > about its usage once in a while. Suppose there is a class Image that > has a number of methods, rotate, open, verify, read, close, etc. Then > to use this class my natural guess would be to have something l

Re: OO conventions

2006-02-01 Thread Kirk McDonald
Daniel Nogradi wrote: > I'm relatively new to object oriented programming, so get confused > about its usage once in a while. Suppose there is a class Image that > has a number of methods, rotate, open, verify, read, close, etc. Then > to use this class my natural guess would be to have something l

Re: OO conventions

2006-02-01 Thread Daniel Nogradi
> > In this case, Image seems to be a python module, with the open function > defined, PIL's Image is not a class. > Thanks for the enlightening remarks, especially this last one, indeed, it's not a class. -- http://mail.python.org/mailman/listinfo/python-list

A class with built-in doctest feature ?

2006-02-01 Thread Runsun Pan
I intend to use the doctect heavily. For this I am thinking of coding a class that comes with a built-in doctest functionality. I'd like to seek for input before I start. The idea is to have a class MyObj from where all my other classes will subclass. lets say: class C(MyObj): ''' Thi

Re: Pulling numbers from ASCII filename not working

2006-02-01 Thread IamIan
Thanks for the help everyone (especially those that gave more answers than attitude). It's working perfectly! Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL and transparent GIFs

2006-02-01 Thread Terry Hancock
On 1 Feb 2006 14:41:05 -0800 "Kamilche" <[EMAIL PROTECTED]> wrote: > It can only read transparency, it can't write it. I went > looking and found that out a couple weeks ago. There was a patch published at one time that was supposed to fix this. I remember doing some testing and not finding it to

Re: PyGILState_Release + Python2.3 = Segmentation Fault

2006-02-01 Thread cadavis2k2
Kirill Simonov wrote: > Hi, > > Could someone tell me why my extension module works under Python 2.4, but > fails with Segmentation Fault under Python 2.3? Here is the stripped version: Maybe Python threads aren't initialized? Adding a call to PyEval_InitThreads() stops the seg fault for me in Py

Re: OO conventions

2006-02-01 Thread Terry Hancock
On Wed, 1 Feb 2006 23:40:37 +0100 Daniel Nogradi <[EMAIL PROTECTED]> wrote: > I'm relatively new to object oriented programming, so get > confused about its usage once in a while. Suppose there is > a class Image that has a number of methods, rotate, open, > verify, read, close, etc. Then to use th

Re: Why checksum? [was Re: Fuzzy Lookups]

2006-02-01 Thread Paul Rubin
Tom Anderson <[EMAIL PROTECTED]> writes: > > The obvious way is make a list of hashes, and sort the list. > > Obvious, perhaps, prudent, no. To make the list of hashes, you have to > read all of every single file first, which could take a while. If your > files are reasonably random at the beginni

Re: Why checksum? [was Re: Fuzzy Lookups]

2006-02-01 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Sure. But if you are just comparing two files, is there any reason to > bother with a checksum? (MD5 or other.) No of course not, except in special situations, like some problem opening and reading both files simultaneously. E.g.: the files are on two

cgi - secure sessions

2006-02-01 Thread infini . g
Hey, I was just wondering if / how would it be possible to create secure sessions for a website using Python CGI... I thought of using cookies, and things looked promising for a while; I could login through a form which pointed to a cgi script which created sent the user cookies, but I found that

Re: Python vs C for a mail server

2006-02-01 Thread Paul Rubin
Magnus Lycka <[EMAIL PROTECTED]> writes: > Sure, but on the other hand, you are really on your own when you > avoid the compile time type safety in C++. But it's almost impossible to avoid. Does *p point to a valid object, or to unallocated memory? C++ has no way to tell this at compile time. --

Re: cgi - secure sessions

2006-02-01 Thread Kirk McDonald
[EMAIL PROTECTED] wrote: > Hey, > > I was just wondering if / how would it be possible to create secure > sessions for a website using Python CGI... I thought of using cookies, > and things looked promising for a while; I could login through a form > which pointed to a cgi script which created sen

Re: cgi - secure sessions

2006-02-01 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I was just wondering if / how would it be possible to create secure > sessions for a website using Python CGI... I thought of using cookies, > and things looked promising for a while; I could login through a form > which pointed to a cgi script which created sent the use

Re: cgi - secure sessions

2006-02-01 Thread GazaM
wow, those were some seriously quick replies, thanks. I understand that cookies is the best way to do things, but I didn't explain my problem well, sorry. Basically, I have a blog in the works and I want to have an online interface for posting. What I have is a cgi script run through a server side

  1   2   >