Re: HELP!...Google SketchUp needs a Python API

2008-11-30 Thread Lie
On Nov 28, 1:52 pm, [EMAIL PROTECTED] wrote: > On Nov 27, 10:28 pm, r <[EMAIL PROTECTED]> wrote: > > > To think...that I would preach freedom to the slaves and be lynched > > for it...IS MADNESS! > > > Not one vote for Python, not a care. I think everyone here should look > > deep within their self

Re: HELP!...Google SketchUp needs a Python API

2008-12-06 Thread Lie
On Dec 3, 10:06 am, r <[EMAIL PROTECTED]> wrote: > "If we can laugh what else would we do" > > I'd like to touch also on some comments by ajaksu: > [ajaksu] > I'd like to try hacking some form of Python to work in SketchUp (on > top of Ruby, that is). Now, why won't I try to? I'm a Linux user and >

Re: "as" keyword woes

2008-12-06 Thread Lie
On Dec 7, 2:38 am, "Warren DeLano" <[EMAIL PROTECTED]> wrote: > > Date: Fri, 05 Dec 2008 22:22:38 -0800 > > From: Dennis Lee Bieber <[EMAIL PROTECTED]> > > Subject: Re: "as" keyword woes > > To: [EMAIL PROTECTED] > > Message-ID: <[EMAIL PROTECTED]> > > >    I'm still in the dark as to what type of

Re: Guido's new method definition idea

2008-12-06 Thread Lie
On Dec 7, 1:02 am, News123 <[EMAIL PROTECTED]> wrote: > What would be interesting would be some syntactical sugar to get rid of > the 'self' (at least in the code body). > > example: > class C: >     class_elements a,b,c,d > >     def method(self,arg): >         global d >         a,b,c = arg[0..3]

Re: Guido's new method definition idea

2008-12-06 Thread Lie
On Dec 6, 9:21 am, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > Hi folks, > > The story of the explicit self in method definitions has been > discussed to death and we all know it will stay. However, Guido > himself acknowledged that an alternative syntax makes perfect sense > and having both (

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Lie
On Oct 11, 5:27 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > This of course means that there has to be another > thread active to actually do the i/o on a periodic basis, > gathering the outputs and writing them out, and reading > the inputs and scattering them to the various named input >

Re: Efficient Bit addressing in Python.

2008-10-10 Thread Lie
On Oct 11, 5:27 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > This of course means that there has to be another > thread active to actually do the i/o on a periodic basis, > gathering the outputs and writing them out, and reading > the inputs and scattering them to the various named input >

Re: better scheduler with correct sleep times

2008-10-20 Thread Lie
On Oct 19, 4:01 am, sokol <[EMAIL PROTECTED]> wrote: > > > I started googling for scheduler and found one in standard library > > > but ih has the same code as mine (it calls the  functions in the > > > right order and my doesn't, but it still waits too long). > > > The other schedulers from web ar

Re: better scheduler with correct sleep times

2008-10-20 Thread Lie
On Oct 19, 4:01 am, sokol <[EMAIL PROTECTED]> wrote: > > > I started googling for scheduler and found one in standard library > > > but ih has the same code as mine (it calls the  functions in the > > > right order and my doesn't, but it still waits too long). > > > The other schedulers from web ar

Re: Improving interpreter startup speed

2008-10-29 Thread Lie
On Oct 27, 2:36 pm, Paul Rubin wrote: > "James Mills" <[EMAIL PROTECTED]> writes: > > Heaven knows! I hardly think invoking hundreds > > and possibly thousands of short-lived python > > interpreters to be an optimal solution that may > > have spawned this particular threa

Re: Parse each line by character location

2008-11-05 Thread Lie
On Nov 5, 2:29 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: [snip] >         So you have a classic (especially for COBOL and older FORTRAN) fixed > field record layout, no? > >         I presume the entire file is of a single layout? That would mean > only one splitting format is needed... > [s

Re: Finding the instance reference of an object

2008-11-05 Thread Lie
On Nov 4, 9:33 am, Joe Strout <[EMAIL PROTECTED]> wrote: > On Nov 3, 2008, at 5:27 PM, Marc 'BlackJack' Rintsch wrote: > > > Maybe this is a surprise for you, because we haven't discussed this in > > much detail in this group lately, but it applies to Python which does > > call-by-object or call-by

Re: Is there a better/simpler way to filter blank lines?

2008-11-05 Thread Lie
On Nov 5, 4:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 05 Nov 2008 14:39:36 +1100, Ben Finney wrote: > > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > > >> On Wed, 05 Nov 2008 13:18:27 +1100, Ben Finney wrote: > > >> > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]>

Re: is there really no good gui builder

2008-11-09 Thread Lie
On Nov 9, 2:35 am, azrael <[EMAIL PROTECTED]> wrote: > whoever I ask, everyone tells me when it come to python and GUI-s and > that there is the best way to use WX. I am browsing for the 10th time > during the last year and I can still not bealive that there is not one > project to make gui-buildin

Re: "Battleship" style game

2009-02-26 Thread Lie
On Feb 26, 3:50 am, Shawn Milochik wrote: > On Wed, Feb 25, 2009 at 11:38 AM, Marco Mariani wrote: > > > Yes it's in Python alright, but it's not Pythonese yet. You could try > > avoiding the getter/setter stuff, and camelCase method naming, things like > > that, for a start. > > > -- > >http://m

Re: python for loop

2009-04-01 Thread Lie
On Apr 1, 7:06 pm, Steven D'Aprano wrote: > There is a major clash between the names of ordinals in human languages > and zero-based counting. In human languages, the Nth-ordinal item comes > in position N. You can keep that useful convention with zero-based > counting by inventing the ugly word

Re: python for loop

2009-04-01 Thread Lie
On Apr 2, 4:05 pm, Aaron Brady wrote: > On Apr 1, 11:58 pm, Lie wrote: > > > On Apr 1, 7:06 pm, Steven D'Aprano > > > wrote: > > > There is a major clash between the names of ordinals in human languages > > > and zero-based counting. In human la

Re: python for loop

2009-04-02 Thread Lie
On Apr 2, 5:29 pm, Steven D'Aprano wrote: > On Wed, 01 Apr 2009 21:58:47 -0700, Lie wrote: > > On Apr 1, 7:06 pm, Steven D'Aprano > > wrote: > > >> There is a major clash between the names of ordinals in human languages > >> and zero-based counting.

can't install new modules after updating python

2009-04-17 Thread lie
I've updated from python 2.5 to 2.6 on my Slackware 12.2, by compiling the 2.6 source. When I try to use slapt-get to install a new module for python, it installs in the old version, and I can't use it. How can I fix this? Should I go back to 2.5? -- http://mail.python.org/mailman/listinfo/python-l

Re: Learning Python the quick way

2009-04-25 Thread Lie
On Apr 25, 11:13 am, mercur...@googlemail.com wrote: > Hi guys, > > I have decided to learn Python a little more than I already do. But I > found few problems, > > I am not sure what will happen if I do the programing in python the > find the program > doesn't deliver the desired performance due to

Re: Is using range() in for loops really Pythonic?

2008-05-13 Thread Lie
On May 13, 11:01 am, John Salerno <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > I think that the idiom > > >     for unused in xrange(10): > >         # do stuff with no reference to 'unused' > > > is quite common. Is that what you're asking about? > > Yes. I was more or less asking about the

Re: Is using range() in for loops really Pythonic?

2008-05-13 Thread Lie
On May 13, 9:20 pm, Lie <[EMAIL PROTECTED]> wrote: > On May 13, 11:01 am, John Salerno <[EMAIL PROTECTED]> wrote: > > > > > Ben Finney wrote: > > > I think that the idiom > > > >     for unused in xrange(10): > > >         # do stuff wi

Re: Python and Flaming Thunder

2008-05-13 Thread Lie
On May 13, 11:20 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > > 5-10 times faster for what kind of code? > > Mostly numerical analysis and CGI scripting.  All of Flaming Thunder's > library code is in assembly language, and Flaming Thunder creates > statically-linked pure syscall CGI scripts. > > >

Re: Python and Flaming Thunder

2008-05-13 Thread Lie
On May 13, 11:36 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > > ... there's something that feels very unnatural about writing English as > > code. > > I think it is ironic that you think Flaming Thunder is unnatural > because it is more English-like, when being English-like was one of > Python's g

Re: Python and Flaming Thunder

2008-05-13 Thread Lie
On May 14, 12:05 am, Dave Parker <[EMAIL PROTECTED]> wrote: > > Just to support this statement: PHP runs an order of magnitude slower than > > python. Yet a great deal (if not the majority) of dynamic sites out there > > run under PHP. All of these are unhappy customers? > > The websites owners mig

Re: Python and Flaming Thunder

2008-05-13 Thread Lie
On May 14, 11:25 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 13 May 2008 09:36:28 -0700 (PDT), Dave Parker > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > > ... there's something that feels very unnatural about writing English as > > > code. > > > I think

Re: Python and Flaming Thunder

2008-05-13 Thread Lie
On May 14, 12:51 pm, Lie <[EMAIL PROTECTED]> wrote: > And your 8 by 8 cross compiler doesn't impress me at all, they're all > based on x86/IA-32 architecture which is quite similar, no PowerPC, > SPARC, ARM, no other CISC or RISC architecture. And your compiler is a &

Re: List behaviour

2008-05-15 Thread Lie
On May 15, 5:08 pm, Gabriel <[EMAIL PROTECTED]> wrote: > Hi all > > Just wondering if someone could clarify this behaviour for me, please? > > >>> tasks = [[]]*6 > >>> tasks > > [[], [], [], [], [], []]>>> tasks[0].append(1) > >>> tasks > > [[1], [1], [1], [1], [1], [1]] > > Well what I was expecti

Re: Python and Flaming Thunder

2008-05-15 Thread Lie
On May 15, 4:08 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 14 mai, 08:08, Lie <[EMAIL PROTECTED]> wrote: > > > On May 14, 12:51 pm, Lie <[EMAIL PROTECTED]> wrote: > > > > And your 8 by 8 cross compiler doesn't impress me at all

Re: Scanning through Windows registry...

2008-05-16 Thread Lie
On May 9, 7:36 pm, Unknown Hero <[EMAIL PROTECTED]> wrote: > Ah, never mind, got it to work. Here's the code now. I hope I won't > run into another problems later :D > > > #Goes through all keys and subkeys in the selected hive (defined as > root) and replaces the value 'old' with the value 'new'

Re: Scanning through Windows registry...

2008-05-16 Thread Lie
On May 17, 2:06 am, Lie <[EMAIL PROTECTED]> wrote: > On May 9, 7:36 pm, Unknown Hero <[EMAIL PROTECTED]> wrote:> Ah, never mind, > got it to work. Here's the code now. I hope I won't > > run into another problems later :D > > > > > #Goes throug

Re: Python and Flaming Thunder

2008-05-17 Thread Lie
On May 16, 3:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 15 mai, 19:30, Lie <[EMAIL PROTECTED]> wrote: > > > > > On May 15, 4:08 am, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > On 14 mai, 08:08,

Re: Using Python for programming algorithms

2008-05-18 Thread Lie
On May 18, 5:32 am, Vicent Giner <[EMAIL PROTECTED]> wrote: > Hello. > > I am new to Python. It seems a very interesting language to me. Its > simplicity is very attractive. > > However, it is usually said that Python is not a compiled but > interpreted programming language —I mean, it is not like

Re: How to modify meaning of builtin function "not" to "!"?

2008-05-18 Thread Lie
On May 9, 8:41 pm, grbgooglefan <[EMAIL PROTECTED]> wrote: > I am creating functions, the return result of which I am using to make > decisions in combined expressions. > In some expressions, I would like to inverse the return result of > function. > > E.g. function contains(source,search) will ret

Re: explain this function to me, lambda confusion

2008-05-18 Thread Lie
On May 9, 8:57 am, [EMAIL PROTECTED] wrote: > On May 8, 6:11 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > > > > No, no, no, no, no! > > Geez.  Go easy. > > > > > You have got it entirely wrong here. Your XOR function simply returns a > > function which gives you the result of xoring the paramete

Re: explain this function to me, lambda confusion

2008-05-18 Thread Lie
On May 9, 12:12 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 08 May 2008 22:57:03 -0300,   > <[EMAIL PROTECTED]> escribió: > > > > > On May 8, 6:11 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > >> No, no, no, no, no! > > Geez.  Go easy. > >> You have got it entirely wrong here. Yo

Re: python newbie: some surprises

2008-05-18 Thread Lie
On May 8, 2:06 pm, v4vijayakumar <[EMAIL PROTECTED]> wrote: > When I started coding in python, these two things surprised me. > > 1. my code is inconsistently indented with the combination of tabs and > spaces. Even lines looked intended, but it is not. The problem is in tab not Python, there is n

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-21 Thread Lie
On May 20, 10:42 am, John Salerno <[EMAIL PROTECTED]> wrote: > On Mon, 19 May 2008 20:34:22 -0700 (PDT) > > [EMAIL PROTECTED] wrote: > > i am confused. > > > x=5 > > y=5 > > > x==y -> True > > x is y -> True > > > shouldnt x is y return False since they shouldnt(dont?) point to the > > same place i

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-21 Thread Lie
On May 20, 2:39 am, destroy <[EMAIL PROTECTED]> wrote: > I'm wondering what is the canonical usage of the keywords 'is' and > 'not' when you're writing conditionals and loops. The one I've been > following is completely arbitrary--I use the symbols '==', '!=' for > numerical comparisons and the

Re: Python(2.5) reads an input file FASTER than pure C(Mingw)

2008-05-23 Thread Lie
On Apr 30, 8:57 pm, n00m <[EMAIL PROTECTED]> wrote: > >>> a = ['zzz', 'aaa'] > >>> id(a[0]), id(a[1]) > > (12258848, 12259296)>>> a.sort() > >>> id(a[0]), id(a[1]) > > (12259296, 12258848) > > That proves you know nothing, that is a list operation, not a string operation. -- http://mail.python.org

Re: Python is slow

2008-05-25 Thread Lie
On May 23, 2:50 pm, Bruno Desthuilliers wrote: > Brad a écrit : > > > cm_gui wrote: > >> Python is slow. > > > It ain't C++, but it ain't a punch card either... somewhere in between. > > I find it suitable for lots of stuff. I use C++ when performance really > > matters tho... right tool for the

Re: php vs python

2008-05-25 Thread Lie
On May 22, 12:28 pm, NC <[EMAIL PROTECTED]> wrote: > On May 21, 1:10 pm, notbob <[EMAIL PROTECTED]> wrote: > > > > > So, here's my delimna: I want to start a blog.  Yeah, who doesn't. > > Yet, I want learn the guts of it instead of just booting up some > > wordwank or whatever. > > Here's a simple

Re: php vs python

2008-05-25 Thread Lie
On May 23, 5:14 am, "inhahe" <[EMAIL PROTECTED]> wrote: > I don't like php.  I tried it once and I had it sort a list, but the list > was apparently too long for its sorting function because it just sorted the > first so-many elements of it and left the rest in order, and didn't generate > any erro

Re: php vs python

2008-05-25 Thread Lie
On May 22, 3:10 am, notbob <[EMAIL PROTECTED]> wrote: > I'm not posting this just to initiate some religious flame war, though it's > the perfect subject to do so.  No, I actaully want some serious advice about > these two languages and since I think usenet is the best arena to find it, > here ya'

Re: Hungarian Notation

2008-05-30 Thread Lie
On May 27, 12:28 pm, "inhahe" <[EMAIL PROTECTED]> wrote: > Does anybody know of a list for canonical prefixes to use for hungarian > notation in Python?  Not that I plan to name all my variables with hungarian > notation, but just for when it's appropriate. If it was me, I'd use an empty-defined c

Re: Assignment and comparison in one statement

2008-05-30 Thread Lie
On May 24, 5:59 am, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Hello group, > > I'm just starting with Python and am extremely unexperienced with it so > far. Having a strong C/C++ background, I wish to do something like > > if (q = getchar()) { >         printf("%d\n", q); > > } > > or translated

Re: How to get all the variables in a python shell

2008-06-01 Thread Lie
[EMAIL PROTECTED] wrote: > Hi! > > I'm currently working on a scientific computation software built in > python. > What I want to implement is a Matlab style command window <-> > workspace interaction. > > For example, you type 'a=1' in the command window, and you see a list > item named 'a' in the

Re: How to get all the variables in a python shell

2008-06-01 Thread Lie
On Jun 2, 1:29 am, Lie <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi! > > > I'm currently working on a scientific computation software built in > > python. > > What I want to implement is a Matlab style command window <-> > > wo

Re: How to get all the variables in a python shell

2008-06-01 Thread Lie
shell's local memory buffer? > I tried to use shell.interp.locals() in wxPython, but there's too many > variables in the list which I don't actually need. > > Come on guys, give me some ideas. Thanks in advance! As an addition: Don't try to share data between windows, it's messy, fragile, and easy to make bugs. PS: Do not confuse Lie (Me) and Lee (OP) -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about files?

2008-06-01 Thread Lie
On Jun 1, 1:44 am, [EMAIL PROTECTED] wrote: > I want to create a program where a user can type what ever they want > to, have it saved to a file, and the be able to re-open it and read > it. How would I do this? Thanks! Use a multi-line text-input widget (available on any widget library) To open

Re: convert binary to float

2008-06-03 Thread Lie
On Jun 2, 2:55 am, Mason <[EMAIL PROTECTED]> wrote: > I have tried and tried... > > I'd like to read in a binary file, convert it's 4 byte values into > floats, and then save as a .txt file. > > This works from the command line (import struct); > >     In [1]: f = open("test2.pc0", "rb") >     In [

Re: Misuse of list comprehensions?

2008-06-03 Thread Lie
On May 20, 8:51 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > John Salerno: > >> What does everyone think about this? > > > The Example 2 builds a list, that is then thrown away. It's just a > > waste of memory (and time). > > No, it doesn't. It uses append becaus

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

2008-06-03 Thread Lie
On May 24, 9:14 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On May 24, 2:58 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > Sh4wn <[EMAIL PROTECTED]> writes: > > > first, python is one of my fav languages, and i'll definitely keep > > > developing with it. But, there's 1 one thing what I -really- m

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

2008-06-03 Thread Lie
On Jun 3, 5:07 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On Mon, Jun 2, 2008 at 10:50 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > >> You are not realizing that only useful(**) thing about data hiding is > >> that some code has acc

Re: make a string a list

2008-06-03 Thread Lie
On May 30, 4:30 am, Nikhil <[EMAIL PROTECTED]> wrote: > or a string iterable ? How can I do that. I have lots of '\r\n' > characters in the string which I think can be easier if it were made > into a list and I can easily see if the required value (its a numeral) > is present in it or not after som

Re: Compare 2 files and discard common lines

2008-06-03 Thread Lie
On May 29, 3:36 pm, loial <[EMAIL PROTECTED]> wrote: > I have a requirement to compare 2 text files and write to a 3rd file > only those lines that appear in the 2nd file but not in the 1st file. > > Rather than re-invent the wheel I am wondering if anyone has written > anything already? It's so e

Re: question

2008-06-03 Thread Lie
On May 30, 5:41 am, Gandalf <[EMAIL PROTECTED]> wrote: > On May 30, 12:14 am, John Henderson <[EMAIL PROTECTED]> wrote: > > > > > Gandalf wrote: > > > how do i write this code in order for python to understand it > > > and print me the x variable > > > > x=1 > > > def (): > > >     x++ > > >  

Re: Generating event from event

2008-06-03 Thread Lie
On May 31, 1:27 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 30, 12:11 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > Hi Diez, I can't see how it  matter which GUI-Toolkit i uses because I > > can combine libraries. > > I think all that matter is that i work with windows XP. > > > if you eve

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

2008-06-03 Thread Lie
On May 24, 9:14 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On May 24, 2:58 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > Sh4wn <[EMAIL PROTECTED]> writes: > > > first, python is one of my fav languages, and i'll definitely keep > > > developing with it. But, there's 1 one thing what I -really- m

Re: New variable?

2008-06-07 Thread Lie
On Jun 4, 1:40 am, tmallen <[EMAIL PROTECTED]> wrote: > What's the proper way to instantiate a new variable? x = ""? You don't need to. The reason why you need to "declare" variable when doing something like a += 1 is because this is actually a shorthand for a = a + 1 (unless you override __radd__

Re: File-writing not working in Windows?

2008-06-08 Thread Lie
On Jun 6, 10:18 pm, [EMAIL PROTECTED] wrote: > All, > > I have the following code: >            for fileTarget in dircache.listdir("directory"): >                 (dirName, fileName) = os.path.split(fileTarget) >                 f = open(fileTarget).readlines() >                 copying = False >  

Re: Do this as a list comprehension?

2008-06-08 Thread Lie
On Jun 8, 12:24 am, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 7, 5:21�am, Paul Miller <[EMAIL PROTECTED]> wrote: > > > On Fri, 06 Jun 2008 18:01:45 -0700, Mensanator wrote: > > > What happens if your iterables aren't the same length? > > > I chose not to consider that case, > > That's a bad ha

Re: Can this be done with list comprehension?

2008-06-08 Thread Lie
On Jun 8, 7:27 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Karlo Lozovina" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | I figured that out few minutes ago, such a newbie mistake :). The fix I > | came up with is: > | > |  result = ['something'] + [someMethod(i) for i in s

Re: Do this as a list comprehension?

2008-06-08 Thread Lie
On Jun 8, 8:56 am, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED]> wrote: > > > Mensanator wrote: > > > What I DID say was that how the builtins actually > > > work should be understood and it APPEARED that the > > > OP didn't understand that. Maybe he un

Re: Interesting Math Problem

2008-06-08 Thread Lie
On Jun 6, 2:25 am, "Rüdiger Werner" <[EMAIL PROTECTED]> wrote: > "BEES INC" <[EMAIL PROTECTED]> schrieb im Newsbeitragnews:[EMAIL PROTECTED] > ... > > Problem: Star Ratings > > People can rate cheeseburgers on my website with a star rating of 0-5 > stars (whole stars only), 5 being mighty tasty a

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

2008-06-09 Thread Lie
On Jun 9, 7:20 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > > On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> Now of course noone would defend such a limitation on the grounds > >> that one doesn't need th

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Lie
On Jun 9, 10:28 pm, [EMAIL PROTECTED] wrote: > Hi All. > > In a complex inheritance hierarchy, it is sometimes difficult to find > where a > method is defined.  I thought it might be possible to get this info > from the > method object itself, but it looks like maybe not.  Here is the test > case I

Re: money data type

2008-06-09 Thread Lie
On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: > Hi lazyweb, > I'm wondering, if there is a usable money data type for python available. > A quick search in pypi and google didn't convey anything, even though the > decimal data type seemed to be planned as a money data type originaly.

Re: Does the python library of Google Data API is truly free?

2008-06-09 Thread Lie
On Jun 10, 1:36 am, Kless <[EMAIL PROTECTED]> wrote: > The Python Client Library for Google Data APIs [1] has been licensed > as Apache 2.0 -a free license- but at the same time they are > restricting the rights of the users with these conditions [2], and I > don't like for anything this. > > --Wit

Odd behavior of python module listing

2008-06-09 Thread Lie
Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to the python interpreter, I happen to do this: ### START OF PYTHON SESSION ### Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more

Re: Question by someone coming from C...

2008-06-09 Thread Lie
On Jun 10, 4:00 am, Skye <[EMAIL PROTECTED]> wrote: > Writing this app in Python, not sure what the "best practice" would > be. > > I want a bitfield global logging level that allows me to turn specific > debugging modules on and off.  If I was doing this in C, I'd just use > some globals like: > >

Re: Separators inside a var name

2008-06-09 Thread Lie
On Jun 10, 3:38 am, Rainy <[EMAIL PROTECTED]> wrote: > On Jun 9, 2:05 pm, "Sebastian \"lunar\" Wiesner" > > <[EMAIL PROTECTED]> wrote: > >  Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > > > > I have a stylistic question. In most languages words in var. name are > > > separated by unders

Re: Question by someone coming from C...

2008-06-09 Thread Lie
On Jun 10, 4:32 am, Skye <[EMAIL PROTECTED]> wrote: > OK, sounds good.  So if not bitfields, what would be a good Python-y > way to do it? The word is "pythonic". > Flip booleans in a "debug config" dictionary or something? I'm not really sure, I've been programming with Python (and some other l

Re: Does the python library of Google Data API is truly free?

2008-06-10 Thread Lie
On Jun 10, 2:49 pm, Kless <[EMAIL PROTECTED]> wrote: > On 9 jun, 22:46, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > Kless schrieb: > > > > On 9 jun, 21:40, Lie <[EMAIL PROTECTED]> wrote: > > >> Do you notice that the terms ar

Re: Advice for a python newbie on parsing whois records?

2008-06-10 Thread Lie
On Jun 10, 9:47 pm, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > Hi. I'm stretching my boundaries in programming with a little python > shell-script which is going to loop through a list of domain names, > grab the whois record, parse it, and put the results into a csv. > > I've got the results co

Re: EXE is very slow by starting (>10sec.) (build with PyInstaller)

2008-06-10 Thread Lie
On Jun 10, 5:29 pm, "Mark Delon" <[EMAIL PROTECTED]> wrote: > Hi, > > My Python executable created with PyInstaller is too slow by starting... > It takes about 15 secs.!!! > > I am  using PyQt4 libraries for creating my very simple GUI-application. > > -> How can I SPEED UP my executable ??? > -> D

Re: proposal: give delattr ability to ignore missing attribute

2008-06-10 Thread Lie
On Jun 10, 10:06 pm, Gary Wilson <[EMAIL PROTECTED]> wrote: > I would like to propose that functionality be added to delattr to > handle the case when the attribute does not exist. > > First off, getattr handles this nicely with the default parameter: > > value = getattr(obj, 'foo', False) > > inst

Re: Python doesn't understand %userprofile%

2008-06-10 Thread Lie
On Jun 10, 11:11 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > In xp when I try os.path.getmtime("%userprofile/dir/file%") Python > > bites back with "cannot find the path specified" Since my script has > > to run on machines where the username is unspecified I need a fix

Re: Do this as a list comprehension?

2008-06-10 Thread Lie
On Jun 8, 11:11 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 8, 4:04 am, Lie <[EMAIL PROTECTED]> wrote: > > > > > On Jun 8, 8:56 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > On Jun 7, 8:22�pm, John Salerno <[EMAIL PROTECTED]> wrote

Re: money data type

2008-06-10 Thread Lie
On Jun 10, 12:02 am, Stephan Diehl <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: > >> Hi lazyweb, > >> I'm wondering, if there is a usable money data type for python available. > >> A q

Re: can't assign to literal

2008-06-11 Thread Lie
On Jun 11, 3:32 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Jun 10, 10:57 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote: > > > > for 1 in oids, vals head_oids: > > > SyntaxError: can't assign to literal > > > -- > > > 1 is a literal, you can't assign it to something. Are you trying to > > use it as a v

Re: problems with opening files due to file's path

2008-06-11 Thread Lie
On Jun 11, 10:07 am, Alexnb <[EMAIL PROTECTED]> wrote: > I don't think you understand it doesn't matter how the variable gets there, > the same code is run regardless, I have no problem with the GUI, but you > asked, and so I told you. the code os.startfile( is run if there is a > GUI or it is

Re: Dynamic HTML from Python Script

2008-06-11 Thread Lie
On Jun 11, 9:16 am, asdf <[EMAIL PROTECTED]> wrote: > On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote: > > asdf wrote: > >>> Well, there's a few ways you could approach it. > > >>> You could create a cgi program from your script - this is probably the > >>> solution you're looking for. > > >> Outpu

Re: Dynamic HTML from Python Script

2008-06-11 Thread Lie
On Jun 11, 9:57 am, Aidan <[EMAIL PROTECTED]> wrote: > asdf wrote: > > On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote: > > >> asdf wrote: > Well, there's a few ways you could approach it. > > You could create a cgi program from your script - this is probably the > solution you're lo

Re: can't assign to literal

2008-06-11 Thread Lie
On Jun 11, 2:53 am, maehhheeyy <[EMAIL PROTECTED]> wrote: > this is stopping my program from running properly. is there something > wrong in my code when that happens? That simply means you did something like this: 'hello' = 'another' 123 = 'kilo' [12, 'asd] = 123 Sometimes it's not that obvious

Re: problems with opening files due to file's path

2008-06-11 Thread Lie
On Jun 11, 9:14 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > Lie wrote: > > In most GUI toolkits (including Tkinter) and raw_input() function, > > when you input a string (using the textbox, a.k.a Entry widget) it > > would automatically be escaped for you, s

Re: Comments on my first script?

2008-06-13 Thread Lie
On Jun 12, 10:10 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > "Phillip B Oldham" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED] > > > I'd like the community's thoughts/comments on what I've done; > > improvements I can make, "don'ts" I should be avoiding, etc. I'm not > > so much bot

Re: Comments on my first script?

2008-06-13 Thread Lie
On Jun 13, 3:19 pm, Bruno Desthuilliers wrote: > Phillip B Oldham a écrit : > > > I'm keen on learning python, with a heavy lean on doing things the > > "pythonic" way, so threw the following script together in a few hours > > as a first-attempt in programming python. > > > I'd like the community'

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Lie
On Jun 15, 8:40 am, John Salerno <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > > If the two computers are in no way connected via any type of > > network, then the two programs won't be able to talk to each > > other. > > > The programs can't create a network, they can only use one that > > a

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Lie
On Jun 14, 11:31 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Let me see if this question even makes sense...I'm reading Core Python > Programming and I jumped ahead to the more specific topics like network > programming. I plan to follow along with the example in that chapter and > create a socke

Re: Creating a TCP/IP connection on already-networked computers

2008-06-15 Thread Lie
On Jun 14, 11:31 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Let me see if this question even makes sense...I'm reading Core Python > Programming and I jumped ahead to the more specific topics like network > programming. I plan to follow along with the example in that chapter and > create a socke

Re: sqlite3 and Python 2.5.1

2008-06-16 Thread Lie
On Jun 17, 12:59 am, milan_sanremo <[EMAIL PROTECTED]> wrote: > I have sqlite installed, but when I try to import sqlite3 I receive: > > Python 2.5.1 (r251:54863, Nov  3 2007, 02:54:36) [C] on sunos5 > Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 > > Tra

Re: Does '!=' equivelent to 'is not'

2008-06-16 Thread Lie
On Jun 17, 11:07 am, "Leo Jay" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 17, 2008 at 11:29 AM, pirata <[EMAIL PROTECTED]> wrote: > > I'm a bit confusing about whether "is not" equivelent to "!=" > > > if a != b: > >  ... > > > if a is not b: > >  ... > > > What's the difference between "is not" and

Re: How to catch StopIteration?

2008-06-16 Thread Lie
On Jun 17, 10:50 am, [EMAIL PROTECTED] wrote: > I'm writing to see calcuration process. > And so, I can't catch StopIteration... > > What is mistake? > > def collatz(n): >   r=[] >   while n>1: >     r.append(n) >     n = 3*n+1 if n%2 else n/2 >     yield r > > for i, x in enumerate(collatz(13)): >

Re: How to catch StopIteration?

2008-06-16 Thread Lie
On Jun 17, 12:36 pm, Lie <[EMAIL PROTECTED]> wrote: > On Jun 17, 10:50 am, [EMAIL PROTECTED] wrote: > > > > > I'm writing to see calcuration process. > > And so, I can't catch StopIteration... > > > What is mistake? > (snip) > > In a

Re: 2d graphics - drawing a vescica piscis in Python

2008-06-17 Thread Lie
On Jun 18, 2:45 am, Terrence Brannon <[EMAIL PROTECTED]> wrote: > Hello, I have written a program to draw a vescica piscis en.wikipedia.org/wiki/Vesica_piscis> > > from turtle import * > > def main(): >     setup(width=400, height=400) > >     r = 50 >     color("black") >     circle(r) >     colo

Re: Getting Python exit code when calling Python script from Java program

2008-06-18 Thread Lie
On Jun 18, 3:54 pm, [EMAIL PROTECTED] wrote: > I have a Python script which is used to load data into a database. Up to > now this script has been run by customers from the Windows command > prompt using "python edg_loader.pyc". Any error messages generated are > written to a log file.  A project t

Re: dict order

2008-06-18 Thread Lie
On Jun 18, 4:22 pm, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi, > > I wish to know how two dict objects are compared. By browsing the > archives I gathered that the number of items are first compared, but if > the two dict objects have the same number of items, then the comparison > algorithm was

Re: dict order

2008-06-18 Thread Lie
On Jun 18, 5:35 pm, [EMAIL PROTECTED] wrote: > On Jun 18, 12:32 pm, [EMAIL PROTECTED] wrote: > > > > > On Jun 18, 11:22 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I wish to know how two dict objects are compared. By browsing the > > > archives I gathered that the number of item

Re: Numeric type conversions

2008-06-18 Thread Lie
On Jun 18, 12:23 am, John Dann <[EMAIL PROTECTED]> wrote: > On Tue, 17 Jun 2008 08:58:11 -0700 (PDT), MRAB > > <[EMAIL PROTECTED]> wrote: > >[snip] > >Please note that in slicing the start position is included and the end > >position is excluded, so that should be ByteStream[12:14]. > > Yes, I just

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