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
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
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
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
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
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
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
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
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
time you start your
comparison.
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
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
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
--
.
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
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
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
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
example of what you would do in such a
hypothetical language?
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
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
not matter.
Sparse datastructures might be better represented with dicts.
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? :-)
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
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
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
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
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
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
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
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
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
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
, pthreads ... which
are all optional anyway.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
, 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
'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.
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
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
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
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
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
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 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
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
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
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
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
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
, ...}, 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
, 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
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
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
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
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
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
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
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
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
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
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
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
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
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
such, not really a python topic.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
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
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
://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
%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
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'
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
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
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
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
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("
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
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
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:
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
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
andler for your
hardware's USB ids.
Regards
Tino
smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list
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
))
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 - 100 of 188 matches
Mail list logo