>
> I seem to recall a post by Diez Roggish that reload() doesn't always
> work as it should. Any news on this? At least im my preliminary test it
> works.
Read the docs on reload:
http://www.python.org/doc/current/lib/built-in-funcs.html
"""
If a module is syntactically correct but its initia
>
> As far as I understand there's no $1, $2... etc stuff right ?
Yes - but there is sys.argv
Try this
import this
print sys.argv
and invoke it as script with args. Make also sure to checkout modules
optparse and getopt to deal with the options.
Diez
--
http://mail.python.org/mailman/lis
if you're getting this on the way in, something is broken (posting a short
self-contained test program will help us figure out what's wrong).
Or he tries to pass a unicode object to parseString.
Regards,
Diez
# -*- coding: utf-8 -*-
import xml.dom.minidom
dom3 = xml.dom.minidom.parseString(
Odd-R. wrote:
> This is retrieved through a webservice and stored in a variable test
>
>
>
>
> ]>
> æøå
>
> printing this out yields no problems, so the trouble seems to be when
> executing
> the following:
>
> doc = minidom.parseString(test)
You need to do
doc = minidom.parseString(test.e
> I have found that some people refuse to stick to standards, so whenever I
> parse XML files I remove any characters that fall in the range
> <= 0x1f
>
>>= 0xf0
Now of what help shall that be? Get rid of all accented characters?
Sorry, but that surely is the dumbest thing to do here - and has
y. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donate.html
Kurt B. Kaiser publishes a weekly report on faults and patches.
y. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donate.html
Kurt B. Kaiser publishes a weekly report on faults and patches.
>
> I debugged a little and what is happening is the space in "c:\Program Files"
> and "...\National Instruments..\" is being parsed as separate arguments and
> i only wish for them to be parsed as one.
>
> How do I get pass a path string containing spaces?
Surround it with double quotes. This
billiejoex wrote:
> I'm sorry. Maybe you misunderstanded.
> I know the great advanteges deriving by using interpretation too, I
> appreciate it very much (I'm newbie in Python and the interpeter really
> helps me out in many situations), but a 'pure' interpretated language needs
> obligatorily
gene tani wrote:
> http://griddlenoise.blogspot.com/2005/07/python-off-rails.html
I don't think that opinion is very founded - especially what he thinks
metaprogramming is about, and what not.
What he seems not to grasp is the crucial difference between django and
rails/subway (at least in the
Patch / Bug Summary
___
Patches : 342 open ( +3) / 2923 closed ( +1) / 3265 total ( +4)
Bugs: 908 open ( +5) / 5232 closed (+10) / 6140 total (+15)
RFE : 188 open ( +1) / 185 closed ( +1) / 373 total ( +2)
New / Reopened Patches
__
String fo
> So, bottom line: Does anyone know how to get the size of the incoming file
> data without reading the whole thing into a string? Can I do something with
> content_header?
http://www.faqs.org/rfcs/rfc1867.html
It seems that _maybe_ you can use the content-length http header. But it
looks as if
[EMAIL PROTECTED] wrote:
>>Why is that? I thought gen.next is a callable and gen.next() actually
>>advances the iterator. Why shouldn't gen.next always be the same object?
>
>
> That is, in essence, my question.
Because bound methods are generated on the fly - google this group,
there have b
Guenter wrote:
> Hi,
>
> I need to develop an application that displays video 640x480 16-bit per
> pixel with 30 fps.
>
> I would prefer to do that with Python (wxPython) but don't have any
> experience whether it is possible to achieve that frame rate and still
> have some resources for other pr
Adam Monsen wrote:
> It would be helpful to be able to temporarily disable AF_INET socket
> connections (I don't care about IPv6 for now).
Maybe put an socket.py with mockup funktions in your path before the
real socket.py. Then you can alter teh behaviour of all necessary functions.
Diez
--
ht
y.com/success
The Python Software Foundation (PSF) has replaced the Python
Consortium as an independent nexus of activity. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a don
y.com/success
The Python Software Foundation (PSF) has replaced the Python
Consortium as an independent nexus of activity. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a don
Patch / Bug Summary
___
Patches : 343 open ( +1) / 2927 closed ( +4) / 3270 total ( +5)
Bugs: 908 open ( +0) / 5245 closed (+13) / 6153 total (+13)
RFE : 189 open ( +1) / 185 closed ( +0) / 374 total ( +1)
New / Reopened Patches
__
Allow to
Thomas Jollans wrote:
> I guess questions like this come all the time here ... well:
>
> I a looking for a python IDE for gnu/linux that :
> - has decent sytax highlighting (based on scintilla would be neat)
> - has basic name completition, at least for system-wide modules
> - has an integrated de
[EMAIL PROTECTED] wrote:
> Hi,
>
> I am embedding Python with a C++ app and need to provide the Python
> world with access to objects & data with the C++ world.
>
> I am aware or SWIG, BOOST, SIP. Are there more?
>
> I welcome comments of the pros/cons of each and recommendations on when
> it ap
> (I wonder, by the way, if it's a good idea to provide a very rich interface
> between an application and embedded Python. I have no experience in the
> area, but intuition tells me that simplicity and minimalism is important.
> How well has this worked out in past projects?)
Check out SIP and th
> Very interesting!
>
> BTW: I wonder if and when someone will use stackless python or pygame as a
> basis for developing a _visual_ development environment for 2D
> games/multimedia like Macromedia Director. It would be a killer app.
Blender. It currently doesn't use stacklass AFAIK, but that
Diez B. Roggisch wrote:
>
>> Very interesting!
>> BTW: I wonder if and when someone will use stackless python or pygame
>> as a
>> basis for developing a _visual_ development environment for 2D
>> games/multimedia like Macromedia Director. It would be a killer a
urn "%i" % l[0]
return ", ".join([f(vals[a:b]) for a,b in ranges])
riddle1 = """
1**83***2
57***1***
***5*9*64
7*4**859*
**3*1*4**
*514**3*6
36*7*4***
***6***79
8***52**3
"""
riddle2 = """
**2*9*1*7
*386*
4
Neal Becker wrote:
> One possible way to improve the situation is, that if we really believe
> python cannot easily support such optimizations because the code is too
> "dynamic", is to allow manual annotation of functions. For example, gcc
> has allowed such annotations using __attribute__ for qu
TPJ wrote:
> OT:
>
>
>>BTW: I wonder if and when someone will use stackless python (...)
>
>
> And what is this stackless python? I have visited it's homepage, but I
> wasn't able to find any answer. (Well, I have found out, that stackles
> python is python's implementation that doesn't use C s
> meanwhile, over in python-dev land:
>
> "Is anyone truly attached to nested tuple function parameters; 'def
> fxn((a,b)): print a,b'? /.../
>
> Would anyone really throw a huge fit if they went away? I am willing
> to write a PEP for their
LaGuna wrote:
> Suse 9.3
>
> Ide RAD for linux?
Eric3
--
http://mail.python.org/mailman/listinfo/python-list
>
> split(path)
> returns a pair (dirname,filename), where dirname is the part of path
> up to the last slash, and filename is the rest of the string after the
> last slash.
Bullshit. Slash isn't always the path component delimiter. Get a clue on
what you're talking about before suggesting
> With functional i mean my files mostly consist of functions and only
> rarely i use "class". The library modules seem to be mostly written the
> object-way on the other hand.
Which is not what functional programming is about. The style you
describe is more often referred to as procedural progra
l
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donate.html
Kurt B. Kaiser publishes a weekly report on faults and patches.
http://www.google
> I think this is unfair. The use of "slash" is a failing of the current
> documentation. If his use is an indication of a nano-tube-narrow
> mindset then so would be the use by the actual documentation writers.
You're right - I missed that somehow, as the original docs talk about
components - w
l
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donate.html
Kurt B. Kaiser publishes a weekly report on faults and patches.
http://www.google
ago wrote:
> Is it possible to have a default value associated python objects? I.e.
> to flag an attribute in such a way that the assignment operator for the
> object returns the default attribute instead of the object itself, but
> calls to other object attributes are properly resolved? (I don't t
thod - it already _has_ its
first argument (an instance of B) bound to it. And just passing it around
doesn't change that. You can assign it to a name in whatever scope you like
- that won't change its nature.
Now if you want to use foo in A as instancemethod, you could do this:
A.
orely
for the OO-style implicit first argument. That they exist at all is a great
difference to e.g. C++, where you can't pass callbacks around that are
instance methods.
If you are after currying - look at the cookbook, there are recipes for
that.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Did you see the daemonize recipe in the cookbook? Don't forget to checkout
the comments section.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
odbc2your-server driver. That would allow
you to cope with a pretty well defined standard (odbc) and doing the
network stuff totally on your own behalf instead of trying to make some
self-written protocol stack like postgres so compatible that a postgres
odbc driver doesn't know the diffe
connect to my server if the client is not on
> the same PC (although I'm doing the above).
> Also:
> 1) my server has more than one IP addresses
> 2) my server does not have any DNS name
> ... so I want to connect to an IP address that I can ping but has no
> name.
> How
t, elmer will
be of use for you.
http://www.python.org/moin/elmer
But it will still be far from being trivial.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
for decorating.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
r/shorter/whatever filter -
pythonistas or perljunkies.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
hat books you mean, I
can't say if its covered there or not.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
t you pick something that really bothers people and see if your
skills (that I'm sure exist) can be of use there?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ith you on this. If you feel
its inconsistent, I'm not trying to convince you otherwise. But as I said
before: Even if it _is_ - its still of no practical impact. Also the OP
didn't have any further problems after seeing whats getting on. So lets
move along.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
urn self.value
inc = Incrementor(0)
print inc(1)
print inc()
print inc(3)
I get this result:
[EMAIL PROTECTED]:~$ python2.4 /tmp/test.py
incrementing
1
Traceback (most recent call last):
File "/tmp/test.py", line 24, in ?
print inc()
TypeError: call() takes ex
hem or face
> our doom." -- Jeremy Bowers
Amen.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
zip(*[(1,4),(2,5),(3,6)])
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Usually, oo-style apis are thread-safe as long as each thread uses its own
objects. Shared global state is _very_ uncommon, and if it's most probably
documented.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
y, values)
is stored, and for a passed key, each key in that list is additionally
compared for being equal to the passed one. So another requirement of
hashable objecst is the comparability. In java, this is done using the
equals method.
So in the end, the actual mapping of key, value looks like this:
re easy?
There is an python-based ide which has the same name as your first name -
try that.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> I know its easy (string.replace()) but why does UTF-16 do
> it on its own then? Is that according to Unicode standard or just
> Python convention?
BOM is microsoft-proprietary crap. UTF-16 is defined in the unicode
standard.
--
Regards,
Diez B. Roggisch
--
http://mail.python.or
ic ASCII characters at the beginning, such as the
use of "#!" of at the beginning of Unix shell scripts. [AF] & [MD]
"""
So they admit that it makes no sense - especially as decoding a utf-8 string
given any 8-bit encoding like latin1 will succeed.
So in the end, I st
s its a
keyword in python). All I had to do to make e.g. examples given in C++ work
was to strip curly braces and type declarations. So again: I don't see the
need for that doc. But that's IMHO, of course.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ür" and so on for a heuristic. But that is no guarantee.
> Using a BOM with UTF-8 makes it easy to indentify it as such AND it
> shouldn't break any probably written Unicode-aware tools.
As the faq states, that can very well happen.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
parameter in the lambda will keep the right
value for each iteration.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
[lambda: foo(i) for i in xrange(5)]
for f in fs:
f()
fs = [lambda x=i: foo(x) for i in xrange(5)]
for f in fs:
f()
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
that it really makes sense to create full docs at a api
level. It would be hard to be in sync with the qt development itself.
Instead a wiki which captures the various pitfalls would be cool. And it
appears it exists:
http://www.diotavelli.net/PyQtWiki
So maybe enhancing that would be an
> If this is "goodbye" I can't say I'm sorry.
Don't feed the trolls - as tempting as it is
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
mssql driver for unxi-odbc. Its called ftl or tls or
something. As always: Google is your friend...
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
e to see reduce, even if
> it
> is a common idiom like that. Also I don't believe it short circuits.
It doesn't but so doesn't your loop example. Put a break in there once
Result is False.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
on. Instead this can be done by companies - see activestate. So if
you want it, step up and do it yourself so your work _becomes_ the official
mingw port. Community gratitude would be guaranteed.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
lly haven't the need for. And I developed
quite large python apps.
>>> c) Why are the following efforts not _directly_ included in the
>>> python source code base?
>>>
>>> http://jove.prohosting.com/iwave/ipython/pyMinGW.html
Ask the author of the patch. We can't read minds here.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
f.getEmptySlot()
> y = emptySlot[1]
> x = emptySlot[0]
make this:
x,y = self.getEmptySlot()
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
eds. But as lots of
people use python and python based solutions with great commercial success,
you might think of reviewing your needs more critical. After all, there is
no _perfect_ system for all needs.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
mx]
elements[fromy][fromx] = dummy
And use xrange instead of range.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
e.com/group/comp.lang.java.softwaretools/browse_frm/thread/837df2c1188e6e39/18b5dcfd54a6a902?q=Lazaridis+Ilias&_done=%2Fgroups%3Fq%3DLazaridis+Ilias%26hl%3Den%26lr%3D%26ie%3DUTF-8%26sa%3DN%26tab%3Dwg%26&_doneTitle=Back+to+Search&&d#18b5dcfd54a6a902
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
administrata wrote:
> Hello. I was about to use tutor-mailing But, When i send to
> tutor@python.org
That just means that somebody subscribed to that list isn't reachable.
Ignore it.
> Plz HELP me;
Please start talking english. This is no l337-script-kiddie forum.
--
Re
to something accessible in the namespace...
Why only the id? A list only stores a reference to the object anyway - no
copy of it. So you don't gain anything by using the id.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
does -
e.g. for a CMS, I'd strongly recommend a zope based solution. Other apps
might be better written in other frameworks.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Patch / Bug Summary
___
Patches : 298 open (+14) / 2754 closed ( +6) / 3052 total (+20)
Bugs: 823 open (+19) / 4829 closed (+17) / 5652 total (+36)
RFE : 168 open ( +1) / 144 closed ( +2) / 312 total ( +3)
New / Reopened Patches
__
date.strp
Maybe ZODB helps.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>> Maybe ZODB helps.
>
> I think it's way too heavyweight for what I'm envisioning, but I
> haven't used it yet. I'm less concerned about object persistence
> (just
you
should skim over the tutorial to get a grasp of how it works.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ough name - so look there and be a happy camper.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
import types
v = []
if type(v) is types.ListType:
pass
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
laborate yaml/xml serializations to
allow for im- and exports and use with xslt and currently I'm investigating
a switch to postgres.
This point is important, and future developments of mine will take that into
consideration more than they did so far.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
accuracy than seconds, it is returned as
fraction of a second. That is the whole point the result of time being a
float and not an int.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
john san skrev:
> pure DOS, old pc, used for teaching . want show some "windows" under
> DOS (under Python).
curses is a text-based interface that will let you build windowed
applications like you could with the crt unit in Turbo Pascal of those
golden days. I've no idea if anyone's compiled it f
john san skrev:
> Actually the "windows" running very good under the xbox-NTOS via
> xboxmediacenter. its just limited functions(not easy to programming
> the "windows" prog.), if we can find WxPython-like can be ported (I
> can import *
> from it to my xboxPython) )it will be a great great .
thon to full fledged app servers like zope. As
usual, google is your friend. No need to dig into the things you mentioned
above - at least not for what you want to do right now.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
r Linux with frambuffer output (see freevo) or a "real" Windows
that is capable of showing a graphical ui.
Maybe somehow the pygame sdl wrapper can be used for gui-stuff. SDL has had
a DOS mode. But it is discontinued.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
inding the created object as first argument to the method. Thus each
instance of a class Foo with a method bar has its own instance of bar - the
bound method bar. But only one per object.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
. It's really great.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
I'm playing a little with curses (okay, call me a masochist) and have
found a small gotcha. When I do eg. a screen = stdscr.subwin(10,20,0,0)
and then a screen.border(), I end up with an ugly border where the
right side is seriously misaligned.
I've figured out the reason: I love the Terminal DEC
Thomas Heller wrote:
> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>
>> Maybe somehow the pygame sdl wrapper can be used for gui-stuff. SDL has
>> had a DOS mode. But it is discontinued.
>
> What exactly is discontinued? pygame? SDL?
The dos mod
m the same unbound method and the same instance as you want:
That did escape me so far - interesting. Why is it that way? I'd expect that
creating a bound method from the class and then storing it in the objects
dictionary is what happens.
--
Regards,
Diez B. Roggisch
--
http://mail.pyth
ddress):
digits = address.split(".")
if len(digits) == 4:
for d in digits:
if int(d) < 0 or int(d) > 255:
return False
return True
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
u
> validate the result, with a cut-down validator that relies on the fact
> that there are 4 segments and they contain only digits:
The search case needs a regular expression. But the OP didn't say much about
what he actually wants.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
show it to us, then we can comment on it.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
the components required
> are:
Damn. Certainly not my glory regular expression day.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
forms and compilers. Just not the compiler you perceive as
being a necessity. But that dead horse has been beaten enough already.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> Unnecessary and deliberately provoking question - python is taken
> seriously, e.g. by multi-billion dollar companies like google and zope.
Of course zope corporation is not amongst the multi-billion dollar companies
- by now. But who knows :)
--
Regards,
Diez B. Roggisch
--
Ilias Lazaridis wrote:
> Diez B. Roggisch wrote:
>>>Should a professional developer take python serious?
> [...] - (ungentle babbling after disrupting coherence of writings)
And that from you *lol*
> I mean, if the team does not manage at least the foundation of a
> m
d by all of us humble developers who
actually _deal_ with problems.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ll be pretty straightforward. As others (including me) have stated
before: windows is a commercial product. You have to pay to use it, and you
have to pay to develop for it. That's the way MS wants it. The alternatives
are there - but you can't have your cake and eat it.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ated from that class.
This works as expected:
class ExistentialCrisis:
def __init__(self, text):
self.spam = text
print 'In the constructor of the %s class' % self.__class__.__name__
ExistentialCrisis("egal")
--
Regards,
Diez B. Roggisch
--
http:
http://www.zope.org/
But there are plenty of other python http frameworks. The mod_python is
AFAIK the most basic and primitive one. But build on top of it or fully
python-based you have plenty of options. Google is your friend - this NG
features similar discussions every other week.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ts main purpose. So you e.g. get session state handling
"for free" - as more or less _all_ web-apps today need them.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Im not sure if I understand you fully, but if what you are after is how to
pass named parameters analog to positional args, do it as dict:
def foo(name=None):
print name
foo(**{name: "Fuzzy"})
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
501 - 600 of 4459 matches
Mail list logo