Re: XML-RPC server-client communication
> server = SimpleXMLRPCServer.SimpleXMLRPCServer(("xxx.xxx.xxx.xxx", > 22999)) Could it be that xxx.xxx.xxx.xxx stands for '127.0.0.1'? If so... rename it to 'localhost'. If you bind a port to 127.0.0.1 it will be found only on the same machine. Greetings, Marco -- http://mail.python.org/mailman/listinfo/python-list
pyExcelerator - Can I read and modify an existing Excel-WorkBook?
Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a different name afterwards. To me it seems, that pyExcelerator does not support the reading for modification of an Excel-sheet. It allows only the "parse_xls" but I would like to keep the "formatting" in the template. Did I miss a "load", "read" or "open" function in pyExcelerator that would hand me back a WorkBook? Greetings, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for an intellisense with good help IDE for Python
The best code completion you can get for Python is delivered by WingIDE: http://wingware.com/ I have seen, PyDev, Kommodo, Spe and when it comes to code completion for Python than nothing beats WingIDE. Maybe anyone can proof the contrary. WingIDE is not for free though (Personal: 35 USD upto Profession: 180 USD) - you can download a fully fuctional version and prolong it a few times... try it out, if you are willing to pay a few bucks. Cheers, Marco -- http://mail.python.org/mailman/listinfo/python-list
Using "external" vars on module load time
Hi I have a script that looks for modules and tries to load them. After loading I attach the "server"-API function to it. module = __import__(module_name, globals(), locals(), []) module.server = server.server_api Now, some modules need the "server" functionality on load/init. I tried to modify the globals(): my_globals = globals().copy() my_globals['server'] = server.server_api module = __import__(module_name, my_globals, locals(), []) module.server = server.server_api This did not work as intended the module to be imported did not get the "server" from my_globals. The solution I have, is to add __init_module__() method that is called after the module was imported: module = __import__(module_name, globals(), locals(), []) module.server = server.server_api if module.__dict__.has_key('__init_module__'): module.__init_module__() This is not really satisfying. I would like: Load a module and hand in already the server_api. How can I achieve this? Thanks for any suggestions, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: Using "external" vars on module load time
Marvelous that was the solution I was looking for. > I think you should consider a class instead of a module, though. What I don't get: Why should I consider using a class? Greetings from sunny Switzerland, Marco -- http://mail.python.org/mailman/listinfo/python-list
The del statement
Hi I was wondering whether the del statment was going to stay in Python3000? It is a bit awkward to use the del statement where a method call would do the same without the need for a new keyword. del list[elem] del map[elem] Where list.del(elem) map.del(elem) would achieve the same result (and I think, this is what happens in the backend). The same discussion was done for the "external" len-function (list.len() vs. len(list)). I don't dare to say that the del-keyword is superflous, but I would like to know the pros and cons of the external keyword approach. Greetings, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: The del statement
> so what about > > del x Ups. I never used it for an object. So far I only used it for deletion of elements of a container. In that case del has two purposes: 1. Deletes an item from a container (and of course destructs it) --> list.remove(elem) 2. Calls the destructor of an object --> list.destruct() One statement and two distinct purposes. Why not having two "standard" function (for containers we have a remove-function) and all objects have a destruct-function. Still no need for a del keyword. A del keyword that calls the destructor... well that is okay (it could be handled without). I am used to see the del keyword in opposition to the new keyword (which does not exist/is implicit in Python). The del keyword for removing an element in a container is a bit awkward to me. I am not as knowledgeable about languages as you are and I am hoping people like you can enlighten me about the language decision taken. > for the curious, guido's rationale for len() can be found here: > >http://preview.tinyurl.com/y6vavp Thanks for the hint. Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: The del statement
> do you find the x[i] syntax for calling the getitem/setitem methods a > bit awkward too? what about HTTP's use of "GET" and "POST" for most > about everything ? ;-) No. I like the x[i] syntax. I use it in every second row of my code and getting an item like: x.getitem(i) would be a viable (in this case clumsy) way but here I find the introduced syntax justified. del on the other hand is used sparingly througout my code. If no del keyword would exist, it wouldn't disturb me. Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: The del statement
Thanks for the answers. I see that the del statement does remove an object from the namespace. And yes, it makes perfect sense to handle it from "outside" with the del command. I am not convinced though that del should also remove elements from a container/sequence. Thanks for the enlighting answers, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: Protecting Python source
+1 QOTW -- http://mail.python.org/mailman/listinfo/python-list
Re: Python and Lotus Notes
The second line of your code is already a show stopper in my case: from win32com.client import Dispatch session = Dispatch('Lotus.NotesSession') session.Initialize('my_secret_passwort') When started, ends: File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\temp\notes_init.py", line 3, in ? session.Initialize('my_secret_passwort') File "c:\Python24\lib\site-packages\win32com\client\dynamic.py", line 489, in __getattr__ raise AttributeError, "%s.%s" % (self._username_, attr) AttributeError: Lotus.NotesSession.Initialize It worked before though with Version 5.x of Notes. In Notes Version 6.X they introduced the session.Initialize() - that was the point, when I couldn't create an instance anymore. I found no hint on the net... Do you have any idea what is going wrong here? Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
Notes 6.X not accessible with Python?
Hi Since my upgrade from Notes 5.X to Notes 6.X I can't access Notes anymore. The third line of the following code is already a show stopper in my case: from win32com.client import Dispatch session = Dispatch('Lotus.NotesSession') session.Initialize('my_secret_passwort') When started, ends: File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\temp\notes_init.py", line 3, in ? session.Initialize('my_secret_passwort') File "c:\Python24\lib\site-packages\win32com\client\dynamic.py", line 489, in __getattr__ raise AttributeError, "%s.%s" % (self._username_, attr) AttributeError: Lotus.NotesSession.Initialize It worked before though with Version 5.x of Notes. In Notes Version 6.X they introduced the session.Initialize() - that was the point, when I couldn't create an instance anymore. I found no hint on the net... Do you have any idea what is going wrong here? Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: Pywin32: How to import data into Excel?
PyXLWriter might be at your service: http://pyxlwriter.sourceforge.net/ Have a nice day, Marco -- http://mail.python.org/mailman/listinfo/python-list
PyExcelerator - mishandling of formulas?
Hi, Yesterday I placed a bug report on PyExcelerators-Sourceforge-page... but I am not so sure anymore, whether this is really a bug - I could imagine that I missed something, but I don't see what. Please confirm that my bug is due to mishandling and I will gladly retreat my bug report. In a formula, I would like to point to a field on another worksheet. pyExcelerator chokes on these references! import pyExcelerator wb = pyExcelerator.Workbook() ws_summary = wb.add_sheet('Summary') ws_data = wb.add_sheet('Data') ws_summary.write(0,0, pyExcelerator.Formula('Data:A1')) <--- Here it chokes! ws_data.write(0, 0, '4000') wb.save('not_parsing.xls') Is this a bug or am I doing something wrong? Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: PyExcelerator - mishandling of formulas?
On Thu, 17 Nov 2005 09:27:26 +0100, Serge Orlov <[EMAIL PROTECTED]> wrote: >> ws_summary.write(0,0, pyExcelerator.Formula('Data:A1')) >> ws_data.write(0, 0, '4000') > I think you're doing it wrong. ":" character means range, to refer to a > sheet use "!" charater: Data!A1 > Right you are. It "changed" somehow... anyhow, even if you change it, it will choke on the same line. I received an answer... a workaround which doesn't make me happy, but it is, as it is! [...] This is not a bug. This is by design. pyExcelerator does not unerstand such syntax. Try Formula("HYPERLINK(address; name)") [...] Which means: ws_summary.write(0,0, pyExcelerator.Formula('HYPERLINK("Data!A1")) does the trick, but the text shown is a hyperlink now! Thanks for your help, Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: Winge IDE Issue - an suggestions?
Without further checking I would propose you let WingIDE ignore this exception - most probably WingIDE is choking on a exception that was thrown intentionally by the module writer. I hope you know how to let WingIDE ignore exceptions? (In the upper part of the Exceptions-tool click on 'Ignore this exception location')... hope this helps. Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
Apple creator on Python
One of the "creators" of Apple has written a book and mentions Python in the interview: http://www.macdevcenter.com/pub/a/mac/2005/01/04/hertzfeld.html After writing around 20 stories, I shifted gears and worked on the web software to publish them, writing a simple authoring system in Python, which I love to program in. -- http://mail.python.org/mailman/listinfo/python-list
Re: python script under windows
> Can you help me ? Or better is there some info for unix person how > to survive with python on windows ;-) Use py2exe to transform your app into a service... -- http://mail.python.org/mailman/listinfo/python-list
Re: Batteries Included?
> I might be wrong expecting that a language whose > moto is "Batteries Included" would be able to produce exe files. Are > there plans to do this in the future version of Python? Yes, you are wrong expecting that. Creating an exe-cutable is windows specific and python _tries_ to be platform neutral. py2exe - a wonderful tool which I use myself - is a battery on the shelves. It can be easily picked from there. Furthermore it is not Python's philosophy to create "exe-cutables". But I do understand your wish (being a Windows Developper at work myself) and Python is not a matter of course within Windows. Your best bet is ActiveState which bundles a windows specific version. Ask them, maybe they are willing to include it. Python should refrain from doing so. Before overloading the "included batteries" an approach as found in Perl (CPAN) should be adapted... eg. http://peak.telecommunity.com/DevCenter/EasyInstall Have a nice day, Marco -- http://mail.python.org/mailman/listinfo/python-list
Embedding Python in Borland Builder C++ (6.0)
Hi There almost no pages on how to embed Python in Borland Builder C++ (6.0). Any hints in this matter are very welcome... Thanks, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: PyHtmlGUI Project is looking for developers
A good idea... but I would prefer it being abstracted from Zope... -- http://mail.python.org/mailman/listinfo/python-list
A sad story about a real "Python"
http://www.snopes.com/photos/animals/fencesnake.asp Cheers, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: List of string
> Thanks , but , this work for an ordered substrings , just like what we > had ['0132442\n', '13\n', '24\n'] , I would like to remove all > substrings from the list , example > > ['0134314244133', '132443', '234'] > > > 2nd and 3rd strings are also substrings from the 1st one , so it should > be removed > > Thanks Sounds like you have some homework to do. Good luck! -- http://mail.python.org/mailman/listinfo/python-list
Re: fast list lookup
what is the fastest way to determine whether list l (with len(l)>3) contains a certain element? Either a sorted list (in conjunction with the bisect-module) or a dictionary is your friend... Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
COM on a network drive can't find pywintypes23.dll
Hi I have installed Python (2.3.4) on a shared network drive. I use it to run a bunch of application on the workstations (Win2K). Now I am running into the first problem ever. I try to use COM to generate a word-file. It runs fine on my machine (Python installed locally). When I deploy it and start the app on another workstation from the fileserver - it runs but as soon as it comes to the COM part it exits saying: The procedure entry point ?PyWinObject_AsDEVMODE@@YAHPAU_object@@PAPAU_devicemodeA@@[EMAIL PROTECTED] could not be located in the dynamic link library pywintypes23.dll Heck... I copied the files: pythoncom23.dll pywintypes23.dll to about "1000" locations to make it run (Application's dir, Workstation's System Dirs, Fileserver's Python main and bin dir, ...). I tried setting the path on the workstations. But nothing seems to solve the problem. Do you have any proposals how to solve this problem? Thanks in advance, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] new version of rur-ple (0.8.5)
On Tue, 10 May 2005 00:49:40 -0300, André Roberge <[EMAIL PROTECTED]> wrote: > Learning to program computer should be fun, for adults and children > alike. RUR-PLE is an environment designed to help you learn computer > programming using the language Python. To use RUR-PLE, you need > wxPython. You can learn more about RUR-PLE or you can go to the download > page. Surrender to Python - Resistance is futile! This is a fine piece of introduction! Thanks for your efforts, Marco -- http://mail.python.org/mailman/listinfo/python-list
From Python to c++
This is actually a c++ problem. Got no satisfying answer on comp.lang.c++. Maybe you can help better because I know, there are many c++-converts ;). Suppose you've got the following list (first line has field names, second line has types and any row after is data): csv = "name,age,place\nstring,int,string\nMac,25,Zurich\nMike,55,Oslo" and you would like to turn it into a dictionary: parsed = { "name":["Mac", "Mike"], "age":[25, 55], "place":["Zurich", "Oslo"] } A trivial task in Python. In C++ it is cumbersome. I was thinking to put the parsed data into a map: map > I have no problem with the key (string) but the value (vector) needs to be of varying type. I think C++-STL does not allow what I want. The following proposal is useless: [...] A simple solution, make two maps: std::map > result_name; std::map > result_age; [...] I want to build the map of lists dynamically - it can have many fields or just one... and I would like to have simple interface (as Python offers). - I cannot import python into the c++ environment (Borland Developer 2006) and I know no one who was able to. - I cannot write (*sigh*) the app in Python. Any suggestions are very welcome! Regards, Marco (Forced to code in c++ again let me estimate the simplicity of python) -- http://mail.python.org/mailman/listinfo/python-list
Re: From Python to c++
On Wed, 22 Mar 2006 08:11:24 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > This is so scary, I probably shouldn't post this. It sounds from your > description, you really want RTTI. I haven't done this in a long > while, so I'm not sure there is an easier way. But the program below > works and seems like it may be what you are asking for. Perfect! That is precisely what I was looking for. I can easily adapt it for my needs! Thanks a lot. Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list
Re: From Python to c++
Heck! I received 1 useless answer in comp.lang.c++ and here I get useful links/hints and even a code-pattern! Great. Thank you all. Sorry for posting a c++-problem here, but it was derived from my thinking the Python way... Cheers, Marco -- http://mail.python.org/mailman/listinfo/python-list