Re: any ways to judge whether an object is initilized or not in a class

2007-03-25 Thread Antoon Pardon
On 2007-03-20, Alex Martelli <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >... >> There are plenty of reasons for preferring new style classes. If those >> reasons hold for you, then of course you should use new style classes. >> >> But that's not the same thing as s

cgi python

2007-03-25 Thread Piyali Biswas
Hi Christian, I have seen your well-solved cgi-python answers. That's why I think you would be able to answer my query related to the same. I am writing a cgi program and placing it in cgi-bin folder of Apache Server. Now I have written a python script in the same folder to generate a graph 'gene

Unicode zipping from Python code?

2007-03-25 Thread durumdara
Hi! As I experienced in the year 2006, the Python's zip module is not unicode-safe. With the hungarian filenames I got wrong result. I need to convert iso-8859-2 to cp852 chset to get good result. As I see, this module is "a command line tool" imported as extension. Now I search for something th

Re: call to function by text variable

2007-03-25 Thread Steve Holden
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Jan Schilleman <[EMAIL PROTECTED]> wrote: >> Hi, >> >> try this: >> func = getattr(operations, ["Replace", "ChangeCase", "Move"][n]) >> >> HTH, >> Jan >> >> "ianaré" <[EMAIL PROTECTED]> schreef in bericht >> news:[EMAIL PROTECTED] >>> yeah t

Sending ECHO_REQUEST (pinging) with python

2007-03-25 Thread Thomas Dybdahl Ahle
Hi, I've writing a python application in which I'd like to have a small "ping label", to always tell the current ping time to the server. It seems however that I have to be root to send those imcp packages, but I guess there must be a workaround since I can easily use the "ping" command as ordi

Re: __init__.py

2007-03-25 Thread Tina I
Tina I wrote: > When looking at other peoples code (to learn from it) I keep seeing an > empty file named "__init__.py". What's the purpose of this? > > Thanks > Tina Duh! Never mind... found it. Kinda neat actually :) T -- http://mail.python.org/mailman/listinfo/python-list

__init__.py

2007-03-25 Thread Tina I
When looking at other peoples code (to learn from it) I keep seeing an empty file named "__init__.py". What's the purpose of this? Thanks Tina -- http://mail.python.org/mailman/listinfo/python-list

Re: call to function by text variable

2007-03-25 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jan Schilleman <[EMAIL PROTECTED]> wrote: >Hi, > >try this: >func = getattr(operations, ["Replace", "ChangeCase", "Move"][n]) > >HTH, >Jan > >"ianaré" <[EMAIL PROTECTED]> schreef in bericht >news:[EMAIL PROTECTED] >> yeah the subject doesn't really make sense does i

ANN: Urwid 0.9.8 - Console UI Library

2007-03-25 Thread Ian Ward
Announcing Urwid 0.9.8 -- Urwid home page: http://excess.org/urwid/ Tarball: http://excess.org/urwid/urwid-0.9.8.tar.gz About this release: === This release improves Urwid's performance by 70% to 450% (reducing running time by 41% to 82%)[1] for some

Re: organizing collections of small modules

2007-03-25 Thread Eric S. Johansson
Jorge Godoy wrote: > "Eric S. Johansson" <[EMAIL PROTECTED]> writes: > >> I have a bunch of small modules that I use within my application. Most of >> these modules are single file modules. Currently, I have them set up as >> stand-alone modules but because it's a royal pain to fetch five or 10

Re: replacing one instance with another

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 23:34:51 -0300, manstey <[EMAIL PROTECTED]> escribió: > I've realised after further testing and reading that I actually need > to do this: > dic_myinstances={} class MyClass(object): > def __new__(cls,id): > global dic_myinstances > if dic_myinstan

Re: replacing one instance with another

2007-03-25 Thread manstey
Hi, yet again to myself! I've realised after further testing and reading that I actually need to do this: >>>dic_myinstances={} >>>class MyClass(object): def __new__(cls,id): global dic_myinstances if dic_myinstances.has_key(id): return dic_myinstances[id]

Re: replacing one instance with another

2007-03-25 Thread manstey
Hi, I solved it myself! I realised that __new__ creates self prior to init, so this works: >>>dic_myinstances={} >>>class MyClass(object): def __new__(self,id): global dic_myinstances if dic_myinstances.has_key(id): return dic_myinstances[id] else:

replacing one instance with another

2007-03-25 Thread manstey
Hi, I'm not sure why this doesn't work: >>>dic_myinstances={} >>>class MyClass(object): def __init__(self, id): global dic_myinstances if dic_myinstances.has_key(id): self = dic_myinstances[id] else: dic_myinstances[id] = self >>>ins1 =

Re: XML minidom Parsing and ToPrettyXML

2007-03-25 Thread Wojciech Muła
Paul Kozik wrote: > However, if I use xml.minidom.parse to parse the xml document, change > a few attributes with setAttribute, then write back with toprettyxml, > my XML file gets loaded up with spaces between many of the elements. Use 'toxml' method, that writes XML document without any modifica

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread John Nagle
[EMAIL PROTECTED] wrote: > Great, thanks so much for posting that. It's worked a treat and I'm > getting HTML files with the list of h2 tags I was looking for. Here's > the code just to share, what a relief :) : > ... > from BeautifulSoup import BeautifulSoup > import

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread Mark Crowther
Yep, I agree! once I've got this done I'll be back to trawling the tutorials. Life never gives you the convenience of learning something fully before having to apply what you have learnt ;] Thanks for the feedback and links, I'll be sure to check those out. Mark. On Mar 26, 12:05 am, "Gabriel Ge

Re: Beginner GTK question

2007-03-25 Thread Dave Cook
On 2007-03-25, dashawn888 <[EMAIL PROTECTED]> wrote: > gui.py:79: GtkWarning: Quit: missing action > menubar = uimanager.get_widget('/MenuBar') > This should probably be action="Quit". Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

XML minidom Parsing and ToPrettyXML

2007-03-25 Thread Paul Kozik
I am trying to write a script that reads an XML file (using the minidom module), makes an edit to a few attributes, then saves it back. If I use minidom.Document() to create the xml file, then write it with toprettyprint, it looks fine. However, if I use xml.minidom.parse to parse the xml document

Re: call to function by text variable

2007-03-25 Thread ianaré
On Mar 25, 7:01 pm, "ianaré" <[EMAIL PROTECTED]> wrote: > Cool now I can run it through the translator. > > ops = (_("Directory"), _("Replace"), _("ChangeCase"), >_("Move"), _("Swap"), _("Insert"), _("ChangeLength")) > > self.operations.insert(pos, getattr(operations, ops[n]).Panel(self, >

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 19:44:17 -0300, <[EMAIL PROTECTED]> escribió: > from BeautifulSoup import BeautifulSoup > import re > > page = open("soup_test/tomatoandcream.html", 'r') > soup = BeautifulSoup(page) > > myTagSearch = str(soup.findAll('h2')) > > myFile = open('Soup_Results.html', 'w') > myFile.

Re: call to function by text variable

2007-03-25 Thread ianaré
Cool now I can run it through the translator. ops = (_("Directory"), _("Replace"), _("ChangeCase"), _("Move"), _("Swap"), _("Insert"), _("ChangeLength")) self.operations.insert(pos, getattr(operations, ops[n]).Panel(self, main)) Thanks guys! -- http://mail.python.org/mailman/listinfo/p

Re: call to function by text variable

2007-03-25 Thread Jan Schilleman
Hi, try this: func = getattr(operations, ["Replace", "ChangeCase", "Move"][n]) HTH, Jan "ianaré" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > yeah the subject doesn't really make sense does it? > > anyway want I want to do is this: > if n == 1: > >self.operations.insert(p

Re: Join strings - very simple Q. ERRATA

2007-03-25 Thread Paulo da Silva
Paulo da Silva escreveu: > John Machin escreveu: >> On Mar 25, 12:32 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: >>> John Machin escreveu: > ... ... > knowledge. If you feel that it is a question that deserves the > honour of your response, just do it. Write it on the stones and > send them down

Re: call to function by text variable

2007-03-25 Thread attn . steven . kuo
On Mar 25, 3:36 pm, "ianaré" <[EMAIL PROTECTED]> wrote: > yeah the subject doesn't really make sense does it? > > anyway want I want to do is this: > if n == 1: > > self.operations.insert(pos, operations.Replace.Panel(self, main)) > > elif n == 2: > > self.operations.insert(pos, operations.

Re: call to function by text variable

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 19:36:26 -0300, ianaré <[EMAIL PROTECTED]> escribió: > list = ["Replace", "ChangeCase", "Move"] > textVariable = list[n] > self.operations.insert(pos, operations.[textVariable].Panel(self, > main)) > > Is something sort of like that possible? Try getattr: textVariable = "Repla

Re: call to function by text variable

2007-03-25 Thread Wojciech Muła
ianaré wrote: > like this: > > > list = ["Replace", "ChangeCase", "Move"] > textVariable = list[n] > self.operations.insert(pos, operations.[textVariable].Panel(self, > main)) > > Is something sort of like that possible? Yes: self.operations.insert( pos, getattr(operations, tex

Re: call to function by text variable

2007-03-25 Thread Steve Holden
ianaré wrote: > yeah the subject doesn't really make sense does it? > > anyway want I want to do is this: > if n == 1: > > self.operations.insert(pos, operations.Replace.Panel(self, main)) > > elif n == 2: > > self.operations.insert(pos, operations.ChangeCase.Panel(self, > main)) > > e

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread mark
Great, thanks so much for posting that. It's worked a treat and I'm getting HTML files with the list of h2 tags I was looking for. Here's the code just to share, what a relief :) : ... from BeautifulSoup import BeautifulSoup import re page = open("soup_test/tomatoandc

call to function by text variable

2007-03-25 Thread ianaré
yeah the subject doesn't really make sense does it? anyway want I want to do is this: if n == 1: self.operations.insert(pos, operations.Replace.Panel(self, main)) elif n == 2: self.operations.insert(pos, operations.ChangeCase.Panel(self, main)) elif n == 3: self.operations.insert(

EuroPython 2007: Call for Proposals

2007-03-25 Thread Michael Hudson
Book Monday 9th July to Wednesday 11th July 2007 in your calendar! EuroPython 2007, the European Python and Zope Conference, will be held in Vilnius, Lithuania. Last year's conference was a great success, featuring a variety of tracks, amazing lightning talks and inspiring keynotes. With your par

Re: A better webpage filter

2007-03-25 Thread John J. Lee
Anton Vredegoor <[EMAIL PROTECTED]> writes: [...] > Most web pages I visit lately are taking so much room for ads (even > with adblocker installed) that the mere 20 columns of text that are > available for reading are slowing me down unacceptably. I have tried [...] http://webcleaner.sourceforge.n

Re: a calendar example

2007-03-25 Thread Steven D'Aprano
On Sun, 25 Mar 2007 11:09:54 -0700, gslm wrote: > Hi! > I want to do a calendar where pictures on.Can you have any free > example like this which can help me ? > Regards... These websites can help you: http://search.yahoo.com/ http://www.google.com/ -- Steven. -- http://mail.python.org/ma

Re: problem at installing phyton on windows

2007-03-25 Thread Paul Boddie
gslm wrote: > Please, can you read again? > Yes, I understand that in phyton interpreter, i can't call phyton > command.Thanks... > > But how can i run '.py' files from this command line?I wanted to use > the phyton command for this. Once you are in the Python interpreter you can run Python files,

Re: problem at installing phyton on windows

2007-03-25 Thread Steve Holden
gslm wrote: > Please, can you read again? > Yes, I understand that in phyton interpreter, i can't call phyton > command.Thanks... > > But how can i run '.py' files from this command line?I wanted to use > the phyton command for this. > > When i click a py extended file, for example calendar.py in

Re: problem at installing phyton on windows

2007-03-25 Thread Stephen Eilert
On Mar 25, 6:23 pm, "gslm" <[EMAIL PROTECTED]> wrote: > Please, can you read again? > Yes, I understand that in phyton interpreter, i can't call phyton > command.Thanks... > > But how can i run '.py' files from this command line?I wanted to use > the phyton command for this. > > When i click a py e

Re: problem at installing phyton on windows

2007-03-25 Thread gslm
Please, can you read again? Yes, I understand that in phyton interpreter, i can't call phyton command.Thanks... But how can i run '.py' files from this command line?I wanted to use the phyton command for this. When i click a py extended file, for example calendar.py in lib directory, file opens,

Re: Multi-line strings with formatting

2007-03-25 Thread Steve Holden
Steven D'Aprano wrote: > On Fri, 23 Mar 2007 19:39:53 -0700, Paul McGuire wrote: > >> (and I'm glad I'm not the only one who uses 'l' for a scratch list >> variable...) > > Yes, and come the revolution, every last one of you will be down the salt > mines. > Better that than up against the wall,

Re: functions, classes, bound, unbound?

2007-03-25 Thread Steven Bethard
On Mar 25, 9:13 am, "7stud" <[EMAIL PROTECTED]> wrote: > Is there some other way to retrieve a user-defined function object > from a class other than using the class name or an instance? On Mar 25, 3:00 am, [EMAIL PROTECTED] wrote: > What Steven B. already said, MyClass.__dict__['someFunc'], is

Re: functions, classes, bound, unbound?

2007-03-25 Thread 7stud
On Mar 25, 3:00 am, [EMAIL PROTECTED] wrote: > On Mar 25, 9:13 am, "7stud" <[EMAIL PROTECTED]> wrote: > > > MyClass.someFunc > > > Is there some other way to retrieve a user-defined function object > > from a class other than using the class name or an instance? > > What Steven B. already said, MyC

Re: functions, classes, bound, unbound?

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 17:22:36 -0300, 7stud <[EMAIL PROTECTED]> escribió: > On Mar 25, 3:00 am, [EMAIL PROTECTED] wrote: >> On Mar 25, 9:13 am, "7stud" <[EMAIL PROTECTED]> wrote: >> >> > Is there some other way to retrieve a user-defined function object >> > from a class other than using the class

Re: Returned mail: see transcript for details (1174853648)

2007-03-25 Thread Internet Technology Group
--|||-- Request Management System - Time Inc. --- To confirm this message was intended to be created as a request in the Internet Technology Group's Request Management System, please

Save time processing netcdf

2007-03-25 Thread vorticitywolfe
Hello, I am working with a netcdf file and trying to remove a long string from it e.g. "KAST BLAH BLAH BLAH BLAH DATA BLAH DATA BLAH BLAH BLAH BLAH BLAH DATA BLAH DATA BLAH" Right now what I have works, but takes a long time to run... I think this could be cut down to a quick 2 second run, but no

Re: problem at installing phyton on windows

2007-03-25 Thread Hertha Steck
gslm schrieb: > First, thaks a lot. > But I'm sorry.I haven't understood what i must do for ruunnig phyton > command.I delete path from proportiesof my computer.Then i open > command line of phyton.But when i write phyton these view below: > Traceback: > File ""; line 1 in > NameError: name phyton

Re: Interactive session, alternating prompt. readline? curses?

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 14:04:09 -0300, Berend van Berkum <[EMAIL PROTECTED]> escribió: > I'm looking at building an interactive session in front of some > rdfobj instances. I've used cmd and just found code.Interactive*. > > However, my question, can I change the "prompt" string in respond > to use

Re: problem at installing phyton on windows

2007-03-25 Thread tac-tics
On Mar 25, 1:06 pm, "gslm" <[EMAIL PROTECTED]> wrote: > Hi! > I'm too new on phyton.I have installed phyton.But when I write phyton > command, unfortunately, i can't run.I suppose that it is bacause of > setting path.But i can't solve. > Can you help? You need to set what is called your PATH envir

Re: problem at installing phyton on windows

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 15:40:14 -0300, gslm <[EMAIL PROTECTED]> escribió: > But I'm sorry.I haven't understood what i must do for ruunnig phyton > command.I delete path from proportiesof my computer.Then i open > command line of phyton.But when i write phyton these view below: > Traceback: > File "";

Re: Join strings - very simple Q.

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 15:31:46 -0300, Paulo da Silva <[EMAIL PROTECTED]> escribió: > John Machin escreveu: >> On Mar 25, 12:32 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: >>> John Machin escreveu: >> [e.g. it's easy to miss the one line in the >> "official" Python tutorial that refers to them]

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread Robert Hicks
On Mar 25, 7:08 am, "has" <[EMAIL PROTECTED]> wrote: > On 24 Mar, 18:30, "Robert Hicks" <[EMAIL PROTECTED]> wrote: > > > I want to upgrade to 2.5 but I don't see any unistall instructions > > anywhere. > > To repeat what others have said: don't uninstall existing > Python.framework builds. Framewor

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread Robert Hicks
On Mar 24, 11:53 pm, "js " <[EMAIL PROTECTED]> wrote: > The only way you can do is rermove python2.4.4's files manually. > > I suggest you to use MacPorts or Fink. > > With MacPort, you can uninstall python2.4 by doing > $ port uninstall python24 > > And Installation is > $ port install python25 >

Re: problem at installing phyton on windows

2007-03-25 Thread gslm
On 25 Mart, 20:16, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > gslm wrote: > > Hi! > > I'm too new on phyton.I have installed phyton.But when I write phyton > > command, unfortunately, i can't run.I suppose that it is bacause of > > setting path.But i can't solve. > > Can you help? > > It's "python"

Re: Join strings - very simple Q.

2007-03-25 Thread Paulo da Silva
John Machin escreveu: > On Mar 25, 12:32 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: >> John Machin escreveu: .. > What was not obvious was (1) if you have been using Python for a > while, how you managed to be unaware of str methods (2) if you are a > newbie, how you managed to find out about t

Re: organizing collections of small modules

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 13:44:54 -0300, Eric S. Johansson <[EMAIL PROTECTED]> escribió: > I have a bunch of small modules that I use within my application. Most > of these modules are single file modules. Currently, I have them set up > as stand-alone modules but because it's a royal pain to fetch

Re: problem at installing phyton on windows

2007-03-25 Thread Paul Boddie
gslm wrote: > Hi! > I'm too new on phyton.I have installed phyton.But when I write phyton > command, unfortunately, i can't run.I suppose that it is bacause of > setting path.But i can't solve. > Can you help? It's "python" you should be typing, of course. If that doesn't work then it may be a PAT

a calendar example

2007-03-25 Thread gslm
Hi! I want to do a calendar where pictures on.Can you have any free example like this which can help me ? Regards... -- http://mail.python.org/mailman/listinfo/python-list

problem at installing phyton on windows

2007-03-25 Thread gslm
Hi! I'm too new on phyton.I have installed phyton.But when I write phyton command, unfortunately, i can't run.I suppose that it is bacause of setting path.But i can't solve. Can you help? Another thing is, when i double click the .py file, there are the project form and the command line.How can i

Re: Anyone know of a MICR parser algorithm written in Python?

2007-03-25 Thread mkppk
On Mar 25, 12:30 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > On Mar 24, 6:52 pm, "mkppk" <[EMAIL PROTECTED]> wrote: > > > Its just that I would rather not reinvent the wheel (or read old C > > code).. > > Wouldn't we all! > > Here is the basic structure of a pyparsing solution. The parsing par

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Hi All, > > Apologies for the newbie question but I've searched and tried all > sorts for a few days and I'm pulling my hair out ;[ > > I have a 'reference' HTML file and a 'test' HTML file from which I > need to pull 10 strings, all of which are contained within tags,

Re: How to find to HTML strings and 'save' them?

2007-03-25 Thread Michael Bentley
On Mar 25, 2007, at 12:04 PM, [EMAIL PROTECTED] wrote: > don't even get me > started on python docs.. ayaa ;] ok, try getting started with this then: http://www.crummy.com/ software/BeautifulSoup/ -- http://mail.python.org/mailman/listinfo/python-list

Re: organizing collections of small modules

2007-03-25 Thread Jorge Godoy
"Eric S. Johansson" <[EMAIL PROTECTED]> writes: > I have a bunch of small modules that I use within my application. Most of > these modules are single file modules. Currently, I have them set up as > stand-alone modules but because it's a royal pain to fetch five or 10 of these > modules for eac

Re: Join strings - very simple Q.

2007-03-25 Thread Paulo da Silva
Dustan escreveu: > On Mar 24, 7:16 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: >> Dustan escreveu: >> >> >> >>> On Mar 23, 1:30 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: Mike Kent escreveu: ... > New way: > l=['a','b','c'] > jl=','.join(l) I thank you all. Almo

Interactive session, alternating prompt. readline? curses?

2007-03-25 Thread Berend van Berkum
Hi all, I'm looking at building an interactive session in front of some rdfobj instances. I've used cmd and just found code.Interactive*. Protocol doesn't matter, I'm looking at the UI possibilities. History is nice to have and my intention is to write output of the session to stdin/stderr. H

Re: Using remote source code

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 04:06:21 -0300, Shane Geiger <[EMAIL PROTECTED]> escribió: > I see that you aren't using ihooks. Below is an example I found that > uses ihooks. I think it would be worth comparing and contrasting both > approaches (though I am not familar enough with this aspect of Python

Re: Tkinter Toplevel geometry

2007-03-25 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Chris <[EMAIL PROTECTED]> wrote: > >> After playing with this an inordinate amount of time, I found that one >> does need to supply parameters, namely the null parameter of an empty >> string. Try: >> >>sometop.geometry('') >> >> This repacks according to the wid

[ANN] argparse 0.7 - Command-line parsing library

2007-03-25 Thread Steven Bethard
Announcing argparse 0.7 --- The argparse module is an optparse-inspired command line parser that improves on optparse by supporting: * positional arguments * sub-commands * required options * options with a variable number of args * better usage messages * a much simpler exten

How to find to HTML strings and 'save' them?

2007-03-25 Thread mark
Hi All, Apologies for the newbie question but I've searched and tried all sorts for a few days and I'm pulling my hair out ;[ I have a 'reference' HTML file and a 'test' HTML file from which I need to pull 10 strings, all of which are contained within tags, e.g.: http://www.someplace.com/";>Go S

Re: saving algorithm

2007-03-25 Thread Gabriel Genellina
En Fri, 23 Mar 2007 20:42:33 -0300, mona bin jubair <[EMAIL PROTECTED]> escribió: > i want to ask about the algorithm's steps of saving > games(sudoku,battleship)? First determine what goes into the game "state" (that is, what defines the current state of the game). Perhaps you also want

organizing collections of small modules

2007-03-25 Thread Eric S. Johansson
I have a bunch of small modules that I use within my application. Most of these modules are single file modules. Currently, I have them set up as stand-alone modules but because it's a royal pain to fetch five or 10 of these modules for each application and tracking whether or not they are al

Re: Pycron for windows - please help

2007-03-25 Thread Gabriel Genellina
En Sun, 25 Mar 2007 10:17:47 -0300, Al <[EMAIL PROTECTED]> escribió: >I figured it out... Pycron does not work with mapped drives. My > script was supposed to copy files from a mapped drive to a local > folder... I had set up my batch command as copy M:\foldername\*.*, > where M: is a mapped d

Re: Other classes in a module

2007-03-25 Thread Daniel Nogradi
> Can an instance of a class in a module, in any simple way find out which > other classes that exists in said module ? # module x ## class c1: pass class c2: pass ### Python 2.5 (r25:51908, Nov 1 2006, 11:42:37) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3

Re: Other classes in a module

2007-03-25 Thread Peter Otten
Roland Hedberg wrote: > Can an instance of a class in a module, in any simple way find out which > other classes that exists in said module ? set(v for v in globals().values() if inspect.isclass(v) and v.__module__ == __name__) Peter -- http://mail.python.org/mailman/listinfo/python-list

saving algorithm

2007-03-25 Thread mona bin jubair
hi i want to ask about the algorithm's steps of saving games(sudoku,battleship)? thank you - Don't pick lemons. See all the new 2007 cars at Yahoo! Autos.-- http://mail.python.org/mailman/listinfo/python-list

Other classes in a module

2007-03-25 Thread Roland Hedberg
Hi! Can an instance of a class in a module, in any simple way find out which other classes that exists in said module ? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern for foo tool <-> API <-> shell|GUI

2007-03-25 Thread Steven Bethard
Anastasios Hatzis wrote: > I'm working on a tool which is totally command-line based and consisting of > multiple scripts. The user can execute a Python script in the shell, this > script does some basic verification before delegating a call into my tool's > package and depending on some argumen

Re: Pycron for windows - please help

2007-03-25 Thread Al
Shane, I figured it out... Pycron does not work with mapped drives. My script was supposed to copy files from a mapped drive to a local folder... I had set up my batch command as copy M:\foldername\*.*, where M: is a mapped drive pointing to the network share; M: is defined on the PC running th

Re: Tkinter Toplevel geometry

2007-03-25 Thread Chris
> After playing with this an inordinate amount of time, I found that one > does need to supply parameters, namely the null parameter of an empty > string. Try: > >sometop.geometry('') > > This repacks according to the widgets. Not quite clear from the > miserable docs, is it? Wow, that does

Re: Tkinter Toplevel geometry

2007-03-25 Thread James Stroud
James Stroud wrote: > James Stroud wrote: >> Chris wrote: >>> Hi, >>> >>> If a user resizes a Toplevel window, or I set a Toplevel's geometry >>> using the geometry() method*, is there any way to have the geometry >>> reset to that required for all the widgets? >>> >>> I think I found what I'm look

Re: Tkinter Toplevel geometry

2007-03-25 Thread James Stroud
James Stroud wrote: > Chris wrote: >> Hi, >> >> If a user resizes a Toplevel window, or I set a Toplevel's geometry >> using the geometry() method*, is there any way to have the geometry >> reset to that required for all the widgets? >> >> I think I found what I'm looking for in tk itself: >> """ >

Re: Class factory functions

2007-03-25 Thread Steven D'Aprano
On Sun, 25 Mar 2007 11:58:00 +0200, Peter Otten wrote: >> But it doesn't work: >> > vint = verbosify_nclass(int) > vint(42) >> Calling constructor __new__ ... >> Traceback (most recent call last): >> File "", line 1, in >> File "", line 6, in __new__ >> TypeError: object.__new__(VCla

Re: Strange behavior when printing a returned closure function

2007-03-25 Thread Steven D'Aprano
On Sun, 25 Mar 2007 03:59:52 -0700, dartsch wrote: > I get an output like > > > > > So according to print I get the same function object returned at both > calls. Not the same function object. The first object is printed, then deleted by the garbage collector because it goes out of scope. Th

Re: Tkinter Toplevel geometry

2007-03-25 Thread James Stroud
Chris wrote: > Hi, > > If a user resizes a Toplevel window, or I set a Toplevel's geometry > using the geometry() method*, is there any way to have the geometry > reset to that required for all the widgets? > > I think I found what I'm looking for in tk itself: > """ > 13.3. How can I clear the g

Re: Strange behavior when printing a returned closure function

2007-03-25 Thread dartsch
On Mar 25, 1:04 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 25 Mar 2007 03:59:52 -0700, [EMAIL PROTECTED] wrote: > > > > >Hello, > > >when I execute the following code (python 2.5) > > >def f(x): > >def g(): > >return x > >return g > > >print f(1) > >print f(2) > > >I ge

Re: Python object overhead?

2007-03-25 Thread Bjoern Schliessmann
Felipe Almeida Lessa wrote: > Could you tell me what in Python isn't an object? Difficult ;) All data structures are (CMIIW). Functions and Types are objects, too. > Are you counting old-style classes and instances as "not object"s? No, both are. Regards, Björn -- BOFH excuse #366: ATM c

Re: Python object overhead?

2007-03-25 Thread Bjoern Schliessmann
Facundo Batista wrote: > "not line" and "len(line) == 0" is the same as long as "line" is a > string. > > He's checking ok, 'cause a "blank line" has a lenght > 0 (because > of newline). Ah, K. Normally, I strip the read line and then test "if not line". His check /is/ okay, but IMHO it's a litt

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread has
On 24 Mar, 18:30, "Robert Hicks" <[EMAIL PROTECTED]> wrote: > I want to upgrade to 2.5 but I don't see any unistall instructions > anywhere. To repeat what others have said: don't uninstall existing Python.framework builds. Frameworks support multiple versions quite happily, and removing them is m

Re: Using remote source code

2007-03-25 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Is there any possible way that I can place a .py file on the internet, > and use that source code in an .py file on my computer? Besides Alex suggestion, you can also check Pyro. -- Jorge Godoy <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/pyt

Re: Strange behavior when printing a returned closure function

2007-03-25 Thread Jean-Paul Calderone
On 25 Mar 2007 03:59:52 -0700, [EMAIL PROTECTED] wrote: >Hello, > >when I execute the following code (python 2.5) > >def f(x): >def g(): >return x >return g > >print f(1) >print f(2) > >I get an output like > > > > >So according to print I get the same function object returned at

Strange behavior when printing a returned closure function

2007-03-25 Thread dartsch
Hello, when I execute the following code (python 2.5) def f(x): def g(): return x return g print f(1) print f(2) I get an output like So according to print I get the same function object returned at both calls. That's surprising, I would expect to get two distinct function o

Beginner GTK question

2007-03-25 Thread dashawn888
I have a simple page that I want to display a menu and toolbar. I have followed the tutorials and have made some customizations to the basic code snippet found at http://www.pygtk.org/pygtk2tutorial/examples/uimanager.py However my customized code does not display the menu bar. It displays the

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread has
On 25 Mar, 06:11, "7stud" <[EMAIL PROTECTED]> wrote: > There it is. I notice there is a directory: /Python.framework/ > Versions/2.3/Mac/Tools/IDE > which has a bunch of files in it. Do Macs have some kind of pre- > installed Python IDE? There's no read me file, so I can't tell what > all th

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread has
On 24 Mar, 18:55, "7stud" <[EMAIL PROTECTED]> wrote: > I don't know if there is a framework install for 2.5. http://www.python.org/ftp/python/2.5/python-2.5-macosx.dmg has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org http://appscript.sourceforge.net/objc-appscript.html

Re: Idiom for running compiled python scripts?

2007-03-25 Thread Sherm Pendley
Mark <[EMAIL PROTECTED]> writes: > Of course I realise the modern mantra that "premature optimisation is > the root of all evil" but I don't subscribe to it. Note the first word - premature. It's an important distinction, and you've entirely missed it. Optimization is premature if you haven't ye

Re: Class factory functions

2007-03-25 Thread Peter Otten
Steven D'Aprano wrote: > Here's a simple class-factory function that returns a sub-class of the > old-style class it is passed. > > def verbosify_oclass(klass): > """Returns a verbose sub-class of old-style klass.""" > class VClass(klass): > def __init__(self, *args, **kwargs): > print "Calling i

Class factory functions

2007-03-25 Thread Steven D'Aprano
Here's a simple class-factory function that returns a sub-class of the old-style class it is passed. def verbosify_oclass(klass): """Returns a verbose sub-class of old-style klass.""" class VClass(klass): def __init__(self, *args, **kwargs):

Re: Idiom for running compiled python scripts?

2007-03-25 Thread Steven D'Aprano
On Sun, 25 Mar 2007 07:10:23 +, Mark wrote: > On Sun, 25 Mar 2007 13:40:33 +1000, Steven D'Aprano wrote: >> Because this is entirely a trivial saving. Who cares? Sheesh. >> ... >> Saving 18ms on a script that takes 50ms to execute *might* be >> worthwhile, ... > > I don't understand your atti

Re: List comprehension returning subclassed list type?

2007-03-25 Thread bullockbefriending bard
Thanks! I went with extend and generator expression as I *am* dealing with rather a lot of data. Now I think I'm going to go on a little hunt through my code looking for more places where I should replace list comprehensions with generator expressions - bit of a newbie here. On Mar 25, 3:57 pm, St

Re: functions, classes, bound, unbound?

2007-03-25 Thread irstas
On Mar 25, 9:13 am, "7stud" <[EMAIL PROTECTED]> wrote: > MyClass.someFunc > > Is there some other way to retrieve a user-defined function object > from a class other than using the class name or an instance? What Steven B. already said, MyClass.__dict__['someFunc'], is a different way than MyClass

Re: List comprehension returning subclassed list type?

2007-03-25 Thread Steven D'Aprano
On Sat, 24 Mar 2007 23:43:10 -0700, bullockbefriending bard wrote: > z_list = [Z(y.var1, y.var2,..) for y in list_of_objects_of_class_Y] > > Of course this just gives me a plain list and no access to the > methodsof z_list. List comprehensions give you a list. If you want to convert that list in

Re: Idiom for running compiled python scripts?

2007-03-25 Thread irstas
On Mar 25, 2:46 am, Mark <[EMAIL PROTECTED]> wrote: > On Sat, 24 Mar 2007 07:21:21 -0700, irstas wrote: > > A simple implementation that "works": > > Not quite irstas BTW .. I was expecting this, hence the quotes around 'works' :P. Another known issue is that globals() dictionary is somewhat diffe

Re: How to receive a FILE* from Python under MinGW?

2007-03-25 Thread John Pye
On Mar 24, 5:37 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 23 Mar 2007 16:34:22 -0300, Gabriel Genellina > <[EMAIL PROTECTED]> escribió: > > >> What about calling mscvrt_get_osfhandle from inside the SWIG wrapper? > >> I tried this but it seemed that the function was not exported

  1   2   >