Re: Jargons of Info Tech industry

2005-08-26 Thread Ulrich Hobelmann
Mike Meyer wrote: > "Mike Schilling" <[EMAIL PROTECTED]> writes: >> Another advantage is that evewry internet-enabled computer today already >> comes with an HTML renderer (AKA browser) > > No, they don't. Minimalist Unix distributions don't include a browser > by default. I know the BSD's don't,

Re: Jargons of Info Tech industry

2005-08-26 Thread Ulrich Hobelmann
John Bokma wrote: > [EMAIL PROTECTED] wrote: > >> In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > > [ web based boards ] > >>> And which useful tools do you require? >>> >> A choice of news readers to suit different people with different >> interfaces, > > - different browsers, d

Re: Jargons of Info Tech industry

2005-08-26 Thread Ulrich Hobelmann
John Bokma wrote: > Ulrich Hobelmann <[EMAIL PROTECTED]> wrote: > >> What I hate about most are the sites that don't even *mention* that >> they want cookies. Often I have to wonder, reinput input fields etc. >> and then after ten minutes trying *bang*, the

Re: Jargons of Info Tech industry

2005-08-26 Thread Ulrich Hobelmann
John Bokma wrote: >> I have cookies off, with explicit exception for sites where >> I want cookies. When the crappy website doesn't bother to MENTION that >> it wants cookies, i.e. give me an error page, how am I to know that it >> needs cookies? Do I want EVERY website to ask me "do you allow

Re: Jargons of Info Tech industry

2005-08-26 Thread Ulrich Hobelmann
John Bokma wrote: [cookies] > Delete them after each session automatically, except the ones on the > exception list. But why? I simply don't even take them, except my exception list ;) Some people have all cookies turned off. > You are clearly not an average user, so your usage pattern > prob

Re: Jargons of Info Tech industry

2005-08-27 Thread Ulrich Hobelmann
Mike Meyer wrote: >> This can be designed much better by using iframes, maybe even Ajax. > > Definitely with Ajax. That's one of the things it does really well. But then you're probably limited to the big 4 of browsers: MSIE, Mozilla, KHTML/Safari, Opera. Ok, that should cover most desktop user

Re: Jargons of Info Tech industry

2005-08-27 Thread Ulrich Hobelmann
Mike Meyer wrote: > Try turning off JavaScript (I assume you don't because you didn't > complain about it). Most of the sites on the web that use it don't > even use the NOSCRIPT tag to notify you that you have to turn the > things on - much less use it to do something useful. I had JS off for a l

Re: Writing portable applications (Was: Jargons of Info Tech industry)

2005-08-28 Thread Ulrich Hobelmann
Mike Meyer wrote: >> I'd rather develop a native client for the machine that people >> actually WANT to use, instead of forcing them to use that >> little-fiddly web browser on a teeny tiny display. > > You missed the point: How are you going to provide native clients for > platforms you've never

Re: Writing portable applications

2005-08-29 Thread Ulrich Hobelmann
Mike Meyer wrote: > I'm still waiting for an answer to that one - where's the Java toolkit > that handles full-featured GUIs as well as character cell > interfaces. Without that, you aren't doing the job that the web > technologies do. Where is the text-mode browser that would even run part of the

Re: Writing portable applications

2005-08-30 Thread Ulrich Hobelmann
Mike Meyer wrote: > If your web apps are well-written, any of them should work. As > previously stated, Sturgeon's law applies to the web, so chances are > good they aren't well-written. :) >> But as soon as some user of platform 54 tries your website, she'll >> encounter some weird behavior with

Re: Communication between JAVA and python

2005-02-24 Thread Ulrich Schaefer
on of remote procedure call via HTTP sockets). It's built-in in Python since 2.2 (http://www.python.org/doc/2.4/lib/module-xmlrpclib.html), in Java use e.g. Apache XML-RPC (http://ws.apache.org/xmlrpc/). Ulrich -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-14 Thread Ulrich Hobelmann
Torsten Bronger wrote: HallÃchen! Tach! Moreover, I dislike the fact that new features are implemented partly in the interpreter and partly in Python itself. It reminds me of TeX/LaTeX, where the enormous flexibility of TeX is used to let it change itself in order to become a LaTeX compiler. Howe

Re: Python docs [was: function with a state]

2005-03-25 Thread Ulrich Hobelmann
[EMAIL PROTECTED] wrote: The Python doc, though relatively incompetent, but the author have Really, how could those morons even dream of creating a language, and even writing docs to accompany it?? tried the best. This is in contrast to documentations in unix related things (unix tools, perl, apa

Re: Lambda: the Ultimate Design Flaw

2005-04-01 Thread Ulrich Hobelmann
alex goldman wrote: Daniel Silva wrote: At any rate, FOLD must fold. I personally think GOTO was unduly criticized by Dijkstra. With the benefit of hindsight, we can see that giving up GOTO in favor of other primitives failed to solve the decades-old software crisis. The fault of goto in imperati

Making Labels from python

2014-03-09 Thread Ulrich Goebel
pagesize (labelsize) and a minimum format (boldface). But may be there is another light-weight-format besides PDF? Any idea? Ulrich -- Ulrich Goebel Paracelsusstr. 120, 53177 Bonn -- https://mail.python.org/mailman/listinfo/python-list

Re: Making Labels from python

2014-03-09 Thread Ulrich Goebel
Many thanks for the moment. I will try reportlab the next days. Am 09.03.2014 22:29, schrieb Ulrich Goebel: Hallo, has anybody an idea how to make small formated documents redy to print with python? I would like to print address labels as firstname lastname street and number cip

Re: Python script help

2013-08-02 Thread Ulrich Eckhardt
Am 01.08.2013 18:02, schrieb cool1...@gmail.com: I know I should be testing out the script myself but I did, I tried and since I am new in python and I work for a security firm that ask me to scan hundreds of documents a day for unsafe links (by opening them) I thought writing a script will be mu

Re: outputting time in microseconds or milliseconds

2013-08-02 Thread Ulrich Eckhardt
Am 02.08.2013 12:54, schrieb matt.doolittl...@gmail.com: I am using 2.7 on Ubuntu 12.10. All I need to do is to print time with the microseconds.[...] # write date and time and microseocnds self.logfile.write('%s\t'%(str(strftime("%Y-%m-%d", self.logfile.write(

Re: outputting time in microseconds or milliseconds

2013-08-05 Thread Ulrich Eckhardt
Am 02.08.2013 15:17, schrieb matt.doolittl...@gmail.com: so you are saying that self.logfile.write('%s\t'%(str(time( should be: self.logfile.write('%s\t'%(str(time.time( No, I'm not saying that. What I wanted to make clear is that your code is impossible to understand as it

Re: Module for dialoging with intercative programs, sockets, files, etc.

2013-08-06 Thread Ulrich Eckhardt
Am 05.08.2013 21:38, schrieb Olive: I have found telnetlib which make very easy to interact with a telnet server, especially the read_until command. I wonder if something similar exits for other things that a telnet server. It's not Python and I haven't played with it extensively, but there is

Re: Basic Python Query

2013-08-21 Thread Ulrich Eckhardt
Am 21.08.2013 08:50, schrieb chandan kumar: class Test(threading.Thread): def StartThread(self): Lock = threading.Lock() self.start() Inconsistently indented code, this is a killer for Python. Please read PEP8 and use four spaces! That said, there is never a need for de

Re: Basic Python Query

2013-08-22 Thread Ulrich Eckhardt
Am 21.08.2013 20:58, schrieb Johannes Bauer: On 21.08.2013 11:11, Ulrich Eckhardt wrote: That said, there is never a need for deriving from the Thread class, you can also use it to run a function without that. That way is IMHO clearer because the threading.Thread instance is not the thread

Re: Basic Python Query

2013-08-23 Thread Ulrich Eckhardt
Am 23.08.2013 05:28, schrieb Steven D'Aprano: On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote: When the Python object goes away, it doesn't necessarily affect thethread or file it represents. > That's certainly not true with file objects. When the file object goes

Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of

2013-08-28 Thread Ulrich Eckhardt
Am 28.08.2013 13:55, schrieb Ferrous Cranus: Τη Τετάρτη, 28 Αυγούστου 2013 2:32:44 μ.μ. UTC+3, ο χρήστης Dave Angel έγραψε: You really have no directory in which you have write permissions? If so, perhaps you'd better solve that first. of cours ei ahve write permissions. Here: ni...@superh

sorting german characters äöü...

2013-10-30 Thread Ulrich Goebel
return r def compare (a, b): aa = normal(a) bb = normal(b) if aa < bb: return -1 elif aa == bb: return 0 else: return 1 That works, but my be there is a more intelligent way? Especially there could be much more r.replace to handle all the accents as ^ ° ´ ` and so on.

Re: sorting german characters äöü... solved

2013-10-30 Thread Ulrich Goebel
idecode does - and what it doesn't. There is also a rather long-ish recent topic on a similar topic that might be worth scanning as well. Sorry, I didn't find that. I've no direct/recent experience with this topic. I'm just an interested bystander. But even a helpful bys

"Backward"-Iterator - Beginners question

2013-10-31 Thread Ulrich Goebel
ward, two steps forward). Any help will be wellcome! Ulrich -- Ulrich Goebel Paracelsusstr. 120, 53177 Bonn -- https://mail.python.org/mailman/listinfo/python-list

Re: "Backward"-Iterator - Beginners question

2013-11-01 Thread Ulrich Goebel
Hi Am 31.10.2013 23:35, schrieb Terry Reedy: On 10/31/2013 5:29 PM, Ulrich Goebel wrote: I'm locking for an "iterator" type with not only the .next() method, but with a .previous(), .first() and .last() method, so that I can through it from the beginning or from the e

Trouble with utf-8 values

2013-11-04 Thread Ulrich Goebel
e byte 0xc3 in position 6: ordinal not in range(128) The "position 6" is exactly the position of the special character, ß in this case. What to do? Ulrich -- Ulrich Goebel Paracelsusstr. 120, 53177 Bonn -- https://mail.python.org/mailman/listinfo/python-list

Terminating an embedded interpreter

2011-09-12 Thread Ulrich Eckhardt
Hi! I'm trying to provide some scripting capabilities to a program. For that, I'm embedding a Python interpreter, running a script in a separate thread to decouple it from the UI. Now, how should I handle rogue scripts? For example, when a script hangs in an endless loop, how do I signal the P

Re: Terminating an embedded interpreter

2011-09-12 Thread Ulrich Eckhardt
Steven D'Aprano wrote: > Ulrich Eckhardt wrote: >> I'm trying to provide some scripting capabilities to a program. For that, >> I'm embedding a Python interpreter, running a script in a separate thread >> to decouple it from the UI. >> >> Now, how

Re: Terminating an embedded interpreter

2011-09-12 Thread Ulrich Eckhardt
Chris Angelico wrote: > You can use PyErr_SetInterrupt to raise KeyboardInterrupt This sounds useful. Just to make sure, this would be called from a different thread than the one running the Python script, is that still OK? > , but it can be caught by the script. There's no guaranteed way, > sho

Re: What is wrong with this code?

2011-09-15 Thread Ulrich Eckhardt
superhappyfuntime wrote: > #this is antiWYSIWYG, an easy to learn cap for begginners to LaTeX. It's LaTeX, not Python. Uli -- http://mail.python.org/mailman/listinfo/python-list

Re: A tuple in order to pass returned values ?

2011-10-05 Thread Ulrich Eckhardt
Am 05.10.2011 15:33, schrieb faucheuse: I was wondering something : when you do : return value1, value2, value3 It returns a tuple. Right. So if I want to pass these value to a function, the function have to look like : def function(self,(value1, value2, value3)) [...] No, you don't have to

Re: encoding problem with BeautifulSoup - problem when writing parsed text to file

2011-10-06 Thread Ulrich Eckhardt
Am 06.10.2011 05:40, schrieb Steven D'Aprano: (4) Do all your processing in Unicode, not bytes. (5) Encode the text into bytes using UTF-8 encoding. (6) Write the bytes to a file. Just wondering, why do you split the latter two parts? I would have used codecs.open() to open the file and defi

Re: OpenGL.GLU.gluNewQuadric() segmentation fault on 64 bit systems

2011-10-10 Thread Ulrich Eckhardt
Am 10.10.2011 14:18, schrieb X1: has this bug been resolved? if yes, which version on files to install? That seems to be part of PyOpenGL, so I'd check their bugtracking system. Uli -- http://mail.python.org/mailman/listinfo/python-list

Re: callling python function in c

2011-10-17 Thread Ulrich Eckhardt
Am 16.10.2011 10:03, schrieb masood shaik: I am trying to call python function from c code.The following program i got from the web source while i am trying to run this program it throws an segmentation fault. Try checking what functions returns instead of blindly using it. Use a debugger to fi

Re: Exception Handling (C - extending python)

2011-10-25 Thread Ulrich Eckhardt
Am 23.10.2011 14:41, schrieb Stefan Behnel: That's just fine. If you are interested in the inner mechanics of the CPython runtime, reading the source is a very good way to start getting involved with the project. However, many extension module authors don't care about these inner mechanics and j

Re: Assign values from list to list of instances

2011-11-01 Thread Ulrich Eckhardt
Am 01.11.2011 16:05, schrieb Gnarlodious: I want to assign a list of variables: locus=[-2, 21, -10, 2, 12, -11, 0, 3] updating a list of objects each value to its respective instance: for order in range(len(Orders)): Orders[order].locus=locus[order] This works, even though it reads lik

Re: ctypes: catch system exit from C library

2011-11-03 Thread Ulrich Eckhardt
Am 03.11.2011 11:07, schrieb Martin Landa: in my python application I am calling functions from a C library via `ctypes` interface. Some fns from that C library calls `exit()` on error. Just curious, which library is that? Uli -- http://mail.python.org/mailman/listinfo/python-list

Re: Design Pattern and Python: Any book recommendation? Your view?

2011-11-04 Thread Ulrich Eckhardt
Am 04.11.2011 01:33, schrieb Anthony Kong: I would like to find out what is the current prevailing view or consensus (if any) on the use of Design Pattern in python? My consensus with myself is that design patterns are language-agnostic. If I write "class Foo serves as view and controller for

unit-profiling, similar to unit-testing

2011-11-16 Thread Ulrich Eckhardt
Hi! I'm currently trying to establish a few tests here that evaluate certain performance characteristics of our systems. As part of this, I found that these tests are rather similar to unit-tests, only that they are much more fuzzy and obviously dependent on the systems involved, CPU load, ne

Re: unit-profiling, similar to unit-testing

2011-11-17 Thread Ulrich Eckhardt
Am 16.11.2011 15:36, schrieb Roy Smith: It's really, really, really hard to either control for, or accurately measure, things like CPU or network load. There's so much stuff you can't even begin to see. The state of your main memory cache. Disk fragmentation. What I/O is happening directly ou

Re: Passing DLL handle as an argument (in Windows)

2011-11-18 Thread Ulrich Eckhardt
Am 18.11.2011 08:51, schrieb Pekka Kytölä: Is it possible to pass my own dll's (already loaded) handle as an argument to load/attach to the very same instance of dll? Thing is that I've done plugin (dll) to a host app and the SDK's function pointers are assigned once the dll is loaded in the host

Re: Passing DLL handle as an argument (in Windows)

2011-11-18 Thread Ulrich Eckhardt
Am 18.11.2011 12:49, schrieb Pekka Kytölä: What I'd like to do is that after fetching those SDK function pointers I'd like to fire up .py/.pyc that snoops for possible plugins written in python and registers those plugins and callbacks and let them react to events. Obviously this python code need

reading optional configuration from a file

2011-11-24 Thread Ulrich Eckhardt
Hi! I have a few tests that require a network connection. Typically, the target will be localhost on port 2. However, sometimes these settings differ, so I want to be able to optionally set them. What I'm currently doing is this: try: from settings import REMOTE_HOST, REMOTE_

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-24 Thread Ulrich Eckhardt
Am 17.11.2011 00:59, schrieb Ben Finney: David Robinow writes: but your code works fine on Windows. Thanks. I'm glad to know that. Perhaps you could investigate why, and suggest an update to the above documentation if it's wrong? The bug tracker at http://bugs.python.org/> would be the appro

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-25 Thread Ulrich Eckhardt
Am 25.11.2011 04:49, schrieb alex23: On Nov 24, 6:51 pm, Tim Golden wrote: The Ctrl-Z thing is what *exits* the interpreter on Windows (a la Ctrl-D on Linux). With ActivePython, Ctrl-D works as well, which is a godsend as I'm constantly working across Windows& linux. In short - on Windows,

Re: Executing .pyc using python c api

2011-11-29 Thread Ulrich Eckhardt
Am 29.11.2011 08:34, schrieb Mrinalini Kulkarni: I need to run .pyc files using python c api. if i do PyImport_Import it executes the script. However, i need to pass a set of variables and their values which will be accessed from within the script. How can this be done. I don't think what you w

Re: subprocess.Popen under windows 7

2011-12-09 Thread Ulrich Eckhardt
Am 08.12.2011 23:41, schrieb Frank van den Boom: arglist = [PATH_TO_7ZIP,"a", "-sfx", archive_name, "*", "-r", "-p",PASSWORD] The "*" is resolved by the shell, this is not a wildcard that gets passed to the program. At least not normally, your case might be different. if output: print o

Re: Screen Control Fullscreen ON/OFF

2011-12-15 Thread Ulrich Eckhardt
Am 15.12.2011 12:12, schrieb yeet: My LCD has 2ms respond time thus it can handle a maximum of 50Hz ON/ OFF (white/black) thus seems to fit my 1-40Hz range. You might want to ask Santa for a new calculator, as in my book a response time of 2ms would be enough for 250Hz (period = 2 * 2ms). Re

modifying a time.struct_time

2011-12-16 Thread Ulrich Eckhardt
Hi! I'm trying to create a struct_time that is e.g. one year ahead or a month back in order to test some parsing/formatting code with different dates. Now, the straightforward approach is t = time.localtime() t.tm_year += 1 This fails with "TypeError: readonly attribute". This kind-of m

Re: modifying a time.struct_time

2011-12-16 Thread Ulrich Eckhardt
Am 16.12.2011 10:45, schrieb Ulrich Eckhardt: I'm trying to create a struct_time that is e.g. one year ahead or a month back in order to test some parsing/formatting code with different dates. There is something I stumbled across that helps and that is the datetime module, which seems

Re: Making the case for "typed" lists/iterators in python

2011-12-19 Thread Ulrich Eckhardt
Am 16.12.2011 18:48, schrieb Nathan Rice: I realize this has been discussed in the past, I hope that I am presenting a slightly different take on the subject that will prove interesting. This is primarily motivated by my annoyance with using comprehensions in certain circumstances. [...] Havin

check for a certain Python version

2011-12-20 Thread Ulrich Eckhardt
Hi! I'd like to give my users a meaningful error message when they are using obsolete Python versions. Is there some kind of best practice or recipe for that? Specifically, the case is a bunch of unittests that use features new to Python 2.7. Thank you! Uli -- http://mail.python.org/mailman

nesting context managers

2011-12-20 Thread Ulrich Eckhardt
Hi! Let us assume I had a class HTTPClient that has a socket for HTTP and a logfile for filing logs. I want to make this HTTPClient a context manager, so that I can write with HTTPClient(url) as client: pass and reliably have both the socket and the logfile closed. The easy way is w

Re: nesting context managers

2011-12-20 Thread Ulrich Eckhardt
Am 20.12.2011 15:15, schrieb Ulrich Eckhardt: Let us assume I had a class HTTPClient that has a socket for HTTP and a logfile for filing logs. I want to make this HTTPClient a context manager, so that I can write with HTTPClient(url) as client: pass Actually, I overestimated the task

Re: argparse missing optparse capabilities?

2012-01-05 Thread Ulrich Eckhardt
Am 05.01.2012 09:05, schrieb ru...@yahoo.com: I have optparse code that parses a command line containing intermixed positional and optional arguments, where the optional arguments set the context for the following positional arguments. For example, myprogram.py arg1 -c33 arg2 arg3 -c44 arg4

replacing __dict__ with an OrderedDict

2012-01-06 Thread Ulrich Eckhardt
Hi! The topic explains pretty much what I'm trying to do under Python 2.7[1]. The reason for this is that I want dir(SomeType) to show the attributes in the order of their declaration. This in turn should hopefully make unittest execute my tests in the order of their declaration[2], so that t

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Ulrich Eckhardt
Am 06.01.2012 12:44, schrieb Peter Otten: Alternatively you can write your own test loader: [...CODE...] Well, actually you just did that for me and it works! ;) Nonetheless, I'm still wondering if I could somehow replace the dict with an OrderedDict. Thank you! Uli -- http://mail.python.

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Ulrich Eckhardt
Am 06.01.2012 12:43, schrieb Lie Ryan: On 01/06/2012 08:48 PM, Ulrich Eckhardt wrote: Hi! The topic explains pretty much what I'm trying to do under Python 2.7[1]. The reason for this is that I want dir(SomeType) to show the attributes in the order of their declaration. This in turn s

Re: replacing __dict__ with an OrderedDict

2012-01-09 Thread Ulrich Eckhardt
Am 09.01.2012 13:10, schrieb Lie Ryan: I was just suggesting that what the OP thinks he wants is quite likely not what he actually wants. Rest assured that the OP has a rather good idea of what he wants and why, the latter being something you don't know, because he never bothered to explain

Re: replacing __dict__ with an OrderedDict

2012-01-09 Thread Ulrich Eckhardt
Am 09.01.2012 15:35, schrieb Roy Smith: The classic unittest philosophy says that tests should be independent of each other, which means they should be able to be run in arbitrary order. Some people advocate that the test framework should intentionally randomize the order, to flush out inter-tes

Re: replacing __dict__ with an OrderedDict

2012-01-10 Thread Ulrich Eckhardt
Am 10.01.2012 13:31, schrieb Lie Ryan: While it is possible to replace __dict__ with OrderedDict and it is possible to reorder the test, those are not his original problem, and the optimal solution to his original problem differs from the optimal solution to what he think he will need. Oh, and

Re: replacing __dict__ with an OrderedDict

2012-01-18 Thread Ulrich Eckhardt
Am 06.01.2012 12:44, schrieb Peter Otten: [running unit tests in the order of their definition] class Loader(unittest.TestLoader): def getTestCaseNames(self, testCaseClass): """Return a sequence of method names found within testCaseClass sorted by co_firstlineno. "

Re: verify the return value of a function

2012-01-20 Thread Ulrich Eckhardt
Am 19.01.2012 21:45, schrieb Jabba Laci: In a unit test, I want to verify that a function returns a cookielib.LWPCookieJar object. What is the correct way of doing that? 1) First I tried to figure out its type with type(return_value) but it is I'm not sure where the problem here is and where e

Re: autoflush on/off

2013-02-04 Thread Ulrich Eckhardt
Am 04.02.2013 18:12, schrieb Jabba Laci: autoflush_on = False def unbuffered(): """Switch autoflush on.""" global autoflush_on # reopen stdout file descriptor with write mode # and 0 as the buffer size (unbuffered) if not autoflush_on: sys.stdout = os.fdopen(sys

Re: Opinion on best practice...

2013-02-05 Thread Ulrich Eckhardt
Am 05.02.2013 05:14, schrieb Anthony Correia: I need to pick up a language that would cover the Linux platform. I use Powershell for a scripting language on the Windows side of things. Very simple copy files script. Is this the best way to do it? import os objdir = ("C:\\temp2") Dro

Re: autoflush on/off

2013-02-05 Thread Ulrich Eckhardt
Am 05.02.2013 01:09, schrieb Jabba Laci: I like the context manager idea There is a helper library for constructing context managers, see http://docs.python.org/2/library/contextlib.html. That would have made your code even shorter. setting the sys.stdout back to the original value doesn

Re: Opinion on best practice...

2013-02-05 Thread Ulrich Eckhardt
Am 05.02.2013 11:35, schrieb Peter Otten: Ulrich Eckhardt wrote: [...] use os.path.walk(), because that doesn't first build a list and then iterate over the list but iterates over the single elements directly. [...] Not true. os.walk() uses os.listdir() internally. Oh. 8| Thank

puzzled by name binding in local function

2013-02-05 Thread Ulrich Eckhardt
Hello Pythonistas! Below you will find example code distilled from a set of unit tests, usable with Python 2 or 3. I'm using a loop over a list of parameters to generate tests with different permutations of parameters. Instead of calling util() with values 0-4 as I would expect, each call uses

Re: puzzled by name binding in local function

2013-02-06 Thread Ulrich Eckhardt
Dave and Terry, Thanks you both for your explanations! I really appreciate the time you took. Am 05.02.2013 19:07, schrieb Dave Angel: If you need to have separate function objects that already know a value for i, you need to somehow bind the value into the function object. One way to do it,

Re: puzzled by name binding in local function

2013-02-07 Thread Ulrich Eckhardt
Heureka! Am 06.02.2013 15:37, schrieb Dave Angel: > def myfunc2(i): def myfunc2b(): print ("myfunc2 is using", i) return myfunc2b Earlier you wrote: There is only one instance of i, so it's not clear what you expect. Since it's not an argument to test(), it has to be found

Re: which situations should we use thread. join() ?

2013-02-08 Thread Ulrich Eckhardt
Am 08.02.2013 07:29, schrieb Chris Angelico: On Fri, Feb 8, 2013 at 3:32 PM, iMath wrote: which situations should we use thread. join() ? http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/ why do we not put thread. join() in this code ? I've no idea why you don't put thread.join() in that code. M

Re: Is Python programming language?

2013-02-08 Thread Ulrich Eckhardt
Am 08.02.2013 14:03, schrieb gmspro: One said, Python is not programming language, rather scripting language, is that true? That depends on your definition of scripting language and programming language. Python's not a language but an animal. Uli -- http://mail.python.org/mailman/listinfo

Re: Awsome Python - chained exceptions

2013-02-14 Thread Ulrich Eckhardt
Am 13.02.2013 um 17:14 schrieb Rick Johnson: Q1: How could a line in the "try" block ever be considered offensive? Because it throws an error? try: rrick.go_and_fuck_yourself() finally: rrick.get_lost() See, wasn't that difficult, was it? :D Are you serious? No, I just coul

Re: Awsome Python - chained exceptions

2013-02-15 Thread Ulrich Eckhardt
Am 15.02.2013 08:51, schrieb Rick Johnson: "How could a line in the "try" block ever be considered offensive?" My suggestion of "offensive" does not imply ignorance on /my/ part[...] Well, it seems to imply that you are not aware of the subtle difference between "offending" and "offensive".

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Ulrich Eckhardt
Am 01.03.2013 09:59, schrieb Isaac Won: try to make my triple nested loop working. My code would be: c = 4 [...] while c <24: c = c + 1 This is bad style and you shouldn't do that in python. The question that comes up for me is whether something else is modifying "c" in that loop,

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-04 Thread Ulrich Eckhardt
Am 01.03.2013 17:28, schrieb Isaac Won: What I really want to get from this code is m1 as I told. For this purpose, for instance, values of fpsd upto second loop and that from third loop should be same, but they are not. Actually it is my main question. You are not helping yourself... In any

Re: Sudoku

2013-03-27 Thread Ulrich Eckhardt
Am 27.03.2013 06:44, schrieb Eric Parry: I downloaded the following program from somewhere using a link from Wikipedia and inserted the “most difficult Sudoku puzzle ever” string into it and ran it. It worked fine and solved the puzzle in about 4 seconds. However I cannot understand how it works.

name lookup failure using metaclasses with unittests

2013-04-10 Thread Ulrich Eckhardt
Hi! I'm having problems using a metaclass to generate test functions. This works when I try to run all tests from the module or test case, but it fails when I'm trying to specify a single test function. My environment is Python 2.7.3 on MS Windows 7 at the moment. It should be upgraded to at

Re: name lookup failure using metaclasses with unittests

2013-04-11 Thread Ulrich Eckhardt
Am 10.04.2013 11:52, schrieb Peter Otten: Ulrich Eckhardt wrote: [...] It looks like this particular invocation relies on class attribute and function __name__ being identical. Please file a bug report. Thanks for confirming this and reducing the test case even more. Now, concerning

Re: name lookup failure using metaclasses with unittests

2013-04-11 Thread Ulrich Eckhardt
Am 10.04.2013 11:52, schrieb Peter Otten: It looks like this particular invocation relies on class attribute and function __name__ being identical. Please file a bug report. http://bugs.python.org/issue17696 Uli -- http://mail.python.org/mailman/listinfo/python-list

Re: name lookup failure using metaclasses with unittests

2013-04-12 Thread Ulrich Eckhardt
Am 11.04.2013 10:19, schrieb Steven D'Aprano: if sys.version >= '3': Use sys.version_info >= (3,), otherwise your code breaks when upgrading to Python 10 and greater. ;^) The second question that came up was if there is a way to keep a metaclass defined inside the class or if the only way

percent faster than format()? (was: Re: optomizations)

2013-04-23 Thread Ulrich Eckhardt
Am 23.04.2013 06:00, schrieb Steven D'Aprano: If it comes down to micro-optimizations to shave a few microseconds off, consider using string % formatting rather than the format method. Why? I don't see any obvious difference between the two... Greetings! Uli -- http://mail.python.org/mailma

Re: Running simultaneuos "FOR" loops

2013-04-23 Thread Ulrich Eckhardt
Am 23.04.2013 09:13, schrieb inshu chauhan: This statement is giving me the following error Statement: for p, k, j in zip(sorted(segments.iterkeys(), class_count.iterkeys(), pixel_count.iterkeys())): Error: Traceback (most recent call last): File "C:\Users\inshu\Desktop\Training_segs_trial2.

Re: percent faster than format()?

2013-04-23 Thread Ulrich Eckhardt
Am 23.04.2013 10:26, schrieb Chris “Kwpolska” Warrick: On Tue, Apr 23, 2013 at 9:46 AM, Ulrich Eckhardt wrote: Am 23.04.2013 06:00, schrieb Steven D'Aprano: If it comes down to micro-optimizations to shave a few microseconds off, consider using string % formatting rather than the f

Re: Xah's Edu Corner: Responsible Software Licensing

2005-12-18 Thread Ulrich Hobelmann
Martin P. Hellwig wrote: > Xah Lee wrote: > > Nice rant, btw in most EU countries the software creator can not > withdraw the responsibility of his/her/it creation, regardless of what > the disclaimer says. The law is the leading authority and not some > Disclaimer/EULA, that's why most US EULA

Re: Xah's Edu Corner: IT Industry Predicament

2006-01-20 Thread Ulrich Hobelmann
Xah Lee wrote: > • The reason fucking languages like C and family mask technically Contrary to popular opinion, languages don't multiply. Certainly they don't have sex. Most (human) languages merely have something called gender, and words don't interact. C has a bastard child called C++, tru

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-14 Thread Ulrich Hobelmann
Xah Lee wrote: > here's a site: http://www.longbets.org/bets that takes socially > important predictions. I might have to enter one or two. > > i longed for such a accountable predictions for a long time. Usually, > some fucking fart will do predictions, but the problem is that it's not [...] OMG

float64 print digits

2007-03-02 Thread Ulrich Dorda
gt;>> type(z[0]) >>> print "%35.25e" %z[0] 1.23456789123456790e+000 This cuts the digits just like the 32bit case. Can anyone please help me get more digits? Thank you very much in advance, Ulrich -- http://mail.python.org/mailman/listinfo/python-list

Re: bigint to timestamp

2009-01-28 Thread Ulrich Eckhardt
Shah Sultan Alam wrote: > I have file with contents retrieved from mysql DB. > which has a time field with type defined bigint(20) > I want to parse that field into timestamp format(-MM-DD HH:MM:SS > GMT) using python code. Try time.strftime. > The value I found for that field is 212099016004

Re: Python 3.0 slow file IO

2009-02-05 Thread Ulrich Eckhardt
thomasvang...@gmail.com wrote: > C:\python30> patch -p0 < fileio_buffer.patch > The patch command is not recognized.. You need the 'patch' program first. Further, you will need a C compiler. If you don't know how to compile from sources, I would postpone patching sources to after learning that. >

Re: Too many open files

2009-02-09 Thread Ulrich Eckhardt
psaff...@googlemail.com wrote: > I'm building a pipeline involving a number of shell tools. In each > case, I create a temporary file using tempfile.mkstmp() and invoke a > command ("cmd < /tmp/tmpfile") on it using subprocess.Popen. > > At the end of each section, I call close() on the file handl

sys.exit and '-i'

2008-12-04 Thread Ulrich Eckhardt
Hi! The unittest module will invoke sys.exit() after running the tests in order to signal success or failure. However, I sometimes don't want to exit the interpreter but instead e.g. inspect some state or just keep the window open. Normally, using '-i' as commandline argument works, but not in the

Re: EBCDIC <--> ASCII

2008-12-04 Thread Ulrich Eckhardt
[EMAIL PROTECTED] wrote: > I've tried starting with something like this, but I assume it is > expecting the source to be in unicode already? > > e.g. (pretend the second half are EBCDIC characters) > > sAll = "This bit is ASCII, " Why pretend? You can use this: "abcde\x81\x82\x83\x84" > sSou

Re: Memory leak when using a C++ module for Python

2008-12-11 Thread Ulrich Eckhardt
Jaume Bonet wrote: > When I test the code from C++ each time I delete a vector the consumed > memory decreases, but it does not happen when the module is called > from python. What is a "vector" for you? Do you mean std::vector? A vector allocated using malloc()? A vector allocated using new? Just

Re: [2.5.1] "UnicodeDecodeError: 'ascii' codec can't decode byte"?

2008-10-29 Thread Ulrich Eckhardt
Gilles Ganault wrote: > I'm getting this error while downloading and parsing web pages: > > = > title = m.group(1) > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position > 48: ordinal not in range(128) > = > > From what I understand, it's because some strings are Unic

Re: Unicode Problem

2008-10-30 Thread Ulrich Eckhardt
Seid Mohammed wrote: > I am new to python. Welcome! :) abebe = 'አበበ በሶ በላ' abebe > '\xe1\x8a\xa0\xe1\x89\xa0\xe1\x89\xa0 \xe1\x89\xa0\xe1\x88\xb6 > \xe1\x89\xa0\xe1\x88\x8b' print abebe > አበበ በሶ በላ abeba = ['አበበ','በሶ','በላ'] abeba > ['\xe1\x8a\xa0\xe1\x89\xa0\xe1\x89\xa0',

Re: Ascii codec can't encode

2008-10-30 Thread Ulrich Eckhardt
luca72 wrote: > hello i have this problem: > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in > position 8: ordinal not in range(128) This is the result of transcoding a Unicode string to ASCII, where the Unicode string contains a character that is not representable in ASCII. Th

<    1   2   3   4   5   >