[Tutor] Input to python executable code and design question

2005-01-09 Thread Ismael Garrido
Hello I am trying to make a program that will plot functions. For that, I need to be able to get an input (the function to be plotted) and execute it. So, my question is, how do I use the input? I have found no way to convert the string to some kind of executable code. I did research the proble

Re: [Tutor] Input to python executable code and design question

2005-01-09 Thread Ismael Garrido
[EMAIL PROTECTED] wrote: Quoting Ismael Garrido <[EMAIL PROTECTED]>: I am trying to make a program that will plot functions. For that, I need to be able to get an input (the function to be plotted) and execute it. > > >So you want the user to be able to type something like &

Re: [Tutor] Input to python executable code and design question

2005-01-09 Thread Ismael Garrido
Jacob S. wrote: eval() is good and it can be done using it. I wrote a -- IMHO -- really great functiongraphing program using vpython. If you would like to see it, just reply and say so. Out of curiosity, I would like to see your program. There's always something to learn (and even more so for m

Re: [Tutor] Time script help sought!

2005-01-11 Thread Ismael Garrido
kevin parks wrote: I am kind of in a bit of a jam (okay a big jam) and i was hoping that someone here could give me a quick hand. I had a few pages of time calculations to do. So, i just started in on them typing them in my time calculator and writing them in by hand. Now i realize, that i rea

Re: [Tutor] FW: hi

2005-01-12 Thread Ismael Garrido
Danny Yoo wrote: Are you looking for an Integrated Development Environment, like Boa Constructor? http://boa-constructor.sourceforge.net/ Is there any way of running Boa with Python 2.4 -only-? When I tried installing it required wxWindows, but only version 2.4.2.4 (and not ver. 2.5, which s

[Tutor] Jythonc compile error

2005-01-13 Thread Ismael Garrido
Hello. I don't know what's wrong. Any help is welcome. Thanks Ismael testui.py ### import Java #Tried with and without this line print "Hello World!" ### H:\ARCHIV~1\Jython>jythonc -c -d -j test testui.py processing testui Required packages: Creating adapters: Creating .java files: testui

[Tutor] Lights game

2005-01-15 Thread Ismael Garrido
Hello list. I'd really appreciate any comments, particulary regarding style corrections. I'm a newbie... Thanks! Ismael import random import tkMessageBox from Tkinter import * class GUI: def __init__(self): self._crearGUI() def _crearGUI(self): self.root = Tk() self.roo

[Tutor] Tkinter Radiobutton

2005-01-16 Thread Ismael Garrido
Hello. I can't figure out what's wrong in here! For some reason I can't understand, the radiobuttons don't work. The code itself is correct, the problem arises when I tell them that their master is self.configurar. I don't know why, but they don't like it. Any help is welcome Thanks Ismael d

Re: [Tutor] Tkinter Radiobutton

2005-01-16 Thread Ismael Garrido
Ismael Garrido wrote: Hello. I can't figure out what's wrong in here! For some reason I can't understand, the radiobuttons don't work. The code itself is correct, the problem arises when I tell them that their master is self.configurar. I don't know why, but they don&#

[Fwd: Re: [Tutor] py2exe]

2005-01-16 Thread Ismael Garrido
Forgot to forward it to the list... Here it goes: Original Message Subject: Re: [Tutor] py2exe Date: Mon, 17 Jan 2005 05:40:44 -0200 From: Ismael Garrido <[EMAIL PROTECTED]> To: Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> References: <[EMAIL PROTE

[Tutor] Classes

2005-02-01 Thread Ismael Garrido
Hello. I was just wondering, what magic can you do with classes? I mean, things like "class Name(Exception)" or "class Name(threading.Thread), which other classes are interesting to subclass? I've seen Object too, but I don't understand what it does. Thanks Ismael __

Re: [Tutor] Hex to Str - still an open issue

2005-02-05 Thread Ismael Garrido
Liam Clarke wrote: Just looking at this - i = 456 s = '' while i: s = str(i % 2) + s i/=2 This works, far simpler than mine, which is always infuriating, but my question is, how exactly? if I have the number 15, when it divides by 2, it will become 7. Yet no error is introduced into the bin

Re: e-mail address change (was Re: [Tutor] python's default argument value handling in functions - weird syntax? problem grappling with the concept)

2005-02-09 Thread Ismael Garrido
Danny Yoo wrote: ### def f(a,L=[]): if L==[5]: print 'L==[5] caught' print L print 'resetting L...' L=[] L.append(a) return L ### Now I'm dizzy... I can't understand why there are two "L"! L is a local variable of the function, right? (I can't imagine it bein

[Tutor] Instance into another instance

2005-02-19 Thread Ismael Garrido
Hello. This is my code: class Node: def __init__(self, tag, value=None, **kwargs): self.tag = tag self.value = value self.kwargs = kwargs self.childs = [] def addChild(self, tag, value=None, **kwargs): node = Node(tag, value, kwargs) self.childs.appen

Refactoring and Domain Objects was Re: [Tutor] Method/subclass

2005-02-23 Thread Ismael Garrido
Kent Johnson wrote: Start small :-) Get a little bit of the database working. Write unit tests for it. Get a little piece of GUI working that uses that part of the database. Lather. Rinse. Repeat. Refactor as your understanding of the problem grows. Talking about refactoring. I couldn't get Bicy

[Tutor] SubClassing

2005-02-24 Thread Ismael Garrido
Hello My code is like this: class Parent: def __init__(self, bunch, of, variables): self.bunch, self.of, self.variables = bunch, of, variables class Son(Parent): def __init__(self, bunch, of, variables, new): self.bunch, self.of, self.variables, self.new = bunch, of, variables, n

[Fwd: Re: [Tutor] Recursive Tkinter buttons]

2005-02-24 Thread Ismael Garrido
Sent only to Liam... Forwading.. Original Message Subject: Re: [Tutor] Recursive Tkinter buttons Date: Fri, 25 Feb 2005 05:45:00 -0200 From: Ismael Garrido <[EMAIL PROTECTED]> To: Liam Clarke <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAI

Re: [Tutor] SubClassing

2005-02-24 Thread Ismael Garrido
Sean Perry wrote: yep. call 'Parent.__init__(this, that)' then do 'self.new = new' def __init__(self, this, that, new): Parent.__init__(this, that) self.new = new Thanks. Though it should be: def __init__(self, this, that, new): Parent.__init__(self, this, that) #note self self.new =

[Tutor] Changing a class into a subclass

2005-03-24 Thread Ismael Garrido
Hello. I have a program that saves/loads to/from XML. I have a main class Building, and a subclass House(Building). When I save the code I instruct each object to save itself to XML (using ElementTree), so House adds itself to the XML tree. My problem is when I load the XML. Before having subcla

Re: [Tutor] Changing a class into a subclass

2005-03-24 Thread Ismael Garrido
Alan Gauld wrote: Absolutely, looks like you answered your own question... :-) But if you want an OOP approach thre are some things to try. First you can create a BuildingFactory class that has a single instance (or indeed no instances because you could use a static method... or get really fancy an

[Tutor] Web browser

2005-06-10 Thread Ismael Garrido
Hello. I've been looking around for a web browser either written in python, or with python bindings. What I need to do is load a web-page, enter a password-protected site and follow certain links, it needs to have frames and follow the refresh meta. I'm running winxp, python 2.4 At first I tho

Re: [Tutor] GetGarf (sorry, this time with attachment)

2005-09-16 Thread Ismael Garrido
Joseph Quigley wrote: > Ok... more probs with my GetGarf program... > First I acidently and permanently deleted all versions and now I've > improved it but it won't download new images > Here's the code (attached... sorry :-( ) > More Questions to come later. > Thanks, > Joe Do you know ab

Re: [Tutor] OT - email & imaplib modules

2005-09-16 Thread Ismael Garrido
mailing list wrote: >It's like Pythoncard, a layer of abstraction makes 90% of what you do >easier, and the other 10% you can still do the manual way. > >I don't know, I'm also tempted to try and write those layers, if >anyone would benefit from them. But yeah, would it be better or worse >for peo

Re: [Tutor] GetGarf (sorry, this time with attachment)

2005-09-17 Thread Ismael Garrido
Joseph Quigley wrote: >Ismael wrote: > > > >>Do you know about Dosage? It downloads lots of comics (around 500 - of >>course, you choose which ones). Among those, there's Garfield. It's >>"catchup" option will download past comics for you, and even generate >>RSS feeds and html pages if you w

Re: [Tutor] Can anyone teach me...?

2005-10-12 Thread Ismael Garrido
Alan Gauld wrote: >However I have to be honest and say that building GUIs in VB >(or Borland's Delphi/Kylix) is a lot easier than in Python IMHO. >I use Delphi for most of my real-world heavy duty GUI work. > > Have you tried Boa Constructor? It is quite similar to Delphi. It builds wxPython.

[Tutor] Spanish text in BS problem

2005-11-08 Thread Ismael Garrido
Hello I'm using Beautiful Soup to scrape a site (that's in Spanish) I sometimes come across strings like: 'Ner\\xf3n como cantor' Which gets printed: Ner\xf3n como cantor When they should be: Nerón como cantor I don't know if it is my fault (due to me misusing BS) or is it a BS fault. Anyway,

[Tutor] [Fwd: Re: Spanish text in BS problem]

2005-11-09 Thread Ismael Garrido
Forwarding... Forgot the list. --- Begin Message --- Kent Johnson wrote: Ismael Garrido wrote: Hello I'm using Beautiful Soup to scrape a site (that's in Spanish) I sometimes come across strings like: 'Ner\\xf3n como cantor' Which gets printed: Ner\xf3n como cantor

Re: [Tutor] [Fwd: Re: Spanish text in BS problem]

2005-11-09 Thread Ismael Garrido
Found the problem myself. (look down) Ismael Garrido wrote: > This is the script: > > import BeautifulSoup > import os > > a = open("zona.htm") > text = a.readlines() > a.close() > > BS = BeautifulSoup.BeautifulSoup(str(text)) Apparently, str(text) is t

Re: [Tutor] [OT] triangulation

2005-11-09 Thread Ismael Garrido
John Fouhy wrote: >On 10/11/05, Gregor Lingl <[EMAIL PROTECTED]> wrote: > > >>but Shi Mu didn't ask for a program in English ;-) >> >> > >This is pretty off-topic, but --- > >Is it possible to be a programmer and not speak English? Are there any >languages out there where the reserved words,

[Tutor] Favourite modules - Wiki Was Re: TurboGears - and some issues

2005-11-14 Thread Ismael Garrido
Kent Johnson wrote: >Maybe we should start a thread of favorite addons. For me, Jason Orendorff's >path module is definitely #1 on the list, probably followed by Fredrik Lundh's >ElementTree. >http://www.jorendorff.com/articles/python/path/ >http://effbot.org/zone/element-index.htm > > A wonde

Re: [Tutor] Favourite modules - Wiki Was Re: TurboGears - and some issues

2005-11-15 Thread Ismael Garrido
Ron Phillips wrote: >That is a good idea, and a nice page. Another would be to implement >some "social tagging" as on del.icio.us. It's kind of a popularity >contest, but that's really what's wanted here, I think. > I believe the guys at PyPI were trying to do something similar. They're trying to

[Tutor] RTSP

2005-11-15 Thread Ismael Garrido
Hi Does anyone know if there's any module able to download rtsp? Failing that, any command line app that could do the job? (Already tried with mplayer, it didn't work) I'm trying to download a series of streams automatically, I have already been able to open the page, parse all the links, and g

Re: [Tutor] Pretty XML

2005-11-23 Thread Ismael Garrido
Greg Lindstrom wrote: > Hello- > I am in the process of creating an XML document from information > stored in our database. One of my colleagues will use the record to > format our information (health care claims) into all sorts of forms, > reports, etc. He is partial to PHP5 but I like Pytho

Re: [Tutor] Modifying Source Code while Program is Running

2005-11-25 Thread Ismael Garrido
Ed Singleton wrote: >I want to create a small simple CMS for my website. Users will be >able to add and edit basic pages. Pages can have sub-pages (no need >for folders cause a folder and an index.html can be unified into one >concept). > >Users will also be able to create new types of pages, ma

Re: [Tutor] Request For Suggestions

2005-12-03 Thread Ismael Garrido
Basem Narmok wrote: >Hi all, > >I am planning to make a Python CD for advocating Python, and I need your >suggestions about this, the objective is to build a CD that contains the >basic material for Python beginner (e.g. Python 2.4.2 for different >platforms) with some advocating material (e.g.

Re: [Tutor] Problems padding a string with 0's while deconcatonating

2005-12-05 Thread Ismael Garrido
Josh Yagy wrote: >Wow, that code is much more compact, thanks for the help! But as far as the >original question goes, I think I worded my problem wrong. The output you got >with your binary string is almost what I Want, but not quite. I need each >subset of binary strings to be n bits long (in

Re: [Tutor] Editors

2005-12-12 Thread Ismael Garrido
Will Harris wrote: > Any of you familar with SPE > > ? I found this just recently on freshmeat and was curious if anyone > had used it? If so how well it works and what not. This caught my > attention because its cross plat

Re: [Tutor] FWD: How do I fix this error so that my exchange rates program will work?

2005-12-14 Thread Ismael Garrido
Simon Gerber wrote: >>store.write(rate + '\n') >> >> > >With this: > > store.write(`rate` + \n') > >Note that these are not your regular sungle quotes. You'll find them >above the tab key, under escape, on most standard keyboards. > > I have to say I don't like that. It's

[Tutor] PAMIE but for linux

2006-01-14 Thread Ismael Garrido
Hi Is there anything like PAMIE but for a linux browser? Even better if it works in windows and linux. PAMIE lets you control Internet Explorer programmatically. I've read about PyXPCOM (for mozilla) but I coudn't find any docs or reference to using it to alter a document (like, clicking butto

Re: [Tutor] nice()

2006-02-12 Thread Ismael Garrido
Smith wrote: > I've been thinking about a function that was recently proposed at > python-dev named 'areclose'. It is a function that is meant to tell > whether two (or possible more) numbers are close to each other. It > is a function similar to one that exists in Numeric. One such > implement

[Tutor] Proxy

2006-02-18 Thread Ismael Garrido
Hi. I been looking in the web for a Proxy which I could modify, but I can't find anything useful. Basically what I want to do is to monitor what's being loaded and modify the page if it matches certain regexps and source locations (Ie: a particular server). I found: http://xhaus.com/alan/pytho

[Tutor] Package problems

2006-02-18 Thread Ismael Garrido
Hello. I'm trying to make a package (so that later I can "import package"). I created one dir with an __init__.py, main.py, one.py __init__.py : from main import * main.py : import one Now, main.py creates one instance of a class (and there can be only that one instance) and provides several

Re: [Tutor] I Give Up.

2006-06-17 Thread Ismael Garrido
Brian Gustin wrote: > I'll just go write it in Perl. Maybe some day when Python actually has > well structured documentation with *actual working code examples* > Indeed. I have always thought that the docs lacked working examples. I usually do a google search, hoping to find some script sho

[Tutor] Performance of classes

2006-06-17 Thread Ismael Garrido
Hello I'm writing a program to find an appropiate combination of resistances to obtain a desired value of resistance. The program takes into account how many resistances you have available and their resistance in ohms. A short review of physics: resistors can be arranged in series or in para

Re: [Tutor] Performance of classes

2006-06-18 Thread Ismael Garrido
Kent Johnson wrote: > Ismael Garrido wrote: > >> I have attached the code, I hope that's fine. If you have any further >> optimization suggestions I would be very glad to hear them :) >> > > generarResist() is doing a lot more work than necessary.

Re: [Tutor] Beginner question(s)

2006-06-18 Thread Ismael Garrido
Alan Gauld wrote: >> Also, does anyone know of a PDA that would run python? >> > > There was a project called pippy, but I haven't heard anything of it > recently so I don't know if its still around or if it runs on modern > PDAs - I think it was PalmOS anyhow... > > Pippy is quite dea

Re: [Tutor] what %s=%s means?

2006-07-05 Thread Ismael Garrido
韩宪平 wrote: > I realy new to python.I try on learning it by code examples.The > following one from "Dive into python": > > def buildConnectionString(params): > """Build a connection string from a dictionary of parameters. > > Returns string.""" > return ";".join(["%s=%s" % (k, v) for k,

Re: [Tutor] Alias for a class name

2006-07-12 Thread Ismael Garrido
Gregor Lingl wrote: > Hi everyoen, > > say in some module I have defined a class Pen > and I want an alias for the class name, say > Turtle > > I can do this: > > class Turtle(Pen): > pass > > or simply (after having defined Pen): > > Turtle = Pen > > Are those two variants different in effect?

Re: [Tutor] parsing

2006-07-12 Thread Ismael Garrido
Сергій wrote: > First, excuse me my English... English is not my native language, but > I hope > that I will be able to describe my problem. > > I am new in python for web, but I want to do such thing: > > Suppose I have a html-page, like this: > """ > TITLE > > body_1 > 1_1 > 2_1 > div_one_1 > p

Re: [Tutor] IDLE Crashing

2006-08-05 Thread Ismael Garrido
Kent Johnson escribió: > Adam Gomaa wrote: > >> I'm having trouble with this script. When I run it, it crashes IDLE... >> which is no fun. :( >> >> I'm running Ubuntu 6.06 w/ python 2.4 >> >> When I say crash, I mean really _crash_. IDLE stop responding, and I >> have to killall idle && killal

Re: [Tutor] Rock, Paper, Scissors

2006-08-11 Thread Ismael Garrido
Luke Paireepinart escribió: > Robert Wierschke wrote: > >> the else part can't have a condition!!! >> ___ >> Tutor maillist - Tutor@python.org >> http://mail.python.org/mailman/listinfo/tutor >> >> >> > Are you referring to Alan's post? > You

Re: [Tutor] about threads

2006-08-16 Thread Ismael Garrido
Luke Paireepinart escribió: > if you run two instances of the python interpreter (like you're doing > when you start two command windows,) > they're executing in different threads, it's just that the threads are > OS level instead of application level. Bear in mind that python threads have the G

Re: [Tutor] Variable help

2006-10-08 Thread Ismael Garrido
Tom R. escribió: > I have a number of arrays: > > player1 = [data, data, data] > player2 = [data, data, data] > player3 = [data, data, data] > player4 = [data, data, data] > > I want to be able to do something like: > > count = 2 > if player + count[3] == 5: >do this >do that >