u a great deal here)
and create an instance of the desired struct. A third way could be to
create an extension type that resembles your struct and use that to create
the "real" struct by getting the types instance values.
HTH
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
If you can use a linux server, you can create a linux user mode file system
- there is a python binding for that - which in turn you could then share
using samba.
http://www.freenet.org.nz/python/lufs-python/
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
2" or --enable-unicode=ucs4. You can't set it to utf-8
or utf-16.
> 2. how to convert string to UCS-2
s = ... # some ucs-2 string
s.decode("utf-16")
might give you the right results for most cases:
http://mail.python.org/pipermail/python-dev/2002-May/024193.h
eed to call them os.getcwd(), as you do
in the second call to it.
- the join is supposed to work on a list of arguments, like this:
os.path.join("a", "b", "c")
will yield
a/b/c
But you concatenate two strings using +, and thus have only one argument at
all, whi
guity.
Soo, in the end it boils down to some explicitness - where IMHO an
additional comma is pretty much no problem at all. Another option would of
course be the introduction of different parentheses for tuples - but I
can't find some on my keyboard.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
reasoning before - I remember you
wanting to shave off microseconds by optimising constant expressions like
5*4 whilst at the same time arguing in another thread that you'd like to
have mutable keys for dicts that needed copying the very same keys - at
much greater costs, per case and even more so in general as using dicts is
common where pure constant arithmetic expressions aren't.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
5' etc.
>
> I find this 'creative use of overloading' rather awful. But what the
> heck, I find list comprehension rather awful.
Well, the number of operators built into the language is limited - and I
actually prefer to have the possibility to overload these if I want to.
No
had you
> would have known that if the objects one had to work with were at
> the same time mutable and usefull as keys, you have to turn them
> into an immutable now for use as a key. This is a copy operation.
> So compared to the situation now, no extra copying would b
.00 question - why all this? No offense intended
- it's a little bit more comfortable than the generators approach sketched
by others (e.g. David Mertz if I recall corretly) - but to my view, it
_could_ be done in today python because we have generators. Or not?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
;text']
Do it like this:
def callconnect():
if b["text"]=="Connect":
_nntp =
nntplib.NNTP(_global.servername,int(_global.portnumber),_global.userid,_global.userpassword)
if(_nntp):
_nntp.quit()
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
"",re.VERBOS)
> ^
> SyntaxError: invalid syntax
No problem here. Is your indentation correct?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ven't I restored the interpreter to a virgin
> state?
You can't unload modules, or at least reload is not always working properly.
So - you'd gotta go the road IDLE has gone before I assume.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
don't bother if
ini-Files are popular on linux or not - on linux a great deal of different
formats is popular, and nobody seems to care too much. E.g. samba uses
ini-style config, too.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
side-effects...)
>
> But are there other things I'm missing? Is my whole plan misguided
> from the beginning?
Sort of, as for your comparably little saving of effort you put the burden
of unknown side-effects from your doings on your user. Certainly not the
right thing to do for a
Bryan wrote:
> is there a way to determine the operating system's language? i can't seem
> to find a method that returns the value.
Try the module locale.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
>
> Personally I could live with that, but the diagram is a bit special
> because of the restriction of the = operation. I do not know if PHP
> supports this operational view by enabling iterations: $a, $$a, $$$a
> ... ?
It does.
--
Regards,
Diez B. Roggisch
--
http://mail.pyt
rser, ...]:
mo = m.match(data)
if mo:
break
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
condition:
# do something
pass
If that running-condition is queried often enough, you can stop the thread
by setting it to false.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
alternative, as it lets specify you the format by a string.
> print ed , '-', bd , '=', (ed-bd).days
I can't imagine what could possibly be easier than subtracting two dates -
in fact, most times one has to jump through much more hoops to achieve
these results, e.g. in j
.
Then your expression gets translated to:
0 in l and l is False
which yields False of course.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
mmercial license makes sense - it does for
trolltech :) And there is nothing in GPL that forces you to integrate code
you've been offered - otherwise, killing a GPL lib would mean to delete all
from a CVS checkout and submit a patch from that - obviouly nobody would
enforce that.
-
preter in case of an exception. Unindenting the
last while will wait in every case, so you can inspect the output
nonetheless.
Apart from that, there might be some hidden "keep this damn window open
after the executed progam terminated"-checkbox. Happy hunting.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
parts that's already available, e.g.
for debian which handles dependencies usually much better and is easier to
use for online updates. I think we have to wait until consistent dependency
checking and so on are established - maybe LSB helps us there.
--
Regards,
Diez B. Roggisch
--
http:
less a general scheme is adopted, no
software project will burden itself with the task of doing this. So you
have to wait for your distribution to do that for them - which may result
in not-so-latest verisons. Or even none at all
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/m
ebian nearly all libs come with an extra
dev-package you need when compiling against them. No big deal, but
compiling software yourself usually means to downtrack these packages by
making multiple configure runs, until all missing headerfiles are there.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ements. And you could
factor the rounding _into_ the loops, but thats more ugly.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> How about sys.byteorder?
This doesn't help, as he wants to read files from varying endianess - what
the _current_ endianess is doesn't matter here.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
olutely no way of telling the endianess.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> But, in fact, he says the files are always big endian. So, code like
> the following should address his problem. Note I use type 'h' as an
> example so I can easily read samples.
I'm sorry, I confused that he asked for machine endianess. Then of course
you are righ
t you'll get the idea.
This doesn't mean I want to discourage you - on the contraire. Developing
your own language is highly educating, and I personally love it when I
"invent" something and then later find out that people much cleverer than
me did so before - it shows that I went down the same paths of thought :)
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
manner, and am looking for some tutorials on
> python-specific advanced features I can use (things like closures,
> lambda forms, map(), etc. etc.). Could anyone point me towards some good
> resources?
http://docs.python.org/tut/tut.html
Especially
http://docs.python.org/tut/node8.html
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Any way I will continue to improve that interpreter,
> it's an interesting thing for me.
I don't have negative opinions about yuan and by no meants want to
discourage you developing it. Its a nice project.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
I perceive your english at beeing
pretty good.
English isn't my native tongue either, so sometimes it might be that my
answers are shorter (and thus more likely percieved unfriendly) because its
difficult to express one's opininon.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
for scenarios such as yours.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
h a stack/lifo as node
container, deepth-first is using a queue/fifo instead - but there is _no_
gain in terms of speed here - both have to visit all nodes.
There is no reason to change you running system - but your hopes for more
performance that way aren't fulfilled either.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
it won't buy you anything.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> Thanks, but can I call it using spawn?
No, but you can spawn a python interpreter that calls it. Like this:
spawnv(P_, sys.executable, ['-c', 'import myfile; foo()'])
But I suggest you use fork - then you can call it in the interpreter itself.
--
Regards,
Di
So maybe you're right in claiming it beeing recursive. But then,
depth-traversal is recursive, too.
Now apart from that, I still fail to see where your method of evaluation has
any speed gains.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> agree that they called the functions for the same
> number of times, the difference is how they are
> called.
What do you mean by difference in calling - a call is a call, no?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
can take advantage from the fact that it knows at
compiletime which eval to inline
But if you have
{
list nodes;
for(nodes::iterator it = nodes.begin(); it != nodes.end(); it++) {
(*exp).eval();
}
}
the compiler can't possibly know which node is in exp- so it has to resort
to a
> I have googeled, but could not find informations that I can understand.
> The most informations comes from unix/linux butIneed this for win32.
The module popen2 is your friend. Or the os.spawn* methods in module os.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/li
child of FGA
print """
ABC
EFGA --> child of ABC
ABDG --> child of AEFGA
MON --> child of ABC
A1
FGA --> child of A1
BG--> child of FGA
"""
Unless you don't tell us what _input_ shall be processed to yield that
output, I d
> for i in range(morethanzero, n):
> ...
>
>> for i= 5 to len(var)
>
> for i in range(5, len(var)):
> ...
Better use xrange - it doesn't create an actual list, but instead an
iterator enumerating the elements. That way more memory and cpu efficient.
-
of xrange have decreased further.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ut.addWidget(self.radioButton3)
self.radioButton3_2 = QRadioButton(self.buttonGroup4,"radioButton3_2")
buttonGroup4Layout.addWidget(self.radioButton3_2)
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ing an
> internet browser such as Internet Explorer? I'm guessing the latter.
I think he wants something more along the lines of Outlook/Thunderbird...
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
nswers.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
>>> data = [['foo','bar','baz'],['my','your'],['holy','grail']]
>>> [e for l in data for e in l]
['foo', 'bar', 'baz', 'my', 'your', 'holy', 'grail']
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
re_ binary data. Use the module struct to convert data from more
convenient representations (numbers) to strings, or use chr() to convert
them yourself.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Have you seen freevo?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
it that way - or provide the neccessary environment by stuffing values
to os.environ
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
t the user
> must specify a value).
Use optparse - in the examples section you'll find what you need.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
g(arg)
# call func
func(*args, **kwargs)
return _d
I don't mind the extra parentheses too much - it just made me wonder what
the rationale behind this is.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
makes it clear, thanks.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
}
For these two, use fetchmail and procmail.
> ..
> - open SMTP-TLS connection to smtp.someserver.com
> - send all mails in my unix mail file
> - close connection
I'm not totally sure how to do this best - but here python might indeed
help, using
it has an out-of-process debugger, so
Detlev must have found a solution :)
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
simply rebind its name to a new value - not that you alter
it. Consider this:
>>> a = 1
>>> b = a
>>> a = 2
>>> print a, b
2 1
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Nice drawing!
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
MTest2 import BMToolbar
which results in BMToolbar beeing part of the global namespace, so you could
do
BMToolBar(self).PrintHello()
I suggest you re-read the tutorial sections covering modules for the
nitty-gritty details of importing.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mai
e
result, do
"".join(stringlist)
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
6578 7400 4c3a ntext.L:
So check out what happens to you stdout.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Helpful subjects help
commands = [c.lower() for c in commands]
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
resulting object.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ace7c98ef31bbf2d/2af9df4b63a48cbc?q=python+killable+thread&_done=%2Fgroups%3Fq%3Dpython+killable+thread%26hl%3Den%26lr%3D%26ie%3DUTF-8%26c2coff%3D1%26sa%3DN%26tab%3Dwg%26&_doneTitle=Back+to+Search&&d#2af9df4b63a48cbc
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ementation of a MVC
pattern pretty easy.
But I have to admit that I don't have larger expierience with wx. Try
googling this newsgroup, there have been plenty of discussions on this.
As you can qt for free on linux, you could try both and see what suits your
needs best.
--
Regards,
Die
. After
all, its pythons module loading mechanism that kicks in for all cases.
If ctypes suits your needs outside of blender, I'd go for trying to
incorporate it into the blender interpreter.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
d also AFAIK photoshop is created
using qt.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
xtension if you don't have
the environment to do so in the first place? that error has nothing to do
with python itself, but with you not having installed the right compiler.
THe same problem will arise building your own extension.
Others suggested trying the ctypes binary installer.
se so just a hint would help.
Google for java-examples and translat to jython. Ist straight forward.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
could have introduced a
def _s_item_unwrapped(self, v):
self._s_item(v)
and used that in the property - but as there are lambdas, I use them :)
And the second def here is not more explanatory, as one has to graps the
internal details of python properties to understand why that extra hoop
real separate controllers. But that
will depend on how the OS deals with these, if you really achieve the
theoretical throughoutput.
> 5) watching the low CPU usage while writing to USB
> shows me, that CPU-time is not a problem.
That is certainly true - the bottleneck are the buses.
-
t; would depend on how the usb-ata-controller deals with that. You said
> yourself that you only had 15MB/sec, so it doesn't look to good.
>
> To make this work would certainly be a deep lowlever driver hack and
> nowhere in the scope of python per se.
>
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
verhead :)
In the end, I'm not sure what throughoutput is actually possible. As I said
to Claudio in a private mail: Apart from multithreaded writing to the bus
and _hoping_ that things speed up one can't do much - at least not in
python, and not without deep driver fiddling or even writing drivers
oneself.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
o
do and what error message it produces.
Until you come up with a more detailed error description, I'll have a good
read at
http://www.catb.org/~esr/faqs/smart-questions.html
Which I suggest you read too.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ings about the MMedia module ("status is unclear") that made me
> leery.
Maybe pygame helps? You can play sound with it, and the sdl abstracts from
directx and whatever linux uses.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
dicates that there is an __init__
of the form
class Foo:
def __init__(self, arg1, arg2)
pass
called like this
Foo("bar")
But as the only constructor you show _has_ only one additional argument
besides self and line
gx=gXconv.gXconv(gXconfPath)
shows that you called it properl
for key, value in myDict:
> print key, value
>
> Obviously, this is not the way it should be done. Should I have a default
> value of None for myDict and test for it? Or is there some other way?
Yes. That's the way to go.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
les hadn't. So it
crashes. If you'd only try that file, it would also crash with only one
file.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
.
> I want to know about php equivalent exec function
> in Python.
> So If anyone know regarding this Kindly Mail me.
> with regards
> prabahar
os.popen or the popen2 module are what you are looking for. In python2.4
there is also subprocess I believe.
--
Regards,
Diez
her tuples. This is equivalent to
>
> lambda x,y,z=0:(x,y,z)
As you say for yourself, that's just lambda in disguise. So I guess the same
arguments about the in- or exclusion of lambda apply here. I personally
like lambda, but _can_ live without it.
--
Regards,
Diez B. Roggisch
--
form short, named
functions are a good replacement. I don't want to get rid of lambda - but
since listcomps got introduced, 95% of my usages of them disappeared.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
onally don't mind lambdas and
for example the reduce function has been useful for me quite a few times,
can't be replaced by listcomps, and frequently needs a callable consisting
of only a single expression. So I'll continue to use lambdas there.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> I found this:
> setattr(__import__(__name__), name, value)
>
> But too much underscores Nothing better?
> Marco.
setattr(sys.modules[__name__], name, value)
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
igned to in
the bind-call.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Actually its not a server. I dont do any binding call, just a connect.
Then where is your problem? The two interfaces have been assigned distinct
IPs, so connect to the appropriate one.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/pyt
Why don't you use ruby? It has braces. And code blocks. And its more
liberal towards overriding builtins, which might appeal to you.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
ly one with this feeling.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
on to grasp what it does, and
while it is not syntactically different to standard python, it seems to
make coding the way you intend to do possible.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
`main':
> : undefined reference to `Py_Finalize'
> /home/mmf/tmp/ccVD2V4h.o(.eh_frame+0x11): undefined reference to
> `__gxx_personality_v0'
> collect2: ld returned 1 exit status
>
> What am I doing wrong?
Not linking against libpython.so?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
manager, not the graphical toolkit
itself. What windowmanager do you use? If I remember one could get access
to the wm using tk and maybe then manipulate some settings.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
that
doesn't work for you. Is it a root-window or some other toplevel window?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Markus Franz wrote:
> Diez B. Roggisch wrote:
>
>>>/home/mmf/tmp/ccVD2V4h.o(.text+0x1d): In function `main':
>>>: undefined reference to `Py_Initialize'
>>>/home/mmf/tmp/ccVD2V4h.o(.text+0x2a): In function `main':
>>>: undefined reference
til -lpython2.2
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> onehourlater = (20,00)
>>> lt = (18,59)
>>> not wakeuptime < lt < onehourlater
True
>>> lt = (19:01)
>>> not wakeuptime < lt < onehourlater
False
And localtime(time())[3:5] returns the desired timetuple. You're sure that's
not working?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
u get what the server sends. That is always binary - either it _is_ a
binary file, or maybe in an unknown encoding.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
simple testscript
class Meta(type):
def __init__(*args):
print args
return type(*args[1:])
class Foo(object):
__metaclass__ = Meta
__slots__ = "foo", "bar"
Foo()
shows that __slots__ is just a part of the type's dict. So you can simply
specify
Markus Franz wrote:
> Diez B. Roggisch wrote:
>
>> You get what the server sends. That is always binary - either it _is_ a
>> binary file, or maybe in an unknown encoding.
>
> And how can I convert those binary data to a "normal" string with
> "normal
Addendum: If you give us the url you're fetching data from, we might be able
to look at the delivered data ourselves.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
for you to have your own layout, create a
prepocessor and do it - I want to do that myself one day I find the time,
not for every-day tasks but for cases like python-embedded-in-html where
the whitespace-dependency collides with the layouting-requirements of html.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
> nevermind that) but what if a searched_string == '' ? Then
> string.find(substring,searched_string) == 0 ?
>>> "".find("fooob")
-1
as expected. Which python version do you use?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 3917 matches
Mail list logo