Re: find out whether a module exists (without importing it)

2012-08-06 Thread Michael Poeltl
in my opinion, "without importing it" makes it unnecessarily complicated. You just want to know it module xyz exists, or better said can be found (sys.path). why not try - except[ - else ] try: import mymodule except ImportError: # NOW YOU KNOW it does not exist #+ and you may react

dictionary comprehensions with Python 2.4/2.5

2012-08-06 Thread Iryna Feuerstein
Hello, for the program developed and maintained by our company the compatibility with Python 2.5 is desired. I'm developing with Python 2.7, though I would like to use dictionary comprehensions in my code. The dictionary comprehensions were added to Python in version 2.7 at first time. Is it

Re: On-topic: alternate Python implementations

2012-08-06 Thread John Nagle
On 8/4/2012 7:19 PM, Steven D'Aprano wrote: > On Sat, 04 Aug 2012 18:38:33 -0700, Paul Rubin wrote: > >> Steven D'Aprano writes: >>> Runtime optimizations that target the common case, but fall back to >>> unoptimized code in the rare cases that the optimization doesn't apply, >>> offer the opport

Re: Intermediate Python user needed help

2012-08-06 Thread rusi
On Aug 7, 8:06 am, Jugurtha Hadjar wrote: > On 08/05/2012 09:52 PM, John Mordecai Dildy wrote: > > > NameError: name 'start' is not defined > > > anyone know how to make start defined > > Maybe rename it "defined_start" ;) > > I wonder how someone can get to the point of writing more than 76 lines

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Steven D'Aprano
On Mon, 06 Aug 2012 10:24:10 +0100, lipska the kat wrote: > er, the point I was trying to make is that when you say 'interface' it > could mean so many things. If you say 'facade' everyone knows exactly > what you are talking about. And that is EXACTLY the point. The whole point of design pattern

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Steven D'Aprano
On Mon, 06 Aug 2012 09:55:24 +0100, lipska the kat wrote: > On 06/08/12 01:22, Steven D'Aprano wrote: >> On Sun, 05 Aug 2012 20:46:23 +0100, lipska the kat wrote: >> >>> >>> Object Oriented programming is a mindset, a way of looking at that >>> particular part of our world that you are trying to

Re: Alternate Python extensions (was alternate Python implementations)

2012-08-06 Thread Stefan Behnel
rusi, 07.08.2012 06:23: > On Aug 4, 11:15 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> Most people are aware, if only vaguely, of the big Four Python >> implementations: > > I think the question about where Cython fits into this, raises the > need for a complementary list to Ste

Alternate Python extensions (was alternate Python implementations)

2012-08-06 Thread rusi
On Aug 4, 11:15 am, Steven D'Aprano wrote: > Most people are aware, if only vaguely, of the big Four Python > implementations: I think the question about where Cython fits into this, raises the need for a complementary list to Steven's. What are the different ways in which python can be extende

Re: The way to develope a graphical application to manage a Postgres database

2012-08-06 Thread rusi
On Aug 5, 11:26 pm, Csanyi Pal wrote: > Mark Lawrence writes: > > On 05/08/2012 16:58, Csanyi Pal wrote: > >> Walter Hurry writes: > > >>> On Thu, 02 Aug 2012 20:24:36 +0200, Csanyi Pal wrote: > > I'm searching for a way to develope a Python graphical application for a > Postgresql dat

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Larry Hudson
On 08/06/2012 11:11 AM, Emile van Sebille wrote: for i in range(N,N+100): for j in range(M,M+100): do_something(i % 100 ,j % 100) Emile How about... for i in range(100): for j in range(100): do_something((i + N) % 100, (j + M) % 100) -=- La

Re: Intermediate Python user needed help

2012-08-06 Thread rusi
On Aug 7, 6:16 am, Steven D'Aprano wrote: > On Mon, 06 Aug 2012 09:05:50 -0700, Ethan Furman wrote: > >   These are not the errors an intermediate user would make, nor the > > questions an intermediate user would ask.  These are the errors that > > somebody who doesn't know Python would make. > >

Re: Intermediate Python user needed help

2012-08-06 Thread Jugurtha Hadjar
On 08/05/2012 09:52 PM, John Mordecai Dildy wrote: NameError: name 'start' is not defined anyone know how to make start defined Maybe rename it "defined_start" ;) I wonder how someone can get to the point of writing more than 76 lines of code while not only still making this kind of errors,

Re: Deciding inheritance at instantiation?

2012-08-06 Thread alex23
On Aug 4, 6:48 am, Tobiah wrote: > I have a bunch of classes from another library (the html helpers > from web2py).  There are certain methods that I'd like to add to > every one of them.  So I'd like to put those methods in a class, > and pass the parent at the time of instantiation.  Web2py has

Re: [newbie] String to binary conversion

2012-08-06 Thread Steven D'Aprano
On Mon, 06 Aug 2012 22:46:38 +0200, Mok-Kong Shen wrote: > If I have a string "abcd" then, with 8-bit encoding of each character, > there is a corresponding 32-bit binary integer. How could I best obtain > that integer and from that integer backwards again obtain the original > string? Thanks in a

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Steven D'Aprano
On Mon, 06 Aug 2012 19:16:45 +0200, Tom P wrote: >> def my_generator(): >> yield 9 >> yield 100 >> for i in range(200, 250): >> yield i >> yield 5 >> >> > Thanks, I'll look at that but I think it just moves the clunkiness from > one place in the code to another. And i

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Ben Finney
Steven D'Aprano writes: > Please trim unnecessary quoted text. > > We don't need to see the entire thread of comment/reply/reply-to-reply > duplicated in *every* email. s/every/any/ -- \ “If you make people think they're thinking, they'll love you; | `\ but if you really make th

Re: Intermediate Python user needed help

2012-08-06 Thread Steven D'Aprano
On Mon, 06 Aug 2012 09:05:50 -0700, Ethan Furman wrote: > These are not the errors an intermediate user would make, nor the > questions an intermediate user would ask. These are the errors that > somebody who doesn't know Python would make. > P.S. The scale I am accustomed to is Novice -> Int

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Steven D'Aprano
On Mon, 06 Aug 2012 17:17:33 +0100, Mark Lawrence wrote: > Please see my comment at the bottom hint hint :) Please trim unnecessary quoted text. We don't need to see the entire thread of comment/reply/reply-to-reply duplicated in *every* email. -- Steven -- http://mail.python.org/mailman/l

Re: [newbie] String to binary conversion

2012-08-06 Thread Emile van Sebille
On 8/6/2012 1:46 PM Mok-Kong Shen said... If I have a string "abcd" then, with 8-bit encoding of each character, there is a corresponding 32-bit binary integer. How could I best obtain that integer and from that integer backwards again obtain the original string? Thanks in advance. It's easy t

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Chris Angelico
On Tue, Aug 7, 2012 at 2:34 AM, rusi wrote: > BTW in "automatic garbage collection" which of the three words is most > important? Least? Most important is "garbage". I sure don't want any language I use to automatically collect non-garbage!! But in seriousness, the definition of "garbage" is one

Re: find out whether a module exists (without importing it)

2012-08-06 Thread Gelonida N
On 08/06/2012 11:58 PM, Miki Tebeka wrote: imp.find_module(), but it didn't find any module name containing a '.' The docs (http://docs.python.org/library/imp.html#imp.find_module) clearly say: "This function does not handle hierarchical module names(names > containing dots). Thanks, Well this

Re: Intermediate Python user needed help

2012-08-06 Thread Chris Angelico
On Tue, Aug 7, 2012 at 5:22 AM, Dennis Lee Bieber wrote: > So am I beginner, intermediate, advanced, expert? I wonder would this sort of a scale help: http://www.geekcode.com/geek.html#perl Novice: P Intermediate: P+ or P++ Advanced: P+++ Master: P ChrisA -- http://mail.python.org/mailman

Re: find out whether a module exists (without importing it)

2012-08-06 Thread Miki Tebeka
> imp.find_module(), but > it didn't find any module name containing a '.' The docs (http://docs.python.org/library/imp.html#imp.find_module) clearly say: "This function does not handle hierarchical module names (names containing dots). In order to find P.M, that is, submodule M of package P, use

Re: [newbie] String to binary conversion

2012-08-06 Thread MRAB
On 06/08/2012 21:46, Mok-Kong Shen wrote: If I have a string "abcd" then, with 8-bit encoding of each character, there is a corresponding 32-bit binary integer. How could I best obtain that integer and from that integer backwards again obtain the original string? Thanks in advance. Try this (P

Re: [newbie] String to binary conversion

2012-08-06 Thread Mok-Kong Shen
Am 06.08.2012 22:59, schrieb Tobiah: The binascii module looks like it might have something for you. I've never used it. Thanks for the hint, but if I don't err, the module binascii doesn't seem to work. I typed: import binascii and a line that's given as example in the document: crc = bina

Re: [newbie] String to binary conversion

2012-08-06 Thread Tobiah
On 08/06/2012 01:59 PM, Tobiah wrote: The binascii module looks like it might have something for you. I've never used it. Having actually read some of that doc, I see it's not what you want at all. Sorry. -- http://mail.python.org/mailman/listinfo/python-list

Re: conditional running of code portion

2012-08-06 Thread Serhiy Storchaka
On 06.08.12 20:02, Dieter Maurer wrote: Serhiy Storchaka writes: On 05.08.12 09:30, Steven D'Aprano wrote: If you are working in a tight loop, you can do this: if VERBOSE_FLAG: for item in loop: print(DEBUG_INFORMATION) do_actual_work(item) else: for item in lo

Re: [newbie] String to binary conversion

2012-08-06 Thread Tobiah
The binascii module looks like it might have something for you. I've never used it. Tobiah http://docs.python.org/library/binascii.html On 08/06/2012 01:46 PM, Mok-Kong Shen wrote: If I have a string "abcd" then, with 8-bit encoding of each character, there is a corresponding 32-bit binary i

[newbie] String to binary conversion

2012-08-06 Thread Mok-Kong Shen
If I have a string "abcd" then, with 8-bit encoding of each character, there is a corresponding 32-bit binary integer. How could I best obtain that integer and from that integer backwards again obtain the original string? Thanks in advance. M. K. Shen -- http://mail.python.org/mailman/listinfo/p

find out whether a module exists (without importing it)

2012-08-06 Thread Gelonida N
Is this possible. let's say I'd like to know whether I could import the module 'mypackage.mymodule', meaning, whther this module is located somewhere in sys.path i tried to use imp.find_module(), but it didn't find any module name containing a '.' Am I doing anything wrong? Is there another e

Re: A difficulty with lists

2012-08-06 Thread MRAB
On 06/08/2012 20:50, Mok-Kong Shen wrote: I ran the following code: def xx(nlist): print("begin: ",nlist) nlist+=[999] print("middle:",nlist) nlist=nlist[:-1] print("final: ",nlist) u=[1,2,3,4] print(u) xx(u) print(u) and obtained the following result: [1, 2, 3, 4] begin:

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Arnaud Delobelle
On 6 August 2012 16:52, Tom P wrote: > consider a nested loop algorithm - > > for i in range(100): > for j in range(100): > do_something(i,j) > > Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some > other values i = N and j = M, and I want to iterate through a

Re: A difficulty with lists

2012-08-06 Thread Chris Kaynor
On Mon, Aug 6, 2012 at 12:50 PM, Mok-Kong Shen wrote: > I ran the following code: > > def xx(nlist): > print("begin: ",nlist) > nlist+=[999] > This is modifying the list in-place - the actual object is being changed to append 999. This can happen because lists are mutable data types in Python

A difficulty with lists

2012-08-06 Thread Mok-Kong Shen
I ran the following code: def xx(nlist): print("begin: ",nlist) nlist+=[999] print("middle:",nlist) nlist=nlist[:-1] print("final: ",nlist) u=[1,2,3,4] print(u) xx(u) print(u) and obtained the following result: [1, 2, 3, 4] begin: [1, 2, 3, 4] middle: [1, 2, 3, 4, 999] final: [1, 2

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Emile van Sebille
On 8/6/2012 12:22 PM Grant Edwards said... On 2012-08-06, Tom P wrote: ah, that looks good - I guess it works in 2.x as well? I don't know. Let me test that for you... Yes, it works in 2.x as well. :) And from the docs, all the way back to 2.3! 9.7. itertools Functions creati

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Grant Edwards
On 2012-08-06, Tom P wrote: no, I meant something else .. j runs through range(M, 100) and then range(0,M), and i runs through range(N,100) and then range(0,N) >>> >>> In 2.x: >>> >>> for i in range(M,100)+range(0,M): >>> for j in range(N,100)+range(0,N): >>>

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
On 08/06/2012 08:29 PM, Grant Edwards wrote: On 2012-08-06, Grant Edwards wrote: On 2012-08-06, Tom P wrote: On 08/06/2012 06:18 PM, Nobody wrote: On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100):

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Grant Edwards
On 2012-08-06, Tom P wrote: > On 08/06/2012 06:18 PM, Nobody wrote: >> On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: >> >>> consider a nested loop algorithm - >>> >>> for i in range(100): >>> for j in range(100): >>> do_something(i,j) >>> >>> Now, suppose I don't want to use i =

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Grant Edwards
On 2012-08-06, Grant Edwards wrote: > On 2012-08-06, Tom P wrote: >> On 08/06/2012 06:18 PM, Nobody wrote: >>> On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: >>> consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread André Malo
* Tom P wrote: > consider a nested loop algorithm - > > for i in range(100): > for j in range(100): > do_something(i,j) > > Now, suppose I don't want to use i = 0 and j = 0 as initial values, but > some other values i = N and j = M, and I want to iterate through all > 10,000 value

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Emile van Sebille
On 8/6/2012 10:14 AM Tom P said... On 08/06/2012 06:18 PM, Nobody wrote: On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial

Re: Deciding inheritance at instantiation?

2012-08-06 Thread Tobiah
On 08/03/2012 02:55 PM, Terry Reedy wrote: On 8/3/2012 4:48 PM, Tobiah wrote: I have a bunch of classes from another library (the html helpers from web2py). There are certain methods that I'd like to add to every one of them. So I'd like to put those methods in a class, and pass the parent at th

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Oscar Benjamin
On 6 August 2012 18:14, Tom P wrote: > On 08/06/2012 06:18 PM, Nobody wrote: > >> On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: >> >> consider a nested loop algorithm - >>> >>> for i in range(100): >>> for j in range(100): >>> do_something(i,j) >>> >>> Now, suppose I don't wan

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
On 08/06/2012 06:03 PM, John Gordon wrote: In Tom P writes: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other values i = N and j = M, and I wan

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
On 08/06/2012 06:18 PM, Nobody wrote: On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other values i = N

Re: Intermediate Python user needed help

2012-08-06 Thread Jean-Michel Pichavant
Ethan Furman wrote: ~Ethan~ P.S. The scale I am accustomed to is Novice -> Intermediate -> Advanced -> Master Are there scales out there that would put these types of questions in the "intermediate" category? Troll -> Novice -> Intermediate -> Advanced Trolls are quite specific, they're

Re: conditional running of code portion

2012-08-06 Thread Dieter Maurer
Serhiy Storchaka writes: > On 05.08.12 09:30, Steven D'Aprano wrote: >> If you are working in a tight loop, you can do this: >> >> if VERBOSE_FLAG: >> for item in loop: >> print(DEBUG_INFORMATION) >> do_actual_work(item) >> else: >> for item in loop: >> do_act

Re: Pickle file and send via socket

2012-08-06 Thread Christian Heimes
Am 06.08.2012 15:32, schrieb S.B: > Does anyone know if it's possible to pickle and un-pickle a file across a > network socket. i.e: > First host pickles a file object and writes the pickled file object to a > client socket. > Second host reads the pickled file object from the server socket and

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread rusi
On Aug 6, 7:27 pm, lipska the kat wrote: > You take out the garbage. > I've got automatic garbage collection :-) BTW in "automatic garbage collection" which of the three words is most important? Least? Heres another take on nouns (and therefore OO): http://hilgart.org/enformy/dma-verb.htm --

OT probably but still relevant (was Re: Looking for a good introduction to object oriented programming with Python)

2012-08-06 Thread lipska the kat
On 06/08/12 13:19, rusi wrote: On Aug 6, 12:46 am, lipska the kat wrote: On 04/08/12 16:49, Jean Dubois wrote: I'm looking for a good introduction to object oriented programming with Python. snip I suggest this http://steve-yegge.blogspot.in/2006/03/execution-in-kingdom-of-nouns.html

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Nobody
On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: > consider a nested loop algorithm - > > for i in range(100): > for j in range(100): > do_something(i,j) > > Now, suppose I don't want to use i = 0 and j = 0 as initial values, but > some other values i = N and j = M, and I want to

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Mark Lawrence
Please see my comment at the bottom hint hint :) On 06/08/2012 16:38, Ramchandra Apte wrote: Its a docstring - it documents the function/class Did you know that docstrings can be used for testing - look at the doctest standard library module! try: class A: def method(self): '''Sam

Re: Pickle file and send via socket

2012-08-06 Thread Nobody
On Mon, 06 Aug 2012 06:32:13 -0700, S.B wrote: > Does anyone know if it's possible to pickle and un-pickle a file across > a network socket. i.e: First host pickles a file object and writes the > pickled file object to a client socket. Second host reads the pickled > file object from the server so

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Ian Foote
The function range can be called with more than one argument. For example: for i in range(N, N + 10): for j in range(M, M + 100): do_something(i, j) You can also call range with 3 arguments, if want a step size different to 1: for k in range(2, 11, 3): print(k) 2 5 8 Hope th

Re: Intermediate Python user needed help

2012-08-06 Thread Alec Taylor
On Tue, Aug 7, 2012 at 2:05 AM, Ethan Furman wrote: > John Mordecai Dildy wrote: >> >> I am currently using python 2.6 and am not going to install the newer >> versions of python and i am looking for people that are still using ver 2.6 >> in python to help with with the code line: >> >> sentence =

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread John Gordon
In Tom P writes: > consider a nested loop algorithm - > for i in range(100): > for j in range(100): > do_something(i,j) > Now, suppose I don't want to use i = 0 and j = 0 as initial values, but > some other values i = N and j = M, and I want to iterate through all > 10,000 valu

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Ethan Furman
Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other values i = N and j = M, and I want to iterate through all 10,000 values in sequence - is t

Script to easily install eGenix PyRun in a target directory

2012-08-06 Thread M.-A. Lemburg
Hello, in case you haven't heard of eGenix PyRun yet, this is a new simple to install Python runtime that can be used independently of a system installed Python version and is very small compared to a regular Python installation. See http://www.egenix.com/products/python/PyRun/ for details. We'r

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Oscar Benjamin
On 6 August 2012 16:52, Tom P wrote: > consider a nested loop algorithm - > > for i in range(100): > for j in range(100): > do_something(i,j) > > Now, suppose I don't want to use i = 0 and j = 0 as initial values, but > some other values i = N and j = M, and I want to iterate through

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Oscar Benjamin
Are you familiar with the itertools module? itertools.product is designed for this purpose: http://docs.python.org/library/itertools#itertools.product Oscar. On 6 August 2012 16:52, Tom P wrote: > consider a nested loop algorithm - > > for i in range(100): > for j in range(100): >

Re: Intermediate Python user needed help

2012-08-06 Thread Ethan Furman
John Mordecai Dildy wrote: I am currently using python 2.6 and am not going to install the newer versions of python and i am looking for people that are still using ver 2.6 in python to help with with the code line: sentence = "All good things come to those who wait." then im getting this err

looking for a neat solution to a nested loop problem

2012-08-06 Thread Tom P
consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial values, but some other values i = N and j = M, and I want to iterate through all 10,000 values in sequence - is there a neat py

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Ramchandra Apte
Its a docstring - it documents the function/class Did you know that docstrings can be used for testing - look at the doctest standard library module! try: class A: def method(self): '''Sample method This method does the difficult task X. Call this method with no arguments.'''#docstring

Re: cant upload the python window popup

2012-08-06 Thread Ramchandra Apte
Please explain the problem like this: 1. What you expected 2. What happened 3. Other info. On 6 August 2012 19:25, Mario Blanco wrote: > I delete by error the python window inteface and now i cant reupload again > some advice is apreciated > thanks > > -- > http://mail.python.org/mailman/listinf

Re: dbf.py API question

2012-08-06 Thread Ethan Furman
[redirecting back to list] Ole Martin Bjørndalen wrote: On Sun, Aug 5, 2012 at 4:09 PM, Ethan Furman wrote: Ole Martin Bjørndalen wrote: You can do this by implementing either __getitem__ or __iter__, unless the streaming flag would also make your table not in memory. Cool! Wow! I realize n

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Jean Dubois
On 5 aug, 20:28, Mark Lawrence wrote: > On 05/08/2012 19:04, Jean Dubois wrote: > > > > > > > > > > > On 5 aug, 02:11, shearich...@gmail.com wrote: > >> One reason you may be having difficulty is that unlike some languages > >> (C++/Java) object-orientation is not a be all and end all in Python,

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread lipska the kat
On 06/08/12 13:19, rusi wrote: On Aug 6, 12:46 am, lipska the kat wrote: On 04/08/12 16:49, Jean Dubois wrote: I'm looking for a good introduction to object oriented programming with Python. Object Oriented programming is a mindset, a way of looking at that particular part of our world t

cant upload the python window popup

2012-08-06 Thread Mario Blanco
I delete by error the python window inteface and now i cant reupload again some advice is apreciated thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle file and send via socket

2012-08-06 Thread Ramchandra Apte
You can use pickle.dumps and pickle.loads On 6 August 2012 19:17, Ramchandra Apte wrote: > This is *absolutely* possible. > Did you know that IDLE uses this very method when run i

Re: Pickle file and send via socket

2012-08-06 Thread Ramchandra Apte
This is *absolutely* possible. Did you know that IDLE uses this very method when run in sub-process mode! On 6 August 2012 19:02, S.B wrote: > Hello friends > > Does anyone know if it's possible to pickle and un-pickle a file across a > network socket. i.e: > First host pickles a file object and

Pickle file and send via socket

2012-08-06 Thread S.B
Hello friends Does anyone know if it's possible to pickle and un-pickle a file across a network socket. i.e: First host pickles a file object and writes the pickled file object to a client socket. Second host reads the pickled file object from the server socket and un-pickles it. Can anyone p

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Roy Smith
In article , lipska the kat wrote: > UML works, non technical 'stakeholders' (yuk) can understand it at a > high level and in my HUMBLE opinion the sequence diagram is the single > most important piece of documentation in the entire software project Yup. Sequence diagrams are the most common

Re: conditional running of code portion

2012-08-06 Thread Ramchandra Apte
I just googled the OP's question and found a StackOverflow question. That question's solution mentions pypreprocessor. On 6 August 2012 08:20, Steven W. Orr wrote: > On 8/5/2012 12:43 AM, Ramchandra Apte wrote: > >> Try pypreprocessor >>

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread rusi
On Aug 6, 12:46 am, lipska the kat wrote: > On 04/08/12 16:49, Jean Dubois wrote: > > > I'm looking for a good introduction to object oriented programming > > with Python. > > Object Oriented programming is a mindset, a way of looking at that > particular part of our world that you are trying to

Re: distutils bdist_wininst failure on Linux

2012-08-06 Thread Bob Bowles
Steven D'Aprano-11 wrote > > And I have a work-around that seems to work for me. Put this at the top > of your setup.py install script: > > > > # Work around mbcs bug in distutils. > # http://bugs.python.org/issue10945 > import codecs > try: > codecs.lookup('mbcs') > except LookupError: >

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread lipska the kat
On 06/08/12 09:55, lipska the kat wrote: On 06/08/12 01:22, Steven D'Aprano wrote: On Sun, 05 Aug 2012 20:46:23 +0100, lipska the kat wrote: snip Well as you seem to be so concerned with terminology I'd have to disagree with you here. An interface (in computing) has any number of meanings

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread DJC
On 06/08/12 02:27, Steven D'Aprano wrote: On Sun, 05 Aug 2012 19:12:35 -0400, Roy Smith wrote: Good lord. I'd rather read C++ than UML. And I can't read C++. UML is under-rated. I certainly don't have any love of the 47 different flavors of diagram, but the basic idea of having a common gra

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread lipska the kat
On 06/08/12 01:22, Steven D'Aprano wrote: On Sun, 05 Aug 2012 20:46:23 +0100, lipska the kat wrote: Object Oriented programming is a mindset, a way of looking at that particular part of our world that you are trying to encapsulate in computer language. The language you use is (should be) irrel

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread lipska the kat
On 06/08/12 01:27, Steven D'Aprano wrote: On Sun, 05 Aug 2012 19:12:35 -0400, Roy Smith wrote: Good lord. I'd rather read C++ than UML. And I can't read C++. UML is under-rated. I certainly don't have any love of the 47 different flavors of diagram, but the basic idea of having a common gra

Re: Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread lipska the kat
On 05/08/12 23:51, Steven D'Aprano wrote: On Sun, 05 Aug 2012 18:45:47 -0400, Dennis Lee Bieber wrote: Don't look for Object-Oriented Programming -- since the first widely popular OOP language was C++ (Smalltalk was earlier, but rather specialized, whereas C++ started as a preprocessor for C).

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-06 Thread Paul Rubin
Steven D'Aprano writes: >> I suspect), but can't say that I've ever used a "factory function"... > If you've ever used an ordinary function decorator, you almost certainly > have. > If you've every created a closure, you definitely have. Or anything with a __iter__ method... -- http://mail.pyth