Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: > >>[EMAIL PROTECTED] wrote: >> >> >>>Output from laptop comp.: >>> >>>1 >>>10 >>>2 >>>10 >>>3 >>>10 >> >>so how are you entering and running the code on your laptop ? >> >>what happens if you set the class attribute to 100 instead of 10 ? >> >> > >

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] > Read my other post. The code was/is definitely identical. In any event, > I don't really care. It's working properly now, and if I have similarly > weird problems in future, I'll deal with them at that time. I don't > know what was up, but I understand it doesn't ma

Re: An error ?

2006-06-12 Thread Steve Holden
Bo Yang wrote: > Hi , > I am confronted with an odd question in the python cgi module ! > > Below is my code : > > import cgitb ; cgitb.enable() > import cgi > > print "Hello World !" > > How easy the script is , and the url is 202.113.239.51/vote/cgi/a.py > but apache give me a 'Server interna

printing all variables

2006-06-12 Thread Sheldon
Good day, I would like to know if there is a way to print all the variables set in a python program with having to write "print variable" on all? sincerely, Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: Evaluating a Function After X Seconds: Python Equivalent to JavaScript's SetTimeout() Function

2006-06-12 Thread Diez B. Roggisch
Dennis Lee Bieber schrieb: > I don't know? How does "SetTimeout" actually behave? Asynchronously? > Synchronously? That is... would The former. It is the poor-mans threading of JavaScript so to speak. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: mutable member, bug or ...

2006-06-12 Thread Sambo
Bruno Desthuilliers wrote: > Sambo a écrit : > >> By accident I assigned int to a class member 'count' which was >> initialized to (empty) string and had no error till I tried to use it >> as string, obviously. Why was there no error on assignment( near the >> end ). > > > Python is dynamical

Re: How to link foreign keys & primary keys using python?

2006-06-12 Thread Steve Holden
sonal wrote: > Hi Mr. George, > Sorry for confusing u so much... > Let me try it again... > > I am not using any relational database to store the required tables > with primary keys & foreign keys > > When I say PRIMARY KEY => > 1. It means an index is created on the specified fields > (

Re: [mod_python] using nested blocks in psp

2006-06-12 Thread grahamd
cloc3 wrote: > I'm a newbie in python, and I'm fighting against nested blocks in psp. > Thats a little example with a funny behaviour: > [code] > > > > > > <% > for i in range(50, 350, 50): > if 'List' in form and int(form['List'])==i: > sel="selected" > else: > sel="pippo" > %> ><%=i%>

Re: printing all variables

2006-06-12 Thread Duncan Booth
Sheldon wrote: > Good day, > > I would like to know if there is a way to print all the variables set > in a python program with having to write > "print variable" on all? > Not all the variables in a program (that would be rather more than you want), but you can print all the variables in a spe

Function to remove elements from a list not working

2006-06-12 Thread Girish Sahani
Hi, I am trying to convert a list of pairs (l4) to list l5 by removing those pairs from l4 which are not present in a third list called pairList. The following is a simplified part of the routine i have written. However it does not give the correct output. Please help! Its possible i have made a

Re: Function to remove elements from a list not working

2006-06-12 Thread Maric Michaud
Le Lundi 12 Juin 2006 10:12, Girish Sahani a écrit : > def getl5(): >     l5 = [] >     pairList = [[1,2],[3,4],[3,5],[3,6],[9,7],[8,9],[8,7],[7,9],[11,10]] >     l4 = > [[4,2],[4,7],[4,10],[4,12],[9,2],[9,7],[9,10],[9,12],[11,2],[11,7]] for > pair in l4: >         if pair not in pairList: >      

Re: An error ?

2006-06-12 Thread Maric Michaud
Le Lundi 12 Juin 2006 09:07, Steve Holden a écrit : > print "Content-Type: text\plain\n" a typo I guess, print "Content-Type: text/plain\n" -- _ Maric Michaud _ Aristote - www.aristote.info 3 place des tapis 69004 Lyon Tel: +33 426 880 097 -- http://mail.python.org/mail

Function to remove elements from a list not working (corrected)

2006-06-12 Thread Girish Sahani
Hi, I am trying to modify a list of pairs (l4) by removing those pairs which are not present in a third list called pairList. The following is a simplified part of the routine i have written. However it does not give the correct output. Please help! Its possible i have made a trivial mistke sinc

Re: printing all variables

2006-06-12 Thread Sheldon
Duncan Booth skrev: > Sheldon wrote: > > > Good day, > > > > I would like to know if there is a way to print all the variables set > > in a python program with having to write > > "print variable" on all? > > > Not all the variables in a program (that would be rather more than you > want), but yo

Re: Python or Ajax?

2006-06-12 Thread bruno at modulix
Redefined Horizons wrote: > I've been hearing a ot about AJAX lately. I may have to build a web > application in the near future, and I was curoius: > > How does a web application that uses Python compare with one that uses > AJAX? How does a car that has a diesel motor compare with one that is r

Re: Intermittent Failure on Serial Port

2006-06-12 Thread H J van Rooyen
Serge Orlof wrote: | H J van Rooyen wrote: | > Serge Orloff wrote: | > | > | H J van Rooyen wrote: | > | > Traceback (most recent call last): | > | > File "portofile.py", line 232, in ? | > | > ret_val = main_routine(port, pollstruct, pfifo) | > | > File "portofile.py", line 108, in main_

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Maric Michaud
Le Lundi 12 Juin 2006 10:25, Girish Sahani a écrit : > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not give the correct outpu

Re: "parent" in a class __init__ def?

2006-06-12 Thread bruno at modulix
[EMAIL PROTECTED] wrote: (meta : please don't top-post) > Intuitively, the name lookup on > self.parent.foo would be faster than if you passed in the object in > question Each dot means doing a lookup in a namespace. The more dots, the more lookups. And lookups do have a cost. -- bruno desthui

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread [EMAIL PROTECTED]
Girish Sahani wrote: > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not give the correct output. Please help! > Its possible

Re: An error ?

2006-06-12 Thread Steve Holden
Maric Michaud wrote: > Le Lundi 12 Juin 2006 09:07, Steve Holden a écrit : > >>print "Content-Type: text\plain\n" > > a typo I guess, > print "Content-Type: text/plain\n" > Good eye! regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.

Re: "parent" in a class __init__ def?

2006-06-12 Thread bruno at modulix
Ray Schumacher wrote: > What is the feeling on using "parent" in a class definition "parent" is just a name. What is the semantic for this name ? Parent class (ie: superclass) ? Container ? Else ? > that class > methods Takes care, "class method" has a very defined meaning in Python - a class m

urllib behaves strangely

2006-06-12 Thread Gabriel Zachmann
Here is a very simple Python script utilizing urllib: import urllib url = "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronological"; print url print file = urllib.urlopen( url ) mime = file.info() print mime print file.read() print fi

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Girish Sahani
Thanks!It workedi wasted a lot of time trying to find a bug in my code...what is wrong in iterating over a list and modifying it? Doesnt python take the modified list every time the loop starts? Also in this case, i want to add a condition that if none of the pairs are in pairList, element = [

Re: [mod_python] using nested blocks in psp

2006-06-12 Thread cloc3
[EMAIL PROTECTED] wrote: See: > > http://www.modpython.org/pipermail/mod_python/2005-May/018102.html > > Comment hints may still be needed in certain cases to turn off scopes > even if 8 space or tab indents are needed so it is good to understand > what they are about. > Thank you. That solves m

py2exe & tkinter

2006-06-12 Thread Robin Becker
Don't know if this is the right place to ask, but has anyone considered using something like tcl's freewrap code to integrate tkinter into py2xe single executables? We currently use the (fairly clunky) nsis route to create single file executables with py2exe as input, but with the new bundle_fi

Re: Killing a thread

2006-06-12 Thread Antoon Pardon
Op 2006-06-10, Carl J. Van Arsdall schreef <[EMAIL PROTECTED]>: > Felipe Almeida Lessa wrote: >> Em Sex, 2006-06-09 às 13:54 -0700, Manish Marathe escreveu: >> >>> On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>> Manish Marathe wrote: >>> >>> > I am creating threa

Re: Function to remove elements from a list not working

2006-06-12 Thread bruno at modulix
Girish Sahani wrote: > Hi, > I am trying to convert a list of pairs (l4) to list l5 by removing those > pairs from l4 which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not give the correct output. Pleas

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Girish Sahani
Thank you Markthis works too... Btw going slightly off-topic, when i try to run a code like below with around 50 elements (pairs) in l4,python just hangs. Any ideas why this is happening...the data is not that large :(( > > Girish Sahani wrote: >> Hi, >> I am trying to modify a list of pairs (

Using PHP in Python

2006-06-12 Thread Tgone
Hello, I've come across sites that discuss embedding Python in PHP, but is it possible to access PHP functions in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using PHP in Python

2006-06-12 Thread Diez B. Roggisch
Tgone wrote: > Hello, > > I've come across sites that discuss embedding Python in PHP, but is it > possible to access PHP functions in Python? I'm not aware of a generic wrapper thingy. Which doesn't mean there is none. But which functions are you interested in? I can't believe there is much tha

Re: Using PHP in Python

2006-06-12 Thread Tgone
Diez B. Roggisch wrote: > Tgone wrote: > > > Hello, > > > > I've come across sites that discuss embedding Python in PHP, but is it > > possible to access PHP functions in Python? > > I'm not aware of a generic wrapper thingy. Which doesn't mean there is none. > But which functions are you interest

Re: Function to remove elements from a list working, but python hangs :((

2006-06-12 Thread Girish Sahani
Hey Bruno...you are seeing the wrong post :P...please ignore this and check out the one with (corrected) appended at the end... Also, i used the list comprehension thingy which u have given, but now the problem is python just hangs if my list l4 contains around 50 pairs...considering its not that b

Re: Using PHP in Python

2006-06-12 Thread Diez B. Roggisch
> I have some custom PHP functions that I didn't want to re-write in > Python. But maybe I should just rewrite them :) Certainly yes. And you'd be amazed how easier it is in python, I believe. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib behaves strangely

2006-06-12 Thread Benjamin Niemann
Gabriel Zachmann wrote: > Here is a very simple Python script utilizing urllib: > > import urllib > url = > "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronological"; > print url > print > file = urllib.urlopen( url ) > mime = file.info() > pri

Re: urllib behaves strangely

2006-06-12 Thread Benjamin Niemann
Benjamin Niemann wrote: > Gabriel Zachmann wrote: > >> Here is a very simple Python script utilizing urllib: >> >> import urllib >> url = >> "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronological"; >> print url >> print >> file = urllib.urlopen( url )

Re: py2exe & tkinter

2006-06-12 Thread Robin Becker
Robin Becker wrote: > Don't know if this is the right place to ask, but has anyone considered using > something like tcl's freewrap code to integrate tkinter into py2xe single > executables? > > We currently use the (fairly clunky) nsis route to create single file > executables with py2exe as i

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Maric Michaud
Le Lundi 12 Juin 2006 11:06, Girish Sahani a écrit : > Thanks!It workedi wasted a lot of time trying to find a bug in my > code...what is wrong in iterating over a list and modifying it? > Doesnt python take the modified list every time the loop starts? Python iterates over an iterator, that m

Re: urllib behaves strangely

2006-06-12 Thread John Hicken
Gabriel Zachmann wrote: > Here is a very simple Python script utilizing urllib: > > import urllib > url = > "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronological"; > print url > print > file = urllib.urlopen( url ) > mime = file.info() > pri

Re: urllib behaves strangely

2006-06-12 Thread Duncan Booth
Gabriel Zachmann wrote: > Here is a very simple Python script utilizing urllib: > > import urllib > url = > "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronologi > cal" > print url > print > file = urllib.urlopen( url ) > mime = file.info() >

Re: Intermittent Failure on Serial Port (Trace Result)

2006-06-12 Thread H J van Rooyen
8<-- (snip) old fail: | | > | > Traceback (most recent call last): | | > | > File "portofile.py", line 232, in ? | | > | > ret_val = main_routine(port, pollstruct, pfifo) | | > | > File "portofile.py", line 108, in main_routine | | > | > send_nak(port, timeout) # so

Re: Function to remove elements from a list working, but Python Hangs :((

2006-06-12 Thread Girish Sahani
> I guess it's already the case with lst = [ e for e in lst if e in pairs ] > > > In [1]: lst = (1,2,3,4) > > In [2]: pairs=(5,) > > In [3]: lst=[e for e in lst if e in pairs] > > In [4]: lst > Out[4]: [] Yes its working. I realized that i was giving an input which didnt satisfy the condition. Now

Re: Function to remove elements from a list working, but python hangs :((

2006-06-12 Thread bruno at modulix
Girish Sahani wrote: (please don't top-post) > Hey Bruno...you are seeing the wrong post :P...please ignore this and > check out the one with (corrected) appended at the end... You should have posted the correction in the same thread. > Also, i used the list comprehension thingy which u have gi

Re: Function to remove elements from a list working, but Python Hangs :((

2006-06-12 Thread Steve Holden
Girish Sahani wrote: >>I guess it's already the case with lst = [ e for e in lst if e in pairs ] >> >> >>In [1]: lst = (1,2,3,4) >> >>In [2]: pairs=(5,) >> >>In [3]: lst=[e for e in lst if e in pairs] >> >>In [4]: lst >>Out[4]: [] > > Yes its working. I realized that i was giving an input which di

Re: PIL problem after installation

2006-06-12 Thread peter
I had similar problems a couple of months back when I was teaching myself Tkinter and PIL. I wrote up my experiences here:- http://www.aqzj33.dsl.pipex.com/how_i_learned_tkinter/contents.htm If you look at the section on Images you will see how I eventually solved it (with bucket loads of help

Re: More pythonic shell sort?

2006-06-12 Thread John Machin
On 11/06/2006 1:26 PM, [EMAIL PROTECTED] wrote: > Thanks for the critique. > > John Machin wrote: >> On 10/06/2006 7:00 AM, [EMAIL PROTECTED] wrote: [snip] >>> def sort(self,myList): >>> for gap in self.gapSeq: >>> for i in range(1,gap+1): >>> self.gapInsert

Re: Using PHP in Python

2006-06-12 Thread Rene Pijlman
Tgone: >I have some custom PHP functions that I didn't want to re-write in >Python. But maybe I should just rewrite them :) Absolutely. The alternative is one of many IPC mechanisms that are available in both Python and PHP (such as XML-RPC). But that may require more effort than rewriting the f

Re: Very nice python IDE (windows only)

2006-06-12 Thread Jan Bijsterbosch
Hello ago, Bernard, "ago" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > > Bernard Lebel wrote: >> Not me. I'll probably sound pedantic but >> - the editor text looks awful, changing the editor options had no effect >> at all >> - there is no network access of UNC paths other th

Searching and manipulating lists of tuples

2006-06-12 Thread MTD
Hello, I'm wondering if there's a quick way of resolving this problem. In a program, I have a list of tuples of form (str,int), where int is a count of how often str occurs e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs twice If I am given a string, I want to search L to

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Mike Kent
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs ... > So clearly that doesn't work... any ideas? Yes, use the proper tool for the job. Tuples are

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Steve Holden
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Harold Fellermann
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given a

Re: Searching and manipulating lists of tuples

2006-06-12 Thread MTD
> Yes, use the proper tool for the job. Tuples are immutable (they are > read-only once created). Instead use a dictionary. They key would be > your string, the value would be the count. Wow, I really should have thought of that! Thanks. -- http://mail.python.org/mailman/listinfo/python-list

(pre)forking server framework?

2006-06-12 Thread czajnik
Hi! I'm quite new to Python development. Can someone advise me a framework useful for building (pre-)forking or threaded TCP servers, other than SocketServer ? I've seen source code of a few python-based app servers, all of theme seem to reinvent the wheel, eventually reusing SocketServer. I'd ap

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Gerard Flanagan
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given a

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Boris Borcic
Girish Sahani wrote: > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not give the correct output. Please help! > Its possible

Re: An error ?

2006-06-12 Thread Bo Yang
It works , thank you everyone ! I think there is much more I need to learn before I can grasp a full understand of the C/S modle ! Thanks again ! -- http://mail.python.org/mailman/listinfo/python-list

Re: (pre)forking server framework?

2006-06-12 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > > Hi! > > I'm quite new to Python development. Can someone advise me a framework > useful for building (pre-)forking or threaded TCP servers, other than > SocketServer ? I've seen source code of a few python-based app servers, > all of theme seem to reinvent the wheel,

Re: Screen Scraping for Modern Applications?

2006-06-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: . . . >Scrape means simply scraping pixel colors from locations on the screen. >I'll worry about assembling it into meaningful information. > >Previously, I used Java,

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 12)

2006-06-12 Thread Cameron Laird
QOTW: "Check out BeautifulSoup -- you will never write HTMLParser-based screen scrapers again. :)" - Jonathan Ellis "You clearly need something instead of XML." - Paul McGuire http://groups.google.com/group/comp.lang.python/msg/09e943c8dbf1e8c5? Johann C. Rocholl donates a PNG manager i

Re: Python or Ajax?

2006-06-12 Thread Bo Yang
I think if you know java language very well but feel suffering with the error prone javascript , GWT is good choose for AJAX development . With the well-known IDE Eclipse your development time efficiency will promote fast ! -- http://mail.python.org/mailman/listinfo/python-list

logging magic

2006-06-12 Thread [EMAIL PROTECTED]
Hi everyone. I've just been trying to add a bit more granularity to my logging code, as the jump from INFO (level 20) to DEBUG (level 10) is a bit too big. I was thinking of borrowing a few levels from java: fine (18), finer (16) and finest(14). This is what I've tried: log = logging.getLogger(a

Re: Python or Ajax?

2006-06-12 Thread dingbat
Redefined Horizons wrote: > How does a web application that uses Python compare with one that uses AJAX? Mauve has the most RAM -- http://mail.python.org/mailman/listinfo/python-list

Re: (pre)forking server framework?

2006-06-12 Thread czajnik
Diez B. Roggisch napisal(a): > Why do you care if the asynchronous model is overkill or the performance is > good? Twisted comes close to what you want - and using its strength as > arguments against it strikes me as odd. I was unclear :) I mean I don't like using asynchronous model for the kind

Re: Very nice python IDE (windows only)

2006-06-12 Thread digitalorganics
Great IDE! I love it. Two things that make me very happy: 1. Unlike PythonWin and Stan's Python Editor (SPE), PyScripter shows not just methods but also attributes in the class browser. [I'll mention that Eric3 also does this, but I don't use Eric3 much because the editor component doesn't allow s

Re: (pre)forking server framework?

2006-06-12 Thread Thomas Guettler
Am Mon, 12 Jun 2006 06:22:52 -0700 schrieb czajnik: > > Hi! > > I'm quite new to Python development. Can someone advise me a framework > useful for building (pre-)forking or threaded TCP servers, other than > SocketServer ? I've seen source code of a few python-based app servers, > all of theme

Re: Very nice python IDE (windows only)

2006-06-12 Thread digitalorganics
Jan Bijsterbosch wrote: > Hello ago, Bernard, > > "ago" <[EMAIL PROTECTED]> schreef in bericht > news:[EMAIL PROTECTED] > > > > Bernard Lebel wrote: > >> Not me. I'll probably sound pedantic but > >> - the editor text looks awful, changing the editor options had no effect > >> at all > >> - there

Re: Very nice python IDE (windows only)

2006-06-12 Thread digitalorganics
By the way, does anyone know if / how you can change the key bindings in PythonWin? In PyScripter, I was quite pleased that the autocomplete lets you make your selection by pressing enter (natural), yet in PythonWin you have to press tab (unnatural). Thanks. [EMAIL PROTECTED] wrote: > Great IDE! I

Re: Win XP: Problem with shell scripting in Python

2006-06-12 Thread A.M
>Does it overcome the problem that you reported earlier, that the contents of the output file from BCP were out of order? Yes, it does. But, to be honest, I don't know how!!! "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/06/2006 3:00 AM, A.M wrote: >> He

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Paul McGuire
"Girish Sahani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not

Re: Thread specific singleton

2006-06-12 Thread jhnsmth
Gabriele Farina wrote: > Hi, > > I'm tring to implement a Singleton object that should be specific for > every thread who create it, not global. > I tried a solution that seems to work, but I have a very poor knowledge > of concurrent programming, so I'd like someone to help me find some > problem

VC++ types to ctypes

2006-06-12 Thread lux
Hi to all, i need to traslate this struct in python using ctypes struct Soptions { char chVolumeLabel[128]; __int32 nSessionToImport; BS_BOOL bJolietFileSystem; BS_BOOL bBootable; TCHAR chBootImage[_MAX_PATH]; BS_BOOL bFinalize; BS_BOOL bTestBurn; BS_BOOL bPerformOPC; BS_BOOL bV

Bridge: Ruby to Python communication

2006-06-12 Thread digitalorganics
Hello all. I want a ruby and a python module to be able to communicate with each other, access classes, instances and the like. Is there a bridge for this? I'm aware of rupy, but the documentation seems rather inadequate for the uninitiated. Are there other libraries/bridges or maybe a rupy tutoria

Re: PIL problem after installation

2006-06-12 Thread Fredrik Lundh
Lad wrote: > I downloaded jpeg (from ftp://ftp.uu.net/graphics/jpeg/ ) source > libraries( file jpegsrc.v6b.tar.gz) and installed them. Now in > /usr/local/lib I have the following files: cjpeg > ,djpeg,jpegtran,rdjpgcom and wrjpgcom cjpeg, djpeg etc are executables, not libraries. if you have

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Sion Arrowsmith
Steve Holden <[EMAIL PROTECTED]> wrote: >def algorith(d, s): > if s in d: > d[s] += 1 > else: > d[s] = 1 def algorith(d, s): d[s] = d.get(s, 0) + 1 And the OP should note that converting between dict d and list of pairs L is simply a matter of L = d.items() and d = di

Re: Using PHP in Python

2006-06-12 Thread Michel Claveau
Hi! Only in Windows, I can call PHP (more exactly PHP-script) from Python. I can, also, call, from Python, PHP-defined-functions, like a method of a Python-class. It's a combination of Active-scripting & dynamic method add to a class. -- @-salutations Michel Claveau -- http://mail.python.o

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Fredrik Lundh
Girish Sahani wrote: > Btw going slightly off-topic, when i try to run a code like below with > around 50 elements (pairs) in l4,python just hangs. Any ideas why this is > happening...the data is not that large :(( building a filtered new list by repeatedly removing stuff from a copy of the origi

Re: ANN: PyQt v4.0 Released - Python Bindings for Qt v4

2006-06-12 Thread Damjan
> QtNetwork > A set of classes to support TCP and UDP socket programming and higher > level protocols (eg. HTTP). Since QtNetwork is asynchronous how does it compare to twisted? I find Qt's signals and slots easier to understand and work with than twisted deferreds. -- damjan -- h

Re: Bridge: Ruby to Python communication

2006-06-12 Thread vasudevram
[EMAIL PROTECTED] wrote: > Hello all. I want a ruby and a python module to be able to communicate > with each other, access classes, instances and the like. Is there a > bridge for this? I'm aware of rupy, but the documentation seems rather > inadequate for the uninitiated. Are there other librari

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Fredrik Lundh
Girish Sahani wrote: > Thanks!It workedi wasted a lot of time trying to find a bug in my > code...what is wrong in iterating over a list and modifying it? > Doesnt python take the modified list every time the loop starts? this is explained in the tutorial, under "the for statement": The

Re: Bridge: Ruby to Python communication

2006-06-12 Thread Michel Claveau
Hi! For me, like PHP (message of 11h.35) : Only in Windows, I can call Ruby (more exactly Ruby-script) from Python. I can, also, call, from Python, Ruby-defined-functions, like a method of a Python-class. It's a combination of Active-scripting & dynamic method add to a class. It's run OK with

Re: VC++ types to ctypes

2006-06-12 Thread Thomas Heller
lux wrote: > Hi to all, > i need to traslate this struct in python using ctypes > > struct Soptions > { > char chVolumeLabel[128]; > __int32 nSessionToImport; > BS_BOOL bJolietFileSystem; > BS_BOOL bBootable; > TCHAR chBootImage[_MAX_PATH]; > BS_BOOL bFinalize; > BS_BOOL bTestBu

Re: Bridge: Ruby to Python communication

2006-06-12 Thread digitalorganics
I'll check that out, thanks! vasudevram wrote: > [EMAIL PROTECTED] wrote: > > Hello all. I want a ruby and a python module to be able to communicate > > with each other, access classes, instances and the like. Is there a > > bridge for this? I'm aware of rupy, but the documentation seems rather >

Re: Searching and manipulating lists of tuples

2006-06-12 Thread bruno at modulix
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given

Re: Bridge: Ruby to Python communication

2006-06-12 Thread digitalorganics
Wait wait, what do I do exactly? Thanks Michel. Michel Claveau wrote: > Hi! > > For me, like PHP (message of 11h.35) : > > Only in Windows, I can call Ruby (more exactly Ruby-script) from > Python. > I can, also, call, from Python, Ruby-defined-functions, like a method > of a Python-class. > > It'

Re: Writing PNG with pure Python

2006-06-12 Thread Johann C. Rocholl
> Just in case anybody has the same problem, here's my first attempt at > implementing a subset of the PNG spec in pure Python. I license it to > you under the terms of the GNU GPL. Update: the code is now licensed under the Apache License 2.0. > http://trac.browsershots.org/browser/trunk/shotfac

Re: Intermittent Failure on Serial Port (Trace Result)

2006-06-12 Thread Serge Orlov
H J van Rooyen wrote: > Note that the point of failure is not the same place in the python file, but > it > is according to the traceback, again at a flush call... Yes, traceback is bogus. Maybe the error is raised during garbage collection, although the strace you've got doesn't show that. The

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 12)

2006-06-12 Thread John Salerno
Cameron Laird wrote: > Andrew Clover provides new Python icons: >http://doxdesk.com/img/software/py/icons2.png >http://mail.python.org/pipermail/python-dev/2006-March/063235.html >http://mail.python.org/pipermail/python-dev/2006-April/063517.html I love the new 'folder

Boa constructor- is it still alive?

2006-06-12 Thread tatamata
Does anyone know is Boa constructor project still alive? I visited Boa web site and it seems that it hasn't been updated for a long time -- http://mail.python.org/mailman/listinfo/python-list

[newbie]apache authentication questions

2006-06-12 Thread nuffnough
I have an apache 1.3.29 server that is running my website. I have written a bunch of scripts to generate the pages from csv files which work great. My next thing to learn is how to get user authentication functioning the way I need it. I understand the steps required to make .htpaccess files wor

Network Ports - blocking / taking over

2006-06-12 Thread abcd
Just curious if anyone had any information, or links, regarding the blocking of network ports and/or taking over (hijacking) ports using Python. Any python modules/libs you could recommend? tutorials/reading materials? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: VC++ types to ctypes

2006-06-12 Thread lux
Thank you now it work!!! Thomas Heller ha scritto: > lux wrote: > > Hi to all, > > i need to traslate this struct in python using ctypes > > > > struct Soptions > > { > > char chVolumeLabel[128]; > > __int32 nSessionToImport; > > BS_BOOL bJolietFileSystem; > > BS_BOOL bBootable; >

Advanced lockfiles

2006-06-12 Thread David Hirschfield
I'm not sure it's even possible to do what I'm trying to here...just because the logistics may not really allow it, but I thought I'd ask around... I want some kind of lockfile implementation that will allow one process to lock a file (or create an appropriately named lockfile that other proce

Re: Bridge: Ruby to Python communication

2006-06-12 Thread Michel Claveau
Hi! Sorry for my bad english. Look here : http://www.mvps.org/scripting/languages/ Python, with PyWin32, can use ActiveScripting. But... only windows... -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced lockfiles

2006-06-12 Thread Carl J. Van Arsdall
David Hirschfield wrote: > I want some kind of lockfile implementation that will allow one process > to lock a file (or create an appropriately named lockfile that other > processes will find and understand the meaning of), but there are some > important requirements: > > 1. Multiple processes w

Re: Boa constructor- is it still alive?

2006-06-12 Thread jean-michel bain-cornu
tatamata a écrit : > Does anyone know is Boa constructor project still alive? > I visited Boa web site and it seems that it hasn't been updated for a long > time > I downloaded the version 0.4.4 a couple of months ago, so I guess the project is alive (I have been used the 0.3.1 before). I h

Re: Advanced lockfiles

2006-06-12 Thread Christopher Weimann
On 06/12/2006-11:00AM, David Hirschfield wrote: > > I want some kind of lockfile implementation that will allow one process > to lock a file (or create an appropriately named lockfile that other > processes will find and understand the meaning of), but there are some > important requirements: >

Egg cache problem with mod_python/ez_setup

2006-06-12 Thread Manuzhai
Hello there, I have this weird problem with a mod_python application. Recently I installed ElementTree and cElementTree through ez_setup.py, even though they were already installed normally (this might not be too smart, but I don't think it's related to my actual problem). I have a web applica

wxpython: how do i write this without the id parameter?

2006-06-12 Thread John Salerno
I was reading in the wxPython wiki that most of the time you don't have to include the id parameter at all, and you can just use keyword arguments for other parameters. But I'm having trouble converting this code into that method (i.e., without the id parameter). I keep getting errors that invo

PIL show moves focus

2006-06-12 Thread elbertlev
Hi! I have an application where images (jpeg) have to be annotated by an operator. I use PIL like: import Image im = Image.open(Path) im.show() raw_input(Path + ':') Python runs in a console window. Then show starts some application (in my case "Windows picture and FAX viewer") and the pict

Logging to a file and closing it again properly (logging module)

2006-06-12 Thread Christoph Haas
Evening, I have an application that is running in an endless loop processing an incoming queue. Every run is supposed to write a log file about the run and then close it again. While the 'logging' module is generally working well (even though the documentation makes me miss some proper examples ho

  1   2   >