personal firewall software is blocking the connection

2010-09-05 Thread vsoler
I'am getting this annoying message all the time when using IDLE. ... personal firewall software is blocking the connection When I am editing a source *.py file and I click on F5 (run) I get the above message. What can I do? I am using Norton Internet Security. I try to find if 127.0.0.1 is

IDLE: personal firewall software is blocking the connection

2010-09-05 Thread vsoler
On 5 sep, 18:00, vsoler vicente.so...@gmail.com wrote: I'am getting this annoying message all the time when using IDLE. ...  personal firewall software is blocking the connection When I am editing a source *.py file and I click on F5 (run) I get the above message. What can I do? I am

Re: Source code for itertools

2010-09-01 Thread vsoler
On 31 ago, 05:33, Rolando Espinoza La Fuente dark...@gmail.com wrote: On Mon, Aug 30, 2010 at 11:06 PM, vsoler vicente.so...@gmail.com wrote: On 31 ago, 04:42, Paul Rubin no.em...@nospam.invalid wrote: vsoler vicente.so...@gmail.com writes: I was expecting an itertools.py file, but I don't

Re: Source code for itertools

2010-09-01 Thread vsoler
On 1 sep, 06:30, Tim Roberts t...@probo.com wrote: vsoler vicente.so...@gmail.com wrote: On 31 ago, 04:42, Paul Rubin no.em...@nospam.invalid wrote: vsoler vicente.so...@gmail.com writes: I was expecting an itertools.py file, but I don't see it in your list. ./python3.1-3.1.2+20100829

Source code for itertools

2010-08-30 Thread vsoler
I'm interested in studying the itertools source code, especially the permutations function. However, I cannot find the library. Where could I find it? Running Python 3.1 Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Source code for itertools

2010-08-30 Thread vsoler
On 31 ago, 04:14, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 9aa266f0-be9b-4c9a-bfbd-6cdfc86ad...@t20g2000yqa.googlegroups.com, vsoler wrote: I'm interested in studying the itertools source code, especially the permutations function. However, I cannot

Re: Source code for itertools

2010-08-30 Thread vsoler
On 31 ago, 04:42, Paul Rubin no.em...@nospam.invalid wrote: vsoler vicente.so...@gmail.com writes: I was expecting an itertools.py file, but I don't see it in your list. ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c looks promising.  Lots of stdlib modules are written in C for speed

Re: Reading the access attributes of directories in Windows

2010-08-23 Thread vsoler
On Aug 21, 8:10 am, Tim Golden m...@timgolden.me.uk wrote: On 20/08/2010 11:54 PM, vsoler wrote: I'am testing your library. I am mainly interested in knowing the access attributes of directories in the local(C:\) or shared unit(W:\) of my system. Using your script with 'c:\\' I get

Proper set-up for a co-existant python 2.6 3.1 installation

2010-08-23 Thread vsoler
I started learning python with ver 2.6. Then I switched to 3.1 after uninstalling the previous version. Now I find that many of the code snippets that I would need are written for py 2.6. Sometimes the automatic converter 2to3 doesn't help, because it is not able to complete its objective and

Re: Proper set-up for a co-existant python 2.6 3.1 installation

2010-08-23 Thread vsoler
On 24 ago, 00:55, Martin v. Loewis mar...@v.loewis.de wrote: I tried to change file associations, first manually, in a CMD window. But the system was responding access denied even when I used an Administrator account (I was using FTYPE python.file=C: \Python26\python.exe %1 %*). That

Re: Proper set-up for a co-existant python 2.6 3.1 installation

2010-08-23 Thread vsoler
On Aug 24, 1:33 am, Martin v. Loewis mar...@v.loewis.de wrote: When I am logged-in in a session as an administrator, the BAT file on the Desktop, and I double-click on it, it does not work. This is not what I meant. Instead, right-click on the BAT file, and select run as administrator.

Re: Reading the access attributes of directories in Windows

2010-08-21 Thread vsoler
On Aug 21, 8:10 am, Tim Golden m...@timgolden.me.uk wrote: On 20/08/2010 11:54 PM, vsoler wrote: I'am testing your library. I am mainly interested in knowing the access attributes of directories in the local(C:\) or shared unit(W:\) of my system. Using your script with 'c:\\' I get

Re: Reading the access attributes of directories in Windows

2010-08-21 Thread vsoler
On Aug 21, 8:10 am, Tim Golden m...@timgolden.me.uk wrote: On 20/08/2010 11:54 PM, vsoler wrote: I'am testing your library. I am mainly interested in knowing the access attributes of directories in the local(C:\) or shared unit(W:\) of my system. Using your script with 'c:\\' I get

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 9:36 am, Tim Golden m...@timgolden.me.uk wrote: I currently do not have subversion access in my PC. I could try to install a free copy of it. But it you could ptovide an installer, it certainly would do things easier. Please let me know if it is possible. Vicente, can you just

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 9:36 am, Tim Golden m...@timgolden.me.uk wrote: I currently do not have subversion access in my PC. I could try to install a free copy of it. But it you could ptovide an installer, it certainly would do things easier. Please let me know if it is possible. Vicente, can you just

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 4:26 pm, vsoler vicente.so...@gmail.com wrote: On Aug 20, 9:36 am, Tim Golden m...@timgolden.me.uk wrote: I currently do not have subversion access in my PC. I could try to install a free copy of it. But it you could ptovide an installer, it certainly would do things easier

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 5:10 pm, Tim Golden m...@timgolden.me.uk wrote: On 20/08/2010 15:49, vsoler wrote: On Aug 20, 4:26 pm, vsolervicente.so...@gmail.com  wrote: On Aug 20, 9:36 am, Tim Goldenm...@timgolden.me.uk  wrote: I currently do not have subversion access in my PC. I could try to install

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 5:10 pm, Tim Golden m...@timgolden.me.uk wrote: On 20/08/2010 15:49, vsoler wrote: On Aug 20, 4:26 pm, vsolervicente.so...@gmail.com  wrote: On Aug 20, 9:36 am, Tim Goldenm...@timgolden.me.uk  wrote: I currently do not have subversion access in my PC. I could try to install

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread vsoler
On Aug 20, 7:42 pm, Tim Golden m...@timgolden.me.uk wrote: On 20/08/2010 5:10 PM, vsoler wrote: On Aug 20, 5:10 pm, Tim Goldenm...@timgolden.me.uk  wrote: To decode the permission bit-strings to vaguely meaningful names: code import os, sys from winsys import fs dacl = fs.file

Reading the access attributes of directories in Windows

2010-08-19 Thread vsoler
Hello everyone! I need to read, for each of the directories in a shared file server unit, who has access to the directories and what type of access privileges. This is something that I can easily do interactively in my Windows Document Explorer by right clicking a single directory, clicking on

Re: Reading the access attributes of directories in Windows

2010-08-19 Thread vsoler
On Aug 19, 8:55 pm, Tim Golden m...@timgolden.me.uk wrote: On 19/08/2010 4:55 PM, vsoler wrote: I need to read, for each of the directories in a shared file server unit, who has access to the directories and what type of access privileges. This is something that I can easily do

Re: Reading the access attributes of directories in Windows

2010-08-19 Thread vsoler
On Aug 19, 10:59 pm, Tim Golden m...@timgolden.me.uk wrote: On 19/08/2010 9:17 PM, vsoler wrote: On Aug 19, 8:55 pm, Tim Goldenm...@timgolden.me.uk  wrote: On 19/08/2010 4:55 PM, vsoler wrote: I need to read, for each of the directories in a shared file server unit, who has access

The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread vsoler
Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE GUI works, but I get the following message when trying to open *.py files written for py 2.6 The Application cannot locate win32ui.pyd (or Python) (126) Should I change the PATH in

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread vsoler
On Aug 4, 5:41 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I used to have python 2.6.4. I'm working on Win7. The IDLE GUI works, but I get the following message when trying to open

Re: The Application cannot locate win32ui.pyd (or Python) (126)

2010-08-04 Thread vsoler
On Aug 4, 7:52 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 5:19 pm, vsoler vicente.so...@gmail.com wrote: On Aug 4, 5:41 pm, Alex Willmer a...@moreati.org.uk wrote: On Aug 4, 2:35 pm, vsoler vicente.so...@gmail.com wrote: Hi all, I just installed python 3.1.2 where I

global variables in imported modules

2010-05-16 Thread vsoler
Taken from www.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0 # Default value of the 'x' configuration setting mod.py: import config config.x = 1 main.py: import config # try removing it import mod print config.x The example, such as shown in

Re: global variables in imported modules

2010-05-16 Thread vsoler
On 17 mayo, 00:05, Patrick Maupin pmau...@gmail.com wrote: On May 16, 4:42 pm, vsoler vicente.so...@gmail.com wrote: Taken fromwww.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0   # Default value of the 'x' configuration setting mod.py

Re: global variables in imported modules

2010-05-16 Thread vsoler
On 17 mayo, 00:38, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x or mod.config.x) it is always the same 'x'. I mean that either

Re: global variables in imported modules

2010-05-16 Thread vsoler
On 17 mayo, 00:52, Patrick Maupin pmau...@gmail.com wrote: On May 16, 5:38 pm, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x

Calling a class method

2010-04-17 Thread vsoler
I have the following script: class TTT(object): def duplica(self): self.data *= 2 def __init__(self, data): self.data = data TTT.duplica(self.data) def __str__(self): return str(self.data) print obj=TTT(7) print obj And I want 14 printed (twice 7) I

Extracting an undefined number of items from a list

2010-04-12 Thread vsoler
Hi everyone, say that 'db' is a list of values say 'i' is a list of indexes I'd like to get a list where each item is i-th element of db. For example: db=[10,20,30,40,50,60,70,80,90] #undefined length i=[3,5,7] #undefined length then

Re: Extracting an undefined number of items from a list

2010-04-12 Thread vsoler
On 12 abr, 22:11, Patrick Maupin pmau...@gmail.com wrote: On Apr 12, 3:05 pm, vsoler vicente.so...@gmail.com wrote: Hi everyone, say that 'db' is a list of values say 'i' is a list of indexes I'd like to get a list where each item is i-th element of db. For example: db

On Class namespaces, calling methods

2010-04-10 Thread vsoler
Still learning python, especially OOP. While testing classes, I sometimes think of them as ordinary containers of values and functions (methods). That is, values and functions can be grouped together inside namespaces calles classes. class Uno: a=1 def m(): print mouse Say that

Re: Clearing memory (namespace) before running code

2010-04-10 Thread vsoler
On Mar 21, 5:18 pm, Jon Clements jon...@googlemail.com wrote: On 21 Mar, 15:02, vsoler vicente.so...@gmail.com wrote: Hi, Is there a way to erase/delete/clear memory before a piece of code is run? Otherwise, the objects of the previous run are re-usable, and may bring confusion

Re: On Class namespaces, calling methods

2010-04-10 Thread vsoler
On Apr 10, 4:46 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: vsoler vicente.so...@gmail.com wrote: I get the following error message:      TypeError: m() takes no arguments (1 given) Since I have not created any instances of Uno, there is no self object, and I do not understand

Re: On Class namespaces, calling methods

2010-04-10 Thread vsoler
On Apr 10, 4:46 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: vsoler vicente.so...@gmail.com wrote: I get the following error message:      TypeError: m() takes no arguments (1 given) Since I have not created any instances of Uno, there is no self object, and I do not understand

Re: On Class namespaces, calling methods

2010-04-10 Thread vsoler
On Apr 10, 5:28 pm, Laszlo Nagy gand...@shopzeus.com wrote: class Uno:     a=1     def m():         print mouse Say that I have this silly class. While I can then write       print Uno.a I cannot write       Uno.m() I get the following error message:      TypeError: m()

function decorator-like function

2010-03-27 Thread vsoler
Hi, Still learning Python, now decorators. Before diving deeply into decorators, I'd like to apply a function to another function. My extremely simple function should print number 3, then the sum of its 2 arguments. Say that I call f(5,7) I'd like to get, somehow, 3 then 12. I've tried the

Re: function decorator-like function

2010-03-27 Thread vsoler
On 27 mar, 17:06, Patrick Maupin pmau...@gmail.com wrote: On Mar 27, 10:24 am, vsoler vicente.so...@gmail.com wrote: Hi, Still learning Python, now decorators. Before diving deeply into decorators, I'd like to apply a function to another function. My extremely simple function

Re: function decorator-like function

2010-03-27 Thread vsoler
On 27 mar, 17:21, vsoler vicente.so...@gmail.com wrote: On 27 mar, 17:06, Patrick Maupin pmau...@gmail.com wrote: On Mar 27, 10:24 am, vsoler vicente.so...@gmail.com wrote: Hi, Still learning Python, now decorators. Before diving deeply into decorators, I'd like to apply

Clearing memory (namespace) before running code

2010-03-21 Thread vsoler
Hi, Is there a way to erase/delete/clear memory before a piece of code is run? Otherwise, the objects of the previous run are re-usable, and may bring confusion to the tester. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Breaking the __main__ script

2010-03-14 Thread vsoler
Hello, I am still learning python, thus developnig small scripts. Some of them consist only of the main module. While testing them (debugging) I sometimes want to stop the script at a certain point, with something likestop, break, end or something similar. What statement can I use?

print formatting

2010-03-13 Thread vsoler
Hello, My script contains a print statement: print '%40s %15d' % (k, m) However, 1- the string is right adjusted, and I would like it left adjusted 2- the number is a decimal number, and I would like it with the thousands separator and 2 decimals If possible,

building a dict

2010-03-13 Thread vsoler
Say that m is a tuple of 2-tuples m=(('as',3), ('ab',5), (None, 1), ('as',None), ('as',6)) and I need to build a d dict where each key has an associated list whose first element is the count, and the second is the sum. If a 2- tuple contains a None value, it should be discarded. The expected

Re: building a dict

2010-03-13 Thread vsoler
On 13 mar, 18:16, ru...@yahoo.com wrote: On Mar 13, 9:26 am, ru...@yahoo.com wrote: That should be: d = {} for item in m:       key = item[0];  value = item[1]     if key is None or value is None: continue     if key not in dict:         d[key] = [1, value]     else:        

a simple def how-to

2010-03-07 Thread vsoler
Hello, My script starts like this: book=readFromExcelRange('book') house=readFromExcelRange('house') table=readFromExcelRange('table') read=readFromExcelRange('read') ... But I would like to have something equivalent, like... ranges=['book','house','table','read'] for i in ranges:

Re: a simple def how-to

2010-03-07 Thread vsoler
On 7 mar, 16:23, Andreas Waldenburger use...@geekmail.invalid wrote: On Sun, 7 Mar 2010 07:05:26 -0800 (PST) vsoler vicente.so...@gmail.com wrote: Hello, My script starts like this: book=readFromExcelRange('book') house=readFromExcelRange('house') table=readFromExcelRange('table

Re: a simple def how-to

2010-03-07 Thread vsoler
On 7 mar, 16:23, John Posner jjpos...@optimum.net wrote: On 3/7/2010 10:05 AM, vsoler wrote: Hello, My script starts like this: book=readFromExcelRange('book') house=readFromExcelRange('house') table=readFromExcelRange('table') read=readFromExcelRange('read') ... But I would

Duplicate keys in dict?

2010-03-07 Thread vsoler
Hello, My code snippet reads data from excel ranges. First row and first column are column headers and row headers respectively. After reding the range I build a dict. 'A'..'B' 'ab'35 'cd'72

Re: Duplicate keys in dict?

2010-03-07 Thread vsoler
On 7 mar, 17:53, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 07 Mar 2010 08:23:13 -0800, vsoler wrote: Hello, My code snippet reads data from excel ranges. First row and first column are column headers and row headers respectively. After reding the range I build

Printing the arguments of an attribute in a class

2010-02-28 Thread vsoler
I have a class that is a wrapper: class wrapper: def __init__(self, object): self.wrapped = object def __getattr__(self, attrname): print 'Trace: ', attrname #print arguments to attrname, how? return getattr(self.wrapped, attrname) I can run it this way:

Re: Printing the arguments of an attribute in a class

2010-02-28 Thread vsoler
On Feb 28, 4:00 pm, Alf P. Steinbach al...@start.no wrote: * vsoler: I have a class that is a wrapper: class wrapper:     def __init__(self, object):         self.wrapped = object     def __getattr__(self, attrname):         print 'Trace: ', attrname         #print arguments

Re: formatting a number as percentage

2010-02-23 Thread vsoler
On Feb 22, 8:32 pm, Hans Mulder han...@xs4all.nl wrote: Günther Dietrich wrote: vsoler vicente.so...@gmail.com wrote: I'm trying to print .7 as 70% I've tried: print format(.7,'%%') .7.format('%%') but neither works. I don't know what the syntax is... Did you try this: print

Creating variables from dicts

2010-02-23 Thread vsoler
Hi, I have two dicts n={'a', 'm', 'p'} v={1,3,7} and I'd like to have a=1 m=3 p=7 that is, creating some variables. How can I do this? -- http://mail.python.org/mailman/listinfo/python-list

Saving the Interactive Window with PythonWin

2010-02-21 Thread vsoler
Hi everyone, When I run a python script, I know that I can print the results of my calculations on the Interactive Window. Once the scripts ends, I can copy/pate these results on an OpenOffice Writer document. However, I would like to know if I can somehow add some lines to my script, so that it

formatting a number as percentage

2010-02-21 Thread vsoler
I'm trying to print .7 as 70% I've tried: print format(.7,'%%') .7.format('%%') but neither works. I don't know what the syntax is... Can you help? Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: formatting a number as percentage

2010-02-21 Thread vsoler
On Feb 21, 7:11 pm, TomF tomf.sess...@gmail.com wrote: On 2010-02-21 09:53:45 -0800, vsoler vicente.so...@gmail.com said: I'm trying to print .7 as 70% I've tried: print format(.7,'%%') .7.format('%%') but neither works. I don't know what the syntax is... print Grade is {0

Building a dict from a tuple of tuples

2010-02-20 Thread vsoler
Hello everyone! I have a tuple of tuples, coming from an Excel range, such as this: ((None, u'x', u'y'), (u'a', 1.0, 7.0), (u'b', None, 8.0)) I need to build a dictionary that has, as key, the row and column header. For example: d={ (u'a',u'x'):1.0, (u'a',u'y'): 7.0, (u'b',u'y'):8.0 } As you

Re: Building a dict from a tuple of tuples

2010-02-20 Thread vsoler
On Feb 20, 7:00 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello everyone! I have a tuple of tuples, coming from an Excel range, such as this: ((None, u'x', u'y'), (u'a', 1.0, 7.0), (u'b', None, 8.0)) I need to build a dictionary that has, as key, the row and column

Re: Building a dict from a tuple of tuples

2010-02-20 Thread vsoler
On Feb 20, 8:54 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: On Feb 20, 7:00 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello everyone! I have a tuple of tuples, coming from an Excel range, such as this: ((None, u'x', u'y'), (u'a', 1.0, 7.0), (u'b', None

Re: Selecting a file in a directory

2010-02-13 Thread vsoler
On Feb 14, 2:28 am, Alf P. Steinbach al...@start.no wrote: * vsoler: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs to work on in as much the same way as I open a .xls file in Excel

Re: Selecting a file in a directory

2010-02-13 Thread vsoler
On Feb 14, 2:45 am, rantingrick rantingr...@gmail.com wrote: On Feb 13, 7:28 pm, Alf P. Steinbach al...@start.no wrote: * vsoler: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs

Re: Unable to install numpy

2010-01-31 Thread vsoler
On Jan 18, 9:08 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-01-18 14:02 PM, vsoler wrote: Hi all, I just download Numpy, and tried to install it using numpy-1.4.0- win32-superpack-python2.6.exe I get an error:  Python version 2.6 required, which was not found in the Registry

Unable to install numpy

2010-01-18 Thread vsoler
Hi all, I just download Numpy, and tried to install it using numpy-1.4.0- win32-superpack-python2.6.exe I get an error: Python version 2.6 required, which was not found in the Registry However, I am using Python 2.6 every day. I'm running Windows 7. What can I do? --

parsing an Excel formula with the re module

2010-01-05 Thread vsoler
Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks reference one another, etc. Hence, I need to parse Excel

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 19:35, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one

Re: What is the best data structure for a very simple spreadsheet?

2010-01-05 Thread vsoler
... Here is a sample controller that shows you how to embed the spreadsheet in web page:http://code.google.com/p/web2py/source/browse/applications/examples/c... Massimo On Jan 3, 5:27 am, vsoler vicente.so...@gmail.com wrote: Hi, Not sure this is the best group to post, but I cannot

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:05, Mensanator mensana...@aol.com wrote: On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:21, vsoler vicente.so...@gmail.com wrote: On 5 ene, 20:05, Mensanator mensana...@aol.com wrote: On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am

What is the best data structure for a very simple spreadsheet?

2010-01-03 Thread vsoler
Hi, Not sure this is the best group to post, but I cannot think of any other. My application would contain a limited set of cells represented by the instances of a Cell class: class Cell: ... A1=Cell(7) A2=Cell(2*A1) A3=Cell(3*A1+A2) A4=Cell(A3*4) Of course, A1 = 7, A2 = 14, A3 = 35 and A4 =

Re: What is the best data structure for a very simple spreadsheet?

2010-01-03 Thread vsoler
On Jan 3, 1:28 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 03 Jan 2010 03:27:46 -0800, vsoler wrote: My application would contain a limited set of cells represented by the instances of a Cell class: class Cell: ... A1=Cell(7) A2=Cell(2*A1) A3=Cell(3*A1

Endless loop

2010-01-02 Thread vsoler
hello, I'm learning Python and OOP, and I am confronted with a rather theoretical problem. If I run the following script: class stepper: def __getitem__(self, i): return self.data[i] X=stepper() X.data=Spam for item in X: print item, ... what I get is S p a m which

Re: Endless loop

2010-01-02 Thread vsoler
On 2 ene, 14:21, Ulrich Eckhardt dooms...@knuut.de wrote: vsoler wrote: class stepper:     def __getitem__(self, i):         return self.data[i] X=stepper() X.data=Spam for item in X:     print item, ... what I get is     S p a m     which seems logical to me since the loop

Default working directory

2009-12-22 Thread vsoler
I'm using Python 2.6.4 on Windows (Vista 7) I usually start Python by clicking on Start Menu the Python IDLE (Python GUI). However, if I want to save a new source *.py file, the default directory proposed for saving is not the one that I want. What can I do if I want that the change of default

Re: Default working directory

2009-12-22 Thread vsoler
On 22 dic, 18:22, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 22 Dec 2009 14:04:23 -0300, vsoler vicente.so...@gmail.com   escribió: I'm using Python 2.6.4 on Windows (Vista 7) I usually start Python by clicking on Start Menu the Python IDLE (Python GUI). However, if I

unable to read the __main__ namespace

2009-12-13 Thread vsoler
I'm learning Python, and I am very fond of it. Using Python 2.6 I am able to list all the names in a class namespace: class abc: pass abc.a1=7 abc.a2='Text' print abc.__dict__.keys() a) However, I do not know how to read the __main__ namespace print __main__.__dict__.keys()# Just does

Re: unable to read the __main__ namespace

2009-12-13 Thread vsoler
On Dec 13, 12:34 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Dec 13, 2009 at 3:20 AM, vsoler vicente.so...@gmail.com wrote: I'm learning Python, and I am very fond of it. Using Python 2.6 I am able to list all the names in a class namespace: class abc: pass abc.a1=7 abc.a2

Re: When will Python 3 be fully deployed

2009-12-07 Thread vsoler
On Dec 6, 11:53 pm, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Edward A. Falk wrote: cut For development purposes, you should stick with the oldest version that will actually run your code.  Every time you move to a more modern version, you're leaving potential

Where is my namespace?

2009-12-07 Thread vsoler
I take the example from Mark Lutz's excellent book Learning Python. *** In nested1.py I have: X=99 def printer(): print X *** In nested2.py I have: from nested1 import X, printer X=88 printer() What is amazing is that running nested2.py prints 99 and not 88. My questions are: 1. Using

Re: Where is my namespace?

2009-12-07 Thread vsoler
On Dec 7, 5:39 pm, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Mon, Dec 7, 2009 at 11:10 AM, vsoler vicente.so...@gmail.com wrote: I take the example from Mark Lutz's excellent book Learning Python. *** In nested1.py  I have: X=99 def printer(): print X *** In nested2.py  I

Re: Changing the current directory (full post)

2009-11-16 Thread vsoler
On Nov 16, 2:35 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sun, 15 Nov 2009 09:04:06 -0300, vsoler vicente.so...@gmail.com escribió: Ever since I installed my Python 2.6 interpreter (I use IDLE), I've been saving my *.py files in the C:\Program Files\Python26 directory, which

Re: Changing the current directory (full post)

2009-11-16 Thread vsoler
On Nov 16, 8:45 pm, Chris Rebert c...@rebertia.com wrote: On Mon, Nov 16, 2009 at 11:36 AM, vsoler vicente.so...@gmail.com wrote: On Nov 16, 2:35 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sun, 15 Nov 2009 09:04:06 -0300, vsoler vicente.so...@gmail.com escribió: Ever since

Changing the current directory

2009-11-15 Thread vsoler
Ever since I installed my Python 2.6 interpreter, I've been saving my *.py files in the C:\Program Files\Python26 directory, which is the default directory for such files in my system. However, I have realised that the above is not the best practice. Therefore I created the C:\Program

Changing the current directory (full post)

2009-11-15 Thread vsoler
Oops!!! something went wrong with my keyboard. Here you have my full post: Ever since I installed my Python 2.6 interpreter (I use IDLE), I've been saving my *.py files in the C:\Program Files\Python26 directory, which is the default directory for such files in my system. However, I have

Re: My own accounting python euler problem

2009-11-08 Thread vsoler
On Nov 8, 1:27 pm, Ozz notva...@wathever.com wrote: Robert P. J. Day schreef:   does your solution allow for the possibility of different invoices of equal amounts?  i would be reluctant to use the word subset in a context where you can have more than one element with the same value. I

My own accounting python euler problem

2009-11-07 Thread vsoler
In the accounting department I am working for we are from time to time confronted to the following problem: A customer sends us a check for a given amount, but without specifying what invoices it cancels. It is up to us to find out which ones the payment corresponds to. For example, say that the

Listing variables

2009-10-25 Thread vsoler
Say that a have: # file test.py a=7 At the prompt: import test dir() I would like to see the variables created in the test namespace. However, variable a does not appear in the list, only test. Since I know that var a is reachable from the prompt by means of test.a, how can I list this sort of

Re: Listing variables

2009-10-25 Thread vsoler
On Oct 25, 12:01 pm, Tim Chase python.l...@tim.thechases.com wrote: Say that a have: # file test.py a=7 At the prompt: import test dir() I would like to see the variables created in the test namespace. However, variable a does not appear in the list, only test. Since I know

Re: Listing variables

2009-10-25 Thread vsoler
On Oct 25, 1:32 pm, Tim Chase python.l...@tim.thechases.com wrote: If I just input dir(test) I don't get a in my list. import test dir(test) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'] I am using python 2.6 Am I doing anything wrong? Are you

Re: Listing variables

2009-10-25 Thread vsoler
On Oct 25, 5:07 pm, Tim Chase python.l...@tim.thechases.com wrote: t...@rubbish:~/tmp$ rm test.py test.pyc t...@rubbish:~/tmp$ python2.5   import test   dir(test) ['__builtins__', '__doc__', '__file__', '__name__', '__path__']   test.__file__ '/usr/lib/python2.5/test/__init__.pyc'

Efficient way to sum a product of numbers...

2009-08-31 Thread vsoler
Hi, After simplifying my problem, I can say that I want to get the sum of the product of two culumns: Say m= [[ 'a', 1], [ 'b', 2],[ 'a', 3]] r={'a':4, 'b':5, 'c':6} What I need is the calculation 1*4 + 2*5 + 3*4 = 4 + 10 + 12 = 26 That is, for each row list in

Re: Efficient way to sum a product of numbers...

2009-08-31 Thread vsoler
On Aug 31, 6:30 pm, Tim Chase python.l...@tim.thechases.com wrote: After simplifying my problem, I can say that I want to get the sum of the product of two culumns: Say          m= [[ 'a', 1], [ 'b', 2],[ 'a', 3]] assuming you meant ['c', 3] here...    ^          r={'a':4, 'b':5, 'c':6}

Re: Efficient way to sum a product of numbers...

2009-08-31 Thread vsoler
On Aug 31, 6:59 pm, Tim Chase python.l...@tim.thechases.com wrote: vsoler wrote: On Aug 31, 6:30 pm, Tim Chase python.l...@tim.thechases.com wrote: After simplifying my problem, I can say that I want to get the sum of the product of two culumns: Say          m= [[ 'a', 1], [ 'b', 2

Re: Colors on IDLE

2009-08-29 Thread vsoler
On Aug 29, 1:27 am, r rt8...@gmail.com wrote: Have you tried saving the files as MYScriptName.py? notice the py extension, very important ;) That was it!!! I see the colors again. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Colors on IDLE

2009-08-29 Thread vsoler
On Aug 29, 1:34 pm, Thorsten Kampe thors...@thorstenkampe.de wrote: * vsoler (Sat, 29 Aug 2009 04:01:46 -0700 (PDT)) On Aug 29, 1:27 am, r rt8...@gmail.com wrote: Have you tried saving the files as MYScriptName.py? notice the py extension, very important ;) That was it!!! I see

Re: Question on the csv library

2009-08-28 Thread vsoler
On Aug 28, 5:43 pm, Steven Rumbalski googleacco...@rumbalski.com wrote: On Aug 27, 3:06 pm, vsoler vicente.so...@gmail.com wrote: I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done

Colors on IDLE

2009-08-28 Thread vsoler
Everything that I see in IDLE is in black. I have tried to add colors, without success. I've tried: /Options/Configure IDLE/Highlighting/IDLE Classic -- http://mail.python.org/mailman/listinfo/python-list

Re: Colors on IDLE

2009-08-28 Thread vsoler
On Aug 28, 8:58 pm, vsoler vicente.so...@gmail.com wrote: Everything that I see in IDLE is in black. I have tried to add colors, without success. I've tried:  /Options/Configure IDLE/Highlighting/IDLE Classic Couldn't finish writing... sorry --- Everything

Re: Colors on IDLE

2009-08-28 Thread vsoler
On Aug 28, 9:55 pm, Chris Rebert c...@rebertia.com wrote: On Fri, Aug 28, 2009 at 12:00 PM, vsolervicente.so...@gmail.com wrote: On Aug 28, 8:58 pm, vsoler vicente.so...@gmail.com wrote: Everything that I see in IDLE is in black. I have tried to add colors, without success. I've tried

Question on the csv library

2009-08-27 Thread vsoler
I am trying to read a csv file generated by excel. Although I succeed in reading the file, the format that I get is not suitable for me. I've done: import csv spamReader = csv.reader(open('C:\\abc.csv', 'r')) print spamReader _csv.reader object at 0x01022E70 for row in spamReader:

  1   2   >