Re: How to remove subset from a file efficiently?

2006-01-13 Thread Fredrik Lundh
"fynali" wrote: > Is a rewrite possible of Raymond's or Fredrik's suggestions above which > will still give me the time saving made? Python 2.2 don't have a readymade set type (new in 2.3), and it doesn't support generator expressions (the thing that caused the syntax error). however, using a di

Re: How to remove subset from a file efficiently?

2006-01-13 Thread fynali
[bonono] > Have you tried the explicit loop variant with psyco ? Sure I wouldn't mind trying; can you suggest some code snippets along the lines of which I should try...? [fynali] > Needless to say, I'm utterly new to python and my programming > skills & know-how are rudimentary. (-:

Re: How to remove subset from a file efficiently?

2006-01-13 Thread fynali
-- $ ./cleanup.py Traceback (most recent call last): File "./cleanup.py", line 3, in ? import itertools ImportError: No module named itertools -- $ time ./cleanup.py File "./cleanup.py", line 8 outfile.writelines(number for number in postpaid_fil

Re: How to remove subset from a file efficiently?

2006-01-13 Thread bonono
fynali wrote: > $ cat cleanup_ray.py > #!/usr/bin/python > import itertools > > b = set(file('/home/sajid/python/wip/stc/2/CBR333')) > > file('PSP-CBR.dat,ray','w').writelines(itertools.ifilterfalse(b.__contains__,file('/home/sajid/python/wip/stc/2/PSP333'))) > > -- > $

Re: How to remove subset from a file efficiently?

2006-01-13 Thread fynali
$ cat cleanup_ray.py #!/usr/bin/python import itertools b = set(file('/home/sajid/python/wip/stc/2/CBR333')) file('PSP-CBR.dat,ray','w').writelines(itertools.ifilterfalse(b.__contains__,file('/home/sajid/python/wip/stc/2/PSP333'))) -- $ time ./cleanup_ray.py

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Steven D'Aprano
On Fri, 13 Jan 2006 22:20:27 -0800, Mike wrote: > Thanks everyone. It seems broken storing complex structures as escaped > strings, but I think I'll take my changes. Have you read the marshal reference? http://docs.python.org/lib/module-marshal.html marshal doesn't store data as escaped strin

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Steven D'Aprano
On Sat, 14 Jan 2006 04:22:53 +, Donn Cave wrote: > Quoth Steven D'Aprano <[EMAIL PROTECTED]>: > | On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: > |> It would help if you or someone would answer these > |> five questions (with something more than "yes" or "no" :-) > |> > |> 1. Do all object

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Thanks everyone. It seems broken storing complex structures as escaped strings, but I think I'll take my changes. Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: How to remove subset from a file efficiently?

2006-01-13 Thread fynali
$ time fgrep -x -v -f CBR333 PSP333 > PSP-CBR.dat.fgrep real0m31.551s user0m16.841s sys 0m0.912s -- $ time ./cleanup.py real0m6.080s user0m4.836s sys 0m0.408s -- $ wc -l PSP-CBR.dat.fgrep PSP-CBR.dat.python 387242

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Donn Cave
Quoth Steven D'Aprano <[EMAIL PROTECTED]>: | On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: |> It would help if you or someone would answer these |> five questions (with something more than "yes" or "no" :-) |> |> 1. Do all objects have values? ... |> 2. What is the value of object()? [ I assum

Re: how to improve this simple block of code

2006-01-13 Thread Steven D'Aprano
On Wed, 11 Jan 2006 05:58:05 -0800, py wrote: > Say I have... > x = "132.00" > > but I'd like to display it to be "132" ...dropping the trailing > zeros...I currently try this Mucking about with the string is one solution. Here is another: print int(float(x)) > I do it like this because if >

Re: how do "real" python programmers work?

2006-01-13 Thread Dan Sommers
On Fri, 13 Jan 2006 17:09:13 +, Tom Anderson <[EMAIL PROTECTED]> wrote: > Ah, of course - to an true believer, emacs *is* the unix toolset. > :) To the true believer, unix runs under emacs. Regards, Dan -- Dan Sommers -- http://mail.python.org/mailman/

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Steven D'Aprano
On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: > It would help if you or someone would answer these > five questions (with something more than "yes" or "no" :-) > > 1. Do all objects have values? All objects ARE values. Some values themselves are complex objects which in turn contain other val

Re: Newbie to XML-RPC: looking for advice

2006-01-13 Thread Christian Tismer
David Hirschfield wrote: > All the above works fine...but I'm finding the following: while the > actual creation and pickling of the objects only takes a millisecond or > so, the actual time before the client call completes is a third of a > second or more. > > So where's the slowdown? It do

Re: decode unicode string using 'unicode_escape' codecs

2006-01-13 Thread aurora
Cool, it works! I have also done some due diligence that the utf-8 encoding would not introduce any Python escape accidentially. I have written a recipe in the Python cookbook: Efficient character escapes decoding http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466293 wy > Does this

Re: Why can't I "from module import *" except at module level?

2006-01-13 Thread Steven D'Aprano
On Fri, 13 Jan 2006 10:17:32 -0800, Mudcat wrote: > I have a directory structure that contains different modules that run > depending on what the user selects. They are identical in name and > structure, but what varies is the content of the functions. They will > only need to be run once per exec

Newbie to XML-RPC: looking for advice

2006-01-13 Thread David Hirschfield
I've written a server-client system using XML-RPC. The server is using the twisted.web.xmlrpc.XMLRPC class to handle connections and run requests. Clients are just using xmlrpclib.ServerProxy to run remote method calls. I have a few questions about the performance of xmlrpc in general, and spe

full screen gui

2006-01-13 Thread linuxnooby
Hi I am trying to write a python script to run on windows xp that will have a full screen gui. The script has a function that creates a full screen (hides task bar) top level window using tkinter. If I close the window and call the function a 2nd time the resulting window is full screen, but doe

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Try... > for i in bytes: print ord(i) > > or > len(bytes) > > What you see isn't always what you have. Your database is capable of > storing \ x 0 0 characters, but your string contains a single byte of > value zero. When Python displays the string representati

Re: Why can't I "from module import *" except at module level?

2006-01-13 Thread Giovanni Bajo
Mudcat wrote: > Is there any way to do this or am must I load all modules by function > name only if it's after initialization? Not sure. globals().update(mod.__dict__) might do the trick. Or just design a better system and be done with it. -- Giovanni Bajo -- http://mail.python.org/mailman/l

Re: import module and execute function at runtime

2006-01-13 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > I'm trying to import a module at runtime using variables to specify > which module, and which functions to execute. for example: > > mStr = "sys" > fStr = "exit" > > # load mod > mod = __import__(mStr) > # call function > mod.fStr() getattr(mod, fStr)() -- Giovanni Ba

Re: Subclassing socket

2006-01-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I would like to > create a subclass of socket that fixes the problem. The socket module is in a messy state right now and subclassing sockets doesn't work for implementation-specific reasons besides the issue you described. Take a look at socket.py to see the situation

Re: Marshal Obj is String or Binary?

2006-01-13 Thread casevh
Try... >>> for i in bytes: print ord(i) or >>> len(bytes) What you see isn't always what you have. Your database is capable of storing \ x 0 0 characters, but your string contains a single byte of value zero. When Python displays the string representation to you, it escapes the values so they c

Re: Subclassing socket

2006-01-13 Thread groups . 20 . thebriguy
I don't think this is true in all cases - for example, if the protocol is UDP, and the packet size is less than the MTU size. Although, I could be wrong - I've always thought that to be the case. I knew someone would have your response, that's why I earlier said I didn't want to argue that. :-)

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Wait a sec. \x00 may represent a byte when unmarshaled, but as long as marshal likes it as \x00, I think my db is capable of storing \ x 0 0 characters. What is the problem? Is it that \? I could escape that... actually I think my django framework already does that for me. Thanks, Mike -- http:/

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Wait a sec. \x00 may represent a byte when unmarshaled, but as long as marshal likes it as \x00, I think my db is capable of storing \ x 0 0 characters. What is the problem? Is it that \? I could escape that... actually I think my django framework already does that for me. Thanks, Mike -- http:/

Re: Freezing

2006-01-13 Thread James Stroud
[EMAIL PROTECTED] wrote: > Dicts and sets require immutable keys, like tuples or frozensets Not really... def freeze(anobj): """returns a new hashable object""" import copy try: hash(anobj) except: pass else: return copy.deepcopy(anobj) class FrozenType(type): def __new__(c

Pythonic wrappers for SQL?

2006-01-13 Thread Kenneth McDonald
I need to do some data manipulation, and SQLite is a nice little product for it, except of course that I'd need to write SQL. Are there any good libraries out there that let one write (basic) queries in a Pythonic syntax, rather than directly in SQL? Thanks, Ken -- http://mail.python.org/ma

Tomcat username and password2

2006-01-13 Thread Michael Oliver
Still trying to get python to access my local tomcat secured with the tomcat realm import urllib2 handler = urllib2.HTTPBasicAuthHandler() handler.add_password(None, 'localhost:8080/manager/html', 'root', 'root') opener = urllib2.build_opener(handler) urllib2.install_opener(opener)

Re: flatten a level one list

2006-01-13 Thread Cyril Bazin
I added my own function to the benchmark of Robin Becker:from itertools import chaindef flatten9(x, y):   return list(chain(*izip(x, y)))Results: no psyco Name   10   20  100  200  500 1000 flatten1  104.499  199.699  854.301 167

Re: Sudoku solver: reduction + brute force

2006-01-13 Thread znx
Hi,Funny that this just came up in Linux Format, the winner entry was:http://rightside.fissure.org/sudoku/ Won first in the "Linux Format Bounty" ( http://www.linuxformat.co.uk/bounty). Congrats to David McLeish.-- enter shameless plug and self promotion --You can digg the page here submitted by m

Re: New Python.org website ?

2006-01-13 Thread Brendan
Steve I didn't realize Python.org was being revamped. The site looks awesome! One thing I noticed: The mac download site still references Jack Jansen's site, which hasn't been updated since 2004 afaik. These days I get most of my mac python downloads from http://pythonmac.org/packages/ Brendan

Sudoku solver: reduction + brute force

2006-01-13 Thread ago
Inspired by some recent readings on LinuxJournal and an ASPN recipe, I decided to revamp my old python hack... The new code is a combination of (2) reduction methods and brute force and it is quite faster than the ASPN program. If anyone is interested I attached the code in http://agolb.blogspot.co

Re: Subclassing socket

2006-01-13 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > To your question of why you'd ever [recv(0)]. > > This is very common in any network programming. If you send a packet > of data that has a header and payload, and the header contains the > length (N) of the payload, then at some point you have to receive N > bytes. If

Re: New Python.org website ?

2006-01-13 Thread [EMAIL PROTECTED]
JW wrote: > On Fri, 13 Jan 2006 11:00:05 -0600, Tim Chase wrote: > > > http://tim.thechases.com/pythonbeta/pythonbeta.html > > > > Very strange. With FF 1.0.7, I can just get the buttons to violate the > next column if I "View>Page Style>Large Text", but I wouldn't have noticed > it unless Tim had

Re: different versions for 2.3.4 documentation

2006-01-13 Thread Martin v. Löwis
Manlio Perillo wrote: >> It appears that the latex-* set really comes from the 2.4 branch, >> somehow. That must be a mistake. >> > > Well, the same happens for 2.3.5... > And I still don't have checked 2.4.x releases. OTOH, 2.3 is not maintained anymore, so it is doubtful that anything will be d

httplib or urllib2 tomcat username and password

2006-01-13 Thread Michael Oliver
I am trying to write a Python client to access a Tomcat servlet using Tomcat Realm authentication with no success. I can use the httplib to connect to localhost port 8080 ok and post and get and all that is fine, but when I try to set username and password and access a protected part of tomcat

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Mike wrote: > The example below shows that result of a marshaled data structure is > nothing but a string > data = {2:'two', 3:'three'} import marshal bytes = marshal.dumps(data) type(bytes) > bytes > '{i\x02\x00\x00\x00t\x03\x00\x00\x00twoi\x03\x

Re: Newcomer question wrt variable scope/namespaces

2006-01-13 Thread Florian Daniel Otel
Gary, First of all, many thanks for the reply. Do I understand it correctly that actually the rule has to be refined as pertaining to the (so called) "immutable" types (like e.g. integers, tuples/strings) whereas lists and dictionaries are "mutable" types and the said scoping rule does not appl

Re: Unicode style in win32/PythonWin

2006-01-13 Thread Neil Hodgson
Thomas Heller: > Hm, I don't know. I try to avoid converting questionable characters at > all, if possible. Then, it seems the error-mode doesn't seem to change > anything with "mbcs" encoding. WinXP, Python 2.4.2 on the console: > u"abc\u034adef".encode("mbcs", "ignore") > 'abc?def'

Re: Why can't I "from module import *" except at module level?

2006-01-13 Thread Mudcat
Anyone? Is there any way to do this or am must I load all modules by function name only if it's after initialization? -- http://mail.python.org/mailman/listinfo/python-list

Re: XML vs. cPickle

2006-01-13 Thread Mike
> I'd guess that XML serialisation with cElementTree is both cpu and > memory competitive with cpickle, if not superior. Although I'm too lazy > to fire up the timeit module right now :-) That maybe true, but I bet Marshal is the fastest. ...right? > Also, how quickly the relevant parsers work de

Re: Subclassing socket

2006-01-13 Thread groups . 20 . thebriguy
Correction to my last post: It should say: "To your question of why you'd ever recv(0):" -- http://mail.python.org/mailman/listinfo/python-list

Re: XML vs. cPickle

2006-01-13 Thread Alan Kennedy
[Mike] > I know XML is more (processor) costly than cPickle, but how bad is it? Are you sure you know that? I'd guess that XML serialisation with cElementTree is both cpu and memory competitive with cpickle, if not superior. Although I'm too lazy to fire up the timeit module right now :-) Also

Re: Subclassing socket

2006-01-13 Thread groups . 20 . thebriguy
Steve, To your question of why you'd ever receive value: This is very common in any network programming. If you send a packet of data that has a header and payload, and the header contains the length (N) of the payload, then at some point you have to receive N bytes. If N is zero, then you rece

Re: jython base64.urlsafe_b64xxx

2006-01-13 Thread Alan Kennedy
py wrote: > anyone know how to do perform the equivalent base64.urlsafe_b64encode > and base64.urlsafe_b64decode functions that Python has but in jython? > Jython comes with a base64 module but it does not have the urlsafe > functions. Tried copying the pythhon base64.py to replace the Jython > on

Weekly Python Patch/Bug Summary

2006-01-13 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 384 open ( +2) / 3016 closed (+13) / 3400 total (+15) Bugs: 909 open ( +6) / 5500 closed (+21) / 6409 total (+27) RFE : 208 open ( +5) / 196 closed ( +1) / 404 total ( +6) New / Reopened Patches __ add suppo

Re: COM automation, Internet Explorer, DocumentComplete event

2006-01-13 Thread [EMAIL PROTECTED]
R. Bell, If you could sent me those URLS that are not working with PAMIE it would be great. It should be a quick fix. I haven't had any of the Users report this as of yet. I notice your writing an app that automates IE also, best of luck with it!! Rob -- http://mail.python.org/mailman/listinf

Re: How to get Windows system information?

2006-01-13 Thread Paul Watson
Martin P. Hellwig wrote: > [EMAIL PROTECTED] wrote: > >> Does anybody know how to get the: >> >> Free hard disk space >> Amount of CPU load >> and Amount of RAM used >> >> on windows? I am making an artificial intelligence program that has >> "moods" based on how much stress the sys

Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Hi, The example below shows that result of a marshaled data structure is nothing but a string >>> data = {2:'two', 3:'three'} >>> import marshal >>> bytes = marshal.dumps(data) >>> type(bytes) >>> bytes '{i\x02\x00\x00\x00t\x03\x00\x00\x00twoi\x03\x00\x00\x00t\x05\x00\x00\x00three0' Now, I need

Re: Converting a string to an array?

2006-01-13 Thread Tim Peters
[Bryan Olson] > ... > For sorting, we had the procedure 'sort', then added the pure > function 'sorted'. We had a 'reverse' procedure, and wisely > added the 'reversed' function. > > Hmmm... what we could we possible do about 'shuffle'? 'permuted' is the obvious answer, but that would leave us ope

Re: How login & download file from remote web site? Passwords a problem?

2006-01-13 Thread [EMAIL PROTECTED]
# Quick and dirty script example from win32com.client import DispatchEx import time def wait(ie): while ie.Busy: time.sleep(0.1) while ie.Document.ReadyState != 'complete': time.sleep(0.1) #instaniate a new ie object so you can call it's

Re: Spanish Translation of any python Book?

2006-01-13 Thread Olaf \"El Blanco\"
:) So Sorry! "gene tani" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > > Olaf "El Blanco" wrote: >> Maybe there is someone that speak spanish. I need the best spanish book >> for >> learning python. >> > > you should learn Chinese, Korean and Russian so you can read this

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Bryan Olson
Sybren Stuvel wrote: > Mike Meyer enlightened us with: > >>>I think type 'object' has only one value, so that's it. >> >>In that case, they should all be equal, right? >> >> >object() == object() >> >>False > > > You compare instances of the type 'object'. They both have one value: > > >>>

Re: return values of os.system() on win32

2006-01-13 Thread Trent Mick
[rbt wrote] > This is a corner case. I'm trying to detect if the py script is running > on a 'special' version of windows. I can't go into the details about > what makes it unique. Python installs and runs, but the windows API > isn't as complete as a normal Windows install... among other things

Re: return values of os.system() on win32

2006-01-13 Thread rbt
Paul Watson wrote: > rbt wrote: > >> Is it safe to say that any value returned by os.system() other than 0 >> is an error? >> >> if os.system('winver') != 0: >> print "Winver failed!" >> else: >> print "Winver Worked." >> >> Thanks! > > > What are you really seeking to do? This is a co

Re: New Python.org website ?

2006-01-13 Thread [EMAIL PROTECTED]
Tim Chase wrote: > > Looks fine here on Firefox 1.5 and Konqueror 3.4.3. > > Just in case anybody is interested, I've posted screenshots of > how it comes out here (minus the ugly colors when 24-bit images > are reduced to 256-color GIF files) in both MozSuite and FF: FWIW, I'm seeing the same ove

Re: New Python.org website ?

2006-01-13 Thread JW
On Fri, 13 Jan 2006 11:00:05 -0600, Tim Chase wrote: > http://tim.thechases.com/pythonbeta/pythonbeta.html > Very strange. With FF 1.0.7, I can just get the buttons to violate the next column if I "View>Page Style>Large Text", but I wouldn't have noticed it unless Tim had pointed it out. Tim's

Extend&Embed : how to pass user-defined object to scripts

2006-01-13 Thread Oscar
/// Foo.cpp class CFoo { }; # Test.py #i use foo.cpp build the 'foo' module import foo #param : CFoo def bar(o): #call the object o's member functions at last,i call the bar() function in my main.cpp. ///main.cpp CFoo foo; /// how to pass foo to the function 'bar' now, i use the binder

Re: import module and execute function at runtime

2006-01-13 Thread iapain
Hi, if you want to import module dynamically, you can use __import__ .. always remember modules are objects .. mStr="sys" mod=__import__(mStr) # Now u can use mod.version .. but cant specify the attribute using other variable, like u did mod.version should read it http://diveintopython.org/funct

Re: string to datetime parser?

2006-01-13 Thread M.-A. Lemburg
beza1e1 wrote: > Is there a library which can parse strings and output a datetime > object? It should be as magical as possible and allow things like: > 12:30 > tomorrow > 10.10.2005 > 02-28-00 > 28/03/95 > 1995-03-28 > 1996.Feb.29 (Thu) 16:45:23.7 > > Is there anything like that out there? My Goo

Re: Weak references (- E04 - Leadership! Google, Guido van Rossum, PSF)

2006-01-13 Thread M.-A. Lemburg
Duncan Booth wrote: > Alex Martelli wrote: > >> It IS true that in Python you cannot set arbitrary attributes on >> arbitrary objects. The workaround is to use a dict, indexed by the id >> of the object you want to "set arbitrary attributes on"; this has the >> helpful consequence that separate n

XML vs. cPickle

2006-01-13 Thread Mike
I know XML is more (processor) costly than cPickle, but how bad is it? The idea is I want to store data that can be described as XML into my database as cPickle objects. Except my web framework has no support for BLOB datatype yet, and I might have to go with XML. Ideas are appreciated, Thanks, M

timeout a process

2006-01-13 Thread iapain
Hello, I am trying to build and infinite loop handler in python 2.4 on windows platform. The problem is that i want to create a process and forcely kill/timeout after 2 sec to handle infinite loop in a gcc complied exe on cygwin. something like below os.system("mycpp.exe") # this exe is compiled w

Re: Creating shortcuts?

2006-01-13 Thread Paul Watson
Ron Griswold wrote: > Hi Dennis, > > Yes, I am equating a unix soft link to a windows shortcut. Both act as > links to a file or directory. > > I have found that windows shortcuts do appear in linux dir listings with > a .lnk extension, however the file is meaningless to linux. On the other > ha

Re: return values of os.system() on win32

2006-01-13 Thread Paul Watson
rbt wrote: > Is it safe to say that any value returned by os.system() other than 0 is > an error? > > if os.system('winver') != 0: > print "Winver failed!" > else: > print "Winver Worked." > > Thanks! What are you really seeking to do? Are you wanting to detect if your code is running

Re: XML Writer in wxPython

2006-01-13 Thread Peter Decker
On 1/12/06, Marco Meoni <[EMAIL PROTECTED]> wrote: > I'm building a GUI of a network manager that send its commands in xml files. > I would can write xml files from GUI (that is in wxPython). Have you > understand from my "spaghetti" english? Yes, your English is fine. Much better than my Italian!

import module and execute function at runtime

2006-01-13 Thread denny
Hello, rookie here. I'm trying to import a module at runtime using variables to specify which module, and which functions to execute. for example: mStr = "sys" fStr = "exit" # load mod mod = __import__(mStr) # call function mod.fStr() can i do this sort of thing? other suggestions? -- http://

Re: Python Desktop Framework?

2006-01-13 Thread Peter Decker
On 13 Jan 2006 10:06:56 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there or should there be a Python Desktop Framework? It would be > great to have something like Turbogears for desktop apps. You might want to look at Dabo (http://dabodev.com). They are the far and away the best fra

Re: XEmacs python-mode question

2006-01-13 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Thomas> I'm trying to customize the python interpreter that is used to > Thomas> execute my scripts from within WinXP, XEmacs, python-mode > Thomas> version $Revision4.70$, but cannot get it to work. > > Thomas> The only thing that works is M-x customize

Re: flatten a level one list

2006-01-13 Thread Bengt Richter
On Fri, 13 Jan 2006 07:48:39 -0800, [EMAIL PROTECTED] (Alex Martelli) wrote: >Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > ... >> I agree with Guido about the special case, but I disagree about the >> error message. Not being able to use sum(L,"") reduces the >> orthogonality of sum for no good

Re: Remote Function Call

2006-01-13 Thread Mike
Thanks Everyone for your input. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: another docs problem - imp

2006-01-13 Thread Kent Johnson
Fredrik Lundh wrote: > Kent Johnson wrote: >>Is there such a list? I have contributed many doc patches and if such >>glory is mine I would like to know it! > > unfortunately, your name don't seem to be mentioned in the Doc version > history either: > > do you have more details (a reference to a p

Why can't I "from module import *" except at module level?

2006-01-13 Thread Mudcat
I have a directory structure that contains different modules that run depending on what the user selects. They are identical in name and structure, but what varies is the content of the functions. They will only need to be run once per execution. Example (directory level): Sys1: A B

RE: Creating shortcuts?

2006-01-13 Thread Ron Griswold
Hi Roger, Thank you, I will look into this. Ron Griswold Character TD R!OT Pictures [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roger Upole Sent: Friday, January 13, 2006 4:59 AM To: python-list@python.org Subject: Re: Creating sh

RE: Creating shortcuts?

2006-01-13 Thread Ron Griswold
Hi Dennis, Yes, I am equating a unix soft link to a windows shortcut. Both act as links to a file or directory. I have found that windows shortcuts do appear in linux dir listings with a .lnk extension, however the file is meaningless to linux. On the other hand, a linux soft link does not appea

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: ... > I think the difference in our perspectives is that you already > *know* what a value is, not necessarily in a way that allows > you to write a defintion, but certainly in a way that allows > to work effectively with them. > > As a Pyt

Python Desktop Framework?

2006-01-13 Thread [EMAIL PROTECTED]
Is there or should there be a Python Desktop Framework? It would be great to have something like Turbogears for desktop apps. I blogged a fews days ago about a Python Desktop Framework or (dare I say it) Wizard: 1. Quick to build an application - Minimal Input e.g. App Name and Type 2. Choi

Re: XEmacs python-mode question

2006-01-13 Thread skip
Thomas> I'm trying to customize the python interpreter that is used to Thomas> execute my scripts from within WinXP, XEmacs, python-mode Thomas> version $Revision4.70$, but cannot get it to work. Thomas> The only thing that works is M-x customize-group python, and Thomas> chan

Re: Hijacking threads

2006-01-13 Thread gene tani
Peter Hansen wrote: > gene tani wrote: > > Roy Smith wrote: > >>Thanks for posting that URL; I hadn't seen the list before. > [...] > > > > pls don't hijack threads > > Um, he didn't "hijack" it, he follow a tangent to the discussion and > even changed the Subject line in a very appropriate manner

Re: return values of os.system() on win32

2006-01-13 Thread rbt
Peter Hansen wrote: > rbt wrote: > >> Is it safe to say that any value returned by os.system() other than 0 >> is an error? >> >> if os.system('winver') != 0: >> print "Winver failed!" >> else: >> print "Winver Worked." > > > According to the docs, assuming that *in general* would be

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread Fredrik Lundh
"gene tani" wrote: > pls don't hijack threads this is usenet, not gene tani's web board. if you have trouble dealing with subthreads, get a better news reader. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newcomer question wrt variable scope/namespaces

2006-01-13 Thread Gary Duzan
Florian Daniel Otel wrote: > > My problem: I just discovered (by mistake) that attempting to assign a > value to a non-local dictionary/list member does NOT generate an " > UnboundLocalError" exception and the assignment is preserved upon > exiting that scope (i.e. function). This would "violate"

Re: how do "real" python programmers work?

2006-01-13 Thread Tom Anderson
On Fri, 13 Jan 2006, Roy Smith wrote: > Mike Meyer <[EMAIL PROTECTED]> wrote: > >> we need a term for development environment built out of Unix tools > > We already have one. The term is "emacs". Emacs isn't built out of unix tools - it's a standalone program. Ah, of course - to an true bel

Re: how do "real" python programmers work?

2006-01-13 Thread Tom Anderson
On Thu, 12 Jan 2006, Mike Meyer wrote: > well, we need a term for development environment built out of Unix > tools Disintegrated development environment? Differentiated development environment? How about just a development environment? tom -- NOW ALL ASS-KICKING UNTIL THE END -- http:/

Re: flatten a level one list

2006-01-13 Thread Michael Spencer
> Michael Spencer wrote: >> result[ix::count] = input + [pad]*(maxlen-lengths[ix]) Peter Otten rewrote: > result[ix:len(input)*count:count] = input Quite so. What was I thinking? Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: return values of os.system() on win32

2006-01-13 Thread Peter Hansen
rbt wrote: > Is it safe to say that any value returned by os.system() other than 0 is > an error? > > if os.system('winver') != 0: > print "Winver failed!" > else: > print "Winver Worked." According to the docs, assuming that *in general* would be an error, but it's likely that for th

Re: New Python.org website ?

2006-01-13 Thread Tim Chase
>>In both Mozilla-suite (1.7) and FireFox (1.5), the links on the left >>(the grey-backgrounded all-caps with the ">>" at the right) all >>intrude into the body text. > > > Looks fine here on Firefox 1.5 and Konqueror 3.4.3. Just in case anybody is interested, I've posted screenshots of how it

Re: Wats the code?

2006-01-13 Thread Peter Hansen
Kr z wrote: > I wonder anyone knows the line of Python codes to generate 1000 threads > concurrently? It's roughly the same as the line of code that generates a single new thread, but with an appropriate loop from 1 to 1000 around it, and written with a full understanding of the problems involv

XEmacs python-mode question

2006-01-13 Thread Thomas Heller
I'm trying to customize the python interpreter that is used to execute my scripts from within WinXP, XEmacs, python-mode version $Revision4.70$, but cannot get it to work. The only thing that works is M-x customize-group python, and change the value of 'Python Command'. However, this changes the

Hijacking threads

2006-01-13 Thread Peter Hansen
gene tani wrote: > Roy Smith wrote: >>Thanks for posting that URL; I hadn't seen the list before. [...] > > pls don't hijack threads Um, he didn't "hijack" it, he follow a tangent to the discussion and even changed the Subject line in a very appropriate manner, both of are completely acceptab

Re: return values of os.system() on win32

2006-01-13 Thread Jorge Godoy
rbt <[EMAIL PROTECTED]> writes: > Is it safe to say that any value returned by os.system() other than 0 is an > error? I believe not. That depends on the return/error code of the specific program you ran. -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." -

return values of os.system() on win32

2006-01-13 Thread rbt
Is it safe to say that any value returned by os.system() other than 0 is an error? if os.system('winver') != 0: print "Winver failed!" else: print "Winver Worked." Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python.org website ?

2006-01-13 Thread Sybren Stuvel
Tim Chase enlightened us with: > In both Mozilla-suite (1.7) and FireFox (1.5), the links on the left > (the grey-backgrounded all-caps with the ">>" at the right) all > intrude into the body text. Looks fine here on Firefox 1.5 and Konqueror 3.4.3. The site looks really nice! I think this is goi

Why is there no post-pre increment operator in python

2006-01-13 Thread gene tani
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "gene tani" <[EMAIL PROTECTED]> wrote: > > > http://zephyrfalcon.org/labs/python_pitfalls.html > > Thanks for posting that URL; I hadn't seen the list before. Skimming over > it, none of them really seemed noteworthy until I got to "5. Mutable

Re: Spanish Translation of any python Book?

2006-01-13 Thread gene tani
Olaf "El Blanco" wrote: > Maybe there is someone that speak spanish. I need the best spanish book for > learning python. > you should learn Chinese, Korean and Russian so you can read this many times http://diveintopython.org/#languages -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode style in win32/PythonWin

2006-01-13 Thread Thomas Heller
"Robert" <[EMAIL PROTECTED]> writes: > Thomas Heller schrieb: >> So after these assignments: >> >> ctypes.windll.user32.MessageBoxW.argtypes = (c_int, c_wchar_p, >>c_wchar_p, c_int) >> ctypes.windll.user32.MessageBoxA.argtypes = (c_int, c_char_p

paypal SOAP API from ZSI or SOAPpy?

2006-01-13 Thread Chris Curvey
Anyone had any luck with this? (Or can anyone just warn me off it right now?) I'm trying to just set up the service proxy via WSDL, and I'm getting either a runaway process that's chewing up tons of memory or a very quick stack trace. I've tried both ZSI and SOAPpy (both stable and release candi

Re: How to remove subset from a file efficiently?

2006-01-13 Thread AJL
On 12 Jan 2006 22:29:22 -0800 "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > AJL wrote: > > How fast does this run? > > > > a = set(file('PSP320.dat')) > > b = set(file('CBR319.dat')) > > file('PSP-CBR.dat', 'w').writelines(a.difference(b)) > > Turning PSP into a set takes extra time, c

Re: flatten a level one list

2006-01-13 Thread Alex Martelli
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: ... > I agree with Guido about the special case, but I disagree about the > error message. Not being able to use sum(L,"") reduces the > orthogonality of sum for no good reason I could see. Having sum(L,'') work but be O(N squared) would be an "attrac

  1   2   3   >