I don't quite understand this error...

2007-02-26 Thread Alexander Orchard
I'm trying to create a simple accounting system based off of an example GUI. The coding is as follows: #!/usr/bin/python from Tkinter import * from os import urandom from twisted.internet import tksupport from twisted.internet import reactor from accounts import accountlist def whichSelected ()

[ANN] mlabrap-1.0b: a high level python to matlab bridge

2007-02-27 Thread Alexander Schmolck
URL --- Description --- Mlabwrap-1.0 is a high-level python to matlab(tm) bridge that makes calling matlab functions from python almost as convenient as using a normal python library. It is available under a very liberal license (BSD/MIT) and should work

PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Alexander Tuchacek
hallo, i try to adress an qt object self.statusbar.showMessage("rtt %s" % (n.rtt)) in an callback function, comming from a shared lib importet by ctypes, on osx this works wonderfull when i run the same code on linux (ubuntu gutsy), i get this core dump, ok, i understand that the problem

Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Alexander Tuchacek
David Boddie wrote: > You can either construct some sort of event handling mechanism or use > signals and slots. Personally, I'd use signals and slots for this, if > possible. > > The idea would be to set up a connection between your callback code and > the status bar's showMessage() slot. Then y

Problems with import

2007-12-04 Thread Alexander Dietz
Hi, I have some problems when importing a library. Suppose I have a directory /home/user/pythonlib/package in which I have a python-library called test.py. Now I want to import that, so I put the following directory into the PYTHONPATH: /home/user/pythonlib and in my main python script I put: fro

Re: Problems with import

2007-12-04 Thread Alexander Dietz
Aaah, this it it! Thank you very much... Alex On Dec 4, 2007 11:49 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Hi, > > > > I have some problems when importing a library. Suppose I have a > > directory /home/user/pythonlib/package in which I have a python- >

Re: Finite State Machine GUI editor in python?

2007-12-17 Thread Alexander Schliep
tput at this stage. In case nothing better comes up and you want to code it yourself: Our Hidden Markov Model library GHMM (http://ghmm.org) has a graphical editor with XML output. Maybe http://networkx.lanl.gov/ or other general Python graph packages have what you want. Also check out http://www.gr

Re: Calling Python from Matlab

2006-04-23 Thread Alexander Schmolck
"Daniel Nogradi" <[EMAIL PROTECTED]> writes: > > I am desperately looking for a way to call Python from Matlab. I have become > > used to Python's rich syntax and large number of libraries, and feel > > ridiculously clumsy being stuck with Matlab's rather restricted facilities > > for doing other

Re: NaN handling

2006-05-06 Thread Alexander Schmolck
Robert Kern <[EMAIL PROTECTED]> writes: > Ivan Vinogradov wrote: > > > It doesn't seem to be here under OSX either (universal Python install). > > It's not enabled by default. In the source distribution, it is > Modules/fpectlmodule.c . > > > Since numpy seems to be working on a variety of plat

Re: NaN handling

2006-05-06 Thread Alexander Schmolck
Felipe Almeida Lessa <[EMAIL PROTECTED]> writes: > Em Sex, 2006-05-05 às 16:37 -0400, Ivan Vinogradov escreveu: > > This works to catch NaN on OSX and Linux: > > > > # assuming x is a number > > if x+1==x or x!=x: > > #x is NaN > > This works everywhere: > > nan = float('nan') > > . > . >

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alexander Schmolck
[trimmed groups] Ken Tilton <[EMAIL PROTECTED]> writes: > yes, but do not feel bad, everyone gets confused by the /analogy/ to > spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief > period I swore off the analogy because it was so invariably misunderstood. > Even Graham mis

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Alexander Schmolck
Bill Atkins <[EMAIL PROTECTED]> writes: > Here's how one of the cells examples might look in corrupted Python > (this is definitely not executable): > > class FallingRock: > def __init__(self, pos): > define_slot( 'velocity', lambda: self.accel * self.elapsed ) > define_slot( 'p

Re: Matplotlib in Python vs. Matlab, which one has much better graphical pressentation?

2006-05-11 Thread Alexander Schmolck
N/A <[EMAIL PROTECTED]> writes: > Hi all, > > Can I have your opinions on Matlab vs. Matplotlib in Python in terms of 2D and > 3D graphical presentation please. > > > Matplotlib in Python vs. Matlab, which one has much better graphical > pressentation? As far as 2D plots are concerned I think

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
jayessay <[EMAIL PROTECTED]> writes: > "Michele Simionato" <[EMAIL PROTECTED]> writes: > > > I was interested in a proof of concept, to show that Python can > > emulate Lisp special variables with no big effort. > > OK, but the sort of "proof of concept" given here is something you can > hack up

Re: New tail recursion decorator

2006-05-12 Thread Alexander Schmolck
Duncan Booth <[EMAIL PROTECTED]> writes: > Tim N. van der Leeuw wrote: > > > The other thing I do not understand, due to my limited understanding of > > what is tail-recursion: factorial2 (Duncan's definition) is not proper > > tail-recursion. Why not? How does it differ from 'real' tail recursio

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
Ken Tilton <[EMAIL PROTECTED]> writes: > In Common Lisp we would have: > > (defvar *x*) ;; makes it special > (setf *x* 1) > (print *x*) ;;-> 1 > (let ((*x* 2)) >(print *x*)) ;; -> 2 > (print *x*) ;; -> 1 You seem to think that conflating special variable binding and

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
Ken Tilton <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > jayessay <[EMAIL PROTECTED]> writes: > > > > >>"Michele Simionato" <[EMAIL PROTECTED]> writes: > >> > >> > >>>I was interested in a proo

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
Duane Rettig <[EMAIL PROTECTED]> writes: > Alexander Schmolck <[EMAIL PROTECTED]> writes: > > > Ken Tilton <[EMAIL PROTECTED]> writes: > > > >> In Common Lisp we would have: > >> > >> (defvar *x*) ;; makes it special > >

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
Duane Rettig <[EMAIL PROTECTED]> writes: > My reason for responding to you in the first place was due to your poor use > of the often misused term "bug". You could have used many other words or > phrases to describe the situation, and I would have left any of those alone. I'm happy to accept you

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
jayessay <[EMAIL PROTECTED]> writes: > > Great -- so can I see some code? Can't be that difficult, it takes about > > 10-15 > > lines in python (and less in scheme). > > Do you actually need the code to understand this relatively simple concept??? Yes. I'd be genuinely curious to see how an imp

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Alexander Schmolck
Ken Tilton <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > Ken Tilton <[EMAIL PROTECTED]> writes: > > > > >>In Common Lisp we would have: > >> > >>(defvar *x*) ;; makes it special > >>(setf *x* 1) >

Re: round numbers in an array without importing Numeric or Math?

2006-05-16 Thread Alexander Schmolck
Lance Hoffmeyer <[EMAIL PROTECTED]> writes: > Is there an easy way to round numbers in an array? > > I have > Test = [1.1,2.2,3.7] > > and want to round so the values are > > print Test [1,2,4] [int(x+0.5) for x in Test] 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Alexander Kozlovsky
t; > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 This recipe is what is stated in its name - "collector of a bunch of named stuff". It is not suitable for elaborate classes with many methods (such as SQLTable), for above mentioned reason - name cluttering betwee

Re: dict!ident as equivalent of dict["ident"]

2006-05-22 Thread Alexander Kozlovsky
ude > So your ! is limited not only to dicts Not only to dict, but to any class with __getitem__ or __setitem__ methods -- Best regards, Alexander mailto:[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: string.count issue (i'm stupid?)

2006-05-22 Thread Alexander Schmolck
"Dirk Hagemann" <[EMAIL PROTECTED]> writes: > I think I can tell you WHY this happens, but I don't know a work-around > at the moment. len(re.findall('_(?=a_)', '_a_a_a_a_')) # untested def countWithOverlaps(s, pat): return len(re.findall("%s(?=%s)" % (re.escape(pat[0]), re.escape(pat[1:]))

COM Server crashing when returning large arrays

2006-05-22 Thread Alastair Alexander
Hi ... I'm using pythoncom to create a python COM server application that needs to be able to return large arrays to COM client apps. For example, I need to be able to return an array to Excel that is 500 by 10, with each element of the array holding a 32 byte string. If I run the code for smal

Re: COM Server crashing when returning large arrays

2006-05-24 Thread Alastair Alexander
Thanks for the replies Tim & Stefan I'm using Python 2.3.5 on XP and the PythonWin build number seems to be 201 ... I'll see if I can find 207. The following blows up on both an XP and Win2k box ... both have same build of Python and PythonWin: import sys clas

Re: COM Server crashing when returning large arrays

2006-05-24 Thread Alastair Alexander
n > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Alastair Alexander > Sent: Monday, May 22, 2006 6:27 PM > To: python-list@python.org > Subject: COM Server crashing when returning large arrays > > Hi ... I'm using python

PyGILState_Ensure() produces a deadlock

2008-02-07 Thread Alexander Eisenhuth
Hello, In my mixed C++ / Python Application there are situations where a PyGILState_STATE gil_state = PyGILState_Ensure() produces a deadlock. The background is that a call fro python to cpp is directed to another subsystem that tries to access the GIL (through my C++ wrapper) from another thr

boost.python Event object wrapped with bp::object()

2008-02-13 Thread Alexander Eisenhuth
Event = event ... methodeCalled = true ... } ThreadClass::threadLoop() { ... if (methodeCalled) { ... this->myEvent.attr("set")(); } } The application crashes. If I comment out event.wait() it doesn't crash. Any suggestions or experiances?

Turtle graphics speed(). Seems broken

2008-02-15 Thread Alexander . Oot
I think the speed function may be broken from the turtle graphics package "from turtle import * speed('fastest') forward(50)" I have tried all of the different speed settings, but I get no change in the turtle's speed does anyone know how to fix this? -- http://mail.python.org/mailman/li

Re: AssertionError not caught?

2009-02-01 Thread Alexander Kain
Thank you for restoring sanity to my world! Indeed, it seems to have to do with the way that the WingIDE debugger works - it actually catches the error correctly , but it -->sets a breakpoint at the original raise first<---. This only occurs for the AssertionError. The debugger can then be

initialized list: strange behavior

2008-11-24 Thread alexander . genkin
Hi Python experts! Please explain this behavior: >>> nn=3*[[]] >>> nn [[], [], []] >>> mm=[[],[],[]] >>> mm [[], [], []] Up till now, 'mm' and 'nn' look the same, right? Nope! >>> mm[1].append(17) >>> mm [[], [17], []] >>> nn[1].append(17) >>> nn [[17], [17], [17]] ??? Python 2.5 Win XP Thank

Re: initialized list: strange behavior

2008-11-25 Thread alexander . genkin
The issue is exhausted in Python Library Reference, Chapter 3.6, so I should apologize for initial posting. All comments were helpful, though Arnaud and Steve are right that pass-by-anything is off the point. Thanks All! -- http://mail.python.org/mailman/listinfo/python-list

Re: Inefficient summing

2008-10-09 Thread Alexander Schmolck
beginner <[EMAIL PROTECTED]> writes: > Hi All, > > I have a list of records like below: > > rec=[{"F1":1, "F2":2}, {"F1":3, "F2":4} ] > > Now I want to write code to find out the ratio of the sums of the two > fields. > > One thing I can do is: > > sum(r["F1"] for r in rec)/sum(r["F2"] for r in re

Re: Inefficient summing

2008-10-10 Thread Alexander Schmolck
beginner <[EMAIL PROTECTED]> writes: > On Oct 9, 3:53 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: >> beginner <[EMAIL PROTECTED]> writes: >> how about: >> >> ratio = (lambda c: c.real/c.imag)(sum(complex(r["F1"], r["F2"]

[ANN] mlabwrap-1.0.1 released

2009-03-24 Thread Alexander Schmolck
Mlabwrap allows pythonistas to interface to Matlab(tm) in a very straightforward fashion: >>> from mlabwrap import mlab >>> mlab.eig([[0,1],[1,1]]) array([[-0.61803399], [ 1.61803399]]) More at . Mlabwrap 1.0.1 is just a maintenance release

Re: Unit testing frameworks

2009-03-30 Thread Alexander Draeger
Hi, I'm work on a testing framework for Python. Until now I have implemented the main features of PyUnit and JUnit 4.x. I like the annotation syntax of JUnit 4.x and it's theory concept is great therefore you can imagine how my framework will be. I plan a lot of additionally features which are n

Re: Separators inside a var name

2008-06-09 Thread Alexander Schmolck
Rainy <[EMAIL PROTECTED]> writes: > I have a stylistic question. In most languages words in var. name are > separated by underscores or cap letters, resulting in var names like > var_name, VarName and varName. I don't like that very much because all > 3 ways of naming look bad and/or hard to type.

Re: how to indent/dedent a region in emacs?

2008-06-11 Thread Alexander Schmolck
Grant Edwards <[EMAIL PROTECTED]> writes: > I've recently switched from Jed to Emacs for editing python > source, and I'm still stumped as to how one indents or dedents > a region of code. In Jed it's 'C-c <' or 'C-c >'. Google has > found several answers, but none of them work, for example I've

Re: python-mode is missing the class browser

2008-08-07 Thread Alexander Schmolck
Michele Simionato <[EMAIL PROTECTED]> writes: > I have noticed that the python-mode for Emacs that comes with the > latest Ubuntu is missing the class browser. Moreover if works > differently from the python-mode I was used to (for instance CTRL-c-c > works as CTRL-c-! whereas CTRL-c-! is missing,

Re: python-mode is missing the class browser

2008-08-08 Thread Alexander Schmolck
"Adam Jenkins" <[EMAIL PROTECTED]> writes: > On Fri, Aug 8, 2008 at 7:32 AM, Michele Simionato > <[EMAIL PROTECTED]> wrote: >> On Aug 7, 5:55 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > ... >> >> I have solved by using ipython.el wh

Re: is +=1 thread safe

2008-05-03 Thread Alexander Schmolck
AlFire <[EMAIL PROTECTED]> writes: >> The threading module already has a function to return the number of Thread >> objects currently alive. > > I have threads within threads - so it does not suit me :-(. How about using a scalar numpy array? They are mutable, so I assume that x += 1 should be at

Re: is +=1 thread safe

2008-05-04 Thread Alexander Schmolck
Gary Herron <[EMAIL PROTECTED]> writes: > But... It's not! > > A simple test shows that. I've attached a tiny test program that shows this > extremely clearly. Please run it and watch it fail. In [7]: run ~/tmp/t.py final count: 200 should be: 200 (I took the liberty to correct yo

Re: is +=1 thread safe

2008-05-04 Thread Alexander Schmolck
Gary Herron <[EMAIL PROTECTED]> writes: > The test was meant to simulate the OP's problem, but even with your suggestion > of using numpy, it *still* fails! Well, although I haven't tested it extensively, it doesn't appear to fail for me, with numpy 1.02 and an AMD Athlon(tm) XP 2800+ under lin

Re: Programmatically exit the REPL

2008-08-26 Thread Alexander Schmolck
Without reading your post properly or having tried to do the same thing myself: I think you might want to have a look at ipython; it gives a better REPL and "embedding ipython" should give you plenty of hits as well. Matthew Fitzgibbons <[EMAIL PROTECTED]> writes: > I've got a pretty complex inte

Re: Numeric literal syntax

2008-09-03 Thread Alexander Schmolck
Ben Finney <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: > >> For Python 2.7/3.1 I'd now like to write a PEP regarding the >> underscores into the number literals, like: 0b_0101_, 268_435_456 >> etc. > > +1 on such a capability. > > -1 on underscore as the separator. > > When you pro

Re: Numeric literal syntax

2008-09-04 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 04 Sep 2008 01:22:22 +0100, Alexander Schmolck wrote: > >> It seems to me that the right choice for thousands seperator is the >> apostrophe. > > You mean the character already used as a string delimiter?

Re: Numeric literal syntax

2008-09-04 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > A problem is that '1234' in Python is a string, so using ' in numbers > looks a bit dangerous to me (and my editor will color those numbers as > alternated strings, I think). Yeah, editors, especially those with crummy syntax highlighting (like emacs) might get it wron

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-20 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > (defun >> (val num-bytes) > "Right-shift positive integer val by num-bytes" > (floor (/ val (expt 2 num-bytes or just (floor val (expt 2 num-bytes)) 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-22 Thread Alexander Schmolck
Mark Carter <[EMAIL PROTECTED]> writes: > A programmers mindset is usually geared towards "writing applications". What > I'm currently doing in Lisp is building up functions as I need them. Using > emacs, I can just C-x C-e to make my functions "live", and when it's time to > stop for the day, save

Re: Dice probability problem

2006-04-04 Thread Alexander Schmolck
Tomi Lindberg <[EMAIL PROTECTED]> writes: > I'm trying to find a way to calculate a distribution of outcomes with any > combination of dice. I have the basics done, but I'm a bit unsure how to > continue. My main concern is how to make this accept any number of dice, > without having to write a ne

Re: Dice probability problem

2006-04-04 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > addDice(resultFor1, pool[1]) > addDice(pool[0], pool[1]) sorry should have spelled out that successive lines are meant to be equivalent, i.e. addDice(resultFor1, pool[1]) == addDice(pool[0], pool[1])

Re: Dice probability problem

2006-04-05 Thread Alexander Schmolck
Tomi Lindberg <[EMAIL PROTECTED]> writes: > # Adds another die to results. > def add_dice(sums, die): > # If first die, all values appear once I'd add something like sums = sums or {} because otherwise your function will sometimes mutate sums and sometimes return a fresh object, whi

Re: Automated Graph Plotting in Python

2006-04-09 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > 1. Which is the best graph plotting utility in python or linux. matplotlib (provided it does the type of graphs you need, which is likely) 'as -- http://mail.python.org/mailman/listinfo/python-list

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

2006-04-11 Thread Alexander Myodov
IA in Python, any capability to localize the lifetime of variables on a level less than a function, and this is indeed not gonna happen to change yet? -- With best regards, Alexander mailto:[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re[2]: RIIA in Python 2.5 alpha: "with... as"

2006-04-11 Thread Alexander Myodov
Hello Duncan, You wrote: > Alexander Myodov wrote: >> So, with 2.5, I tried to utilize "with...as" construct for this, but >> unsuccessfully: >> ... >> So, does this mean that we still don't have any kind of RIIA in >> Python, any capability to

Total maximal size of data

2010-01-25 Thread Alexander Moibenko
I have a simple question to which I could not find an answer. What is the total maximal size of list including size of its elements? I do not like to look into python source. Here is a code example: import struct KB=1024 MB=KB*KB GB=MB*KB buf=[] bs=32*KB n=4*GB/bs print "N",n i=0 size=0L while i <

(pywin related) pywintypes.com_error: -2147417846 "Application busy"

2009-11-25 Thread Alexander Eisenhuth
ed. [...]" As this part of the COM API (IMessageFilter, CoRegisterMessageFilter) isn't included in pywin32 I don't see a possibility to do that, or? Did anybody else have to deal with that problem? Any hints are very welcome. Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: (pywin related) pywintypes.com_error: -2147417846 "Application busy"

2009-11-25 Thread Alexander Eisenhuth
I don't think so, because it happens very rarely Michel Claveau - MVP schrieb: Hi! Your computer is too slow, for launch Excel. Configure the machine for more speed... @+ -- http://mail.python.org/mailman/listinfo/python-list

Python eCommerce, small webshop

2010-03-12 Thread Alexander Kapps
Hello everybody! I have to set up a small webshop for used books, CDs, DVD, and stuff and did't find anything realy usefull on google. I'm pretty skilled with Python and would strongly prefer a Python based Shop but all I've found are in early stage, unmaintained or too limited. I've look

Python eCommerce, small webshop

2010-03-12 Thread Alexander Kapps
Hello everybody! I have to set up a small webshop for used books, CDs, DVD, and stuff and did't find anything realy usefull on google. I'm pretty skilled with Python and would strongly prefer a Python based Shop but all I've found are in early stage, unmaintained or too limited. I've look

Re: Python eCommerce, small webshop

2010-03-12 Thread Alexander Kapps
Sorry, Emile for the private post, one beer too much and the wrong button... ;-) Emile van Sebille wrote: > On 3/12/2010 5:02 PM Alexander Kapps said... >> Hello everybody! >> >> I have to set up a small webshop for used books, CDs, DVD, and stuff and >> did'

Re: Raw Unicode docstring

2010-11-16 Thread Alexander Kapps
On 16.11.2010 22:56, Boštjan Mejak wrote: Hello, how does one write a raw unicode docstring? If I have backslashes in the docstring, I must tuck an 'r' in front of it, like this: r"""This is a raw docstring.""" If I have foreign letters in the docstring, I must tuck a 'u' in front of it, like t

Re: Is Unladen Swallow dead?

2010-11-17 Thread Alexander Kapps
On 17.11.2010 23:09, John Nagle wrote: On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspi wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference: "http://www.mtholyoke.edu/~ebarnes/python/dead-parrot.htm"; Thank y

Re: Program, Application, and Software

2010-11-17 Thread Alexander Kapps
On 17.11.2010 19:38, Boštjan Mejak wrote: What is the difference between a program, an application, and software? Program: A sequence of one or more instructions (even 'print "hello"' is a valid Python program) Application: Usually a large(er), complex program Software: The parts of a compu

Re: Raw Unicode docstring

2010-11-17 Thread Alexander Kapps
On 17.11.2010 06:14, John Machin wrote: On Nov 17, 9:34 am, Alexander Kapps wrote: >>> ur"Scheißt\nderBär\nim Wald?" Nicht ohne eine Genehmigung von der Umwelt Erhaltung Abteilung. The typical response around here is "Ja, aber nur wenn er Klopapier da

Re: Program, Application, and Software

2010-11-18 Thread Alexander Kapps
On 19.11.2010 01:26, MRAB wrote: On 19/11/2010 00:07, Steven D'Aprano wrote: On Thu, 18 Nov 2010 14:21:47 +, Martin Gregorie wrote: I use 'script' to refer to programs written in languages that don't have a separate compile phase which must be run before the program can be executed. IOW Py

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Tue, Nov 16, 2010 at 01:52:42PM -0800, Ian wrote: > The proper way to get the number of rows is to > use the COUNT aggregate function, e.g., "SELECT > COUNT(*) FROM TABLE1", which will return a > single row with a single column containing the > number of rows in table1. It's better to s

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
On Fri, Nov 19, 2010 at 01:14:34PM +0200, Alexander Gattin wrote: > On Tue, Nov 16, 2010 at 01:52:42PM -0800, Ian > wrote: > > The proper way to get the number of rows is to > > use the COUNT aggregate function, e.g., "SELECT > > COUNT(*) FROM TABLE1", which w

Re: strange subprocess behavior when calling ps

2010-11-19 Thread Alexander Gattin
Hello, On Wed, Nov 17, 2010 at 01:19:09AM -0800, Ned Deily wrote: > As far as I know, COMMAND_MODE has no special > meaning on other platforms UNIX_STD=2003 on HP-UX if anyone's interested... -- With best regards, xrgtn -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Fri, Nov 19, 2010 at 12:32:19PM +0100, Alain Ketterlin wrote: > Alexander Gattin writes: > > It's better to select count(1) instead of > > count(*). The latter may skip rows consisting > > entirely of NULLs IIRC. > > Wrong: count(anyname) ignores NULL,

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Fri, Nov 19, 2010 at 01:03:14PM +0100, Wolfgang Rohdewald wrote: > On Freitag 19 November 2010, Alexander Gattin wrote: > > It's better to select count(1) instead of > > count(*). not true, > > The latter may skip rows consisting > > entirely of NU

Re: Wanted: slow regexes

2010-12-08 Thread Alexander Gattin
Hello, On Mon, Dec 06, 2010 at 04:08:16AM +, MRAB wrote: > I'm looking for examples of regexes which are > slow (especially those which seem never to > finish) but whose results are known. does it have anything to do with http://swtch.com/~rsc/regexp/regexp1.html? -- With best regards, xrgt

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Alexander Kapps
On 11.12.2010 22:38, Stef Mientki wrote: On 11-12-2010 17:24, Martin Kaspar wrote: Hello commnity i am new to Python and to Beatiful Soup also! It is told to be a great tool to parse and extract content. So here i am...: I want to take the content of a-tag of a table in a html document. For ex

Re: stuck with Pexpect script need help!!

2010-12-12 Thread Alexander Kapps
On 12.12.2010 17:06, Emile van Sebille wrote: On 12/10/2010 10:02 PM Darshak Bavishi said... Pexpect is intended for UNIX-like operating systems.""") Can we use pexpect from windows host machine ?! I expect not... Emile According to [1] you might get it working with the Cygwin port o

Re: Wanted: slow regexes

2010-12-12 Thread Alexander Gattin
Hello, On Wed, Dec 08, 2010 at 04:24:02PM +, MRAB wrote: > Interestingly, that webpage says that: > > ("a" x 10) =~ /^(ab?)*$/ > > caused Perl to segfault. I tried it and it didn't segfault, but it > didn't match either It doesn't segfault but produces a warning with -w: xr...@xrgtn-

Re: Tkinter: The good, the bad, and the ugly!

2010-12-29 Thread Alexander Kapps
On 30.12.2010 00:58, rantingrick preached: Tkinter: The good, the bad, and the ugly! - An expose by rantingrick You are seriously starting to sound like Xah Lee. our beloved dictator (Mr. Van Rossum) had the foresight to include a simplistic GUI tool

Re: I am not able to verify the integrity of python.2.5.4.msi

2010-12-31 Thread Alexander Gattin
Hello, On Sun, Dec 26, 2010 at 05:44:22AM +0530, Varuna Seneviratna wrote: > > D:\Python>gpg --verify python-2.5.4.msi.asc > gpg: no valid OpenPGP data found. > gpg: the signature could not be verified. > Please remember that the signature file (.sig or .asc) > should be the first file given on th

Re: String building using join

2011-01-03 Thread Alexander Gattin
Hello, On Sun, Jan 02, 2011 at 10:11:50AM -0800, Alex Willmer wrote: > def prg3(l): > return '\n'.join([str(x) for x in l if x]) just one fix (one fix one fix one fix): return '\n'.join([str(x) for x in l if x is not None]) -- With best regards, xrgtn -- http://mail.python.org/mailman/

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Alexander Kapps
On 17.01.2011 21:04, Octavian Rasnita wrote: I say probably not considering the availability of 3rd party downloads. What say you, Python community? Available as 3rd party downloads: XML,HTML,... HTTP,FTP,SMTP,POP,IMAP/... MD5,SHA,... zip,bzip,... and so on and so on and so on. Remove them a

Re: UTF-8 question from Dive into Python 3

2011-01-17 Thread Alexander Kapps
On 17.01.2011 23:19, carlo wrote: Is it true UTF-8 does not have any "big-endian/little-endian" issue because of its encoding method? And if it is true, why Mark (and everyone does) writes about UTF-8 with and without BOM some chapters later? What would be the BOM purpose then? Can't answer yo

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Alexander Kapps
On 18.01.2011 09:58, Octavian Rasnita wrote: > From: "Alexander Kapps" >> On 17.01.2011 21:04, Octavian Rasnita wrote: >>> I say probably not considering the availability of 3rd party >>> downloads. What say you, Python community? >> >>

Re: Tkinter: The good, the bad, and the ugly!

2011-01-18 Thread Alexander Kapps
On 18.01.2011 21:23, Octavian Rasnita wrote: From: "Alexander Kapps" Tkinter causes damage? Very bad damage? What are you talking about? I am talking about the fact that Python promotes Tkinter, and many beginners will start using it, and they will start creating applications wi

Re: Short circuting

2011-01-21 Thread Alexander Kapps
On 22.01.2011 00:33, Ed Connell wrote: Hi, Consider the following please: (re_section, re_name, etc are previously compiled patterns) result1 = re_section.search(line); result2 = re_name.search(line); result3 = re_data1.se

Re: Short circuting

2011-01-21 Thread Alexander Kapps
On 22.01.2011 01:10, Alexander Kapps wrote: On 22.01.2011 00:33, Ed Connell wrote: Hi, Consider the following please: (re_section, re_name, etc are previously compiled patterns) result1 = re_section.search(line); result2 = re_name.search(line); result3 = re_data1.search(line); result4

Re: WxPython versus Tkinter.

2011-01-24 Thread Alexander Kapps
There are two completely different issues here: 1. Tyler's/Octavian's very valid (but AFAICT now somewhat over-expressed) point that Tk/Tkinter isn't accessible. I accept this, but don't see any point against Tk(inter) in this per se. Tk(inter) could be advanced to support screen readers and

Re: WxPython versus Tkinter.

2011-01-26 Thread Alexander Kapps
On 26.01.2011 18:04, Octavian Rasnita wrote: From: "Littlefield, Tyler" with JAWS because it is the most used screen reader. Get off your me soapbox. Jaws is not the most used. NVDA is taking over, quite fast, and lots of people have totally switched to mac or Vinux Lots of people means an in

Re: Return Statement

2011-01-26 Thread Alexander Kapps
On 26.01.2011 21:26, sl33k_ wrote: How does "return True" and "return False" affect the execution of the calling function? If only affects the calling function if you use the return value: def foo(): return True def bar1(): foo() # nothing difference, whether foo() returns True or Fal

Re: WxPython versus Tkinter.

2011-01-27 Thread Alexander Kapps
On 27.01.2011 19:33, rantingrick wrote: Please don't use the lower accessibility percentage to prop up the low Linux percentage in an attempt to win your argument. Because healthy Linux users ARE NOT equal to handicapped people! Please don't put words into my mouth, idiot. And read my complete

Re: How to create an entry in the "Program menu" of Windows?

2011-02-01 Thread Alexander Kapps
On 01.02.2011 22:43, Diesel wrote: Hi, I'd like to add menu entry in the Program Menu as part of the installation of an application. Is it possible to do that from Python? Any examples or link? I have not been able to find anything with google... thanks in advance s/ AFAIK, the startmenu e

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Alexander Gattin
Hello, On Thu, Feb 10, 2011 at 07:52:34AM +0100, Petter Gustad wrote: > r...@rpw3.org (Rob Warnock) writes: > > invocation was given only one arg!! IT FOUND > > THE PATTERN, BUT DIDN'T TELL ME WHAT > > !@^%!$@#@! FILE IT WAS IN!! :-{ > > Sounds frustrating, but grep -H will always > print the fi

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Alexander Gattin
Hello, On Tue, Feb 08, 2011 at 05:32:05PM +, Icarus Sparry wrote: > The key thing which makes this 'modern' is the > '+' at the end of the command, rather than '\;'. > This causes find to execute the grep once per > group of files, rather than once per file. many thanks to you, man! I'm surp

Re: file find skips first letter

2011-02-15 Thread Alexander Kapps
On 15.02.2011 19:32, Wanderer wrote: I'm using code def getFiles(self, fileBase): """return a list of the filenames in a director containing a base word """ allFiles = os.listdir(self.resultDir) baseFiles = [] for f in allFiles: if

Re: newbie question about PYTHONPATH

2011-02-15 Thread Alexander Kapps
On 15.02.2011 19:12, Panupat Chongstitwattana wrote: Panupat, please don't top-post, it messes the the natural order of the discussion. Thanks. I think the command line should look something along this line export PYTHONPATH=$HOME/foo/prog/learning_python/: with a colon at the end. Nope,

Re: Best way to gain root privileges

2011-02-16 Thread Alexander Kapps
On 16.02.2011 23:02, Ian Kelly wrote: On Wed, Feb 16, 2011 at 2:29 PM, Daniel Mahoney wrote: On Wed, 16 Feb 2011 21:26:26 +, GSO wrote: I'm sure this question is as old as time, but what is the best way to gain root privileges? (Am using Python 2.6.5, pygtk2 v2.16, Gtk v2.18.9, on RHEL6.

Re: Best way to gain root privileges

2011-02-16 Thread Alexander Kapps
On 17.02.2011 01:00, GSO wrote: OK, thanks for the tips. gksu* does not seem to be included with RHEL6 Desktop (though there is a package called beesu) On RHEL try consolehelper/userhelper instead which need additional configuration. The philosophy at the end of the day I think is do your

Re: Archiving Modules

2011-02-18 Thread Alexander Kapps
On 18.02.2011 19:51, Westley Martínez wrote: On Fri, 2011-02-18 at 04:55 -0800, peter wrote: On Feb 17, 9:55 pm, Jorgen Grahn wrote: RAR is a proprietary format, which complicates things. For example, Linux distributions like Debian cannot distribute software which handles it. If Python inc

Re: Best way to gain root privileges

2011-02-18 Thread Alexander Kapps
On 18.02.2011 15:22, Adam Skutt wrote: On Feb 18, 9:04 am, Ricardo Aráoz wrote: Many a time I have wanted to allow access to certain privileges to a user but *only* through a program. As far as security is concerned it would be enough that only root has permission to give the said program run

Re: Best way to gain root privileges

2011-02-18 Thread Alexander Kapps
On 18.02.2011 15:42, GSO wrote: I note that policykit was created by redhat, and that RHEL6 does not include gksudo in with its gnome for some odd reason. Don't know if this helps you, but at least for CentOS 5.4, gksudo is available in the gksu package from rpmforge. -- http://mail.python.o

<    1   2   3   4   5   6   >