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
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
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
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
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
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
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
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
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
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
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
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
'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.
, 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
, pthreads ... which
are all optional anyway.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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? :-)
not matter.
Sparse datastructures might be better represented with dicts.
Regards
Tino
--
http://mail.python.org/mailman/listinfo/python-list
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
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
example of what you would do in such a
hypothetical language?
Tino.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
generate excel reports for all the
damnd ms office adicts in the company...
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
generate excel reports for all the
damnd ms office adicts in the company...
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
s not true, pyexcelerator can also read XLS files. However it
does not preserve meta information (formatting etc.) when it reads
them.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
ot;share".
So in the OS world you can actually spend that money on someone
indeed giving you a solution.
Btw, SUN has a plugin for MS office to read/write odf.
(Which works instead of the solution from MS itself).
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http
ifficult to fix in the general case, because your page might
already contain "&". If it is possible that some of them might be
wrong while some are right, you can do something like:
s = s.replace( '&', '&' ).replace( '&', '&
code.
Ok, so...
What is the best way to do this? The "most pythonic"?
The question would be - why do you want this? Is it just
curiosity or can we find a better solution to the overall
problem, once understood?
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
items()
allitems.sort() # sort based on keys as first tuple element
for (key,(var1,var2)) in allitems:
print key,var1,var2
HTH
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
Luke Hamilton wrote:
Hey People,
I am wondering if there are any OS shopping cart application written in
python?
Yes there are.
HTH
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
see the answer given by Fredrik)
Ah, btw, I'd check the the other posts of long term members
if you see something in the appearance different to
yours :-) (not related to your question itself)
Cheers
Tino
...
Luke Hamilton wrote:
Hey People,
I am wondering if there are any OS shopping
re already
pretty fast).
Looks as you didn't mention ZODB yet.
As it is actively developed, it is maybe something
you could consider.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
t makes sense to handle things differently for performance, then
please have it doing it silently, e.g. when it detects strings just
use join() internally.
Cheers
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
ese, Russian, French, ... :)
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
look at rfc2616 and friends,
get something like wiresharc to see how HTTP requests
work in real world.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
teresting idea for the core of the converter,
maybe you like it:
def int_to_bin(v):
i=1
d=1
a=0
while i>> int_to_bin(5)
101
>>> print "%08d" % int_to_bin(5)
0101
I think the formatting bit is a tad nicer then '0' * (8-len(
the following would work:
dupes=[]
for items in data.values():
dupes.extend(items[1:])
HTH
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
Tino Wildenhain wrote:
Hi,
Alexzive wrote:
Hello there :) ,
I am a python newbie and need to run following code for a task in an
external simulation programm called "Abaqus" which makes use of python
to access the mesh (ensamble of nodes with xy coordinates) of a
certain geometr
Hi,
Terry Reedy wrote:
...
Yes, after figuring out what to do from the original post, I saw yours
and then Pruebono's and decided that since two people had submitted the
jackpot algorithm, I need not say more. I will say this: this solution
amounts to finding equivalence classes (the sets of
s changing arrays with "foreach" loop:
#!/usr/local/bin/php
How can I make sure that
for x in a: x=2*x
actually changes the elements of the array "a"?
>>> l=range(10)
>>> for i in range(len(l)):
... l[i]*=2
...
>>> l
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
Cheers
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
hon/
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(TIMEOUT)
sock.connect(server_host)
sock.send(query)
data = sock.recv(512)
for data_item in data:
try:
print chr(data_item)
this is never going to work since recv() returns a string buffer, not
a list of integers.
['param'] = "y"
if i == 2: data['param'] = "x"
print data_set
Beside the data copy which is explained in the other posts,
what is the problem you want to solve? Would
data_set[1]['param']="x"
data_set[2]['param']=&quo
orter:
iterable.count(y)
not work and read better anyway?
even calculating with boolean values isn't neccessary
since 'and' and 'foo if bar else blub' are working much better
so the type coalescing
bool - int - float can really go away.
Tino
smime.p7s
Description: S/MIME C
Hi,
[EMAIL PROTECTED] wrote:
Tino Wildenhain:
Wouldn't
len([x for x in iterable if x==y])
or even shorter:
iterable.count(y)
not work and read better anyway?
The first version creates an actual list just to take its length,
think about how much memory it may use.
yes it seems len()
n i
do.
You could output the whole environ to see what you get and how it is called.
I'd recommend however to check that you are using a configured value and
not something sent by the client if you are going to use it during
filesystem lookup.
Regards
Tino
smime.p7s
Description: S/M
Hi,
Bobby Roberts wrote:
On Sep 23, 9:10 am, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
Bobby Roberts wrote:
Depends on the technology/web framework. If you use WSGI, you should use
something like:
host_name = environ.get("HTTP_HOST", None) or environ["SERVER_NAME"]
s of a list I
can create an x-y coordinate plane for navigation.
You can 'count' (whatever that means) equally in strings as you do in
lists. As said above, they behave exactly the same. Just strings
are imutable - e.g. you can't change individual parts of them.
Tino
--
http://mail.python.org/mailman/listinfo/python-list
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
walk.
Hoewever it entirely depends on your algorithm.
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
t in a single statement, but readability
will suffer:
cursor.execute(
"""
SELECT titem.object_id, titem.tag_id
FROM tagging_taggeditem titem
WHERE titem.object_id IN (%s)
""" % ", " .join("%s" for x in xrange(len(eid_list))),
ei
Hi,
Tim Rowe wrote:
2008/9/23 Craig Allen <[EMAIL PROTECTED]>:
So python may turn out to be pure OO
...
The question I usually ask is "Does this language help me get the job
done?" Python often does. That's all that really matters, isn't it?
Well then it still depends on the perception of
1,5,9]])
Nope. That would be dangerous! -> google for SQL injection
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
Michael Mabin wrote:
I laugh in the face of danger.
Give me a use case for an exploit.
(see below)
On Fri, Sep 26, 2008 at 8:05 AM, Tino Wildenhain <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Michael Mabin wrote:
cu
ssibly
insecure data into 'secure' then, no I would still object.
Why? Because its a bad example of "default permit". Its always better
to have a whitelist - even more so when its so easy to do.
Its just a habit you develope - if you never do it right, how would you
know when a
Hi,
Michael Mabin wrote:
If the inputs are edited prior to the construction of the string and
these fields are used for more than one update then it's not an exploit.
It's simply a matter not repeating yourself when coding.
In python we do not fear that.
In this particular case too, we're t
in fact the company I work for does not do much
web application but input validation is something we get even audited
for.
Nevertheless I wish you a very good weekend :-)
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
to write 1+2 in the form of 1.add(2) ?
(Yes, in python you can do that, as well as "hello".__len__() works
even (1).__add__(2) works.)
Maybe its just that python don't want to waste good names for methods :-)
So as said above in some other thread, python supports OO but does not
Michael Mabin wrote:
Tino, dude, I'm afraid I lied about my previous post being the last
word. There are some things you said here that must be addressed.
Well. Its interesting to see thats either my English is so bad you
don't understand or you are too tired. All what needs to b
-install with your search engine of
choice.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
vation of traceroute ;)
Well, maybe an implementation in python itself could be of interest?
http://mail.python.org/pipermail/python-list/2003-March/196063.html
maybe there are more attempts - this one was just the first thing
which popped up with g**gle. (The script is in the attachment).
Rega
['name']
'adf'
but of course eval() is dangerous, so feel free to
explore more then this one solution.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
ou basically need to encode into xml charref or have your xml library
do so.
It seems a little googling turns up this one, which might be helpful:
http://www.xml.com/pub/a/2002/11/13/py-xml.html
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
MT (2) 2006-04-01 18:09:26.469445+00:00
> GMT (3) 2006-04-01 19:09:26.469445+00:00
> GMT (4) 2006-04-01 18:09:26.469445+00:00
> _tz_germany: Europe/Berlin (id: -1212869684) , local.tzinfo: Europe/Berlin
(id: -1212868756)
--> Why is GMT (3) wrong?
Cheers,
Tino
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
.
Regards
Tino
--
http://mail.python.org/mailman/listinfo/python-list
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
--
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
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
time you start your
comparison.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
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
101 - 188 of 188 matches
Mail list logo