Re: [Python 2.4/2.5] subprocess module is sorely deficient?

2008-04-22 Thread Martin v. Löwis
> 2. Kill the subprocess in a platform independent manner (i.e. no third party > modules and no hacks). What's wrong with the .terminate method of the Popen object? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] annoying dictionary problem, non-existing keys

2008-04-24 Thread Martin v. Löwis
> this is very annoying. Posting to so many lists is even more annoying. You might not get a single helpful answer just because people are so frustrated by this behavior. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k concerns. An example

2008-04-24 Thread Martin v. Löwis
o keep the rules in mind that you want to follow). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Installer

2008-04-24 Thread Martin v. Löwis
;t use the official product code, but create your own one. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k concerns. An example

2008-04-25 Thread Martin v. Löwis
> these threads -- it doesn't add a lot, I think. shame 1 a. a painful emotion caused by consciousness of guilt, shortcoming, or impropriety 2 a condition of humiliating disgrace or disrepute So who do you think should feel guilt? Or should be disgraced or disreputed? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is None <= 0

2008-04-25 Thread Martin v. Löwis
oices. (FWIW, in 2.x, x>=4?, it's None < numbers < anything else; numbers are ordered by value, everything else is ordered by type name, then by address, unless comparison functions are implemented). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I say "Is this a function"?

2008-04-26 Thread Martin P. Hellwig
John Henry wrote: How do I determine is something a function? For instance, I don't want to relying on exceptions below: def f1(): print "In f1" def f3(): print "In f3" def others(): print "In others" for i in xrange(1,3): fct = "f%d()"%(i+1) try: exec fct except:

Re: How do I say "Is this a function"?

2008-04-26 Thread Martin v. Löwis
s() I'd write that as for i in xrange(1,3): globals().get("f%d" % (i+1), others)() Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't timedeltas be divided?

2008-04-26 Thread Martin v. Löwis
> sorry for bringing up such an old thread, but this seems important to me > -- up to now, there are thousands [1] of python programs that use > hardcoded time calculations. Would you like to work on a patch? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't timedeltas be divided?

2008-04-27 Thread Martin v. Löwis
ss it on python-dev. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't timedeltas be divided?

2008-04-27 Thread Martin v. Löwis
> Well, http://bugs.python.org/issue1673409 seems very closely related. I can't see the relationship. This issue is about conversion methods, not about arithmetic. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why can't timedeltas be divided?

2008-04-27 Thread Martin v. Löwis
o bugs.python.org, optionally also post a message referring to that patch to python-dev. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Tremendous slowdown due to garbage collection

2008-04-27 Thread Martin v. Löwis
> Martin said it but nevertheless it might not be true. > > We observed similar very bad behaviour -- in a Web application server. > Apparently, the standard behaviour is far from optimal when the > system contains a large number of objects and occationally, large > numbers of o

Re: py3k concerns. An example

2008-04-27 Thread Martin v. Löwis
ble -- I'm speaking of algorithmic and system > libraries). I don't see the connection. Why do you think your .keys() implementation breaks just because dict.keys has a different semantics now? An existing application of an existing dict-like object will continue to work just fine

Re: py3k concerns. An example

2008-04-28 Thread Martin v. Löwis
from adjusting the Python standard library itself, and from converting Django to Python 3. In my experience (from the same applications), by far the most significant change in Python 3 is the change to the meaning of string literals, and the disposal of the 2.x str type. Regards, Martin -- http://mail.

Re: Tremendous slowdown due to garbage collection

2008-04-28 Thread Martin v. Löwis
t's why they are tunable parameters), just that the defaults shouldn't change (as the OP was requesting). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple unicode-safe version of str(exception)?

2008-04-28 Thread Martin v. Löwis
at Unicode object contains non-ASCII parameters. >> I did, of course, try unicode(e) but that fails. > > Converting unicode to unicode doesn't help. e is an exception object, not a Unicode object. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Martin v. Löwis
> Should I report this as a bug? I suspect it's a misfeature. Please no. There isn't much that can be done about it, IMO. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help me with linking libraries on Solaris 10 sparc

2008-05-01 Thread Martin v. Löwis
> lib/python/site-packages/psycopg2/_psycopg.so: symbol round: > referenced symbol not found You need to link _psycopg.so with the math library, -lm. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help me with linking libraries on Solaris 10 sparc

2008-05-01 Thread Martin v. Löwis
> Martin, could you please tell me how to do this, I am pretty new in > Solaris. It's fairly complicated, so I'm not sure I can give you the full tutorial in a Usenet message. In essence, you need to spot the linker line in the build process, (e.g. by the -o option to the compil

Re: Problems with Cheese Shop

2008-05-01 Thread Martin v. Löwis
> How can I authorise to the Python Cheese Shop in order to use > setup.py upload? Currently, I get > > Upload failed (401): You must be identified to edit package information You need to add your PyPI password to .pypirc. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python application distribution

2008-05-01 Thread Martin v. Löwis
shouldn't even have to know that the application is written in Python. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Preventing 'bad' filenames from raising errors in os.path

2008-05-02 Thread Martin v. Löwis
he very least > there isn't a significant difference in code size between the two > methods. > > I don't know what the equivalent error is called in *nix but assume it > is PosixError (it isn't) The common base class to use here is actually OSError. Win

Re: IPv6 and Python

2008-05-02 Thread Martin v. Löwis
t, I recommend SixXS (http://www.sixxs.net/). You can setup a tunnel to the IPv6 net through your IPv4 POP, using a close IPv6 POP who participates in SixXS. To set up the tunnel, you then use aiccu, which works really well for me (and is packaged conveniently as a Debian package). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: portable /dev/null

2008-05-02 Thread Martin v. Löwis
cess, you are out of luck. Some systems just don't support a null device, so Python can't possibly emulate it. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: IPv6 and Python

2008-05-03 Thread Martin v. Löwis
socket module, the system does not support mapped sockets. Unfortunately, there is an exception to the last rule: on Vista, the option is supported, but Python won't magically know what the option numeric value is. So on Windows, you need to define IPV6_V6ONLY yourself (the value is 27), an

Re: How to convert unicode string to unsigned char *

2008-05-05 Thread Martin v. Löwis
l suggested: def some_thing(s): return some_thing_real(s.encode("utf-8")) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
semantics. Why don't generators follow the usual eager evaluation semantics of Python and immediately execute up until right before the first yield instead? Giving generators special case semantics for no good reason is a really bad idea, so I'm very curious if there is a good reason for i

Re: Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
d you're not going to be surprised by it. You may still want to change the semantics, but for reasons that are irrelevant to my point. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
er a query result set in my original post, I see even less of a problem. Maybe I'm simply daft and you need to spell it out for me. :-) Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python newbie: some surprises

2008-05-08 Thread Martin P. Hellwig
v4vijayakumar wrote: When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. Even the standard editor Idle tries to guess the intendation, so this was never a probl

Re: PyXml

2008-05-09 Thread Martin v. Löwis
s Xml > Schema? The libxml bindings for Python can do that. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.6a3 and 3.0a5

2008-05-10 Thread Martin v. Löwis
> Python 2.5.2, so I guess the dependencies must be somewhere there. > Does Ubuntu have any non-standard lib dir ? You need to manually install the -dev packages (through aptitude) before building Python. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonicity of some algorithms

2008-05-10 Thread Martin v. Löwis
ue class as a base class, though, rather than starting from scratch. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: People still using Tkinter?

2008-05-10 Thread Martin v. Löwis
ocumentation around. If you need to find out what option is supported by what widget, there isn't really much point in duplicating that information in Tkinter, IMO - the Tk documentation has it all. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a PyPI API?

2008-05-10 Thread Martin v. Löwis
> I just can't figure out how to get the metadata, I guess. See http://wiki.python.org/moin/PyPiXmlRpc Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling Python 2.5.2 on AIX 5.2

2008-05-10 Thread Martin v. Löwis
() > EnvironmentError: [Errno 22] Invalid argument I see. This is http://bugs.python.org/issue678250 Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with Tix in Python2.5

2008-09-08 Thread Martin v. Löwis
ove-programs, select Python, then Repair. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on Windows XP 64-bit: python not found in registry

2008-09-12 Thread Martin v. Löwis
hon, that will fail: even if installation would succeed, you still couldn't use the resulting installations, since you just can't mix the two architectures in a single process. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to emit Cyrillic and Chinese via unicode from console mode?

2008-09-14 Thread Martin v. Löwis
32 to create > a window and a message pump and display it there. I anticipate using pywin32 > for some other function calls. It also depends on your console. On Linux, with an UTF-8 capable-and-enabled console, py> print u"\u0413" Г work just fine. Regards, Martin -- http://m

Re: PYPI, some troubles

2008-09-17 Thread Martin v. Löwis
g the file openopt-0.19.tar.bz2. If that doesn't help, contact the setuptools mailing lists. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Automated Build System ?

2008-09-18 Thread Martin v. Löwis
ints to existing solutions. > Can anybody help me ? I recommend to use distutils. It can already build extension modules and install them. For testing, you would need to supply your own test command. Alternatively, try setuptools - there seems to be a test command already included. Regards, Mart

Re: CTypes on a 64 bit machine truncates pointers to 32 bits?

2008-09-18 Thread Martin v. Löwis
>>>> foolib = cdll.LoadLibrary('foo.so') >>>> foolib.foo(0xF) > 0 Shouldn't you tell ctypes that the argument and the result of foo is a pointer? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-20 Thread Martin v. Löwis
r/prog/python.html which has the exact text he quoted. Unfortunately, this text has foreach in bold, so he might have assumed foreach to be a keyword (despite the example to the right demonstrating the contrary). What this has to do with OO, or with numpy, is beyond me. Regards, Martin -- http:

Re: Quick sort implementation in python

2008-09-25 Thread Martin v. Löwis
ccess data structure or not. However i have > no idea how to access the values of a data structure that doesn't > allow random access. Can you please explain how you did that in C? IOW, how did you do the partition function (template) in case you don't have random access to the co

Re: Quick sort implementation in python

2008-09-26 Thread Martin v. Löwis
that allows you to modify the underlying collection. There is the iter() function/type, but it only allows read access. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 and repr

2008-09-28 Thread Martin v. Löwis
the ASCII representation with > escapes for all other characters You can use the ascii() builtin if you want that. > especially considering the "repr() should produce output suitable for > eval() when possible" rule. But that is preserved under the new behavior, also! Just try

Re: How to emit UTF-8 from console mode?

2008-09-30 Thread Martin v. Löwis
the output encoding to Python, rather than assuming a fixed UTF-8 output encoding. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to emit UTF-8 from console mode?

2008-10-01 Thread Martin v. Löwis
5001, and emit the UTF-8 explicitly. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: windows help files ?

2008-10-02 Thread Martin v. Löwis
run under Linux/Mac, how should I > call the help file under Linux/Mac. Provide an HTML tree of the documentation, and use the webbrowser module to start a browser on it. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: "Exploding" (**myvariable) a dict with unicode keys

2008-10-03 Thread Martin v. Löwis
Devin wrote: > So Python can have unicode variable names but you can't > "explode" (**myvariable) a dict with unicode keys? WTF? That works fine for me. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: "Exploding" (**myvariable) a dict with unicode keys

2008-10-03 Thread Martin v. Löwis
Devin wrote: > On Oct 3, 1:57 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> "Martin v. Löwis" wrote: >>> Devin wrote: >>>> So Python can have unicode variable names but you can't >>>> "explode" (**myvariable) a dict wit

Re: "Exploding" (**myvariable) a dict with unicode keys

2008-10-04 Thread Martin v. Löwis
oesn't mean that you can use all Unicode characters in all places of the code. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement in unicodestrings?

2008-10-04 Thread Martin v. Löwis
> >>>> '\xc3\xab' in 'Arj\xc3\xabn' > True > > I just don't get it, what's the difference? It's the repr(): py> '\xc3\xab' in 'Arj\xc3\xabn' True py> repr('\xc3\xab') in repr('Arj\xc3\xabn') False py> repr('\xc3\xab') "'\\xc3\\xab'" py> repr('Arj\xc3\xabn') "'Arj\\xc3\\xabn'" repr('\xc3\xab') starts with an apostrophe, which doesn't appear before the \\xc3 in repr('Arj\xc3\xabn'). HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Martin v. Löwis
your application. Don't use byte strings to represent text, but use Unicode strings all the time, except at the system boundary (where you decode/encode as appropriate). There are some limitations with Unicode .lower also, but I don't think they apply to Russian (specifically, SpecialCasing

Re: embedding Python: how to avoid memory leaks?

2006-03-09 Thread Martin v. Löwis
lize only once. It is well-known that initializing the Python interpreter allocates memory that can never be freed, e.g. global variables in extension modules (there just isn't any API to tell all the modules to release their memory). So a cycle of Py_Initialize/Py_Finalize will certainly leak.

Re: encoding problem

2006-03-09 Thread Martin v. Löwis
The second form should be used, but not in interactive mode. In a Python script, make sure you properly declare the encoding of your script, e.g. # -*- coding: iso-8859-1 -*- print u'é' That should work. If not, give us your Python version, operating system name, and mode of operation.

Re: String functions: what's the difference?

2006-03-09 Thread Martin v. Löwis
ghtly slower. > And reasons to prefer one? For what purpose? To find out whether a letter is lower-case? Just use the .islower() method on the character for that. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: embedding Python: how to avoid memory leaks?

2006-03-09 Thread Martin v. Löwis
told that the next version of Python will release memory, > so that's good news. You can get it now if you're willing to build > Python from the latest source code. That still won't release all memory - only the arenas that don't have live Python objects on them anymor

Re: embedding Python: how to avoid memory leaks?

2006-03-10 Thread Martin v. Löwis
this with Python 2.4 (which is linked with msvcr71.dll), you cannot use PyRun_*File*. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: XML international characters

2006-03-10 Thread Martin v. Löwis
g of XML (in absence of a declaration) is UTF-8. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

PEP 8 example of 'Function and method arguments'

2006-03-13 Thread Martin P. Hellwig
While I was reading PEP 8 I came across this part: """ Function and method arguments Always use 'self' for the first argument to instance methods. Always use 'cls' for the first argument to class methods. """ Now I'm rather new to programming and unfamiliar to some basic concepts of OOP.

Re: recycling internationalized garbage

2006-03-14 Thread Martin v. Löwis
well just assume ISO 8859-1. The point is that you can tell UTF-8 reliably. If the data decodes as UTF-8, it *is* UTF-8, because no other encoding in the world produces the same byte sequences (except for ASCII, which is an UTF-8 subset). So if it is not UTF-8, the guessing starts. Regards, Marti

Re: PEP 8 example of 'Function and method arguments'

2006-03-14 Thread Martin P. Hellwig
Steven, Bruno, Terry & Duncon, thank you for your insights, it really helped me a great deal. -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: recycling internationalized garbage

2006-03-15 Thread Martin v. Löwis
k of any multi-byte encoding that can't produce > valid UTF-8 byte sequence. The same reasoning applies for them. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Java gzip performance

2006-03-17 Thread Martin v. Löwis
n the Python > version? Don't use readline/readlines. Instead, read in larger chunks, and break it into lines yourself. For example, if you think the entire file should fit into memory, read it at once. If that helps, try editing gzip.py to incorporate that approach. Regards, Martin -- http://mai

Re: Getting .NET SDK to work with Python 2.4.2

2006-03-19 Thread Martin v. Löwis
nsions > for python. The error message is misleading. It is not the SDK that you need, but Visual Studio 7.1. Alternatively, you can try building the extension with the GNU mingw32 compiler. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 Schedule

2006-03-19 Thread Martin v. Löwis
ary likely crashes. In addition to changing the type of Py_UNICODE, you also need change all calls to Microsoft API that expects UCS-2 (i.e. all *W API). Contributions are welcome. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: Testing my reference counting

2006-03-20 Thread Martin v. Löwis
nge. If it does change, sys.get_counts() will give you the number of objects per type. Furthermore, sys.getobjects() will give you a list of all objects allocated (excluding the result list). HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 Schedule

2006-03-20 Thread Martin v. Löwis
tf-8 -*- into the file, or start the file with the UTF-8 signature (if your editor supports that). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Martin v. Löwis
1, I suppose). That's all correct, except for the last parenthetical remark: using a single-byte character set isn't the same as using Latin-1. There are various single-byte characters sets; they have names like Latin-2, Latin-5, Latin-15, KOI8-R, CP437, windows-1252, and so on. Reg

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Martin v. Löwis
w whether a certain string literal is meant to denote bytes or characters, we can't just change the interpretation. Unicode is a superset of ASCII and Latin-1, but not of byte sequences. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Martin v. Löwis
encode a character, or it might be that they are parts of two characters, e.g. when you get the second byte of the first character and the first byte of the second one. In some encodings (e.g. ISO-2022), these bytes may indicate *no* character, e.g. when the bytes just indicate an in-stream ch

Re: How to recgonize an USB device in FreeBSD?

2006-03-21 Thread Martin P. Hellwig
Geoffery wrote: > I want to add some applications to Freevo. > Let Freevo recgonize the USB device is the one. > Thank u for your answer. > Have a look at 'man 5 usbd.conf' -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Java gzip performance

2006-03-21 Thread Martin v. Löwis
that gzip decompresses the current block over an over again if the caller only requests 100 bytes each time. This is a pure guess - you would need to read the zlib source code to find out. Anyway, decompressing the entire file at one lets zlib operate at the highest efficiency. Regards, Mart

Re: Python vs. Java gzip performance

2006-03-22 Thread Martin v. Löwis
arge - it might exhaust your memory. Such a setting shouldn't be the default. Somebody should research what blocking size works best for zipfiles, and then compare that in performance to "read it all at once". It would be good if the rationale for using at most 100 bytes at a time coul

don't understand popen2

2006-03-22 Thread Martin P. Hellwig
Hi all, I was doing some popen2 tests so that I'm more comfortable using it. I wrote a little python script to help me test that (testia.py): - someline = raw_input("something:") if someline == 'test': print("yup") else: print("nope") ---

Re: LONG_BIT PROBLEM on Sun Solaris 5.8 linking python

2006-03-22 Thread Martin v. Löwis
onfig.h? When you compile the file #include LOOK HERE: LONG_BIT with cc -E -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1 a.c what output do you get after LOOK HERE? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: don't understand popen2

2006-03-22 Thread Martin P. Hellwig
gry@ll.mit.edu wrote: > > You gave it a single string, not a list(sequence) of strings. Try > something like: > std_in.writelines(["notgood"]) > I got this output then: >>> something: Traceback (most recent call last): File "F:\coding\pwSync\popen_test\popen_test.py", line 8, in ?

Re: don't understand popen2

2006-03-23 Thread Martin P. Hellwig
Donn Cave wrote: > > Anyway, it seems unlikely he would get that INVARG error for this > reason. That's an error from the host operating system, not the > interpreter, and it mostly likely refers to the file descriptor. > Since it works for me, I guess his problem is basically this: > > |> (pyt

Re: encoding problems (é and è)

2006-03-24 Thread Martin v. Löwis
s intentional, of course: there is no "canonical" compatibility character for every decomposed code point. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problems (é and è)

2006-03-25 Thread Martin v. Löwis
ore elaborate and precise than in the early days. Likely, the Unicode consortium found somebody speaking the Western Armenian dialect (given that many of these speakers live in North America today); the decision might have been a mixture of lack of knowledge, ignorance, and perhaps even poli

Re: Building Python extensions from sources on Windows

2006-03-25 Thread Martin v. Löwis
tp://www.vrplumber.com/programming/mstoolkit/ Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing func_name from inside a function

2006-03-25 Thread Martin v. Löwis
James Thiele wrote: > Is there a standard way of getting the name of a function from inside > the function? No, there isn't. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python -U problem for 2.4.3c1 on Windows 2000 (was Does -U option really exist?)

2006-03-27 Thread Martin v. Löwis
right now. However, I can readily believe that Python easily crashes when invoked with -U, and I can also believe that it only happens on some systems. If you care, please research the cause, and submit a bug fix. Just submitting the bug report likely won't react in action (atleast not from

Re: To run a python script in all the machines from one server

2006-03-28 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > Hi Everyone > > I want to run a python script in all the machines that are connected > through local network and collect the information about that machine > such as HDD size, RAM capacity(with number of slots) ,processer speed > etc. > > But i want to run a script fro

Re: in-place string reversal

2006-03-28 Thread Martin P. Hellwig
Sathyaish wrote: > And that the "extra-memory" operation I've given above is expensive, I > believe. Is there an efficient way to do it? > If i recall correctly a string is an immutable list. I would do it this way: >>> strTXT = "foo" >>> strREV = strTXT[::-1] >>> strREV 'oof' -- mph -- http

Re: Python 2.5 licensing: stop this change

2006-04-01 Thread Martin P. Hellwig
Fuzzyman wrote: > From the site: "Advanced Program for Research In Licensing, whose First Object-Oriented License" string = "Advanced Program for Research In Licensing, whose First Object-Oriented License" for letter in string: if ord(letter) in range(65,91): print(letter), --

Re: print() in Python 3000 return value?

2006-04-02 Thread Martin v. Löwis
ning None). What do you want it to return? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: print() in Python 3000 return value?

2006-04-02 Thread Martin v. Löwis
s don't return anything, not even None (they don't have a value). If print becomes a function, the question about its return value becomes meaningful. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode, command-line and idle

2006-04-06 Thread Martin v. Löwis
ance has no attribute 'encoding' What operating system and Python version are you using? This ought to work. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: What does 'repair Python 2.5a1' do?

2006-04-07 Thread Martin v. Löwis
trol the actions taken in REINSTALL by setting the REINSTALLMODE property: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/reinstallmode.asp So if you want to reinstall everything, you need to set REINSTALLMODE to, say, "amus" (or "saum"). Regards,

Re: unicode wrap unicode object?

2006-04-08 Thread Martin v. Löwis
t; True Ok. But how about that: py> s='\xe9\xab\x98' py> ss=u'\u9ad8' py> s1=s.decode('utf-8') py> s1==ss True Here, ss is a single character, which uses 3 bytes in UTF-8. In your example, ss has three characters, which are not Chinese, but European. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: freeze.py builds, but binary doesn't even run locally (shared GTK problem?)

2006-04-08 Thread Martin v. Löwis
look for _gtk.so on sys.path. Try copying _gtk.so into the directory where the binary is, or set PYTHONPATH before running the binary. If you want to freeze _gtk into the application, you need it as a static library. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-08 Thread Martin v. Löwis
going to write a Python extension, an Apache module, or a Linux kernel module in the near future, start learning C today. If you don't know what you want to use it for, learning it might be a waste of time, as you won't know what to look for if you don't have a specific project in mind. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-09 Thread Martin v. Löwis
language, for that matter). You will read the book, and might be able to *read* C programs afterwards. To be able to write them, you need practice, and, for that, you need a specific inducement. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-09 Thread Martin v. Löwis
That's everybody's choice, of course. If you enjoy programming languages on their own merits, you won't need further motivation. However, then you don't post to a newsgroup "should I learn this language", but you just go ahead and do it. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-09 Thread Martin v. Löwis
nt yourself. It's just very hard to properly learn > a language without having an idea what to do with it (in fact, I have > seen people interested to learn programming utterly fail in doing so > because they had absolutely no clue what to program). This is my experience also. R

Re: RIIA in Python 2.5 alpha: "with... as"

2006-04-11 Thread Martin v. Löwis
ne and still don't > have another. > Or maybe you have an idea how this can be fixed? Why do you want to restrict the lifetime of a variable? If you want the variable to become unassigned, just invoke the del statement. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Manipulating sets from the 2.4 C API?

2006-04-11 Thread Martin v. Löwis
ay, invoke the add method, do PyObject_CallMethod(s, "add", "O", o); HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

<    33   34   35   36   37   38   39   40   41   42   >