Re: How do I pass structures using a C extension?

2005-03-14 Thread Diez B. Roggisch
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

Re: simulated samba server

2005-03-15 Thread Diez B. Roggisch
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

Re: unicode converting

2005-03-15 Thread Diez B. Roggisch
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

Re: why this error?

2005-03-15 Thread Diez B. Roggisch
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

Re: Why tuple with one item is no tuple

2005-03-16 Thread Diez B. Roggisch
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

Re: Why tuple with one item is no tuple

2005-03-16 Thread Diez B. Roggisch
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

Re: Why tuple with one item is no tuple

2005-03-16 Thread Diez B. Roggisch
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

Re: Why tuple with one item is no tuple

2005-03-17 Thread Diez B. Roggisch
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

Re: Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-18 Thread Diez B. Roggisch
.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

Re: HELP:UnboundLocalError: local variable '_nntp' referenced before assignment

2005-03-18 Thread Diez B. Roggisch
;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: syntax incorrect with regex

2005-03-18 Thread Diez B. Roggisch
"",re.VERBOS) > ^ > SyntaxError: invalid syntax No problem here. Is your indentation correct? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to I restart an interactive session?

2005-03-18 Thread Diez B. Roggisch
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

Re: Simple XML-to-Python conversion

2005-03-19 Thread Diez B. Roggisch
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

Re: How to I restart an interactive session?

2005-03-19 Thread Diez B. Roggisch
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

Re: determine os language

2005-03-19 Thread Diez B. Roggisch
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

Re: Variable Variable

2005-03-20 Thread Diez B. Roggisch
> > 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

Re: inline comparison

2005-03-20 Thread Diez B. Roggisch
rser, ...]: mo = m.match(data) if mo: break -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: how to drop all thread ??

2004-11-29 Thread Diez B. Roggisch
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

Re: date diff calc

2004-11-29 Thread Diez B. Roggisch
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

Re: weird behaviour of "0 in [] is False"

2004-11-30 Thread Diez B. Roggisch
. 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

Re: ANNOUNCE: Ice 2.0 released

2004-11-30 Thread Diez B. Roggisch
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. -

Re: A way to wait Python event

2004-11-30 Thread Diez B. Roggisch
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

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Diez B. Roggisch
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:

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Diez B. Roggisch
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

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Diez B. Roggisch
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

Re: efficient intersection of lists with rounding

2004-12-02 Thread Diez B. Roggisch
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

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> 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

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
olutely no way of telling the endianess. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> 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

Re: How is Python designed?

2004-12-04 Thread Diez B. Roggisch
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

Re: Import Semantics, or 'What's the scope of an import?', and class attribute instantiation

2004-12-04 Thread Diez B. Roggisch
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

Re: How is Python designed?

2004-12-05 Thread Diez B. Roggisch
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

Re: How is Python designed?

2004-12-06 Thread Diez B. Roggisch
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

Re: help using sockets, and OOP?

2004-12-06 Thread Diez B. Roggisch
for scenarios such as yours. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: How is Python designed?

2004-12-07 Thread Diez B. Roggisch
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

Re: How is Python designed?

2004-12-08 Thread Diez B. Roggisch
it won't buy you anything. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: spawn or fork

2004-12-08 Thread Diez B. Roggisch
> 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

Re: How is Python designed?

2004-12-08 Thread Diez B. Roggisch
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

Re: How is Python designed?

2004-12-08 Thread Diez B. Roggisch
> 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

Re: How is Python designed?

2004-12-08 Thread Diez B. Roggisch
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

Re: newbie question: starting external application(win)?

2004-12-09 Thread Diez B. Roggisch
> 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

Re: Parse XML using Python

2004-12-09 Thread Diez B. Roggisch
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

Re: for loop

2004-12-12 Thread Diez B. Roggisch
> 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. -

Re: for loop

2004-12-12 Thread Diez B. Roggisch
of xrange have decreased further. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Qt

2004-12-12 Thread Diez B. Roggisch
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

Re: Python 3.0

2004-12-13 Thread Diez B. Roggisch
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

Re: How can i send 8-bit data or binary data with pyserial?

2004-12-13 Thread Diez B. Roggisch
nswers. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: do you master list comprehensions?

2004-12-13 Thread Diez B. Roggisch
>>> 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: How can i send 8-bit data or binary data with pyserial?

2004-12-13 Thread Diez B. Roggisch
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

Re: Looking for a coder to do some work

2004-12-13 Thread Diez B. Roggisch
Have you seen freevo? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: KeyError

2004-12-15 Thread Diez B. Roggisch
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

Re: getopt: Make argument mandatory

2004-12-15 Thread Diez B. Roggisch
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

decorator peculiarity

2004-12-17 Thread Diez B. Roggisch
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

Re: decorator peculiarity

2004-12-17 Thread Diez B. Roggisch
makes it clear, thanks. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Email filters in python

2004-12-17 Thread Diez B. Roggisch
} 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

Re: Raw Sockets vs. What?

2004-12-11 Thread Diez B. Roggisch
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

Re: newbie questions

2004-12-11 Thread Diez B. Roggisch
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

Re: Python mascot proposal

2004-12-12 Thread Diez B. Roggisch
Nice drawing! -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

re: usage of __import__ across two files

2004-12-13 Thread Diez B. Roggisch
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

Re: jython and concatenation of strings

2004-12-13 Thread Diez B. Roggisch
e result, do "".join(stringlist) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: logging in omniORB for python

2004-12-15 Thread Diez B. Roggisch
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

create lowercase strings in lists - was: (No subject)

2004-12-16 Thread Diez B. Roggisch
Helpful subjects help commands = [c.lower() for c in commands] -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2004-12-19 Thread Diez B. Roggisch
resulting object. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: embedding: forcing an interpreter to end

2004-12-20 Thread Diez B. Roggisch
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

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread Diez B. Roggisch
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

Re: extending python with a C-written dll

2004-12-20 Thread Diez B. Roggisch
. 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

Re: Best GUI for small-scale accounting app?

2004-12-20 Thread Diez B. Roggisch
d also AFAIK photoshop is created using qt. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: extending python with a C-written dll

2004-12-20 Thread Diez B. Roggisch
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.

Re: gridbaglayout

2004-12-20 Thread Diez B. Roggisch
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

Re: what is lambda used for in real code?

2004-12-31 Thread Diez B. Roggisch
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

Re: simultaneous copy to multiple media

2005-03-20 Thread Diez B. Roggisch
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. -

Re: simultaneous copy to multiple media

2005-03-20 Thread Diez B. Roggisch
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

Re: simultaneous copy to multiple media

2005-03-20 Thread Diez B. Roggisch
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

Re: Please help for Python programming

2005-03-21 Thread Diez B. Roggisch
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

Re: beeping portably

2005-03-21 Thread Diez B. Roggisch
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

Re: Constructor class problem

2005-03-21 Thread Diez B. Roggisch
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

Re: Using default a empty dictionary as a default value

2005-03-22 Thread Diez B. Roggisch
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

Re: (noob alert) why doesn't this work?

2005-03-22 Thread Diez B. Roggisch
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

Re: Doubt regarding exec function

2005-03-22 Thread Diez B. Roggisch
. > 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

Re: Anonymus functions revisited

2005-03-22 Thread Diez B. Roggisch
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 --

Re: Anonymus functions revisited

2005-03-22 Thread 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

Re: Anonymus functions revisited

2005-03-23 Thread Diez B. Roggisch
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

Re: setattr inside a module

2005-03-23 Thread Diez B. Roggisch
> 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

Re: Interface selection

2005-03-25 Thread Diez B. Roggisch
igned to in the bind-call. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface selection

2005-03-25 Thread Diez B. Roggisch
[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

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread Diez B. Roggisch
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

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread Diez B. Roggisch
ly one with this feeling. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggesting a new feature - "Inverse Generators"

2005-03-25 Thread Diez B. Roggisch
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

Re: Embedding Python

2005-03-26 Thread Diez B. Roggisch
`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

Re: How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-26 Thread Diez B. Roggisch
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

Re: How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-26 Thread Diez B. Roggisch
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

Re: Embedding Python

2005-03-26 Thread Diez B. Roggisch
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

Re: Embedding Python

2005-03-26 Thread Diez B. Roggisch
til -lpython2.2 -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Diez B. Roggisch
> 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

Re: Get document as normal text and not as binary data

2005-03-27 Thread Diez B. Roggisch
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

Re: Specifying __slots__ in a dynamically generated type

2005-03-27 Thread Diez B. Roggisch
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

Re: Get document as normal text and not as binary data

2005-03-28 Thread Diez B. Roggisch
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

Re: Get document as normal text and not as binary data

2005-03-28 Thread Diez B. Roggisch
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

Re: Grouping code by indentation - feature or ******?

2005-03-29 Thread Diez B. Roggisch
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

Re: oddness in string.find(sub,somestring)

2005-03-30 Thread Diez B. Roggisch
> 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

<    1   2   3   4   5   6   7   8   9   10   >