Re: Regarding Content-type headers

2005-06-14 Thread Ola Natvig
It's not wrong, but you won't get the results you want. If you want to display HTML your should send the content-type: text/html. regards Ola Natvig -- http://mail.python.org/mailman/listinfo/python-list

Re: python equivalent of php implode

2005-04-26 Thread Ola Natvig
O $table (".implode(", ", array_keys($query_param)).") VALUES ('".implode("','", $query_param)."')"; how it can be done, using python (elegantly, without cycles)? sql = "INSERT INTO %s (%s) VALUES (%s)" % (table, &#x

Re: database in python ?

2005-04-11 Thread Ola Natvig
SQL or postgree in your trunk :) ola -- ---------- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: Does IronPython indicate MS interest in dynamic languages?

2005-04-06 Thread Ola Natvig
Bengt Richter wrote: If there is to be an MSPython, how long 'til Mozilla FirePython? ;-) Regards, Bengt Richter 'Reclaim your runtime' I can't wait... -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.p

Re: The value exceptions are raised with (odd behaviour?)

2005-03-31 Thread Ola Natvig
Ola Natvig wrote: When raising an exception with a value for instance an integer you assume that when catching the exception the value can be compared with other integers. That is not what happens. try: raise Exception, 12 except Exception, number: print number == 12 # False This is

The value exceptions are raised with (odd behaviour?)

2005-03-31 Thread Ola Natvig
variable is a exception instance and not an integer. I wonder if I'm the only one which find this behavior odd, and if anyone knows if there is a way to retrieve the original initialization value of the exception. ola -- ------ Ola Natvig <[EMAIL P

Re: Static parameter count

2005-03-17 Thread Ola Natvig
uld do the trick ola -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

pyXPCOM with mozilla 1.7 + python 2.4

2005-03-16 Thread Ola Natvig
e hav expirienced this problem and perhaps found a solution to it. Ola -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: About Databases...

2005-03-16 Thread Ola Natvig
und ) It was called SAP DB, I can recomend that one, the only trouble I've had with it is the Python drives in a heavily threaded environment, even with locking. -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.p

Re: simulated samba server

2005-03-15 Thread Ola Natvig
hare a database based filesystem which is spread over various numbers of drives and servers. I haven't seen one so far; however, is it possible that you could serve your users through HTTP? I have done so in a similar situation like yours. Or FTP.. -- ---------- Ol

Small but significant memory leak in Pyana XSLT processor

2005-03-08 Thread Ola Natvig
t. The software I'm using on the computer I've done the tests on: Python 2.4 (ActivePython) Pyana 0.9.2 Win XP Pro SP2 I've tried with both precompiled and self compiled versions of the Pyana package. ola -- ---------- Ola Natvig <[EMAIL PROTECTED

Re: how to control a USB DISK?

2005-03-02 Thread Ola Natvig
eal problem are the detecting of the session start and beeing able to disable the disk. I don't know which (if any) COM service that can be used. ola -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: large amount of or's

2005-03-02 Thread Ola Natvig
e executed. ola -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Ola Natvig
bject): def __del__(self): There should be a super(self.__class__, self)._del__() here if I'm not totaly wong, which could be the case here ;) print "Base.__del__" -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSens

Efficient checksum calculating on lagre files

2005-02-08 Thread Ola Natvig
lity on *nix systems. -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

xmlentities

2005-02-07 Thread Ola Natvig
Hi all Does anyone know a good library for transfering non standard characters to enity characters in html. I want characters like < and > to be transformed to < and >. And the norwegian ø to ø ola -- ------ Ola Natvig <[EMAIL PROTECTED]

Re: dynamic func. call

2005-02-04 Thread Ola Natvig
Aljosa Mohorovic wrote: can i do something like this: s = "myFunction" a = s() # equals to: a = myFunction() a = locals()[x]() locals() returns a dictionary with string keys that you can use -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense

Re: new style exception handleing

2005-02-03 Thread Ola Natvig
Peter Hansen wrote: Ola Natvig wrote: Does anybody know why it's not possible to raise Exceptions which are types (new-style-classes). I know all standard exceptions are classic classes, but if you make a custom exception which both inherits from a exception class and a new-style one t

new style exception handleing

2005-02-02 Thread Ola Natvig
raising types as exceptions that I can't think of ? -- ---------- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: equivelant of Java's toString() method? (not repr)

2005-02-01 Thread Ola Natvig
method... thanks! alex use: log(str(handle.info())) str creates a string object from a supplied object with a __str__ method. I think print calls str on what it is going to print -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: find isset() php function equivalent in python

2005-02-01 Thread Ola Natvig
Max M wrote: Ola Natvig wrote: Olivier Noblanc ATOUSOFT wrote: Hello What is the equivalent function of php isset() in python try: if variable: # isset pass except NameError: # not set pass you could use: >>> 'variable' in vars() But be aware

Re: find isset() php function equivalent in python

2005-02-01 Thread Ola Natvig
work... -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: import directory error

2005-01-31 Thread Ola Natvig
odule located at inc/setupxml.py It's said that it imports the setupxml *module* from the inc *package* All packages should include a __init__.py file. The import may not work unless. You will get the __init__.py file if you type import inc -- ------ Ola Natv

Re: Please suggest on the book to follow

2005-01-27 Thread Ola Natvig
s_ap_i1_xgl14/104-9460635-7128701?v=glance&s=books&n=507846 -- ---------- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: access private field in python 2.4

2005-01-26 Thread Ola Natvig
re not good practice to access theese through that name. -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: 4suite XSLT thread safe ?

2005-01-26 Thread Ola Natvig
to the threads. -- ---------- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: 4suite XSLT thread safe ?

2005-01-26 Thread Ola Natvig
Diez B. Roggisch wrote: Ola Natvig wrote: Anybody out there who knows if the 4suite implementation of XSLT are a threadsafe one? What do you mean by that? You can of course transform xml using xslt in as many threads as you like - but what do you want with two or more threads in _one_

4suite XSLT thread safe ?

2005-01-26 Thread Ola Natvig
Anybody out there who knows if the 4suite implementation of XSLT are a threadsafe one? -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: Another scripting language implemented into Python itself?

2005-01-25 Thread Ola Natvig
that in Python. But it should not be to much work if you don't need many functions. -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: generator expressions: performance anomaly?

2005-01-18 Thread Ola Natvig
What makes the leftmost expression different from the iterable returning expression inside the for? The same arguments apply there. It's not different, but it's a requirement that the iterable returns the same data every time. I know that anyone can type range = fancyRange and make this return a

Re: generator expressions: performance anomaly?

2005-01-18 Thread Ola Natvig
Diez B. Roggisch wrote: Would it be a bad solution to make that a list or tuple of ten time.time() calls, you could also restrict what theese prebuilding sequenses could contain, or perhaps try to prebuild them, and then fail if it's impossible. I don't fully understand what you mean. Restricting

Re: generator expressions: performance anomaly?

2005-01-18 Thread Ola Natvig
impossible. -- ------ Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: generator expressions: performance anomaly?

2005-01-18 Thread Ola Natvig
Antoon Pardon wrote: Op 2005-01-18, Steve Holden schreef <[EMAIL PROTECTED]>: Antoon Pardon wrote: Op 2005-01-18, Nick Coghlan schreef <[EMAIL PROTECTED]>: Raymond Hettinger wrote: [Delaney, Timothy C] Nick's other suggestion - that genexps propagate __len__ - might still be interesting. Of cou

Removing M2Crypto debug data in production code

2005-01-12 Thread Ola Natvig
ept: SSLv3 read client key exchange A LOOP: SSL accept: SSLv3 read finished A LOOP: SSL accept: SSLv3 write change cipher spec A LOOP: SSL accept: SSLv3 write finished A LOOP: SSL accept: SSLv3 flush data INFO: SSL accept: SSL negotiation finished successfully reg

Removing M2Crypto debug data in production code

2005-01-12 Thread Ola Natvig
L accept: SSLv3 read client key exchange A LOOP: SSL accept: SSLv3 read finished A LOOP: SSL accept: SSLv3 write change cipher spec A LOOP: SSL accept: SSLv3 write finished A LOOP: SSL accept: SSLv3 flush data INFO: SSL accept: SSL negotiation finished successfully reg

Re: How do I make Windows Application with Python ?

2005-01-04 Thread Ola Natvig
isn't installed if you are familliar with the .NET framework you can use the beta release og Python.NET to create your GUI. It gives you access to the Windows Forms controlls in the .NET framework -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS /

Re: [dictionary] how to get key by item

2004-12-13 Thread Ola Natvig
has the same value as the item this will cause problems because keys in your result dictionary can be overwritten. Could it be a option to build the result dictionary as a dictionary with the values as the keys, and lists of keys as the value. Perhaps you need to use a loop for this. -- ---

Re: Find Items & Indices In A List...

2004-12-10 Thread Ola Natvig
range(len(mylist)) if mylist[i] == 1] -- -- Ola Natvig <[EMAIL PROTECTED]> infoSense AS / development -- http://mail.python.org/mailman/listinfo/python-list

Re: Unknown locale nb_NO ?

2004-12-07 Thread Ola Natvig
File "/usr/lib/python2.3/locale.py", line 280, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: nb_NO Any help would appreciated. Thanks, Stas I believe the standard locale for "Norsk bokmål" is 'no_NO'.

pyOpenSSL and Python 2.4? or alternatives...

2004-12-02 Thread Ola Natvig
Anyone that knows anyone knows a win32 Py2.4 build of pyOpenSSL? Or perhaps has a outstanding alternative to this SSL package. It's imperative the package is as simmilar to the standard socket library of python. Anyone? -- ------ Ola Natvig <[EMAIL P