allows you to create rpm packages.
HTH
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Of course, your mileage may vary.
That's not a daemon process (which are used to execute 'background services'
in UNIX environments).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
the CGI
version of the PHP interpreter. E.g.
os.system('/usr/bin/php mms.php')
or using the subprocess module, if you want to pass some data to the script
(using stdin/out).
As long as no remote PHP server is involved this is easier and perhaps even
faster than the RPC approach...
--
Benjamin
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
functionality.
Don't know, if this is possible at all, but usually it's not a good idea to
mess with the bowels of Python unless you have some greater surgical
skills.
HTH
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python
objects from/to strings.
marshal.loads() tries to deserialize an encoded string back into a python
object - which does not make sense here.
What you probably want is:
exec data in my_module.__dict__
HTH
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http
()
except thread_finished:
print Timeout
return
ftimed (test, 30)
print Script finished
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
this is done in detail is a windows issue. You may find help and
documentation in win specific group/mailing list, msdn, ... You can usually
translate the COM calls from VB, C#, ... quite directly to Python.
HTH
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de
difficult.
Is number() (the global one) a function or class. I guess it's a function,
so I would suggest to name it 'get_number' (and same
for 'get_user_guess') - this makes the code more descriptive. Should it
really be a class, a common convention is to capitalize it 'Number()'.
HTH
--
Benjamin
want should be written as:
newname = ..join(li[:-1])
HTH
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
print self.weight, self.colour, self.length
HTH
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
LorcanM wrote:
Benjamin Niemann wrote:
You'll have to invoke the __init__ method of the superclass, this is not
done implicitly. And you probably want to add the weight and colour
attributes to your subclass in order to pass these to the animal
constructor.
class fish(animal):
def
function.
Additionally I do usually add an 'argv' argument to main() which I use
instead of sys.argv, so I can easily test it with different arguments.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
third of the time on
this process and the rest is used for other processes (e.g. updating the
display).
What you need is time.time(), if its precision is sufficient.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
characters in tc, resulting in a possibly opened
door for SQL injection attacks.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
/wiki/Commons%3aFeatured_pictures/chronological',
perhaps urllib is stricter than your browsers (which are known to accept
every b**t you feed into them, sometimes with very confusing results)
and gets confused when it tries to parse the malformed URI.
--
Benjamin Niemann
Email: pink at odahoda
Benjamin Niemann wrote:
Gabriel Zachmann wrote:
Here is a very simple Python script utilizing urllib:
import urllib
url =
http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronological;
print url
print
file = urllib.urlopen( url )
mime
read (using a script called
hotshot2calltree, which is part of KCachegrind).
If anyone has a more direct solution, I'd be interested, too :)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
as a time way down the road... The next
major version of Python will be: Python PI (and each build will add
another digit... 3.1, 3.14, 3.141, ...)
That's actually the versioning scheme of TeX, currently being at 3.141592
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de
just have not found the right part of the doc:
http://docs.python.org/lib/module-sys.html#l2h-337
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
the stdlib).
'import random' will import the script itself (not the random module from
the stdlib), which is not what you want.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
(using py.test, if it matters).
http://www.logilab.org/projects/xmldiff
You'd still have to integrate this into your test framework though...
And I'll have a look at XMLUnit - seem's like something I could use for my
current project ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http
= random()
if x == mx: print x
else: print 'No luck,', x
Also note that random() returns a float and it is *very* unlikely that the
condition x == mx will ever come true
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman
(prerelease) (Debian 4.0.2-4)] on linux2
python2.4 seems to be unaffected.
Python 2.4.2 (#2, Nov 20 2005, 17:04:48)
[GCC 4.0.3 2005 (prerelease) (Debian 4.0.2-4)] on linux2
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo
if the input
encoding was different.
Is this a known behaviour, or I discovered a terrible unknown bug in
python encoding implementation that should be immediately reported and
fixed? :-)
happy new year,
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http
you import a module, programatically edit it, then have the
file reload the module?
Does anyone have any ideas about this?
Steve
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
?
Performance, network load...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
http://www.python.com/ perhaps?
Yep, let's make this the new official python site ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
COMPLETELY the same? if the codes are
translated first into C, where can I get the C source?
You may have a look at PyPy. I do not know what it exactly can do, but this
might be interesting for you:
http://codespeak.net/pypy/dist/pypy/doc/faq.html#how-do-i-compile-my-own-programs
--
Benjamin
list, dict, set...):
Just unpickle it and call repr() on the resulting object.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
?
Dunno - but as a last resort, you could create a tempfile with a unique name
(to be sure, not to override any existing data), dump your output there and
later os.unlink() it...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman
,))
# do other stuff, foo is running in background
r = fooResult.get() # guaranteed to block until result is available
print r
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
will learn to simply ignore these files ;)
Many file managers have already learnt this lesson and have options to hide
such backup files.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
in advance for any helpful replies!
The threading module does already take care of keeping references to all
running threads, so there's no need to do it yourself and your threads are
safe from being garbage collected.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de
for encrypt/sign every attachment separately...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Sion Arrowsmith wrote:
In article [EMAIL PROTECTED], Benjamin Niemann [EMAIL PROTECTED]
wrote:
[EMAIL PROTECTED] wrote:
However, in my current project I'm creating a bunch of threads which
are supposed to run until they've completed their run() method, and I'm
worried that if I do not keep
expception if field is required and is empty
if(product[k] == '' and fieldIsRequired):
raise GMError(k + ' is required')
if product[k] == '' and k in fieldIsRequired:
raise GMError(k + ' is required')
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http
the month name using
a translation table for English to Dutch month names.
Have you tested it with the proper locale setting and strptime(dateString,
%c)? I have not ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Tompa wrote:
Benjamin Niemann pink at odahoda.de writes:
You are almost there.
I don't feel so...
Your create_image.py does not return anything to the
browser yet.
Yes, I am aware of that but I do not what to return.
First return proper HTTP headers, e.g.
sys.stdout.write('Status
the
chances of hash collisions are pretty low.
Or everyone will start optimizing their programs by using long, *random*
names ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
complete example, so we can tell you where the
problem is. Try to build a minimal file that reproduces the problem. Often
you will find the line causing the error yourself - and the fix might be
obvious to you -, if your strip stuff away.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http
of the file in order to decode the string
literal into an unicode string.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
, but in different ways ;)
Perhaps you could try to use sys.stdout.write() directly, avoiding the
overhead of 'print'. Perhaps there are differences between the (default)
output buffering settings of perl and python.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de
(the JS members start with lowercase - e.g.
'properties' -, while COM need uppercase - 'Properties').
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
, but uncompressed and
would bloat JPEGs to a multiple of the original filesize) which supports
'image sequences'. Perhaps a DivX encoder could even support this
fileformat directly as input.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org
a http client based on select() that
allows you to check shutdownEvent.isset() at certain intervals - instead of
urlopen which just blocks.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
, if you drop static typing.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
+'.
Useful for regular expression (because the re module parses the '\X'
sequences itself) or Windows pathes (e.g. r'C:\newfile.txt').
And you should append a '$' to the regular expression, because
r[EMAIL PROTECTED] would match '[EMAIL PROTECTED]', too.
--
Benjamin Niemann
Email: pink at odahoda
Qopit wrote:
[snip]
My questions are:
- Am I missing something with my tester example?
- Are there other code-checking options other than PyChecker?
Try pylint
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python
are using another editor, you'll have to search its
menus for the proper way to save files as utf-8.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
will be executed in the thread that is called it of course (and
not in the thread that sent the reference to it).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Luis M. Gonzalez wrote:
This is great!
It's absolutely useless, like a real therapist, but it's free!
Never heard of Eliza? Even Emacs has it built in (Menu Help - Emacs
Psychiatrist).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org
.
http://blog.ianbicking.org/python-unicode-doesnt-really-suck.html
any help will be greatly appreciated
thx
Marc
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
not sure what will
happen then...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
to setup() and run() from the constructor.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
overheat and not the core
of a nuclear power plant.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Christoph Zwerschke wrote:
Benjamin Niemann wrote:
Some (many?) people don't like the unittest module, because it is not
very pythonic - nothing to wonder as it has its root in the Java world.
That's probably one of the reasons why there are other (more pythonic)
unittesting frameworks
Michael Hoffman wrote:
Benjamin Niemann wrote:
Christoph Zwerschke wrote:
Benjamin Niemann wrote:
Some (many?) people don't like the unittest module, because it is not
very pythonic - nothing to wonder as it has its root in the Java world.
That's probably one of the reasons why
adventures, I do not have such a personal relationship with my
classes ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
.
You might pipe the document through an external tool like HTML Tidy
http://www.w3.org/People/Raggett/tidy/ before you feed it into
HTMLParser.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
to this topic) and I also had the problem of heavy setup
costs. I deal with it by using a script around my testsuite (instead of
calling just unittest.main()) that does the setup/teardown of the
environment.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http
Cliff Wells wrote:
On Sun, 2005-07-31 at 13:14 +0200, Benjamin Niemann wrote:
But you should be aware of the fact that (if you send mail from a dialup
machine without going through a relay server) your mails will quickly be
marked as spam - I hope you do not intend to send spam...
Yah
Cliff Wells wrote:
On Mon, 2005-08-01 at 12:28 +0200, Benjamin Niemann wrote:
Cliff Wells wrote:
[snip]
By using a local SMTP server to proxy, your app can
queue up a large amount of mail in a much shorter period. It won't
necessarily go out any faster, but at least your app won't
machine without going through a relay server) your mails will quickly be
marked as spam - I hope you do not intend to send spam...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
)
as the first parameter. What you need is a string with the path to the
file.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
== 'That\'s my house'
You say: \Hello\ == 'You say: Hello'
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
]
And in A.__init__
self.d = WrappedDict(self, {})
You may also subclass WrappedDict from dict...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
for re.sub():
http://docs.python.org/lib/node114.html
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
a minor fix/customization to: not a good idea.
Probably not just for the casual hacker like me, but also for the
maintainance phase of a project, when the former lead gurus lost interest
and/or employment.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http
of memory, if you try to build a list of (dist, place) tuples. Better
use the generator syntax (requires python 2.4):
minDist, closestPlace = min(((place.pos-pos).len(), place)
for place in galaxy.places.itervalues())
--
Benjamin Niemann
Email: pink at odahoda dot de
side ('[1,2,x]') is evaluated *before* the value is
bound to the name 'x' - and at this point there is obviously no name 'x'
defined.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
convention are mostly a matter of personal taste (unless you are
working in a larger team, where there are some official conventions that
must be followed). So I would say the 'feels right' is the most important
factor.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de
dataset
(with N starting at 1)
or use the 'LIMIT' feature of MySQL:
cursor.execute (SELECT * FROM dataset LIMIT %s,1, n)
where n is the index of the requested dataset (starting at 0)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman
and it specifies a charset, this will
override your meta http-equiv. Often iso-8859-1 is the default charset
for the Content-Type header.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
. ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
signal to noise ratio.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
that J Hugunin didn't announce it himself.
Jim Hugunin announced it himself in a keynote at PyCon. You can read a lot
about it on Python centric blogs - just one example:
http://www.postneo.com/2005/03/23/keynote-ironpython
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http
by the first print.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
80 matches
Mail list logo