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

2008-09-20 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Ron Garret wrote: > Default return type is int, which I assumed would be > 64 bits on a 64 bit machine, but turns out it's 32. Stupid. I think preferred ABIs these days are LP64, not ILP64 or LLP64. -- http://mail.python.org/mailman/listinfo/python-list

Re: writeable buffer and struct.pack_into and struct.unpck_from

2008-09-20 Thread Tzury Bar Yochay
Thanks Gabriel, I was missing the information how to create a writable buffer. -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-20 Thread Kay Schluehr
On 20 Sep., 23:07, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 20, 3:22 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > > > On 20 Sep., 18:33, Bruno Desthuilliers > > > <[EMAIL PROTECTED]> wrote: > > > The following definitions are AFAIK the only commonly accepted > > > defin

Re: Not fully OO ?

2008-09-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Thomas G. Willis <[EMAIL PROTECTED]> wrote: >On Sep 20, 5:23=A0am, candide <[EMAIL PROTECTED]> wrote: >> >> Excerpt quoted fromhttp://www.astro.ufl.edu/~warner/prog/python.html: >> >> "About Python: Python is a high level scripting language with object >> oriented fe

Quick & Secured Pharmacy Online. hr3tn

2008-09-20 Thread [EMAIL PROTECTED]
Start saving, best online pharmacy here http://gjlabeh.cuchezfarg.com/?cdfikmabehxwvrsygzchcmjl -- http://mail.python.org/mailman/listinfo/python-list

Quick & Secured Pharmacy Online. bhsrf

2008-09-20 Thread [EMAIL PROTECTED]
Start saving, best online pharmacy here http://gjlabeh.cuchezfarg.com/?cdfikmabehxwvrsygzchcmjl -- http://mail.python.org/mailman/listinfo/python-list

BeautifulSoup and Problem Tables

2008-09-20 Thread academicedgar
Hi I would appreciate some help. I am trying to learn Python and want to use BeautifulSoup to pull some data from tables. I was really psyched earlier tonight when I discovered that I could do this from BeautifulSoup import BeautifulSoup bst=file(r"c:\bstest.htm").read() soup=BeautifulSoup(bst)

Re: improving a huge double-for cycle

2008-09-20 Thread Aaron "Castironpi" Brady
On Sep 20, 9:20 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 20 Sep 2008 19:01:42 +0200, Bruno Desthuilliers wrote: > > Once again, sorry > > if me missing your correct answer drives you paranoid :-) > > What do you mean by that? How many other people have been talkin

Re: writeable buffer and struct.pack_into and struct.unpck_from

2008-09-20 Thread Aaron "Castironpi" Brady
On Sep 20, 6:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 20 Sep 2008 15:45:48 -0300, Tzury Bar Yochay   > <[EMAIL PROTECTED]> escribió: > > > I can't find in the documentation the way to use these two functions. > > > can someone share a simple code that utilize these two functi

Re: improving a huge double-for cycle

2008-09-20 Thread Steven D'Aprano
On Sat, 20 Sep 2008 19:01:42 +0200, Bruno Desthuilliers wrote: > Once again, sorry > if me missing your correct answer drives you paranoid :-) What do you mean by that? How many other people have been talking about me? *wink* -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: explain slice assignment to newb

2008-09-20 Thread Stephen Horne
On Sat, 20 Sep 2008 14:20:20 -0700 (PDT), Andrew <[EMAIL PROTECTED]> wrote: >please explain this behavior to a newb: > a = [1,2,3,4] b = ["a","b","c","d"] a[0:2] = b[0:2] The slice [0:2] represent positions 0 <= x < 2 Replaces the [1, 2] from [1, 2, 3, 4] with ['a', 'b'] Result: a

Re: Not fully OO ?

2008-09-20 Thread Aaron "Castironpi" Brady
On Sep 20, 8:06 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Actually it is simply wrong in the mentioned case and here is the > > proof: > > > def foo(): > >     return 2+2 > > > import dis > > dis.dis(foo) > > >   2           0 LOAD_CONST              

Re: How to make a reverse for loop in python?

2008-09-20 Thread Steven D'Aprano
On Sun, 21 Sep 2008 01:56:59 +0200, Christian Heimes wrote: > Just *don't* try to abuse lists by creating fancy stuff e.g. linked > lists. The memory overhead is going to kill your app. I agree with your advice not to abuse lists, but not for the reason you give. The memory overhead of a linked

Re: Not fully OO ?

2008-09-20 Thread Christian Heimes
Kay Schluehr wrote: Actually it is simply wrong in the mentioned case and here is the proof: def foo(): return 2+2 import dis dis.dis(foo) 2 0 LOAD_CONST 2 (4) 3 RETURN_VALUE OO is a heuristic method used to understand the semantics of a programming

Re: How to make a reverse for loop in python?

2008-09-20 Thread Steven D'Aprano
On Sat, 20 Sep 2008 16:27:41 -0700, Alex Snast wrote: > Another quick question please, is the List data structure just a dynamic > array? If so how can you use static size array, linked list, AVL trees > etcetera. Before I answer your question, I should say that you can go a LONG way with just t

Re: How to make a reverse for loop in python?

2008-09-20 Thread bearophileHUGS
Christian Heimes: > Unless you have specific needs for highly specialized data types, use lists. There's also the collections.deque for other related purposes. (I suggest people willing to look at some nice C code to read the sources of deque, Hettinger has created some refined code, very readabl

Re: explain slice assignment to newb

2008-09-20 Thread Terry Reedy
Andrew wrote: please explain this behavior to a newb: Read the section on sequence slicing in the Library Reference. Use the interactive interpreter or IDLE to perform experiments, like you did, until you understand to your satisfaction. -- http://mail.python.org/mailman/listinfo/python-li

Hi guys!

2008-09-20 Thread Rajko Mackic Cvrcko
Hello, this is Rajko Mackic from town Banjaluka, Bosnia and Herzegovina, also known as Cvrcko Does anyone know of any bars in town where I can swallow a bucket of cum? It can be either dog, horse or human cum. Also, does anyone know of any sex bars where people will shit in your mouth? I also like

Re: Installing pySerial

2008-09-20 Thread Gabriel Genellina
En Sat, 20 Sep 2008 02:01:14 -0300, eliben <[EMAIL PROTECTED]> escribió: Why are people preferring the python.org package over ActiveState's, which seems to be more complete and includes more modules (like pywin32) ? They do a hard work collecting, compiling and packaging the Python distribu

Re: How to make a reverse for loop in python?

2008-09-20 Thread Steven D'Aprano
On Sat, 20 Sep 2008 16:22:31 -0700, Alex Snast wrote: > That's a lot of responses guys. Thanks a lot i think i got it. Another > question, are there any pointers in python (or iterators) for when i use > a data structure that doesn't support random access? That surely depends on the data structu

Re: How to make a reverse for loop in python?

2008-09-20 Thread Gabriel Genellina
En Sat, 20 Sep 2008 20:27:41 -0300, Alex Snast <[EMAIL PROTECTED]> escribió: Another quick question please, is the List data structure just a dynamic array? If so how can you use static size array, linked list, AVL trees etcetera. Yes, lists are implemented as dynamic arrays (but you shouldn't

Re: How to make a reverse for loop in python?

2008-09-20 Thread Christian Heimes
Alex Snast wrote: Another quick question please, is the List data structure just a dynamic array? If so how can you use static size array, linked list, AVL trees etcetera. You should treat Python lists as an opaque item. You shouldn't concern yourself with the implementation details. Python li

Re: writeable buffer and struct.pack_into and struct.unpck_from

2008-09-20 Thread Gabriel Genellina
En Sat, 20 Sep 2008 15:45:48 -0300, Tzury Bar Yochay <[EMAIL PROTECTED]> escribió: I can't find in the documentation the way to use these two functions. can someone share a simple code that utilize these two functions? struct.pack_into is intended to "fill" a buffer you got from somewhere,

Re: How to make a reverse for loop in python?

2008-09-20 Thread Alex Snast
On Sep 20, 8:13 pm, [EMAIL PROTECTED] wrote: > Duncan Booth: > > > > e.g. the python equivalent to the c++ loop > > > for (i = 10; i >= 0; --i) > > > The exact equivalent would be: > >         for i in range(10, -1, -1): print i > > I'd use xrange there. Anyway, I have always felt that Python synta

Re: How to make a reverse for loop in python?

2008-09-20 Thread Alex Snast
On Sep 20, 8:13 pm, [EMAIL PROTECTED] wrote: > Duncan Booth: > > > > e.g. the python equivalent to the c++ loop > > > for (i = 10; i >= 0; --i) > > > The exact equivalent would be: > >         for i in range(10, -1, -1): print i > > I'd use xrange there. Anyway, I have always felt that Python synta

Re: explain slice assignment to newb

2008-09-20 Thread Sean DiZazzo
On Sep 20, 2:20 pm, Andrew <[EMAIL PROTECTED]> wrote: > please explain this behavior to a newb: > > >>> a = [1,2,3,4] > >>> b = ["a","b","c","d"] > >>> a > [1, 2, 3, 4] > >>> b > > ['a', 'b', 'c', 'd'] > > >>> a[0:2] > [1, 2] > >>> a > [1, 2, 3, 4] > >>> b[2:4] > ['c', 'd'] > >>> a[0:2] = b[0:2] >

explain slice assignment to newb

2008-09-20 Thread Andrew
please explain this behavior to a newb: >>> a = [1,2,3,4] >>> b = ["a","b","c","d"] >>> a [1, 2, 3, 4] >>> b ['a', 'b', 'c', 'd'] >>> a[0:2] [1, 2] >>> a [1, 2, 3, 4] >>> b[2:4] ['c', 'd'] >>> a[0:2] = b[0:2] >>> b[2:4] = a[2:4] >>> a ['a', 'b', 3, 4] >>> b ['a', 'b', 3, 4] >>> -- http://mail.pyt

Re: Not fully OO ?

2008-09-20 Thread Aaron "Castironpi" Brady
On Sep 20, 3:22 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 20 Sep., 18:33, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > > The following definitions are AFAIK the only commonly accepted > > definitions about OO: > > > 1/ an object is defined by identity, state and behaviour > > 2/ obj

Re: [Tkinter-discuss] (newbie) can't invoke button for twice

2008-09-20 Thread Guilherme Polo
On Sat, Sep 20, 2008 at 4:10 PM, dmitrey <[EMAIL PROTECTED]> wrote: > > hi all, > I have the problem: > a func has been binded to a Button: > > RunPause = Button(root, textvariable = t, command = lambda: > invokeRunPause(p)) > > def invokeRunPause(p): >if p.state == 'init': >p.state = '

Re: Not fully OO ?

2008-09-20 Thread Kay Schluehr
On 20 Sep., 18:33, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > The following definitions are AFAIK the only commonly accepted > definitions about OO: > > 1/ an object is defined by identity, state and behaviour > 2/ objects interacts by sending messages each other > 3/ an OO program is made o

Re: matplotlib in interactive mode locks when run from subprocess

2008-09-20 Thread Almar Klein
I think my question was not very clear. I narrowed the problem down to a reconstructable small example, consisting of a python script (a very simple interpreter) and three lines to execute in it: == start simple interpreter file == import os import sys import time def run(): while

Re: improving a huge double-for cycle

2008-09-20 Thread Bruno Desthuilliers
Harald Luessen a écrit : On Thu, 18 Sep 2008 Bruno Desthuilliers wrote: # Harald : uncomment this and run test_results. As far as I can tell, it # doesn't yields the expected results ## IN7 = IN[:] ## def sortk7(n): ## return n.coordinates[0] ## def doubles7(): ## "is ordering better

Re: improving a huge double-for cycle

2008-09-20 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : Alexzive a écrit : Hello there :) , (snip) Now the obvious winner is pruebono Correction (my bad) : Steven D'Aprano submitted the set-based solution first. So the winners are Steven and pruebono. -- http://mail.python.org/mailman/listinfo/python-list

RE: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

2008-09-20 Thread Blubaugh, David A.
Sir, Let me state that do have extensive experience with developing binary files. Please note that I have followed all of the instructions to the letter as far as developing a DLL to be imported. However, it is not working correctly. I believe it might be my system environment variables??

Re: improving a huge double-for cycle

2008-09-20 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Thu, 18 Sep 2008 20:43:00 +0200, Bruno Desthuilliers wrote: Now the obvious winner is pruebono - even unoptimized, using sets seems to be *way* faster than even the most optimized corrected version of your algorithm. I'm not being snarky about losing priority here

Re: Python newbie question re Strings and integers

2008-09-20 Thread Bruno Desthuilliers
rmac a écrit : the following code attempts to extract a symbol name from a string: extensionStart = int(filename.rfind('.')) rfind returns an int, so passing it to the int type constructor is useless. filenameStart = int(filename.rfind('/')) idem #print 'Extension Start - ' +

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Mensanator
On Sep 20, 1:34�pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > On Sat, Sep 20, 2008 at 1:27 PM, Mensanator <[EMAIL PROTECTED]> wrote: > > Beacuse in 2.6, Python apparently has fixed a discrepency that existed > > in previous versions. > > > In the IDLE that comes with 2.5, typing "as", to wit "i

ANN: Python FTP Server library (pyftpdlib) 0.5.0 released

2008-09-20 Thread Giampaolo Rodola'
Hi, I'm pleased to announce release 0.5.0 of Python FTP Server library (pyftpdlib). http://code.google.com/p/pyftpdlib/ === About === Python FTP server library provides an high-level portable interface to easily write asynchronous FTP servers with Python. Based on asyncore framework pyftpdlib i

writeable buffer and struct.pack_into and struct.unpck_from

2008-09-20 Thread Tzury Bar Yochay
Hi, I can't find in the documentation the way to use these two functions. can someone share a simple code that utilize these two functions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Guilherme Polo
On Sat, Sep 20, 2008 at 1:27 PM, Mensanator <[EMAIL PROTECTED]> wrote: > Beacuse in 2.6, Python apparently has fixed a discrepency that existed > in previous versions. > > In the IDLE that comes with 2.5, typing "as", to wit "import random as > ran", > the words "import" and "as" highlight in red,

Re: Not fully OO ?

2008-09-20 Thread Bruno Desthuilliers
candide a écrit : Excerpt quoted from http://www.astro.ufl.edu/~warner/prog/python.html : "About Python: Python is a high level scripting language with object oriented features. (...) Python supports OOP and classes to an extent, but is not a full OOP language." Thanks for any comment.

Re: Ascii Menu I/O redirection

2008-09-20 Thread Hendrik van Rooyen
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >I'm not sure that closing stdin and stout are a good idea. This could >have side-effects for other parts of your program, and will almost >certainly end badly if you're running in the interactive interpreter. > Its a very simple thingy - there will o

Re: Not fully OO ?

2008-09-20 Thread Paul Boddie
On 20 Sep, 19:42, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > > Wikipedia puts it decently: "mainly for OO programming, but with some > procedural elements." > > When it comes to Python and object-oriented programming, you can't leave out the ducks. ;-) Paul -- http://mail.python.o

Re: Not fully OO ?

2008-09-20 Thread Aaron "Castironpi" Brady
On Sep 20, 5:14 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Answer: if you want to define an entity it has to be defined inside a > > class. If you want to access an entity you have to use the dot > > operator. Therefore Java is OO but Python is not. > > you're satirising

Re: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

2008-09-20 Thread Fredrik Lundh
Blubaugh, David A. wrote: (no need to shout when filling in the subject line, thanks) I have now been able to generate a .pyd file from a FORTRAN > file that I am trying to interface with python. I was able > to execute this with an additional insight into how f2py > operates. ImportError:

Sunbeam India UPS Point- unfair Trade Practices in Computer Business

2008-09-20 Thread ronald
Sunbeam India UPS Point- unfiar Trade Practices in Computer Business Save Money, Tension, and Time. Avoid Nehru Place market to buy Computer Goods Hello All, This is to inform you all the sellers at the Nehru Place are not selling good products. Especially the shop- Nishchal Joshi, Sunbeam India

Re: How to make a reverse for loop in python?

2008-09-20 Thread bearophileHUGS
Duncan Booth: > > e.g. the python equivalent to the c++ loop > > for (i = 10; i >= 0; --i) > > The exact equivalent would be: > for i in range(10, -1, -1): print i I'd use xrange there. Anyway, I have always felt that Python syntax not easy to understand at first sight, expecially when you

NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

2008-09-20 Thread Blubaugh, David A.
To All, I have now been able to generate a .pyd file from a FORTRAN file that I am trying to interface with python. I was able to execute this with an additional insight into how f2py operates. It seems as though the documentation requires an upgrade, since there appears to be missing info

Re: how can i check whether a variable is iterable in my code?

2008-09-20 Thread Terry Reedy
satoru wrote: On Sep 20, 6:35 pm, Aidan <[EMAIL PROTECTED]> wrote: satoru wrote: hi, all i want to check if a variable is iterable like a list, how can i implement this? this would be one way, though I'm sure others exist: if hasattr(yourVar, '__iter__'): # do stuff thank you,but th

Re: How to make a reverse for loop in python?

2008-09-20 Thread Peter Otten
Gary Herron wrote: > Or you can create a new reversed (copy of the original) list and iterate > through it > > for item in reversed(L): >   print item It's not a copy, it's a view: >>> items = [1,2,3] >>> r = reversed(items) >>> items[:] = "abc" >>> for item in r: print item ... c b a Peter -

Re: How to make a reverse for loop in python?

2008-09-20 Thread Fredrik Lundh
Fredrik Lundh wrote: e.g. the python equivalent to the c++ loop for (i = 10; i >= 0; --i) use range with a negative step: for i in range(10-1, -1, -1): ... or just reverse the range: for i in reversed(range(10)): ... (and to include the 10 in the range, add one to

Re: How to make a reverse for loop in python?

2008-09-20 Thread Gary Herron
Alex Snast wrote: Hello I'm new to python and i can't figure out how to write a reverse for loop in python e.g. the python equivalent to the c++ loop for (i = 10; i >= 0; --i) -- http://mail.python.org/mailman/listinfo/python-list What are you trying to loop through? If it's the contents

Re: How to make a reverse for loop in python?

2008-09-20 Thread Fredrik Lundh
Alex Snast wrote: I'm new to python and i can't figure out how to write a reverse for loop in python e.g. the python equivalent to the c++ loop for (i = 10; i >= 0; --i) use range with a negative step: for i in range(10-1, -1, -1): ... or just reverse the range: for i in r

Re: How to make a reverse for loop in python?

2008-09-20 Thread Simon Brunning
2008/9/20 Alex Snast <[EMAIL PROTECTED]>: > I'm new to python and i can't figure out how to write a reverse for > loop in python > > e.g. the python equivalent to the c++ loop > > for (i = 10; i >= 0; --i) for i in range(10, 0, -1): print i -- Cheers, Simon B. -- http://mail.python.org/mailm

Re: How to make a reverse for loop in python?

2008-09-20 Thread Duncan Booth
Alex Snast <[EMAIL PROTECTED]> wrote: > Hello > > I'm new to python and i can't figure out how to write a reverse for > loop in python > > e.g. the python equivalent to the c++ loop > > for (i = 10; i >= 0; --i) > The exact equivalent would be: for i in range(10, -1, -1): print i ex

Re: How to make a reverse for loop in python?

2008-09-20 Thread Mensanator
On Sep 20, 11:16�am, Alex Snast <[EMAIL PROTECTED]> wrote: > Hello > > I'm new to python and i can't figure out how to write a reverse for > loop in python > > e.g. the python equivalent to the c++ loop > > for (i = 10; i >= 0; --i) >>> for i in xrange(10,-1,-1): print i, 10 9 8 7 6 5 4 3 2 1 0

Re: How to make a reverse for loop in python?

2008-09-20 Thread Thoma
Alex Snast a écrit : Hello I'm new to python and i can't figure out how to write a reverse for loop in python e.g. the python equivalent to the c++ loop for (i = 10; i >= 0; --i) for (i = 0; i < 10; i--) -> for i in range(10): for (i = 10; i >= 0; --i) -> for i in range(10,-1,-1): Thoma --

Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-20 Thread Mensanator
Beacuse in 2.6, Python apparently has fixed a discrepency that existed in previous versions. In the IDLE that comes with 2.5, typing "as", to wit "import random as ran", the words "import" and "as" highlight in red, so you can't use them as variable names or you'll get a syntax error. Ah, but you

How to make a reverse for loop in python?

2008-09-20 Thread Alex Snast
Hello I'm new to python and i can't figure out how to write a reverse for loop in python e.g. the python equivalent to the c++ loop for (i = 10; i >= 0; --i) -- http://mail.python.org/mailman/listinfo/python-list

Re: XML-schema 'best practice' question

2008-09-20 Thread Lorenzo Gatti
Sorry for pressing the send button too fast. On 20 Set, 07:59, Frank Millman <[EMAIL PROTECTED]> wrote: > I want to introduce an element of workflow management (aka Business > Process Management) into the business/accounting system I am > developing. I used google to try to find out what the curr

Re: XML-schema 'best practice' question

2008-09-20 Thread Lorenzo Gatti
On 20 Set, 07:59, Frank Millman <[EMAIL PROTECTED]> wrote: > I want to introduce an element of workflow management (aka Business > Process Management) into the business/accounting system I am > developing. I used google to try to find out what the current state of > the art is. After several month

Re: Not fully OO ?

2008-09-20 Thread Colin J. Williams
Fredrik Lundh wrote: Colin J. Williams wrote: "foreach: for x in array: statements Loops over the array given by array. On each iteration, the value of the current element is assigned to x and the internal array pointer is advanced by one. " This could be a useful addition to Python. for

Re: Not fully OO ?

2008-09-20 Thread Thomas G. Willis
On Sep 20, 5:23 am, candide <[EMAIL PROTECTED]> wrote: > Excerpt quoted fromhttp://www.astro.ufl.edu/~warner/prog/python.html: > > "About Python: Python is a high level scripting language with object > oriented features. > (...) > Python supports OOP and classes to an extent, but is not a full OOP

Re: Not fully OO ?

2008-09-20 Thread Eduardo O. Padoan
On Sat, Sep 20, 2008 at 11:26 AM, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 20 Sep., 12:14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Kay Schluehr wrote: >> > Answer: if you want to define an entity it has to be defined inside a >> > class. If you want to access an entity you have to use the d

Re: Not fully OO ?

2008-09-20 Thread Kay Schluehr
On 20 Sep., 12:14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Answer: if you want to define an entity it has to be defined inside a > > class. If you want to access an entity you have to use the dot > > operator. Therefore Java is OO but Python is not. > > you're satirising

Re: Ascii Menu I/O redirection

2008-09-20 Thread Steven D'Aprano
On Sat, 20 Sep 2008 23:14:26 +0200, Hendrik van Rooyen wrote: > class console(object): > """ > This spoofs a single file like object, using stdout & - in > (Minimalistic proof of concept implementation) """ > > def __init__(self): > self.read = sys.stdin.read > sel

Re: how can i check whether a variable is iterable in my code?

2008-09-20 Thread satoru
thanks very much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-20 Thread Steven D'Aprano
On Sat, 20 Sep 2008 13:13:08 +, Duncan Booth wrote: > This is a good indication that the > author doesn't know much about OOP. I think you can drop the last two words :) Actually that's unfair -- it looks like he knows quite a bit about the metallicity of quasers, but he's just parroting a

jips works with in online

2008-09-20 Thread killyou
http://candapud.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-20 Thread Duncan Booth
candide <[EMAIL PROTECTED]> wrote: > Excerpt quoted from http://www.astro.ufl.edu/~warner/prog/python.html : > > "About Python: Python is a high level scripting language with object > oriented features. > (...) > Python supports OOP and classes to an extent, but is not a full OOP > language." >

Re: Not fully OO ?

2008-09-20 Thread Martin v. Löwis
> for-in could be a useful addition to Python? looks like Guido's used > his time machine again, then, since it's been around since the pre-1.0 > days: > > http://www.python.org/doc/ref/for.html He somehow must have misinterpreted http://www.astro.ufl.edu/~warner/prog/python.html which has

Re: Not fully OO ?

2008-09-20 Thread Fredrik Lundh
Colin J. Williams wrote: "foreach: for x in array: statements > Loops over the array given by array. On each iteration, the value of the current element is assigned to x and the internal array pointer is advanced by one. " This could be a useful addition to Python. for-in could be a usefu

Re: how can i check whether a variable is iterable in my code?

2008-09-20 Thread John Machin
On Sep 20, 8:54 pm, satoru <[EMAIL PROTECTED]> wrote: > On Sep 20, 6:35 pm, Aidan <[EMAIL PROTECTED]> wrote: > > > satoru wrote: > > > hi, all > > > i want to check if a variable is iterable like a list, how can i > > > implement this? > > > this would be one way, though I'm sure others exist: > >

Re: Not fully OO ?

2008-09-20 Thread Colin J. Williams
candide wrote: Excerpt quoted from http://www.astro.ufl.edu/~warner/prog/python.html : "About Python: Python is a high level scripting language with object oriented features. (...) Python supports OOP and classes to an extent, but is not a full OOP language." Thanks for any comment. "for

Re: how can i check whether a variable is iterable in my code?

2008-09-20 Thread Vito De Tullio
satoru wrote: > hi, all > i want to check if a variable is iterable like a list, how can i > implement this? untested def is_iterable(param): try: iter(param) except TypeError: return False else: return True -- By ZeD -- http://mail.python.org/mailman/listinfo/python-list

Re: how can i check whether a variable is iterable in my code?

2008-09-20 Thread satoru
On Sep 20, 6:35 pm, Aidan <[EMAIL PROTECTED]> wrote: > satoru wrote: > > hi, all > > i want to check if a variable is iterable like a list, how can i > > implement this? > > this would be one way, though I'm sure others exist: > > if hasattr(yourVar, '__iter__'): >         # do stuff thank you,but

Re: Not fully OO ?

2008-09-20 Thread Carl Banks
On Sep 20, 2:23 am, candide <[EMAIL PROTECTED]> wrote: > Excerpt quoted fromhttp://www.astro.ufl.edu/~warner/prog/python.html: > > "About Python: Python is a high level scripting language with object > oriented features. > (...) > Python supports OOP and classes to an extent, but is not a full OOP

Re: how can i check whether a variable is iterable in my code?

2008-09-20 Thread Aidan
satoru wrote: hi, all i want to check if a variable is iterable like a list, how can i implement this? this would be one way, though I'm sure others exist: if hasattr(yourVar, '__iter__'): # do stuff -- http://mail.python.org/mailman/listinfo/python-list

Re: report a BUG of package setuptools-0.6c8.

2008-09-20 Thread Carl Banks
On Sep 20, 1:11 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > 为爱而生 wrote: > > File "/usr/lib/python2.5/site-packages/setuptools/command/sdist.py", > > line 98, in entries_finder > > log.warn("unrecognized .svn/entries format in %s", dirname) > > NameError: global name 'log' is not defined >

Re: Not fully OO ?

2008-09-20 Thread Fredrik Lundh
Kay Schluehr wrote: Answer: if you want to define an entity it has to be defined inside a class. If you want to access an entity you have to use the dot operator. Therefore Java is OO but Python is not. you're satirising the quoted author's cargo-cultish view of object orientation, right?

Re: Not fully OO ?

2008-09-20 Thread Kay Schluehr
On 20 Sep., 11:23, candide <[EMAIL PROTECTED]> wrote: > Excerpt quoted fromhttp://www.astro.ufl.edu/~warner/prog/python.html: > > "About Python: Python is a high level scripting language with object > oriented features. > (...) > Python supports OOP and classes to an extent, but is not a full OOP >

how can i check whether a variable is iterable in my code?

2008-09-20 Thread satoru
hi, all i want to check if a variable is iterable like a list, how can i implement this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-20 Thread James Mills
This is wrong. Python _is_ a full OOP language. Everything form modules, functions to basic data types are an object. --JamesMills On Sat, Sep 20, 2008 at 7:23 PM, candide <[EMAIL PROTECTED]> wrote: > Excerpt quoted from http://www.astro.ufl.edu/~warner/prog/python.html : > > "About Python: Pytho

Not fully OO ?

2008-09-20 Thread candide
Excerpt quoted from http://www.astro.ufl.edu/~warner/prog/python.html : "About Python: Python is a high level scripting language with object oriented features. (...) Python supports OOP and classes to an extent, but is not a full OOP language." Thanks for any comment. -- http://mail.python.

Ascii Menu I/O redirection

2008-09-20 Thread Hendrik van Rooyen
I am writing a small application with a simple ascii based menu. The menu is used to test individual functions, and to change some timings. Otherwise the application just runs automatically, depending on command line options. I want to be able to redirect the menu. The console, a serial port, or

Re: The Python computer language

2008-09-20 Thread Fredrik Lundh
ROSEEE wrote: http://pthoncomputerlanguage.blogspot.com report here: http://tinyurl.com/blogspot-spam -- http://mail.python.org/mailman/listinfo/python-list

The Python computer language

2008-09-20 Thread ROSEEE
http://pthoncomputerlanguage.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: report a BUG of package setuptools-0.6c8.

2008-09-20 Thread Fredrik Lundh
为爱而生 wrote: File "/usr/lib/python2.5/site-packages/setuptools/command/sdist.py", line 98, in entries_finder log.warn("unrecognized .svn/entries format in %s", dirname) NameError: global name 'log' is not defined global name 'log' is not defined to the line 98!!! please report bugs here