Re: .dll files

2005-06-21 Thread Sabin.A.K
Thank you Larry, And one more thing to ask, Will the COM Object be a total solution for my problems? I just try to make a dll to encapsulate some 'icon and text' files for my application. Which should get installed in the users system while installing it. but user should not be able to edit those

py2exe problem

2005-06-21 Thread Austin
I use py2exe to build python program to "aa.exe". If this program has a bug, after closed this program, it will show "aa.exe.log" in this folder. Is there any ways to avoid this log file? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python choice of database

2005-06-21 Thread EP
Oren suggested: > How about using the filesystem as a database? For the number of records > you describe it may work surprisingly well. A bonus is that the > database is easy to manage manually. I tried this for one application under the Windows OS and it worked fine... until my records (text -

Re: A tool for Python - request for some advice

2005-06-21 Thread Brian van den Broek
TPJ said unto the world upon 21/06/2005 02:00: > First I have to admit that my English isn't good enough. I'm still > studying and sometimes I just can't express what I want to express. I've graded essays in Philosophy at my university that were written by native speakers of English yet were sub

Re: A tool for Python - request for some advice

2005-06-21 Thread Robert Kern
Brian van den Broek wrote: > That suggests implementing the custom installation work in Python, and > having a bash script that will > > 1) determine if there is an existing Python install, > 2) if there is not, install Python in the standard way, > 3) using the now guaranteed to be there instal

Re: py2exe problem

2005-06-21 Thread Simon Brunning
On 6/21/05, Austin <[EMAIL PROTECTED]> wrote: > I use py2exe to build python program to "aa.exe". > If this program has a bug, after closed this program, it will show > "aa.exe.log" in this folder. > Is there any ways to avoid this log file? It's probably best just have a try/except at the very to

Re: tree functions daily exercise: Table

2005-06-21 Thread Xah Lee
here's the Python spec for the Table function: '''Table(f,[iStart,iEnd,iStep]) returns a list of f applied to the range range(iStart,iEnd,iStep). Example: Table(f,[3,10,2]) returns [f(3),f(5),f(7),f(9)] Table(f,[iStart,iEnd,iStep], [jStart,jEnd,jStep], ...) returns a nested list of f(i,j,...)

Re: strxfrm works with unicode string ?

2005-06-21 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Gruëzi, Gerald ;-) > > Well, ok, but I don't understand why I should first convert a pure > unicode string into a byte string. > The encoding ( here, latin-1) seems an arbitrary choice. Yes. The correct choice would be 'cp1252', not 'latin-1', since that's what your loc

Re: How to get/set class attributes in Python

2005-06-21 Thread Simon Brunning
On 6/12/05, Steve Jorgensen <[EMAIL PROTECTED]> wrote: > Oops - I thought I cancelled that post when I relized I was saying nothing, Would that everyone cancelled their posts when they realised that they weren't saying anything. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonlin

Re: after transfer of data from MS-outlook(mail ids) to application, mail ids are consisting of strange characters

2005-06-21 Thread Konstantin Veretennicov
On 20 Jun 2005 22:24:09 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello all, ... > I hope somebody will help > me in this regard to unfold this mystery.Bye. I hope you will explain how this is related to Python. - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: .dll files

2005-06-21 Thread Konstantin Veretennicov
On 20 Jun 2005 23:56:50 -0700, Sabin.A.K <[EMAIL PROTECTED]> wrote: > > Will the COM Object be a total solution for my problems? I just try to > make a dll to encapsulate some 'icon and text' files for my > application. Are you trying to create a windows resource dll? I believe Python isn't the t

Re: FAQ: __str__ vs __repr__

2005-06-21 Thread Simon Brunning
On 6/15/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > __repr__ shouldn't be anything, if you don't have an actual need for it. > Neither should __str__. Oh, I don't know. __str__ is so frequently useful in debugging and logging that I always try and do something useful with it. -- Cheers, Simo

Re: regarding cache clearing header in python cgi

2005-06-21 Thread Fredrik Lundh
"praba kar" wrote: > In Php the following headers base we can clean > the cache in the url "header('Cache-Control: > no-store, no-cache, must-revalidate'); " > I want to know Php equivalent headers in Python-cgi > If anybody know regarding this kindly mail me. did you try print 'Cache

Re: Python choice of database

2005-06-21 Thread Jeremy Sanders
On Mon, 20 Jun 2005 23:42:21 -0800, EP wrote: > until my records (text - maybe 50KB average) unexpectedly blossomed into > the 10,000-1,000,000 ranges. If I or someone else (who innocently doesn't > know better) opens up one of the directories with ~150,000 files in it, > the machine's personalit

ZEO client hangs when combined with other asyncore code

2005-06-21 Thread Paul Boots
Dear people, We have an application that makes use of a ZEO client and has other async socket code that implements as POP3 proxy. The ZEO client is called (to query and store ZEO server) from within the proxy code when it runs during mail checks, so we have multiple async connections at the sa

ZEO client hangs when combined with other asyncore code

2005-06-21 Thread Paul Boots
Dear people, We have an application that makes use of a ZEO client and has other async socket code that implements as POP3 proxy. The ZEO client is called (to query and store ZEO server) from within the proxy code when it runs during mail checks, so we have multiple async connections at the sa

Re: ISO authoritative Python ref

2005-06-21 Thread Magnus Lycka
bill wrote: >>I have to learn Python in a hurry. > > My apologies. I found what I needed. I don't understand it how > I missed it in my first round of searching. I don't know what you found, but I think you would appreciate Martelli's "Python in a Nutshell". For the really, really terse versi

Howto access a enumeration in a COM TypeLib

2005-06-21 Thread Alexander Eisenhuth
Hello alltogether, I hope somebody can help me in that case. I bet I have overseen s.th.. I have a VC++ IDispatch Com-Server (ATL) and include for error handling issues a enumeration in the IDL-File. [...] enum PROG_ERROR { P_OK = 0, P_ERR_01 = 1, P_ERR_02 = 2, .

Re: getting list of all available modules

2005-06-21 Thread TZOTZIOY
On Tue, 21 Jun 2005 01:33:06 GMT, rumours say that Benjamin Rutt <[EMAIL PROTECTED]> might have written: >I note that the help() function of interactive python can determine >all available modules: >I want to do the same (get all such modules in a python list); how can >I do so? Or where is th

Re: Loop until condition is true

2005-06-21 Thread Magnus Lycka
Remi Villatel wrote: > while True: > some(code) > if final_condition is True: > break > # > # > > What I don't find so "nice" is to have to build an infinite loop only to > break it. This is a common Python idiom. I think you will get used to it. > Is there a better recipe?

Re: Create our own python source repository

2005-06-21 Thread qwweeeit
Hi datacide, before, the good part...: thank you for your replay. Your suggestion has opened me a new worldl: an alternative method to get web resources. Now the bad part: your is an example of "guru's suggestion", that is a few words from which the poor newbye can't exctract much. It is much mor

Re: Using print with format to stdout generates unwanted space

2005-06-21 Thread Jorgen Grahn
On Tue, 21 Jun 2005 00:08:03 +0100, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: ... > For quick and simple removal of the extra space, append a '\b' > backspace character to your output "string" For things that are only ever to be viewed on the terminal, yes. But this does, of course, print

Re: Howto access a enumeration in a COM TypeLib

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Alexander Eisenhuth <[EMAIL PROTECTED]> wrote: > Hello alltogether, > > I hope somebody can help me in that case. I bet I have overseen s.th.. > > I have a VC++ IDispatch Com-Server (ATL) and include for error handling > issues a enumeration in the IDL-File. > > [...] > enum PROG_ERR

eval() in python

2005-06-21 Thread Xah Lee
is it possible to eval a string like the following? m=''' i0=[0,1] i1=[2,3] i2=[4,'a'] h0=[] for j0 in i0: h1=[] for j1 in i1: h2=[] for j2 in i2: h2.append(f(j0,j1,j2)) h1.append( h2[:] ) h0.append( h1[:] ) return h0''' perhaps i'm tired, but why can't i run: t='m=3' pr

Re: Loop until condition is true

2005-06-21 Thread Cyril BAZIN
Another question could be: why is there not a statement "whileTrue" or "loop"? For exemple: whileTrue:     statement 1     if condition:     break     statement 2 It could be an economy of one unuseful test by loop.On 6/21/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: Remi Villate

Re: getting list of all available modules

2005-06-21 Thread Peter Otten
Benjamin Rutt wrote: > I want to do the same (get all such modules in a python list); how can > I do > so?  Or where is the code for the REPL for help() itself so I can > find out myself? Get hold of the Python source code and grep for some (hopefully) selective piece of text. In the case of hel

Re: Create our own python source repository

2005-06-21 Thread Michele Simionato
qwwee: > for a certain argument I'd prefer an application fully >explained (also if not covering all the features) to a more general >tutorial with only brief and unrelated code snippets. >Unfortunately, that's not the way things are normally done, because it >is much harder to build a useful appli

Re: OO approach to decision sequence?

2005-06-21 Thread Magnus Lycka
Chinook wrote: > I understand what you are saying. The point I'm messing up my head with > though, is when the entity (tree node in my case or variable record content > deconstructing in the aspect example I noted) is not an instance of a class > already - it is obtained from an external source

Re: eval() in python

2005-06-21 Thread harold fellermann
> the doc seems to suggest that eval is only for expressions... it says > uses exec for statements, but i don't seem to see a exec function? Python 2.4 (#1, Dec 30 2004, 08:00:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for mo

Re: Back to the future - python to C++ advice wanted

2005-06-21 Thread Jorgen Grahn
On 17 Jun 2005 06:26:50 -0700, George Sakkis <[EMAIL PROTECTED]> wrote: > During the last 18 months or so I have indulged in the joy of learning > and using python for almost everything, but I may have to go back to > C/C++ at work. Suddenly I found myself transliterating (or translating > at least

Embedding Python - Deleting a class instance

2005-06-21 Thread Bue Krogh Vedel-Larsen
How do I delete a class instance created using PyInstance_New? I've tried calling Py_CLEAR on the instance, but __del__ isn't called. I've also tried calling PyObject_Del, but this gives an access violation in _PyObject_DebugDumpAddress so I guess that ain't a good idea :) I've noticed that the

Re: FAQ: __str__ vs __repr__

2005-06-21 Thread Peter Hansen
Simon Brunning wrote: > On 6/15/05, Peter Hansen <[EMAIL PROTECTED]> wrote: >>__repr__ shouldn't be anything, if you don't have an actual need for it. >> Neither should __str__. > > Oh, I don't know. __str__ is so frequently useful in debugging and > logging that I always try and do something use

Re: eval() in python

2005-06-21 Thread Peter Hansen
Xah Lee wrote: > the doc seems to suggest that eval is only for expressions... it says > uses exec for statements, but i don't seem to see a exec function? Because it's a statement: http://docs.python.org/ref/exec.html#l2h-563 -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding Python - Deleting a class instance

2005-06-21 Thread Denis S. Otkidach
On Tue, 21 Jun 2005 12:06:47 GMT "Bue Krogh Vedel-Larsen" <[EMAIL PROTECTED]> wrote: > How do I delete a class instance created using PyInstance_New? I've tried > calling Py_CLEAR on the instance, but __del__ isn't called. I've also tried > calling PyObject_Del, but this gives an access violatio

Re: Embedding Python - Deleting a class instance

2005-06-21 Thread Jeff Epler
I wrote the following module to test the behavior of PyInstance_New. I called it something like this: import vedel class k: def __del__(self): print "deleted" vedel.g(k) I get output like: after creation, x->refcnt = 1 doing decref deleted after decref Unles

Re: Loop until condition is true

2005-06-21 Thread Benji York
Cyril BAZIN wrote: > Another question could be: why is there not a statement "whileTrue" or > "loop"? I don't think the saving of a single space to transform "while True:" into "WhileTrue:" is really worth it. The same goes for "loop", the added complexity to the language (as little as it is)

Re: eval() in python

2005-06-21 Thread Jeff Epler
On Tue, Jun 21, 2005 at 08:13:47AM -0400, Peter Hansen wrote: > Xah Lee wrote: > > the doc seems to suggest that eval is only for expressions... it says > > uses exec for statements, but i don't seem to see a exec function? > > Because it's a statement: http://docs.python.org/ref/exec.html#l2h-563

Re: Want to learn a language - is Python right?

2005-06-21 Thread Steven D'Aprano
On Mon, 20 Jun 2005 17:23:27 -0700, James Stroud wrote: > By the way, ignore any posts talking about speed of execution. This is > generally a non-issue for new programmers. If you want your code to run > faster, buy a faster computer. Oooh, red rag to a bull. Not everybody can afford to buy a

Europython 2005 - last call

2005-06-21 Thread Jacob Hallen
Europython 2005 will start on Monday 27 June! If you haven't preregistered for Europython 2005, you still have a few hours to do so. You can register and pay by credit card until 21 June 18.00 CEST. Payment by SWIFT/IBAN is closed, since we would not receive your payment before the conference sta

Leo 4.3.1 released

2005-06-21 Thread Edward K. Ream
Leo 4.3.1 final is now available at http://sourceforge.net/projects/leo/ This is a bug fix release, with the following new features: - Added support for Tk resource files. - Added support for coloring the PL/SQL language. - All Mark commands are now undoable. - Improved Resize To Screen command.

Re: tree functions daily exercise: Table

2005-06-21 Thread Xah Lee
the example in the spec of previous post is wrong. Here's corrected version: here's the Python spec for the Table function: '''Table(f,[iStart,iEnd,iStep]) returns a list of f applied to the range range(iStart,iEnd,iStep). Example: Table(f,[3,10,2]) returns [f(3),f(5),f(7),f(9)] Table(f,[iStart,

Re: Question about HTMLgen

2005-06-21 Thread Sebastian Bassi
Thanks, you are right! On 6/20/05, Konstantin Veretennicov <[EMAIL PROTECTED]> wrote: > > > type="image/svg+xml" name="wmap" wmode="transparent"> > > Works for me... -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Ex

Re: eval() in python

2005-06-21 Thread Benji York
harold fellermann wrote: > >>> s="print 'hello Xah Lee :-)'" > >>> exec(s) > hello Xah Lee :-) Note that because "exec" is a statement, the parentheses above are superfluous. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Python can do it for me?

2005-06-21 Thread [EMAIL PROTECTED]
Hello people! I think it is my first message here. Well, I would go to start a Delphi database program, but now my client want a program that runs in Linux. So I want to know your opinion: what best language/IDE I can use for my purposes? I need mainly: MySQL or Potsgree SQL ***remote connection*

Re: after transfer of data from MS-outlook(mail ids) to application, mail ids are consisting of strange characters

2005-06-21 Thread Beat Bolli
> [Å@ [Å. [Å,©Ä@ ©Ä. ©Ä etc. This looks like UTF-8 encoding Beat -- mail: echo '<[EMAIL PROTECTED]>' | tr -d '[A-S]' pgp: 0x506A903A; 49D5 794A EA77 F907 764F D89E 304B 93CF 506A 903A gsm: 4.7.7.6.0.7.7.9.7.1.4.e164.arpa icbm: 47.0452 N, 7.2715 E "It takes love over gold, and mind over matt

Re: Want to learn a language - is Python right?

2005-06-21 Thread sjmsoft
Aziz McTang wrote: > What I'm looking for is more to learn one good, comprehensive > programming language well than several approximately on an ad hoc > basis. What I also failed to mention is the desire to develop my > presently limited computer skills a lot further. I've programmed in perhaps 20

Re: Python choice of database

2005-06-21 Thread Charles Krug
On Mon, 20 Jun 2005 23:42:21 -0800, EP <[EMAIL PROTECTED]> wrote: > Oren suggested: > >> How about using the filesystem as a database? For the number of records >> you describe it may work surprisingly well. A bonus is that the >> database is easy to manage manually. > > I tried this for one appl

Re: Embedding Python - Deleting a class instance

2005-06-21 Thread Bue Krogh Vedel-Larsen
Jeff Epler <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Unless there's a cycle and GC gets involved, all there is to deleting > *anything* in Python is correctly managing the refcount. On the other > hand, you can never free an object while it is still reachable. Some > local name

Re: Howto access a enumeration in a COM TypeLib

2005-06-21 Thread Alexander Eisenhuth
Thanks, thats it. Konstantin Veretennicov schrieb: import myserver print myserver.constants. P_OK > 0 > > Maybe you can access constants without makepy, I don't know. > > - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-21 Thread Charles Krug
On Tue, 21 Jun 2005 12:05:25 +0200, Magnus Lycka <[EMAIL PROTECTED]> wrote: > Remi Villatel wrote: >> while True: >> some(code) >> if final_condition is True: >> break >> # >> # >> >> What I don't find so "nice" is to have to build an infinite loop only to >> break it. > > Th

Re: Python can do it for me?

2005-06-21 Thread Grigoris Tsolakidis
PyQt for example will do all this + Python but the desition is not that easy <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello people! I think it is my first message here. > > Well, I would go to start a Delphi database program, but now my client > want a program that runs

Re: Python can do it for me?

2005-06-21 Thread Benji York
[EMAIL PROTECTED] wrote: > MySQL or Potsgree SQL ***remote connection***(it's the most important). > GUI interface. > Report generator. > Barcode printing. I've done all of these very successfully in Python. > Maybe PyGTK can do it for me? What do you think? I've never used PyGTK, but it looks n

Re: A tool for Python - request for some advice

2005-06-21 Thread Peter Maas
TPJ schrieb: > First I have to admit that my English isn't good enough. I'm still > studying and sometimes I just can't express what I want to express. No excuses, please! Keep in mind that your English is much better than the Polish of most of us. And just in case you were fishing for compliments

Re: tree functions daily exercise: Table

2005-06-21 Thread Duncan Booth
Xah Lee wrote: > '''Table(f,[iStart,iEnd,iStep]) returns a list of f applied to the > range range(iStart,iEnd,iStep). Example: Table(f,[3,10,2]) returns > [f(3),f(5),f(7),f(9)] Table(f,[iStart,iEnd,iStep], > [jStart,jEnd,jStep], ...) returns a nested list of f(i,j,...) applied > thru the iterator

Re: FAQ: __str__ vs __repr__

2005-06-21 Thread Skip Montanaro
>> __repr__ shouldn't be anything, if you don't have an actual need for >> it. Neither should __str__. Simon> Oh, I don't know. __str__ is so frequently useful in debugging Simon> and logging that I always try and do something useful with it. And sometimes __repr__ inherited fro

Re: Python can do it for me?

2005-06-21 Thread [EMAIL PROTECTED]
Really? I see Python is very good general-purpose language. I studing TCL, C++ and Java too. And remote conection? Do you know something? Thank you very much! Bye! -- http://mail.python.org/mailman/listinfo/python-list

Re: Install MySQL-python-0.9.1

2005-06-21 Thread Andy Dustman
Cathy Hui wrote: > I am trying to install MySQL-Python 0.9.1 on my Solaris 8 system. The > system has Python 2.3.3 and Mysql 4.0.21 installed. You're wasting your time. Use MySQL-python-1.2.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using code objects?

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Chinook <[EMAIL PROTECTED]> wrote: > > When I create the code objects though, it seems a couple different ways work > and I'm wondering which is better and why (or is there a more correct > technique in this situation)? > > The two different ways are illustrated below: ... > >>> obj1

Re: Python choice of database

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Charles Krug <[EMAIL PROTECTED]> wrote: > > Related question: > > What if I need to create/modify MS-Access or SQL Server dbs? You could use ADO + adodbapi for both. http://adodbapi.sourceforge.net/ - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-21 Thread Fredrik Lundh
Remi Villatel wrote: > There is always a "nice" way to do things in Python but this time I can't > find one. > > What I'm trying to achieve is a conditionnal loop of which the condition > test would be done at the end so the loop is executed at least once. It's > some way the opposite of "while".

Re: Loop until condition is true

2005-06-21 Thread Magnus Lycka
Benji York wrote: > If by "economy" you mean "optimization", then I would suggest that the > difference would be unnoticeable. If there is a measurable performance gain in skipping the runtime test in "while True", then this is a compiler issue, not a language issue. I don't know anything about t

asynchronous comunication, wxPython and threads.

2005-06-21 Thread Zunbeltz Izaola
Hi, I have the following problem. I'm developing a GUI program (wxPython). This program has to comunicate (TCP) whit other program that controls a laboratory machine to do a measurement. I have a dialog box, wiht two buttoms "Start measurement" and "Stop". "Start" executes a function that do the

How do I access avariable named "return"?

2005-06-21 Thread Holger Wirtz
Hi, I have a small problem: I have a WSDL file where different functions are described. It worked perfectly until I have a function which has a return-value named "return": Here is my program: --- cut here --- from SOAPpy import WSDL wsdlFile = 'mypbx.wsdl' server = WSDL.Proxy(wsdlFile

Re: How do I access avariable named "return"?

2005-06-21 Thread Brian Beck
> I think this seems to be a problem due to the use of a forbidden word. But I > have no chance to change the WSDL definition, so: How can I get the > variable resp.return? Any suggestions? To get it: getattr(resp, 'return') To set it: setattr(resp, 'return', value) -- Brian Beck Adventurer of th

use a regex or not?

2005-06-21 Thread Joost Jacob
I am looking for a function that takes an input string and a pattern, and outputs a dictionary. # @param s str, lowercase letters # @param p str, lowercase and uppercase letters # @return dict def fill(s, p): d = {} return d String s has characters from the lowercase letters. Str

Re: Python can do it for me?

2005-06-21 Thread Richard Lewis
On 21 Jun 2005 06:51:16 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> said: > Really? I see Python is very good general-purpose language. I studing > TCL, C++ and Java too. > > And remote conection? Do you know something? > You mean connecting to a database from a remote machine? Most (probabl

Re: How do I access avariable named "return"?

2005-06-21 Thread Holger Wirtz
Brian Beck wrote: >> I think this seems to be a problem due to the use of a forbidden word. >> But I have no chance to change the WSDL definition, so: How can I get the >> variable resp.return? Any suggestions? > > To get it: getattr(resp, 'return') > To set it: setattr(resp, 'return', value) >

Re: UML to Python/Java code generation

2005-06-21 Thread Mike P.
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > James wrote: > > The brain may be fine for generating Python from UML but it is MANY > > MANY orders of magnitude harder to generate UML from code with just > > your brain than using a tool (usually zero effort and error

Re: Python choice of database

2005-06-21 Thread GMane Python
For my database, I have a table of user information with a unique identifier, and then I save to the filesystem my bitmap files, placing the unique identifier, date and time information into the filename. Why stick a photo into a database? For instance: User Table: uniqueID: 0001 lNane: Rose fNa

Re: Loop until condition is true

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: > I don't know anything about the Python compiler internals, > but it doesn't seem very hard to identify simple literals following > while and if, and to skip the runtime test. (Perhaps it's done > already?) True doesn't seem to be a literal, it

Re: use a regex or not?

2005-06-21 Thread Joost Jacob
Oops, the 3rd test should be fill('bb', p='Aa') resulting in the empty dict {} because no binding for A can be found. -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Toby Dickenson
On Tuesday 21 June 2005 14:22, Zunbeltz Izaola wrote: > This comunication is done in a new thread not to frezee the GUI. > The problem is that when "Stop" is done (it kills the thread) some > confirmation sockets are mixed (are not receibed in the correct order > although i use tcp). I guess you

Re: multi threading and win9x

2005-06-21 Thread fraca7
Tim Peters a écrit : > All versions of Windows >= Win95 use threads heavily, have very solid > thread support, and the Win32 API was thread-aware from the start > Thread _scheduling_ is pretty bizarre <= WinME, but process scheduling > is too. Don't try to use hundreds of threads <= WinME and yo

Re: tree functions daily exercise: Table

2005-06-21 Thread David Van Horn
Xah Lee wrote: > here's the Python spec for the Table function: ... > References: > > • for a context of this message, see: http://xahlee.org/tree/tree.htm Here is a Scheme implementation of Table. As noted on your web page and the Mathematica documentation, the first argument of Table "evaluat

Re: Python choice of database

2005-06-21 Thread Peter Hansen
GMane Python wrote: > For my database, I have a table of user information with a unique > identifier, and then I save to the filesystem my bitmap files, placing the > unique identifier, date and time information into the filename. Why stick a > photo into a database? There are various possible re

Running WMI within a Windows service

2005-06-21 Thread cameron . mccloud
Hi, When trying to import the WMI module in a Python Windows Service, I get the following: dynamic module does not define init function (initwmi) The WMI version is 0.6. Python 2.4 on Win32, Python Win32 extensions version 203 Code below, Cam. def SvcDoRun(self): import servi

Nested lists [was Re: tree functions daily exercise: Table]

2005-06-21 Thread Steven D'Aprano
Removing cross-posts to java and scheme lists. On Tue, 21 Jun 2005 01:54:40 -0700, Xah Lee wrote: > here's the Python spec for the Table function: > > '''Table(f,[iStart,iEnd,iStep]) returns a list of f applied to the > range range(iStart,iEnd,iStep). > Example: Table(f,[3,10,2]) returns [f(

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Zunbeltz Izaola
On Tue, 21 Jun 2005 15:30:41 +0100, Toby Dickenson wrote: > On Tuesday 21 June 2005 14:22, Zunbeltz Izaola wrote: > > > I guess you are accessing the socket from both your GUI thread and > communications thread. Dont do that. An action in the GUI thread should > signal the communictions thread

Re: Loop until condition is true

2005-06-21 Thread Magnus Lycka
Konstantin Veretennicov wrote: > On 6/21/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: > >>I don't know anything about the Python compiler internals, >>but it doesn't seem very hard to identify simple literals following >>while and if, and to skip the runtime test. (Perhaps it's done >>already?) >

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Peter Hansen
Zunbeltz Izaola wrote: > I'm developing a GUI program (wxPython). This program has to comunicate > (TCP) whit other program that controls a laboratory machine to do a > measurement. I have a dialog box, wiht two buttoms "Start measurement" and > "Stop". "Start" executes a function that do the measu

Re: eval() in python

2005-06-21 Thread Martin Blume
"Xah Lee" schrieb > > perhaps i'm tired, but why can't i run: > > t='m=3' > print eval(t) > Perhaps you didn't read the documentation? :-) Perhaps you didn't try hard enough? C:\WINNT>c:\programme\python\python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "hel

Re: Loop until condition is true

2005-06-21 Thread Stelios Xanthakis
Magnus Lycka wrote: > Konstantin Veretennicov wrote: > >> On 6/21/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: >> >>> I don't know anything about the Python compiler internals, >>> but it doesn't seem very hard to identify simple literals following >>> while and if, and to skip the runtime test. (P

Re: use a regex or not?

2005-06-21 Thread Kent Johnson
Joost Jacob wrote: > I am looking for a function that takes an input string > and a pattern, and outputs a dictionary. Here is one way. I won't say it's pretty but it is fairly straightforward and it passes all your tests. Kent def fill(s, p): """ >>> fill('ab', p='aA') {'A': 'b'}

RE: Running WMI within a Windows service

2005-06-21 Thread Tim Golden
[EMAIL PROTECTED] | Hi, | | When trying to import the WMI module in a Python Windows | Service, I get | the following: | | dynamic module does not define init function (initwmi) | | The WMI version is 0.6. Python 2.4 on Win32, Python Win32 extensions | version 203 This is almost certainly

Re: Using print with format to stdout generates unwanted space

2005-06-21 Thread Michael Hoffman
[Tim Williams] >>For quick and simple removal of the extra space, append a '\b' >>backspace character to your output "string" [Jorgen Grahn] > For things that are only ever to be viewed on the terminal, yes. > But this does, of course, print an actual backspace character. > If you feed this outpu

Re: smtplib and TLS

2005-06-21 Thread Matthias Kluwe
> From: "Paul Rubin" "http://phr.cx"@NOSPAM.invalid >> "Matthias Kluwe" <[EMAIL PROTECTED]> writes: >> After getting a @gmail.com address, I recognized I had to use TLS in my >> python scripts using smtplib in order to get mail to the smtp.gmail.com >> server. >> [...] >> The server accepts and

Re: use a regex or not?

2005-06-21 Thread Paul McGuire
Here's a hybrid solution, using pyparsing to parse your input pattern string (p), and transforming it into a regexp string. Then uses re.match using the regexp to process string (s), and then builds a dictionary from the matched groups. Download pyparsing at http://pyparsing.sourceforge.net. --

utf8 silly question

2005-06-21 Thread Catalin Constantin
i have the following code: c=chr(169)+" some text" how can i utf8 encode the variable above ? something like in php utf8_encode($var);?! chr(169) is the © (c) sign ! 10x for your help ! p.s.: i tryed using codecs, etc but always get an error message like: 'ascii' codec can't decode byte 0xa9 i

Re: smtplib and TLS

2005-06-21 Thread Tim Williams
- Original Message - From: "Matthias Kluwe" <[EMAIL PROTECTED]> > > Have you verified that its your end that is broken, not gmail's, do other > > servers give the same response ? > > No, I have not -- I should have, as I know now: Connecting, starttls, > login and sending mail works fin

Re: smtplib and TLS

2005-06-21 Thread Jp Calderone
On 21 Jun 2005 08:39:02 -0700, Matthias Kluwe <[EMAIL PROTECTED]> wrote: >> From: "Paul Rubin" "http://phr.cx"@NOSPAM.invalid > >>> "Matthias Kluwe" <[EMAIL PROTECTED]> writes: >>> After getting a @gmail.com address, I recognized I had to use TLS in my >>> python scripts using smtplib in order to g

Re: utf8 silly question

2005-06-21 Thread Grig Gheorghiu
Salut, Catalin You can first convert your c string to unicode, and in the process specify an encoding that understands non-ASCII characters (if you don't specify an encoding, it will try to use your default, which is most likely ASCII, and you'll get the error you mentioned.). In the following exa

Re: Embedded Systems Python?

2005-06-21 Thread Dennis Clark
Guys, Thanks, that was all information that I wanted to hear. I have a Cirrus Logic Linux port for the ARM9. I've no idea what the code base is, I've not figured that out yet. I should just need to re- compile on the platform. thanks, DLC --

Re: utf8 silly question

2005-06-21 Thread Qiangning Hong
Catalin Constantin wrote: > i have the following code: > > c=chr(169)+" some text" > > how can i utf8 encode the variable above ? > something like in php utf8_encode($var);?! > > chr(169) is the © (c) sign ! > > 10x for your help ! > > p.s.: i tryed using codecs, etc but always get an error me

Re: utf8 silly question

2005-06-21 Thread Steven Bethard
Grig Gheorghiu wrote: import codecs print codecs.encode(c, 'utf-8') > > © some text Or simply: py> print c.encode('utf-8') © some text -- http://mail.python.org/mailman/listinfo/python-list

looking for beginner projects to help out with

2005-06-21 Thread Brown, Alysia
I’m new to the list. I work for a US Gov’t agency & have been learning Python. I’ve been doing web development work for some years now & got involved with Python/Zope/Plone last fall. I’ve had formal Zope/Plone training. I’ve also been working my way through Deitel’s “Python How to Program”

Re: Create our own python source repository

2005-06-21 Thread Brian van den Broek
Michele Simionato said unto the world upon 21/06/2005 07:58: > qwwee: > >>for a certain argument I'd prefer an application fully >>explained (also if not covering all the features) to a more general >>tutorial with only brief and unrelated code snippets. >>Unfortunately, that's not the way things

Re: utf8 silly question

2005-06-21 Thread Jeff Epler
If you want to work with unicode, then write us = u"\N{COPYRIGHT SIGN} some text" You can also write this as us = unichr(169) + u" some text" When you have a Unicode string, you can convert it to a particular encoding stored in a byte string with bs = us.encode("utf-8") It's gen

Re: Create our own python source repository

2005-06-21 Thread gene tani
Practical Python is quite a good book. And to re-iterate again, teh humongous tutorial list which has Hetland's Instant python among others: http://www.awaretek.com/tutorials.html Brian van den Broek wrote: > Michele Simionato said unto the world upon 21/06/2005 07:58: > > qwwee: > > > >>for a c

article on PyNSol in CISE

2005-06-21 Thread beliavsky
The July/August 2005 issue of Computing in Science & Engineering has an article by Michael Tobis about PyNSol (slides from the talk at http://geosci.uchicago.edu/~tobis/PS0/PS3.html ). It appears to be a code generation tool that takes a few equations specified by the user and translates them to Py

Re: Python choice of database

2005-06-21 Thread Philippe C. Martin
I guess I use databases to store data ;-) and I do not wish to worry about the type of data I'm storing. That's why I love to pickle. I understand that during an optimization phase, decisions might be taken to handle data otherwise. Regards, Philippe GMane Python wrote: > For my databa

  1   2   >