Re: search through this list's email archives

2011-06-23 Thread Hans Mulder
On 23/06/11 18:11:32, Cathy James wrote: I looked through this forum's archives, but I can't find a way to search for a topic through the archive. Am I missing something? One way to search the past contributions to this forum is to go to http://groups.google.com/advanced_search and specify "co

Re: Wait for a keypress before continuing?

2011-08-17 Thread Hans Mulder
On 17/08/11 10:03:00, peter wrote: Is there an equivalent to msvcrt for Linux users? I haven't found one, and have resorted to some very clumsy code which turns off keyboard excho then reads stdin. Seems such an obvious thing to want to do I am surprised there is not a standard library module fo

Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1")

2011-08-21 Thread Hans Mulder
On 21/08/11 19:14:19, Irmen de Jong wrote: What the precise difference (semantics and speed) is between the BINARY_ADD and INPLACE_ADD opcodes, I dunno. Look in the Python source code or maybe someone knows it from memory :-) There is a clear difference in semantics: BINARY_ADD always produces

Re: how to format long if conditions

2011-08-27 Thread Hans Mulder
On 27/08/11 09:08:20, Arnaud Delobelle wrote: I'm wondering what advice you have about formatting if statements with long conditions (I always format my code to<80 colums) Here's an example taken from something I'm writing at the moment and how I've formatted it: if (isinstance(left,

Re: how to format long if conditions

2011-08-27 Thread Hans Mulder
On 27/08/11 11:05:25, Steven D'Aprano wrote: Hans Mulder wrote: [...] It may look ugly, but it's very clear where the condition part ends and the 'then' part begins. Immediately after the colon, surely? On the next line, actually :-) The point is, that this layout make

Re: how to format long if conditions

2011-08-27 Thread Hans Mulder
On 27/08/11 17:16:51, Colin J. Williams wrote: What about: cond= isinstance(left, PyCompare) and isinstance(right, PyCompare) and left.complist[-1] is right.complist[0] py_and= PyCompare(left.complist + right.complist[1:])if cond else: py_and = PyBooleanAnd(left, right) Colin W

Re: killing a script

2011-08-30 Thread Hans Mulder
On 30/08/11 06:13:41, Steven D'Aprano wrote: On Tue, 30 Aug 2011 08:53 am Arnaud Delobelle wrote: [...] Yes, but if I am not mistaken, that will require me to put a line or two after each os.system call. That's almost like whack-a-mole at the code level rather than the Control-C level. OK, not

Re: Can't use subprocess.Popen() after os.chroot() - why?

2011-09-04 Thread Hans Mulder
On 4/09/11 17:25:48, Alain Ketterlin wrote: Erik writes: import os from subprocess import Popen, PIPE os.chroot("/tmp/my_chroot") p = Popen("/bin/date", stdin=PIPE, stdout=PIPE, stderr=PIPE) stdout_val, stderr_val = p.communicate() print stdout_val but the Popen call is dying with the follow

Re: One line command line filter

2011-09-06 Thread Hans Mulder
On 6/09/11 01:18:37, Steven D'Aprano wrote: Terry Reedy wrote: The doc says "-c Execute the Python code in command. command can be one or more statements separated by newlines," However, I have no idea how to put newlines into a command-line string. I imagine that it depends on the shell you

Re: Python marks an instance of my class undefined

2011-09-06 Thread Hans Mulder
On 6/09/11 16:18:32, Laszlo Nagy wrote: On 2011-09-06 15:42, Kayode Odeyemi wrote: I was able to get this solved by calling class like this: >>> from core.fleet import Fleet >>> f = Fleet() Thanks to a thread from the list titled "TypeError: 'module' object is not callable" Or you can also do

Re: dictionary size changed during iteration

2011-05-08 Thread Hans Mulder
On 08/05/2011 00:12, Roy Smith wrote: In article<7xd3jukyn9@ruckus.brouhaha.com>, Paul Rubin wrote: Roy Smith writes: changes = [ ] for key in d.iterkeys(): if is_bad(key): changes.append(key) changes = list(k for k in d if is_bad(k)) is a little bit more direct. This

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-11 Thread Hans Mulder
On 03/05/2011 09:52, rusi wrote: [If you believe it is, then try writing a log(n) fib iteratively :D ] It took me a while, but this one seems to work: from collections import namedtuple Triple = namedtuple('Triple', 'hi mid lo') Triple.__mul__ = lambda self, other: Triple( self.hi * othe

Re: os.popen command working differently on Windows

2011-05-13 Thread Hans Mulder
On 12/05/2011 16:21, Tim Golden wrote: On 12/05/2011 15:11, Ayaskanta Swain wrote: Please help me in solving the following issue I am facing while executing my python script. Basically I am executing the OS specific move command to move a file/dir from one location to another. Why? Why not use

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-13 Thread Hans Mulder
On 13/05/2011 13:11, rusi wrote: On May 12, 3:06 am, Hans Mulder wrote: On 03/05/2011 09:52, rusi wrote: [If you believe it is, then try writing a log(n) fib iteratively :D ] It took me a while, but this one seems to work: from collections import namedtuple Triple = namedtuple('T

Re: checking if a list is empty

2011-05-14 Thread Hans Mulder
On 07/05/2011 02:43, Jon Clements wrote: On May 7, 12:51 am, Ian Kelly wrote: On Fri, May 6, 2011 at 4:21 PM, Philip Semanchuk wrote: What if it's not a list but a tuple or a numpy array? Often I just want to iterate through an element's items and I don't care if it's a list, set, etc. For

python not working

2018-01-29 Thread Abbas Hans
it shows thepythonw.exe system error: The program can't start because api-ms-win-crt-runtime-|1-1-0.dll is missing from your computer. try reinstalling the program to fix this problem. I reinstall it many times try to repair it is not working -- https://mail.python.org/mailman/listinfo/pyt

Re: The Industry choice

2004-12-31 Thread Hans Nowak
nit tests for a dynamic language, you don't check for these things at all. How often do you explicitly check types in Python unit tests? IMHO, when using a dynamic language, you don't need most of the checks that Java, C# and their ilk force upon you. -- Hans Nowak http://

Re: The Industry choice

2004-12-31 Thread Hans Nowak
Christopher Koppler wrote: > -- > Christopher > > In theory, I'm in love with Lisp, > but I hop into bed with Python every chance I get. That reminds me of something my old math teacher used to say... "My wife is my cathedral, but I pray in every chapel.

Re: what is lambda used for in real code?

2004-12-31 Thread Hans Nowak
expression, just like other types can be part of an expression. However, by that same reasoning, maybe classes aren't special enough either to warrant a special case. Where's the keyword to create an anonymous class? :-) -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.o

Re: The Industry choice

2005-01-01 Thread Hans Nowak
Donn Cave wrote: Quoth Hans Nowak <[EMAIL PROTECTED]>: | Paul Rubin wrote: | |> You should write unit tests either way, but in Python you're relying |> on the tests to find stuff that the compiler finds for you with Java. | | As I wrote on my weblog a while ago, I suspect th

Re: UserDict deprecated

2005-01-01 Thread Hans Nowak
Uwe Mayer wrote: Why is the UserDict module is deprecated after Python 2.2. The application of it I have in mind is, i.e. multiple inheritance from "file" and "dic" - which is not possible. I am curious, what would you do with a class that derives from both file and dict?

Re: UserDict deprecated

2005-01-01 Thread Hans Nowak
#x27;t do what you want, so you have to override them anyway. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-04 Thread Hans Nowak
pment will continue in the same vein. (He may just be putting his thoughts on paper, but it's the BDFL, so what is one supposed to think?) I for one will NOT welcome our new static typing overlords. ;-) -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Funny Python error messages

2005-01-21 Thread Hans Nowak
" + x[18:] >>> cPickle.loads(y) Traceback (most recent call last): File "", line 1, in ? ValueError: insecure string pickle -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write a tutorial

2005-01-23 Thread Hans Nowak
nks for the tip, man! -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic class methods misunderstanding

2005-01-28 Thread Hans Nowak
To add m as a new method to the *instance*, use new.instancemethod, as Diez B. Roggisch already pointed out. HTH, -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic class methods misunderstanding

2005-01-28 Thread Hans Nowak
Bill Mill wrote: On Fri, 28 Jan 2005 11:09:16 -0500, Hans Nowak <[EMAIL PROTECTED]> wrote: > To add m as a new method to the *class*, do this: >>> class test: ... def __init__(self, method): ... self.__class__.method = method ... self.method() ... >>&

Re: Where are list methods documented?

2005-02-01 Thread Hans Nowak
eason, "pydoc list.sort" doesn't work on my machine (Python 2.3.4, Windows XP). -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Ode to python

2005-09-07 Thread hans . eccentricity
Very good poem. Mind if forward it around?? I'll include ur email ID if u don't mind -- http://mail.python.org/mailman/listinfo/python-list

Re: changing __call__ on demand

2005-02-14 Thread Hans Nowak
;>> t() Called with: () {} >>> t(3, 4) Called with: (3, 4) {} >>> t(42, x=0) Called with: (42,) {'x': 0} -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How Do I get Know What Attributes/Functions In A Class?

2005-02-19 Thread Hans Nowak
lp', 'login', 'mail', 'noop', 'putcmd', 'quit', 'rcpt', 'rset', 'send', 'sendmail', 'set_debuglevel', 'starttls', 'verify', 'vrfy'] To get more detailed information than just a list of names, see the inspect module. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Regexp problem, which pattern to use in split

2004-12-13 Thread Hans Almåsbakk
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > >>> import csv > > http://online.effbot.org/2003_08_01_archive.htm#librarybook-csv-module > This seems be just the thing I need. Now ofcourse, another problem arouse: The csv module is new in Python 2.3. han

Regexp problem, which pattern to use in split

2004-12-14 Thread Hans Almåsbakk
. (optional " before and after comma), which of course also goes wrong. " may and may not occur around the splitting comma, but that would also match single commas inside quoted text, see example. Any pointer will be greatly appreciated. Maybe I'm attacking this problem the wrong way alre

Re: BASIC vs Python

2004-12-17 Thread Hans Nowak
plex form with grids, explorer like trees etc. in 2 minutes in standard python. To be fair, this is more a property of a GUI builder than of a language... -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to pass globals across modules (wxPython)

2004-12-20 Thread Hans Nowak
ication" object from other modules, actually the windows and frames that live therein and I don't know how to do this. If you just need to access the running application from other wxPython objects, then wx.GetApp() is your friend. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.py

Re: Boo who? (was Re: newbie question)

2004-12-20 Thread Hans Nowak
s syntax may look like C or C++ in some areas, but the languages are nowhere near alike.) Pointing out the difference is not trolling. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What is on-topic for the python list [was "Re: BASIC vs Python"]

2004-12-21 Thread Hans Nowak
Doug Holton wrote: Steve Holden wrote: 'Scuse me? This group has a long history of off-topic posting, and anyway who decided that CPython should be the exclusive focus? Even on-topic we can talk about Jython and PyPy as well as CPython. I agree with your point, although Hans Nowak and other

Re: What is on-topic for the python list [was "Re: BASIC vs Python"]

2004-12-21 Thread Hans Nowak
Doug Holton wrote: Hans Nowak wrote: Now you're trying to make it seem like I am against free speech on this list, and against people's rights to discuss whatever they want. I never said that, and I in fact enjoy the fact that c.l.py posters are an eclectic bunch who have knowled

Re: What is on-topic for the python list [was "Re: BASIC vs Python"]

2004-12-21 Thread Hans Nowak
Doug Holton wrote: Hans Nowak wrote: You said that boo should not be mentioned on this newsgroup. Please point me to the post where I said that. Since everything is stored in Google Groups, it should be easy for you to come up with an URL... if such a post existed. Quote: "th

Re: What is on-topic for the python list [was "Re: BASIC vs Python"]

2004-12-21 Thread Hans Nowak
Doug Holton wrote: Hans Nowak wrote: Quote: "this is comp.lang.python, not comp.lang.boo." Which is obviously not the same as "Boo should not be mentioned on this newsgroup". I used the exact same phrase in another note except using the term "logo" instead o

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-28 Thread Hans Nowak
ally necessary, unless code is ambiguous. >>> x = 1, 2, 3 >>> x (1, 2, 3) >>> y = 5, >>> y (5,) but: >>> print 8, 9 # not a tuple 8 9 >>> print (8, 9) (8, 9) HTH, -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: copying classes?

2004-12-30 Thread Hans Nowak
oo) >>> FooCopy >>> Foo It appears it doesn't copy the class at all, you just get the same class back. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: killing a script

2011-09-09 Thread Hans Mulder
On 9/09/11 11:07:24, Steven D'Aprano wrote: Sure enough, I now have to hit Ctrl-C repeatedly, once per invocation of script.py. While script.py is running, it receives the Ctrl-C, the calling process does not. You misinterpret what you are seeing: the calling process *does* receive the ctrl-C,

Re: Python without a tty

2011-09-29 Thread Hans Mulder
On 29/09/11 11:21:16, Steven D'Aprano wrote: I have a Python script which I would like to test without a tty attached to the process. I could run it as a cron job, but is there an easier way? There is module on Pypi called python-daemon; it implements PEP-3143. This module detaches the process

Re: Python without a tty

2011-09-29 Thread Hans Mulder
On 29/09/11 12:52:22, Steven D'Aprano wrote: [steve@sylar ~]$ python -c "import sys,os; print os.isatty(sys.stdout.fileno())" True > If I run the same Python command (without the setsid) as a cron job, I get False emailed to me. That's the effect I'm looking for. In that case, all you need t

Re: regexp compilation error

2011-09-30 Thread Hans Mulder
On 30/09/11 11:10:48, Ovidiu Deac wrote: I have the following regexp which fails to compile. Can somebody explain why? re.compile(r"""^(?: [^y]* )*""", re.X) [...] sre_constants.error: nothing to repeat Is this a bug or a feature? A feature: the message explains why this pattern is not all

Re: Python without a tty

2011-09-30 Thread Hans Mulder
On 30/09/11 20:34:37, RJB wrote: You could try the old UNIX "nohup ...&" technique for running a process in the background (the&) with no HangUP if you log out: $ nohup python -c "import sys,os; print os.isatty(sys.stdout.fileno())"& appending output to nohup.out $ cat nohup.out False But that

Re: Python without a tty

2011-10-02 Thread Hans Mulder
On 3/10/11 06:37:43, Steven D'Aprano wrote: On Fri, 30 Sep 2011 21:09:54 +0100, Nobody wrote: On Thu, 29 Sep 2011 11:53:12 +0200, Alain Ketterlin wrote: I have a Python script which I would like to test without a tty attached to the process. I could run it as a cron job, but is there an easie

Re: Python without a tty

2011-10-03 Thread Hans Mulder
On 3/10/11 08:10:57, Hegedüs, Ervin wrote: hello, On Mon, Oct 03, 2011 at 04:37:43AM +, Steven D'Aprano wrote: I wanted to ensure that it would do the right thing when run without a tty, such as from a cron job. If you fork() your process, then it will also loose the tty... Errhm, I su

Re: compare range objects

2011-10-20 Thread Hans Mulder
On 20/10/11 18:22:04, Westley Martínez wrote: On Thu, Oct 20, 2011 at 06:19:40AM -0700, Yingjie Lan wrote: Hi, Is it possible to test if two range objects contain the same sequence of integers by the following algorithm in Python 3.2? 1. standardize the ending bound by letting it be the first

Re: Problem using execvp

2011-10-27 Thread Hans Mulder
On 27/10/11 10:57:55, faucheuse wrote: I'm trying to launch my python program with another process name than "python.exe". Which version of Python are you using? Which version of which operating system? In order to do that I'm trying to use the os.execvp function : os.execvp("./Launch.py", [

Re: all() is slow?

2011-11-09 Thread Hans Mulder
On 9/11/11 02:30:48, Chris Rebert wrote: Burn him! Witch! Witch! Burn him! His code turned me into a newt! -- Sent nailed to a coconut carried by swallow. Is that a European swallow or an African swallow? -- HansM -- http://mail.python.org/mailman/listinfo/python-list

Re: How to insert my own module in front of site eggs?

2011-11-18 Thread Hans Mulder
On 18/11/11 03:58:46, alex23 wrote: On Nov 18, 11:36 am, Roy Smith wrote: What if the first import of a module is happening inside some code you don't have access to? No import will happen until you import something. That would be the case if you use the '-S' command line option. Otherwis

Re: Reading twice from STDIN

2011-12-01 Thread Hans Mulder
On 2/12/11 03:46:10, Dan Stromberg wrote: You can read piped data from sys.stdin normally. Then if you want something from the user, at least on most *ix's, you would open /dev/tty and get user input from there. 'Not sure about OS/X. Reading from /dev/tty works fine on OS/X. -- HansM -- ht

Re: Reading twice from STDIN

2011-12-02 Thread Hans Mulder
On 2/12/11 10:09:17, janedenone wrote: I had tried sys.stdin = open('/dev/tty', 'r') That seems to work for me. This code: import sys if sys.version_info.major == 2: input = raw_input for tp in enumerate(sys.stdin): print("%d: %s" % tp) sys.stdin = open('/dev/tty', 'r') answer = i

Re: Single key press

2011-12-06 Thread Hans Mulder
On 6/12/11 09:48:39, Steven D'Aprano wrote: On Tue, 06 Dec 2011 10:19:55 +0430, Sergi Pasoev wrote: Hi. I wonder if it is realistic to get a single key press in Python without ncurses or any similar library. In single key press I mean something like j and k in Gnu less program, you press the k

Re: Obtaining user information

2011-12-09 Thread Hans Mulder
On 10/12/11 02:44:48, Tim Chase wrote: Currently I can get the currently-logged-in-userid via getpass.getuser() which would yield something like "tchase". Is there a cross-platform way to get the full username (such as from the GECOS field of /etc/passed or via something like NetUserGetInfo on W

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Hans Mulder
On 21/12/11 01:03:26, Ian Kelly wrote: As type conversion functions, bool(x) and int(x) should *always* return bools and ints respectively > (or raise an exception), no matter what you pass in for x. That doesn't always happen in 2.x: >>> type(int(1e42)) This was fixed in 3.0. -- HansM -- h

Re: Why does this launch an infinite loop of new processes?

2011-12-22 Thread Hans Mulder
On 21/12/11 21:11:03, Andrew Berg wrote: On 12/21/2011 1:29 PM, Ethan Furman wrote: Anything that runs at import time should be protected by the `if __name__ == '__main__'` idiom as the children will import the __main__ module. So the child imports the parent and runs the spawn code again? That

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-22 Thread Hans Mulder
On 22/12/11 14:12:57, Steven D'Aprano wrote: On Thu, 22 Dec 2011 06:49:16 -0500, Neal Becker wrote: I agree with the OP that the current syntax is confusing. The issue is, the meaning of * is context-dependent. Here you are complaining about an operator being "confusing" because it is contex

Re: program with raw_input prompt behaves differently after compile

2005-12-24 Thread Hans Nowak
-a-exe-text-color-187633.html The solution described here was to compile the program as a console app, rather than a Windows app. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-28 Thread Hans Nowak
Robert Kern wrote: > PyPy will not bring about the Singularity. But if it did, imagine how cool that would look on the developers resumes... :-) -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question on Parameters...

2005-12-28 Thread Hans Nowak
eColor=(1.0, 1.0, 1.0, 1.0), fillColor=(0.0, 0.0, 0.0, 0.25)): r, g, b, a = outlineColor fr, fg, fb, fa = fillColor ...do something with these values... -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: questions about py2exe and wax

2005-12-30 Thread Hans Nowak
future releases of Wax...) Feel free to contact me by private mail if you need more help. Cheers, -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-31 Thread Hans Nowak
to me that the end of the expression ... for u in(3,14,10)) can be written as: ... for u in 3,14,10) which would shave off a character. Tuples don't always need parentheses... -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-31 Thread Hans Nowak
André wrote: > Hans Nowak wrote: > >>André wrote: > > >>I don't know if this suggestion has been made already, but it seems to >>me that the end of the expression >> >> ... for u in(3,14,10)) >> >>can be written as: >> &

Re: Python or Java or maybe PHP?

2006-01-02 Thread Hans Nowak
generator. (Or is this behavior different in Python 2.5? I hope not...) -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-03 Thread Hans Nowak
ject_id => 2469 irb(main):036:0> x.object_id => 2469 irb(main):041:0> y = 1000 => 1000 irb(main):042:0> y.object_id => 2001 irb(main):043:0> y += 234 => 1234 irb(main):044:0> y.object_id => 2469 I am not an expert on Ruby internals, but it looks like these integers are cached. As with Python, I don't know if one can count on this behavior to happen always. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-09 Thread Hans Nowak
derstand why some people > have problems entering that same environment and privileged conditions > as yourself. This attitude is very common and needs only some kind > Blair-alike kind of selfhypnosis in order to effectively not being aware > of lying. Tony Blair, or the Blair Witch

Re: Spelling mistakes!

2006-01-11 Thread Hans Nowak
t attribute is of any importance. Otherwise there's a loophole in your tests. :-) -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic sequences in Python

2006-01-19 Thread Hans Nowak
ve liked to say that lists are a fundamental data type, much more so than a set... but in reality that seems to be a matter of taste and priorities. Pascal, for example, has a set literal, but no list literal; in fact, it doesn't even have a built-in list type. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Wax: problem subclassing TextBox

2006-10-18 Thread Hans Nowak
98 > on char 98 > on char 99 > on char 99 > on char 100 > on char 100 Heh, that's a bug. As a temporary solution, go to textbox.py and comment out the line in the __events__ dict that says 'Char': wx.EVT_CHAR. I will need to fix the way Wax handles events like these; this will probably be solved in the next release. -- Hans Nowak http://zephyrfalcon.org/ -- http://mail.python.org/mailman/listinfo/python-list

Pyrex: problem with blanks in string

2007-06-04 Thread Hans Terlouw
nit__(self): pass When I substitute the blanks in the string for something else, then the problem disappears: class Axis: axtype = "unknown_type_of_axis" def __init__(self): pass Does anybody have an idea? Hans Terlouw -- http://mail.python.org/mailman/listinfo/python-list

How to print the variable?

2007-02-14 Thread Hans Schwaebli
Hi, am am a Python beginner with Java knowledge background. Infact I need to use Jython. My first beginner question is how to determine of what type a variable is? In program which supports Jython there is a variable called "rc" available. I can use the methods on that variable

Version 0.6.0 of CodeInvestigator

2007-11-08 Thread Hans Moleman
CodeInvestigator version 0.6.0 was released on November 8. This version adds support for input() and raw_input() functions. The main changes: * The 'Details' button on the file selection screen gives access to statistics, stdin and stdout for the running program. Control Z an

DBApi Question with MySQL

2007-12-12 Thread Hans Müller
llion rows) insert a lot of new date in these tables (also about 2 million lines) commit all changes, so all changes become visible here and only here. Thanks a lot, Greetings Hans -- http://mail.python.org/mailman/listinfo/python-list

How to read a binary file into a mysql table

2007-12-14 Thread Hans Müller
; at row 1 The blob data is actually chopped. The Table has two columns, char(100), blob Has someone a working idea how to get binary file into a blob using MySQLdb and python ?! System is SuSE 10.0 Linux with python 2.5.1, current MySQLdb version, MySQL is: 5.0.26 Thanks a lot! Greetings Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: How to read a binary file into a mysql table

2007-12-18 Thread Hans Müller
Sorry, I found the mistake: There is more than one blob type, blob as a default stores only 64k of data. LONGBLOB has a 4G limit which is Ok for my purposes. Happy Christmas to all, Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: How to read a binary file into a mysql table

2007-12-18 Thread Hans Müller
solve this ? Greetings Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: at what complexity, a comparison fails ?

2007-12-31 Thread Hans Nowak
her undefined (or ill-defined) comparison methods, so that the overall list comparison does not do what you expect. I'm not sure what ndarray and color are, but check their comparison methods (you know, __cmp__, __lt__, __eq__, etc). (If that isn't clear, please see http://effbot.org/pyref/__lt__.htm.) --Hans -- http://mail.python.org/mailman/listinfo/python-list

Problem with format string and unicode

2008-03-28 Thread Hans Martin
Hi, this is probably a trivial problem, but a google search for "python" and "unicode" and" format string" gives too many hits: If I specify e.g. "%20s" in a format string and the string value contains UTF-8 stuff (differing number of bytes per character), the length of the resulting string (in ch

Anoying unicode / str conversion problem

2009-01-26 Thread Hans Müller
dinal not in range(128) Please help, how can I convert ANY column data to a string which is usable as a key to a dictionary. The purpose of using a dictionary is to find equal rows in some database tables. Perhaps using a md5 hash from the column data is also an idea ? Thanks a lot in advance, Hans. -- http://mail.python.org/mailman/listinfo/python-list

Re: Anoying unicode / str conversion problem

2009-01-26 Thread Hans Müller
simplified code. Again, thanks for the hint! Greetings Hans -- http://mail.python.org/mailman/listinfo/python-list

Set & Frozenset?

2009-03-08 Thread Hans Larsen
cerning a set or frozenset! hope somebody can help! -- Hans Larsen Galgebakken Sønder 4-11A DK-2620 Albertslund Danmark/Danio begin 666 Hans Larsen.vcf M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DQA-- http://mail.python.org/mailman/listinfo/python-list

RE: best way to compare contents of 2 lists?

2009-04-23 Thread Hans DushanthaKumar
'set' comes to mind, though I'm not sure if there are performance inplications with large amopunts of data. >>> a=[1, 2, 3] >>> b=[2, 3, 1] >>> set(a) == set(b) True Cheers, Hans -Original Message- From: python-list-bounces+hans.dushanthakumar

RE: sorting two corresponding lists?

2009-04-23 Thread Hans DushanthaKumar
Just being pedantic here :) [items[x] for x in [i for i in map(values.index, new_values)]] Is the same as [items[x] for x in map(values.index, new_values)] -Original Message- From: python-list-bounces+hans.dushanthakumar=hcn.com...@python.org [mailto:python-list-bounces+hans.dushantha

Re: Can I get a technical explanation on the following error

2009-05-24 Thread Hans Müller
Try this: print "\\" \ is the escape character, it masks the meaning of the next chararcter. If you write print "\" python tries to print " (the meaning of " as the string delimiter is beeing masked) and finds no closing " This is why you got the er

Seach for encrypted socket wrapper

2009-06-02 Thread Hans Müller
server but this seems quite fat. Better ideas ?! Importand is also that the C-Lib on the cobol side should be coded as simple as possible. Platforms: Windows, *ix Thanks a lot. Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: save dictionary for later use?

2008-05-16 Thread Hans Nowak
'other': 17, 'that': 101} If you want to store to / restore from file, use 'dump' and 'load': # write to file 'out'... >>> f = open("out") >>> f = open("out", "wb") >>> pickle.dump(d, f) >

Re: can't delete from a dictionary in a loop

2008-05-16 Thread Hans Nowak
ol of processes... I'll leave it others, presumably more knowledgable, to comment on that. :-) But I can tell you how to solve the immediate problem: for pid in procs_dict.keys(): ... Hope this helps! --Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: can't delete from a dictionary in a loop

2008-05-16 Thread Hans Nowak
[EMAIL PROTECTED] wrote: On 16 mai, 23:34, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: On 16 mai, 23:28, Hans Nowak <[EMAIL PROTECTED]> wrote: Dan Upton wrote: for pid in procs_dict: (snip) for pid in procs_dict.keys(): I'm afraid this will do the same e

Re: SImple python print question

2008-05-16 Thread Hans Nowak
to sys.stdout, which is buffered, and may not be displayed immediately (because it's held in the buffer). To force the output to be displayed, use flush(): print "-#- executing: %s" % section, sys.stdout.flush() ...tests here... Hope this helps! --Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: Classmethods are evil

2008-05-17 Thread Hans Nowak
this was what people did before they came along in 2.2). Personally, I don't use them... but some people like them. Different strokes, and all that... --Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: 2 different versions of python compiling files.

2008-05-22 Thread Hans Nowak
this: >>> import foo Traceback (most recent call last): File "", line 1, in ? ImportError: Bad magic number in foo.pyc I'm not sure what would happen if multiple Pythons try to write a .pyc file at the same time, though... -- Hans Nowak (zephyrfalcon at gmail dot org) ht

Problem with subprocess and mkstemp

2008-05-28 Thread Hans Larsen
lly. Does anyone know of this problem? Is there a workaround? A fix, maybe? We're using temporary files because a pipe hangs out with large output, such as this one. Thanks a lot, Hans Larsen -- My definition of an expert in any field is a person who knows enough about what'

Re: Code execution in imported modules

2008-05-29 Thread Hans Nowak
;d like to compile it once. It is compiled when you import the module. -- Hans Nowak (zephyrfalcon at gmail dot com) http://4.flowsnake.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: accumulator generators

2008-05-30 Thread Hans Nowak
e the second example tries to do) would not be OK. Also see: http://zephyrfalcon.org/labs/python_pitfalls.html (pitfall #6). -- Hans Nowak (zephyrfalcon at gmail dot com) http://4.flowsnake.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Hans Nowak
odule, etc. So in this case, not telling them that the attributes exist, will not stop them from finding out. -- Hans Nowak (zephyrfalcon at gmail dot com) http://4.flowsnake.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Harry Potter?

2008-06-05 Thread Hans Nowak
. If you scan the alt.fan.harry-potter archives carefully, you will find at least one well-known Python core developer. :-) -- Hans Nowak (zephyrfalcon at gmail dot com) http://4.flowsnake.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question, list comprehension

2008-06-06 Thread Hans Nowak
, you can just use a slice, as localtime is a tuple: fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % localtime[:6] Hope this helps! ^_^ -- Hans Nowak (zephyrfalcon at gmail dot com) http://4.flowsnake.org/ -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   >