Re: floatref

2010-07-15 Thread Tino Wildenhain
floatref(object): def __init__(self,val): self.val=val ? x = floatref(1.0) y = x print(x.val) x.val = 10.0 print(x.val) print(y.val) Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: floatref

2010-07-14 Thread Tino Wildenhain
mutable float by providing a constant name or reference for it within the class. For example: >>> a=b=[1.0] >>> a[0]+=0.5 >>> a,b ([1.5], [1.5]) HTH Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: Free chapter about Python and databases (MySQL and SQLite)

2010-05-28 Thread Tino Wildenhain
sting in the way you can write stored functions in python there) Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Function that knows its argument's variable name

2010-03-17 Thread Tino Wildenhain
lease note introspective approaches have a very narrow field where they can work - as already shown in other posts: you can have values w/o names and also more then one name to a value (or object). Regards Tino Wildenhain smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Any Python Module to send ring tones from PC to mobile via GSM modem

2010-02-01 Thread Tino Wildenhain
find more information on how to do that. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Moving from PHP to Python. Is it Possible

2009-12-12 Thread Tino Wildenhain
me very dangerous. Keep in mind if you are using a user supplied string, like coming from a form entry and just include it as above literally into your HTML, you have created a way of cross site scripting, a very common attack. To prevent that, you should always propery quote strings for the context where they are used. Template engines such as Zope Page Templates (also usable stand allone) are doing this for you. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: postgresql_autodoc in Python?

2009-12-07 Thread Tino Wildenhain
the stuff :-) *) http://www.alberton.info/postgresql_meta_info.html Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected python exception

2009-11-13 Thread Tino Wildenhain
tbake does some things is evil but it does other things rather well and we can't break those. I'd need to see the bigger picture because I don't know of bitbake but I have a feeling this can be done much nicer in the end. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Solved - Python: automate input to MySQL query

2009-09-24 Thread Tino Wildenhain
e not. One is the current price in the catalogue and the other is the price it was sold for at a particular time. They need different names for that reason. Yes and you should name them different in your query when they appear in the same result set. Regards Tino smime.p7s Description: S

Re: python module for data comparison of 2 MySQL servers

2009-09-04 Thread Tino Wildenhain
time you start your comparison. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this group have so much spam?

2009-09-02 Thread Tino Wildenhain
Am 01.09.2009 22:10, schrieb David: Il Mon, 31 Aug 2009 20:06:54 -0700 (PDT), r ha scritto: ... The system is definitely flawed. I am no internet expert so i don't really know what we could do to fix it. I do fear goverment or corporations taking over of the internet and robbing use of our fre

Re: Python word to text

2009-09-01 Thread Tino Wildenhain
is match with "App Engine doesn't allow external programs"? :-) For excel this would be easy but word - Björn, did you check google api if you would be able to access google docs for this? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a text file

2009-08-19 Thread Tino Wildenhain
upper()) except StopIteration: break More useless code, under the hood its working similar. But why not use it in the way intended? for input_line in sys.stdin: sys.stdout.write(input_line.upper()) ? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature --

Re: xlrd - insert column?

2009-07-28 Thread Tino Wildenhain
. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: How save clipboard data as bmp file

2009-04-20 Thread Tino Wildenhain
gopal mishra wrote: Hi, I am trying to save my clipboard data (format is CF_ENHMETAFILE) as BitMap file (.BMP). Can any on suggest how to do this. Sure. Open "Paint" press ctrl-v and the save as BMP. Regards Tino smime.p7s Description: S/MIME Cryptographic Signatu

Re: print as a function in 2.5 ?

2009-04-19 Thread Tino Wildenhain
ging) The other way if you want to selectively do so, either use a form of log (because why must it be print if the output is debugging information?) or instead of hooking sys.stdout, use another output stream and print >>debug, ... to it. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: Useful MySQL Routines

2009-04-19 Thread Tino Wildenhain
Lawrence D'Oliveiro wrote: In message , Tino Wildenhain wrote: Lawrence D'Oliveiro wrote: I've done a writeup on some of the basic routines I frequently use here <http://codecodex.com/wiki/index.php?title=Useful_MySQL_Routines>. Why is that specific to mysql? Because

Re: Useful MySQL Routines

2009-04-19 Thread Tino Wildenhain
full batch sizes. If you allow query construnction better don't forget appropriate quoting of table- and column names too to be on the safe side. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tino Wildenhain
example of what you would do in such a hypothetical language? Tino. -- http://mail.python.org/mailman/listinfo/python-list

Re: Network game using mysql

2009-04-14 Thread Tino Wildenhain
f I put two programs reading the same command list sometimes they handle the command twice.. You could use Postgres instead and write stored functions in python to access the tables. This would avoid your asynchrous approach alltogether. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: video capture in Python ?

2009-04-13 Thread Tino Wildenhain
captured a frame) I can say opencv worked great for me both on linux and windows and didn't crash. Maybe you have just an unlucky combination of drivers. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: Q:Pythonic way to create list of lists

2009-04-12 Thread Tino Wildenhain
not matter. Sparse datastructures might be better represented with dicts. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython on Google AppEngine.

2009-04-09 Thread Tino Wildenhain
Jason Scheirer wrote: On Apr 9, 9:12 am, Alan Kennedy wrote: Hi all, You may be interested to know that you can now run jython 2.2 out of the box on Google AppEngine, thanks to their new java support. ... Finally! A way to run Python on App Engine! ? Is that some kind of weird humor? :-)

Re: asynchronous python call

2009-04-08 Thread Tino Wildenhain
P for example) where you can ping once you wrote out the mails to be send. Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Generation

2009-04-03 Thread Tino Wildenhain
s which can be used outside Zope as well, (even with many other languages) For example: http://zpt.sourceforge.net/ Regards Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: Python v3 question related to pickle/marshal

2009-03-26 Thread Tino Wildenhain
of a minimal example how you tried? Regards Tino PS: it would not hurt to end questions with a question mark ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Bash-like brace expansion

2009-03-24 Thread Tino Wildenhain
r} as well but again I don't think the whole stuff would be very usefull anyway given the %(foo)s form works quite well and has a host of options (for aligning for example). Cheers Tino -- http://mail.python.org/mailman/listinfo/python-list

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Tino Wildenhain
thomasvang...@gmail.com wrote: You could use: B=list(set(A)).sort() Hope that helps. That would leave a B with value None :-) B=list(sorted(set(A)) could work. smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Use of HTMLparser to change language

2009-03-20 Thread Tino Wildenhain
executable on your end to generate the static files using the templates. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
venutaurus...@gmail.com wrote: On Mar 20, 1:58 pm, Tino Wildenhain wrote: venutaurus...@gmail.com wrote: Hello all, ... smime.p7s 4KViewDownload Thanks for your suggestion. By the way the attachment which have added has some unknown file extension. May I know how can I view it? This is

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
Tim Golden wrote: ... and do the following: from winsys import fs for f in fs.flat ("c:/temp"): f.dump () ^ eeek! But btw, what extra information would it give? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listi

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Tino Wildenhain
deal with large matrices [~50 * 4] This is something I'd consider either reordering your data (for example into dictionary) or look at scipy/numpy. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
d os.stat please see the example for os.walk - this would work on every platform supported by python. for acls, a little more work would be needed if you want something filesystem specific but posix style information is included with stat() Regards Tino smime.p7s Description: S/MIME Cryp

Re: cross compile Python to Linux-ARM

2009-03-19 Thread Tino Wildenhain
, pthreads ... which are all optional anyway. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Style formating of multiline query, advise

2009-03-18 Thread Tino Wildenhain
, a.iso FROM all AS a WHERE a.name = LOWER(%s) ) AS c JOIN other AS b ON c.gid = b.id WHERE class = 'A' ORDER BY population DESC LIMIT %s; """ And I'd not recomment SELECT * for anything beside test queries in an interactive

Re: REDIRECT

2009-03-18 Thread Tino Wildenhain
's the Python way of implementing this ? Can anyone help me out on this ? What did you try so far? Hint: the redirect is done via Location: HTTP-Header. You can check all details in rfc2616, this is independend from the language you would use. Everything else depends on the framework you use.

Re: split problem if the delimiter is inside the text limiter

2009-03-18 Thread Tino Wildenhain
split by "hand made" function You should check out the csv module, you can define quote char and delimiter and this should just work. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Neatest way to do a case insensitive "in"?

2009-03-14 Thread Tino Wildenhain
tinn...@isbd.co.uk wrote: ... But I was wondering if there's a neater/easier way? How is "if stringA.lower() in stringB.lower():" complex/messy? Well I guess I was just looking for "incase" a bit like "strcasecmp" in C. Which locales case folding

Re: Get pixel colors from images in Python 3

2009-03-14 Thread Tino Wildenhain
ing PIL to python 3. I'm guessing if you ask again at least it will be viewed as a +1 vote on the project and that will probably not hurt :) Sure not, and I think a helping hand wouldn't hurt either ;) In case mr OP wants it fast, I'd suggest sticking with python2.x Regards Tino

Re: Can Python do shopping cart?

2009-03-07 Thread Tino Wildenhain
write the code - but of course you can do _that_ perfectly with python. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Inverse of dict(zip(x,y))

2009-03-06 Thread Tino Wildenhain
Andre Engels wrote: On Thu, Mar 5, 2009 at 7:46 PM, Andre Engels wrote: If the dict = {key1: val1, key2: val2, ...}, you can do: for key in dict: plot(key,dictionary[key]) Of course I meant: for key in dict: plot(key,dict[key]) Which would be the verbose form of: for x,y in data

Re: Inverse of dict(zip(x,y))

2009-03-06 Thread Tino Wildenhain
Hi, psykeedelik wrote: On Mar 5, 6:01 pm, Tino Wildenhain wrote: Piet van Oostrum wrote: Andre Engels (AE) wrote: AE> On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle wrote: Can someone suggest a easy method to do the inverse of dict(zip(x,y)) to get two lists x and y? So, if x and y are

Re: Inverse of dict(zip(x,y))

2009-03-06 Thread Tino Wildenhain
Andre Engels wrote: On Thu, Mar 5, 2009 at 6:01 PM, Tino Wildenhain wrote: Still I'd like to see an application where this really matters (that keys() and values() match in order) I think there are many such applications, but also that in each of those cases it's a mis-prog

Re: While loop

2009-03-05 Thread Tino Wildenhain
raise XYZError...() # define appropriate for your app # here you can work with result HTH Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Tino Wildenhain
teed to use the same order. Yes, they are if the dictionary is not changed in the meantime (not even inserting and removing the same thing). See the library documentation, section dict. Still I'd like to see an application where this really matters (that keys() and values() match in orde

Re: Question about binary file reading

2009-03-04 Thread Tino Wildenhain
ee no reason why all the "pseudo" encodings are bad - since after all they are encodings (base64, hex, ... even gzip) what is missing at the moment would be urlencoding. Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about binary file reading

2009-03-04 Thread Tino Wildenhain
x: print hex(ord(b)) better: print x.encode("hex") Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Tino Wildenhain
having the two resulting sequences relate to each other. So in fact it doesn't matter if order is preserved or not. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Tino Wildenhain
, ...}, what is there any trick to get lists x = [x1, x2, ...] and y = [y1, y2, ...] x,y=zip(d.items()) Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: String Identity Test

2009-03-04 Thread Tino Wildenhain
, you could profit from identity and the overhead of installing it would be neglectable (and you can force this in python with "internal") but in this case I'd think calculating and working with a hash instead should be preferred. Regards Tino Wildenhain smime.p7s Description: S

Re: Perl-python regex-performance comparison

2009-03-03 Thread Tino Wildenhain
straight forward way. And you don't need the hammer (aka regex) for everything. Several hundred megabytes is not much, you would work thru them sequentially, that is with python you would almost exclusively work with generators. HTH Tino smime.p7s Description: S/MIME Cryptographic Signa

Re: Email Program

2009-03-02 Thread Tino Wildenhain
other way round but not with python but with AREXX those days. It was an SMTPD to accept forwarded mail and spool directly into YAM (that if someone on the other end of the world has hit "send" it was immediately rattling in my inbox :-) Regards Tino smime.p7s Description: S/MIME

Re: Email Program

2009-03-01 Thread Tino Wildenhain
J wrote: Is it possible to make a GUI email program in Python that stores emails, composes, ect? Yes this is possible. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dictionary size/entry limit?

2009-02-21 Thread Tino Wildenhain
string in memory) which runned perfectly with linux. You can try yourself maybe by installing ubuntu on the same host. (If you feel fit you can even skip the install and run it off life CD but then you need to fiddle a little to get swap space on disk) Regards Tino -- http://mail.python.org/mailm

Re: print string as raw string

2009-02-17 Thread Tino Wildenhain
nsense. print r"\." or in python3.0 print(r"\.") will just print: \. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Tino Wildenhain
dom string to a number is sure something you want to achieve. Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Tino Wildenhain
pproach instead of trying to copy (incomplete as it has been shown not only digits and . constitute a float) already implemented code. Of course if you want to limit the range of accepted data even more, then isdigit and friends can be used - maybe you could time both approaches with a set of data

Re: hist without plotting

2009-02-15 Thread Tino Wildenhain
like scipy.histogram(a) ? Actually I don't see many plotting functions beside plot() anyway... Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python interface to ODF documents?

2009-02-15 Thread Tino Wildenhain
st of xml parsers included in the standard lib. This works very well to my experience. Not sure if an abstraction layer on top of that exists. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: PySerial "write" should accept "bytearray"

2009-02-14 Thread Tino Wildenhain
read" functions should return a "bytearray". I'm sure patches are welcome. And did you copy the pyserial author? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2.Request:: http Request sending successfully, but Response contains in valid data.

2009-02-11 Thread Tino Wildenhain
ta is having valid xml data r = urllib2.urlopen(req) print(r.code) // output 200 print(r.msg) // output OK print(r.read()) // Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Using paramiko rsa key

2009-02-10 Thread Tino Wildenhain
and connecting in my python code? Sure, where can we send the invoice too? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: python ssh and Tetia SSH server

2009-02-10 Thread Tino Wildenhain
past with ssh.com ssh. Maybe you can get a test version and just try it out. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: convert the ip packet to and from RS-232 packet

2009-02-09 Thread Tino Wildenhain
such, not really a python topic. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Strings

2009-02-06 Thread Tino Wildenhain
st try it out in the interactive interpreter Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest database solution

2009-02-06 Thread Tino Wildenhain
iguration would be helpful. Please note that postgres is quite good at handling concurrent load - this does not mean its best or every desk top database application. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing two book chapters (text files)

2009-02-05 Thread Tino Wildenhain
://www.nltk.org/ it's a python toolkit for natural language processing. there's a book at http://www.nltk.org/book with much more info. Also there is difflib in the standard package which can be used depending on exact definition of "similarity". Regards Tino smime.p7s

Re: Use list name as string

2009-02-05 Thread Tino Wildenhain
%s' line %d" % (repr(a),filename,func_name,line_no) for ln,srcline in enumerate(contextlines or []): print "%3s : %s" % ('*>' if ln==contextindex else '',srcline) just play around calling the above function from different places and you should see what I mean :-) Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Use list name as string

2009-02-05 Thread Tino Wildenhain
27;dataname' of the assignment in the function call? The only solution I see would be to add a property to your datastore to give it its own unique name. (By subclassing and providing a name attribute or property) - and while you are at it, maybe you want to put the 'write to file'

Re: len()

2009-02-04 Thread Tino Wildenhain
ects where sequences indeed have a len() method called __len__() Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Locating python

2009-02-04 Thread Tino Wildenhain
se 11.1 default config. i just tried it: argh. This Nürnberg Windows ;-) But this shows that a sensible configuration of the system is usefull before you start installing services on it :-) Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Locating python

2009-02-04 Thread Tino Wildenhain
s root for you, but needs the password to do it. sudo does the same thing, but again needs the password to do it. hope that makes senses (and that this worked). actually "su" needs the root (or the target users') password and sudo needs _your_ (the current users) password. HTH Tin

Re: Python ssh with SSH Tectia server

2009-02-03 Thread Tino Wildenhain
Hi, loial wrote: Has anyone any experiencing with ssh between a python client and the SSH Tectia server from SSH (ssh.com) ? this might well be. ;) Does it work? Did you try? (It should however since at least openssh client worked) Cheers Tino smime.p7s Description: S/MIME

Re: Unzipping a .zip properly, and from a remote URL

2009-02-03 Thread Tino Wildenhain
Christopher Culver wrote: Tino Wildenhain writes: so instead you would use archive = zipfile.ZipFile(remotedata) That produces the following error if I try that in the Python interpreter (URL edited for privacy): import zipfile import urllib2 remotedata = urllib2.urlopen("

Re: Unzipping a .zip properly, and from a remote URL

2009-02-03 Thread Tino Wildenhain
eation could be put into a class with caching of already existing subdirectories created and recursive creation of missing subdirectories as well es to make sure you do not ascend out of your target directory by accident (or crafted zip, see above). Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: key capture

2009-02-02 Thread Tino Wildenhain
needs to be asynchronously so you can catch note-on, note-off events during playback. Good luck Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-01-29 Thread Tino Wildenhain
ere everything is a class, even the primitive types. well actually except keywords, everything is an object in python too, including of course primitive types (if you say so - practically python does not have them). Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http:

Re: Results of executing hyperlink in script

2009-01-28 Thread Tino Wildenhain
the records, at least os.popen2,os.popen3 support tuple as argument: i,o=os.popen2((cmd,arg1,arg2)) and quotes them correctly. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: USB in python

2009-01-27 Thread Tino Wildenhain
t might be temperature sensors but there are a lot of GPIO chips, electronic resistors, A/D converters etc. available. Most of the stuff can be even ordered as sample from dallas/maxim. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: USB in python

2009-01-22 Thread Tino Wildenhain
andler for your hardware's USB ids. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print lambda result ?

2009-01-20 Thread Tino Wildenhain
Barak, Ron wrote: Thanks Tino: your solutions without the lambda work nicely. What I still don't understand is why the print does not execute the lambda and prints the result, instead of printing the lambda's object description. Bye, Ron. Well its up to the implemention what

Re: How to print lambda result ?

2009-01-20 Thread Tino Wildenhain
)) which is just a quite useless application of lambda :-) (num,num >1 and "s" or "") or even (num,"s" if num >1 else "") in python > 2.5 or in python <3.0: (num,"s"*(num >1)) :-) HTH Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 weirdness

2009-01-17 Thread Tino Wildenhain
can happen if the environment of the web server differs from your personal user when you are testing your scripts. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: reading file to list

2009-01-17 Thread Tino Wildenhain
MRAB wrote: Tino Wildenhain wrote: Xah Lee wrote: comp.lang.lisp,comp.lang.scheme,comp.lang.functional,comp.lang.python,comp.lang.ruby ... OK, I want to create a nested list in Lisp (always of only integers) from a text file, such that each line in the text file would be represented as a

Re: reading file to list

2009-01-17 Thread Tino Wildenhain
thon would be 3 or 5)). So? Please count the lines: [line.strip().split() for line in file("blob.txt")] HTH Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: image recogniton?

2009-01-06 Thread Tino Wildenhain
gt; wrote: Hi! I know little about the computer image processing, and now I have a fancy problem which is how to read the time from the picture of a clock by programming ? Is there anyone who can give me some suggestions? Thank! Li Han Regards Tino smime.p7s Descriptio

Re: Ideas to optimize this getitem/eval call?

2009-01-04 Thread Tino Wildenhain
at of course ;-) Infact, evoque is really one of the few (or even the only one?) that was conceived from the start to support restricted evaluation. Thats is definitively not the case. There are at least 2 quite old template systems on top of a quite good restricted environment. Cheers Tino smim

Re: ACL in python

2009-01-03 Thread Tino Wildenhain
environment you find within zope for all the TTW-stuff? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Switching user in a SSH connection

2009-01-02 Thread Tino Wildenhain
ould for example run su - in that connection? Or sudo if installed and configured. What else would you need? Tino. smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing Excel spreadsheets

2008-12-30 Thread Tino Wildenhain
m, but I'd rather get some more input before going with something I don't know. Thanks, Andy. xlrd(read only) also see pyExcelerator which is now replaced by xlwt :-) Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: math module for Decimals

2008-12-29 Thread Tino Wildenhain
ica and friends with python you might check scipy/numpy. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows SSH (remote execution of commands) - Python Automation

2008-12-29 Thread Tino Wildenhain
its more easy and relieable to just use cron on unix side. This works much much better then Task scheduler on windows btw. Regards Tino Can anyone provide me some help in achieving this ? Thanks, -- *Raghu

Re: Can´t Surf Python Pages in Windoz e

2008-12-26 Thread Tino Wildenhain
cations using this port already, firewall in your way... a 404 however indicates the service is there but you are not authorized. Please read "User and Permission" chapter in the zope book. Please note the above code you cited is not useable (or sensible) in a zope environm

Re: How to represent a sequence of raw bytes

2008-12-21 Thread Tino Wildenhain
py, scipy, they have arrays similar to C and also much more numeric datatypes. Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Django/Turbogears too specific?

2008-12-21 Thread Tino Wildenhain
code and design this way. I prefer TAL (template attribute language, ZPT) [1] much over the other attempts I've seen ( and I've seen a lot) Cheers Tino [1] http://en.wikipedia.org/wiki/Template_Attribute_Language smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.pyt

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Tino Wildenhain
ation sensibly, best if you would come with a proposal? Perhaps pprint.pprint is a starting point? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Tino Wildenhain
Neal Becker wrote: Reading some FAQ, I see that __str__ is "meant for human eyes". But it seems that: class X(object): def __str__(self): return "str" def __repr__(self): return "repr" x = X() d = {0 : x} print d {0: repr} So if __str__ is "meant for human eyes", then w

Re: regex problem ..

2008-12-15 Thread Tino Wildenhain
uld my current regex (r"""[^a-zA-Z0-9]""") be modified? You might want to normalize before checking, e.g. from urllib import unquote p=re.compile("[^a-zA-Z0-9 ]") flagged=[] for s in strs: if p.search(unquote(s)): flagged.append(s) be carefull howeve

Re: zip a created file

2008-12-13 Thread Tino Wildenhain
mediate file in the file system. (This also avoids a lot of problems with your approach above - for example if the same query is put twice the same time...) Just have a look at the examples in the documentation which come with the zipfile module. Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: python to parse excel file csv format

2008-12-03 Thread Tino Wildenhain
n reader: os.popen(("chown",fmodes,fname)) or even plus better: for fmodes,fname in reader: os.chmod(fname,fmodes) (Both my examples avoid problems with unquoted filenames) Regards Tino smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >