Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread half . italian
On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote: > Hi, > > Is it still the case there is no practical Expect-like module for > win32? I know that cygwin can support pexpect, but that isn't an > option here --- I have to use a native win32 Python version. > > Are there alternatives, or is it

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread half . italian
On Aug 31, 11:11 am, gsxg <[EMAIL PROTECTED]> wrote: > Thanks, > The curses library doesn't look to helpful to me. However using CTRL- > C is fine and is working nicely. > > BTW, it should be "time.sleep(1)" in the example above, instead of > just > "sleep(1)" (Just in case any other newbies like

Re: Newbie question - sorting a slice

2007-08-28 Thread half . italian
On Aug 28, 7:43 pm, hwg <[EMAIL PROTECTED]> wrote: > I've searched the group and didn't see the answer to this... > > Why doesn't this work?: > > >>> letters = ['d', 'a', 'e', 'c', 'b'] > >>> letters[1:3].sort() > > This returns None. > > Why? letters[1:3] is ['a', 'e', 'c']Sorting that shou

Re: Socket - gaierror

2007-08-27 Thread half . italian
On Aug 27, 4:22 pm, [EMAIL PROTECTED] (Douglas Wells) wrote: > In article <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] writes: > > On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > Changing it to IP gives me the same exact error... > > > File "bin/prgram.py", line 123, in notif

Re: Socket - gaierror

2007-08-27 Thread half . italian
On Aug 27, 12:47 pm, [EMAIL PROTECTED] wrote: > On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > Hi all, > > > > I'm having trouble with the socket module resolving a hostname. It > > > seems like this is a system level problem, but I'm not even

Re: Socket - gaierror

2007-08-27 Thread half . italian
On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi all, > > > I'm having trouble with the socket module resolving a hostname. It > > seems like this is a system level problem, but I'm not even sure where > > to start. I can ping the smtp server by name a

Socket - gaierror

2007-08-27 Thread half . italian
Hi all, I'm having trouble with the socket module resolving a hostname. It seems like this is a system level problem, but I'm not even sure where to start. I can ping the smtp server by name and IP, but when smtp.SMTP("theHost") tries to get the hostname, it keeps giving me the following error:

Re: moving files in a seperate thread (and/or with progress?)

2007-08-15 Thread half . italian
On Aug 15, 2:28 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi all, > > I want to make a small batch copy tool that scans for certain files, > and copies them to a specified directory. Since the files are huge > (AVI / DIVX) typical 300 to 700 Mb, I want to provide the user with > some feedback

Re: Threaded Design Question

2007-08-10 Thread half . italian
On Aug 9, 9:45 pm, "Mark T" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if

Re: Threaded Design Question

2007-08-09 Thread half . italian
On Aug 9, 12:09 pm, "Justin T." <[EMAIL PROTECTED]> wrote: > On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > > Here's how I have it designed so far. The main thread starts a > > Watch(threading.Thread) class that loops and searches a directory for > > files. It has been passed a Queue.Queue() ob

Re: tempfile behavior

2007-08-09 Thread half . italian
On Aug 9, 11:21 am, billiejoex <[EMAIL PROTECTED]> wrote: > Hi all, > I would like to use tempfile module to generate files having unique > names excepting that I don't want them to be removed after closing. > Does it is possible? Looks like tempfile.mkstemp() will do what you want. '''Unlike Tem

Threaded Design Question

2007-08-09 Thread half . italian
Hi all! I'm implementing one of my first multithreaded apps, and have gotten to a point where I think I'm going off track from a standard idiom. Wondering if anyone can point me in the right direction. The script will run as a daemon and watch a given directory for new files. Once it determines

Re: How to Machine A python script execute Machine B python script?

2007-07-08 Thread half . italian
On Jul 8, 6:45 pm, johnny <[EMAIL PROTECTED]> wrote: > Anyone know how I can make Machine A python script execute a python > script on Machine B ? xmlrpc will work. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread half . italian
On Jul 8, 5:06 pm, [EMAIL PROTECTED] wrote: > i hope someone here can help me. > > basically, me and my friend have a summer project. > > in this project, we need something that would basically function as a > blender. we know we'll need to buy a motor that spins, but what we're > having trouble wi

Re: allow scripts to use .pth files?

2007-07-03 Thread half . italian
On Jul 3, 7:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote: > Suppose I have a directory `scripts`. > I'd like the scripts to have access to a package > that is not "installed", i.e., it is not on sys.path. > On this list, various people have described a variety > of tricks they use, but nobody has pr

Re: Getting importError: No module named _md5

2007-06-27 Thread half . italian
On Jun 27, 7:04 am, jeffself <[EMAIL PROTECTED]> wrote: > I'm running Python 2.5.1 which I'm getting from the MacPort package > system. I just installed Django and tried to start up the Django > server and I got the following error: > > ImportError: No module named _md5 > > I'm pretty sure this is

Re: Tkinter: different results from the same tcl script

2007-06-26 Thread half . italian
On Jun 26, 1:06 am, Fabrizio Pollastri <[EMAIL PROTECTED]> wrote: > Hello, > in mixed python-tcl programming I found the following different > behaviours of the same tcl script. > > If I type manually in the python interpreter the following lines > > >>> from Tkinter import * > >>> w = Tk() > >>

Re: can't start Apache on Mac OS X--no listening sockets available?

2007-06-26 Thread half . italian
On Jun 25, 11:09 pm, 7stud <[EMAIL PROTECTED]> wrote: > > On Jun 25, 7:23 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > I'm trying to get Apache set up on my system so I can use mod_python. > > > I installed Apache 2.2.4 according to the following instructions: > > > >http://switch.richard5.net/isp-

Re: can't start Apache on Mac OS X--no listening sockets available?

2007-06-25 Thread half . italian
On Jun 25, 7:23 pm, 7stud <[EMAIL PROTECTED]> wrote: > I'm trying to get Apache set up on my system so I can use mod_python. > I installed Apache 2.2.4 according to the following instructions: > > http://switch.richard5.net/isp-in-a-box-v2/installing-apache-on-mac-o... > > and everything seemed to

Re: regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread half . italian
On Jun 24, 10:00 pm, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > Why not ditch regular expressions altogether for this problem? > > [ p for p in os.listdir(dir) > if os.path.isfile(os.path.join(dir,p)) > and p.lower().find('.thumbnail.')==-1 ] I like `and '.thumbnail.' not in p]` as a better

Re: How to create a file with read access rights

2007-06-21 Thread half . italian
On Jun 21, 8:27 am, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to create a file on Linux with access rights? > For example > owner can read and write into the file > others can only read from the file > Thanks for replies > L. That all depends on your umask. Most commonly, the default

Re: Split file into several and reformat

2007-06-21 Thread half . italian
On Jun 20, 10:45 pm, [EMAIL PROTECTED] wrote: > Hi, > > I want to take read an input file (sels.txt) that looks like: > > Begin sels >sel1 = {1001, 1002, 1003, ... >... >1099} > >sel2 = {1001, 1008, 1009 ... >... >1299} > End sels > > And turn

Re: string formatter %x and a class instance with __int__ or __long__ cannot handle long

2007-06-20 Thread half . italian
On Jun 20, 8:24 pm, "Kenji Noguchi" <[EMAIL PROTECTED]> wrote: > Hi > > I'm using Python 2.4.4 on 32bit x86 Linux. I have a problem with printing > hex string for a value larger than 0x8 when the value is given to > % operator via an instance of a class with __int__(). If I pass a long va

Re: Windows XMLRPC Service

2007-06-20 Thread half . italian
On Jun 19, 12:32 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 19 Jun 2007 14:57:10 -0300, <[EMAIL PROTECTED]> escribió: > > >> > #win32event.WAIT_TIMEOUT = 2 --- This just makes the loop > >> > never execute because > >> > # the WaitFor... part always returns 258 > >

Re: Windows XMLRPC Service

2007-06-19 Thread half . italian
On Jun 19, 10:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 19 Jun 2007 03:45:19 -0300, <[EMAIL PROTECTED]> escribió: > > > I can't quite figure out where to set the "socket timeout". I tried > > setting win32event.WAIT_TIMEOUT, but I'm pretty sure that's not the > > variable you

Re: Windows XMLRPC Service

2007-06-18 Thread half . italian
On Jun 18, 2:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 18 Jun 2007 00:25:25 -0300, <[EMAIL PROTECTED]> escribió: > > > > > > > I'm trying to serve up a simple XMLRPC server as a windows service. I > > got it to run properly, I'm just not sure how to stop it properly. > > Most

Windows XMLRPC Service

2007-06-17 Thread half . italian
Hi, I'm trying to serve up a simple XMLRPC server as a windows service. I got it to run properly, I'm just not sure how to stop it properly. Most of the documentation/examples I found for this was from forums, so I'd love some links to relevant info also. Here's what I have...taken from the cook

Re: Bytes/File Size Format Function

2007-06-13 Thread half . italian
On Jun 13, 12:48 am, [EMAIL PROTECTED] wrote: > On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > Quick file size formatting for all those seekers out there... > > > import math > > > def filesizeformat(bytes, precision=2): > > """Returns a humanized string for a given amount

Re: Bytes/File Size Format Function

2007-06-13 Thread half . italian
On Jun 13, 12:48 am, [EMAIL PROTECTED] wrote: > On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > Quick file size formatting for all those seekers out there... > > > import math > > > def filesizeformat(bytes, precision=2): > > """Returns a humanized string for a given amount

Re: Bytes/File Size Format Function

2007-06-13 Thread half . italian
On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > Quick file size formatting for all those seekers out there... > > import math > > def filesizeformat(bytes, precision=2): > """Returns a humanized string for a given amount of bytes""" > bytes = int(bytes) > if bytes is 0: >

Re: Bytes/File Size Format Function

2007-06-12 Thread half . italian
On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote: > Quick file size formatting for all those seekers out there... > > import math > > def filesizeformat(bytes, precision=2): > """Returns a humanized string for a given amount of bytes""" > bytes = int(bytes) > if bytes is 0: >

Re: launching default browser

2007-06-08 Thread half . italian
On Jun 8, 8:41 am, alf <[EMAIL PROTECTED]> wrote: > Hi, > > I wonder how to launch from python default Windows browser? In fact I > have the same question for Linux. > > thx in advancve, > -- > alf For posterity... On a mac [sean:~] sean% open http://www.google.com ~Sean -- http://mail.python.

Re: ftplib error- Large file

2007-06-07 Thread half . italian
On Jun 7, 8:54 am, Facundo Batista <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Why would storbinary throw an exception even when the file transfer > > was successful? Why would the exception not be thrown until after the > > file was sent? Shouldn't ftplib return something like (104

Re: get a list from a string

2007-06-07 Thread half . italian
On Jun 7, 3:34 am, simon kagwe <[EMAIL PROTECTED]> wrote: > Hi, > > I have a string "distances = [[1,1,1,1],[2,2,2,2]]". I want to create a > variable called distances whose value is the list [[1,1,1,1],[2,2,2,2]]. How > can > I go about that? I know I can use setattr, but how do I create the list

Re: ftplib error- Large file

2007-06-07 Thread half . italian
On Jun 6, 11:21 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote: > > Hi all, > > > I'm using ftplib to transfer large files to remote sites. The process > > seems to work perfectly with small files, but when the file gets to > > large ~20GB I begin getting errors t

ftplib error- Large file

2007-06-06 Thread half . italian
Hi all, I'm using ftplib to transfer large files to remote sites. The process seems to work perfectly with small files, but when the file gets to large ~20GB I begin getting errors that sometimes seem to be non- fatal, and other times the transfer does not complete. I've debugged the hell out of

Re: Who uses Python?

2007-06-06 Thread half . italian
On Jun 4, 1:47 pm, Mark Carter <[EMAIL PROTECTED]> wrote: > walterbyrd wrote: > > Anything else? Finance? Web-analytics? SEO? Digital art? > > I played with NodeBox a little while > ago:http://nodebox.net/code/index.php/Home > "NodeBox is a Mac OS X application that lets you create 2D visuals > (s

Re: get_traceback

2007-06-04 Thread half . italian
On Jun 4, 3:51 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 04 Jun 2007 14:23:00 -0300, <[EMAIL PROTECTED]> escribió: > > > Is there a function or idoim for returning an exception/traceback > > rather than just printing it to stdout? I'm running a deamon where > > stdout is going t

get_traceback

2007-06-04 Thread half . italian
Hi, Is there a function or idoim for returning an exception/traceback rather than just printing it to stdout? I'm running a deamon where stdout is going to /dev/null, and I'm not even watching it..until now. All the functions I found in traceback and sys seemed only to print the error rather tha

Re: Using PIL to find separator pages

2007-05-31 Thread half . italian
On May 31, 10:01 am, Larry Bates <[EMAIL PROTECTED]> wrote: > I have a project that I wanted to solicit some advice > on from this group. I have millions of pages of scanned > documents with each page in and individual .JPG file. > When the documents were scanned the people that did > the scanning

Re: paste text with newlines into raw_input?

2007-05-30 Thread half . italian
On May 30, 2:04 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Using Python on Debian Etch. > > What is the best way to paste a block of text in at the command > prompt. > > I'm trying something like: > > Quote = raw_input("Paste quote here: ") > > Which works great for one line of text with a

Re: multiline regular expression (replace)

2007-05-29 Thread half . italian
On May 29, 2:03 am, Zdenek Maxa <[EMAIL PROTECTED]> wrote: > Hi all, > > I would like to perform regular expression replace (e.g. removing > everything from within tags in a XML file) with multiple-line pattern. > How can I do this? > > where = open("filename").read() > multilinePattern = "^ <

Re: User input with a default value that can be modified

2007-05-28 Thread half . italian
On May 28, 11:52 am, "Etienne Hilson" <[EMAIL PROTECTED]> wrote: > Hello the list :-) > > I do a little program that permit the user to manage list of sentences. > This program runs into a linux shell. > The user can add, modify and delete the sentences. > > What I want to do is : > > When the user

Re: User input with a default value that can be modified

2007-05-28 Thread half . italian
On May 28, 11:52 am, "Etienne Hilson" <[EMAIL PROTECTED]> wrote: > Hello the list :-) > > I do a little program that permit the user to manage list of sentences. > This program runs into a linux shell. > The user can add, modify and delete the sentences. > > What I want to do is : > > When the user

Re: Can python create a dictionary from a list comprehension?

2007-05-28 Thread half . italian
On May 28, 12:25 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, half.italian > wrote: > > > [entries.__setitem__(int(d.date.strftime('%m'))], d.id) for d in > > links] > > > btw...I was curious of this too. I used 'dir(dict)' and looked for a > > method that migh

Re: Can python create a dictionary from a list comprehension?

2007-05-27 Thread half . italian
On May 27, 1:55 pm, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to turn o list of objects into a dictionary using a list > comprehension. > > Something like > > entries = {} > [entries[int(d.date.strftime('%m'))] = d.id] for d in links] > > I keep getting errors when I try to do it. Is

Re: sockets, gethostname() changing

2007-05-25 Thread half . italian
On May 24, 8:04 pm, 7stud <[EMAIL PROTECTED]> wrote: > Hi, > > I'm experimenting with a basic socket program(from a book), and both > the client and server programs are on my computer. In both programs, > I call socket.gethostname(), but I discovered that when I am connected > to the internet, bo

Re: sockets, gethostname() changing

2007-05-25 Thread half . italian
On May 24, 8:50 pm, 7stud <[EMAIL PROTECTED]> wrote: > Thanks for the response. > > On May 24, 9:24 pm, [EMAIL PROTECTED] wrote: > > > I can't imagine why your hostname would be changing, unless you > > installed some of their proprietary software thats messing around with > > things. > > When I

Re: sockets, gethostname() changing

2007-05-24 Thread half . italian
On May 24, 8:04 pm, 7stud <[EMAIL PROTECTED]> wrote: > Hi, > > I'm experimenting with a basic socket program(from a book), and both > the client and server programs are on my computer. In both programs, > I call socket.gethostname(), but I discovered that when I am connected > to the internet, bo

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 1:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 23, 2:58 pm, [EMAIL PROTECTED] wrote: > > > > > On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > I'm looking for any existing packages or ideas on how to implement the > > > equivalent of a generator (in the P

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: Parallel/distributed generator

2007-05-23 Thread half . italian
On May 23, 11:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm looking for any existing packages or ideas on how to implement the > equivalent of a generator (in the Python sense, > i.e.http://www.python.org/dev/peps/pep-0255/) in a parallel/distributed > way. As a use case, imagine a functio

Re: i/o prob revisited

2007-05-18 Thread half . italian
On May 18, 12:06 am, [EMAIL PROTECTED] wrote: > Hi, > I am parsing an xml file ,before that i have replaced a string in > the original xml file with another and made a new xml file which will > now be parsed.I am also opening some more files for output.The > following code shows some i/o comman

Re: How to do basic CRUD apps with Python

2007-05-16 Thread half . italian
On May 14, 7:46 pm, "James T. Dennis" <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > walterbyrd a ?crit : > >> With PHP, libraries, apps, etc. to do basic CRUD are everywhere. Ajax > >> and non-Ajax solutions abound. > >> With Python, finding such library, or apps.

Re: iteration doesn't seem to work ??

2007-05-16 Thread half . italian
On May 16, 1:41 am, stef <[EMAIL PROTECTED]> wrote: > hello, > > can someone tell me why the following iteration doesn't work, > and > how I should replace empty strings in a list with a default value. > > >>> v > ['123', '345', '', '0.3'] > >>> for items in v: > ... if items=='': > ...

Re: setting an attribute

2007-05-16 Thread half . italian
On May 16, 12:34 am, 7stud <[EMAIL PROTECTED]> wrote: > "When you bind (on either a class or an instance) an attribute whose > name is not special...you affect only the __dict__ entry for the > attribute(in the class or instance, respectively)." > > In light of that statement, how would one explain

Re: transparent images

2007-05-15 Thread half . italian
On May 15, 5:26 pm, [EMAIL PROTECTED] wrote: > Does any one know how to make a transparent image with specifically > PIL, but any standard python library will do. I need a spacer, and it > has to be transparent. > > Thanks Something like this...not my code...untested... im = Image.open("image.jpg

Re: Trying to choose between python and java

2007-05-15 Thread half . italian
>> #3 Is there any equivalent to jfreechart and jfreereport >> (http://www.jfree.org for details) in python. ChartDirector http://www.advsofteng.com/download.html Again, not free for commercial use, but very versatile. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: removing spaces between 2 names

2007-05-14 Thread half . italian
On May 14, 11:00 pm, [EMAIL PROTECTED] wrote: > Hi, > Suppose i have a string stored in variable,how do i remove the > space between them,like if i have the name: > "USDT request" in a variable.i need "USDTrequest",without any space . > Thanks s = "jk hij ght" print "".join(s.

Re: Path python versions and Macosx

2007-05-14 Thread half . italian
On May 14, 4:46 am, andrea <[EMAIL PROTECTED]> wrote: > On 12 Mag, 01:09, [EMAIL PROTECTED] wrote: > > > > > On May 11, 1:36 pm, andrea <[EMAIL PROTECTED]> wrote: > > > > Hi everyone, > > > I use python on macosx with textmate as editor (great program). > > > > I also use macport to install unix pr

Re: Removing part of string

2007-05-14 Thread half . italian
On May 13, 10:56 pm, [EMAIL PROTECTED] wrote: > Hi, > I am parsing an xml file ,and one part of structure looks > something like this: > > - PhysicalLink="Infotainment_Control_Bus_CAN"> > Infotainment_Control_Bus_CAN_TIMEOUT_AX > Timeout N_As/N_Ar > Time from transmit request until a CAN

Re: __dict__ for instances?

2007-05-13 Thread half . italian
On May 13, 4:30 am, Ivan Voras <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I think you want "dir(instance)" __dict__ returns the instance > > Part of the problem is that dir(instance) returns a list of strings, so > iterating the dir(instance) gets me strings, not methods. Alternativ

Re: __dict__ for instances?

2007-05-12 Thread half . italian
On May 12, 5:20 pm, Ivan Voras <[EMAIL PROTECTED]> wrote: > While using PyGTK, I want to try and define signal handlers > automagically, without explicitly writing the long dictionary (i.e. I > want to use signal_autoconnect()). > > To do this, I need something that will inspect the current "self"

Re: Creating a function to make checkbutton with information from a list?

2007-05-12 Thread half . italian
On May 12, 11:04 am, Thomas Jansson <[EMAIL PROTECTED]> wrote: > Dear all > > I am writing a program with tkinter where I have to create a lot of > checkbuttons. They should have the same format but should have > different names. My intention is to run the functions and the create > all the buttons

Re: os.popen on windows: loosing stdout of child process

2007-05-11 Thread half . italian
On May 11, 8:46 pm, Greg Ercolano <[EMAIL PROTECTED]> wrote: > When I use os.popen(cmd,'w'), I find that under windows, the stdout > of the child process disappears, instead of appearing in the DOS > window > the script is invoked from. eg: > > C:\> type foo.py > import os

Re: Path python versions and Macosx

2007-05-11 Thread half . italian
On May 11, 1:36 pm, andrea <[EMAIL PROTECTED]> wrote: > Hi everyone, > I use python on macosx with textmate as editor (great program). > > I also use macport to install unix programs from the command line and > I find it great too. > Well I would like to have all my modules in the path when I'm usi

Re: module error for elementtree

2007-05-11 Thread half . italian
On May 11, 12:05 am, [EMAIL PROTECTED] wrote: > #!/usr/bin/env python > > from elementtree import ElementTree as Element > tree = et.parse("testxml.xml") > > for t in tree.getiterator("SERVICEPARAMETER"): > if t.get("Semantics") == "localId": > t.set("Semantics", "dataPackag

Re: Newbie look at Python and OO

2007-05-10 Thread half . italian
On May 10, 2:21 pm, [EMAIL PROTECTED] wrote: > walterbyrd wrote: > > I learned to program with Pascal, way back when. Went into software > > development for a while, then went into systems admin. Have programmed > > in several languages, just learning Python. > > > Some things I find odd: > > > 1)

Re: Newbie look at Python and OO

2007-05-10 Thread half . italian
walterbyrd wrote: > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 == -3? > > 2) list assignment handling, pointing tw

Re: replacing string in xml file--revisited

2007-05-10 Thread half . italian
On May 10, 4:21 am, [EMAIL PROTECTED] wrote: > On May 10, 1:55 pm, [EMAIL PROTECTED] wrote: > > > > > On May 10, 12:56 am, [EMAIL PROTECTED] wrote: > > > > Hi, > > > I need to replace a string in xml file with something else.Ex > > > > - > > > rate > > > rate > > > > > > > > > >

Re: replacing string in xml file--revisited

2007-05-10 Thread half . italian
On May 10, 12:56 am, [EMAIL PROTECTED] wrote: > Hi, > I need to replace a string in xml file with something else.Ex > > - > rate > rate > > > > - > > Here i have opened an xml > file(small part is pasted here).I want to replace the word 'loca

Re: replacing string in xml file--revisited

2007-05-10 Thread half . italian
On May 10, 12:56 am, [EMAIL PROTECTED] wrote: > Hi, > I need to replace a string in xml file with something else.Ex > > - > rate > rate > > > > - > > Here i have opened an xml > file(small part is pasted here).I want to replace the word 'loca

Re: Checking if string inside quotes?

2007-05-09 Thread half . italian
On May 9, 2:31 pm, "Michael Yanowitz" <[EMAIL PROTECTED]> wrote: > Thanks, but it is a little more complicated than that, > the string could be deep in quotes. > >The problem is in string substitution. > Suppose I have a dictionary with MY_IP : "172.18.51.33" > > I need to replace all insta

Re: File I/O

2007-05-09 Thread half . italian
On May 9, 2:13 pm, HMS Surprise <[EMAIL PROTECTED]> wrote: > If one has a list of lists such as > > lst = [['a','1'],['b','2']] > > is there a standard python idiom for writing and reading the pairs to/ > from a file? > > Thanks, > > jh These work. Assuming you can choose the format. Or you coul

Re: Checking if string inside quotes?

2007-05-09 Thread half . italian
On May 9, 1:39 pm, "Michael Yanowitz" <[EMAIL PROTECTED]> wrote: > Hello: > >If I have a long string (such as a Python file). > I search for a sub-string in that string and find it. > Is there a way to determine if that found sub-string is > inside single-quotes or double-quotes or not inside a

Re: long lists

2007-05-07 Thread half . italian
On May 7, 5:14 am, Merrigan <[EMAIL PROTECTED]> wrote: > On May 7, 10:18 am, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > On Mon, 07 May 2007 00:28:14 -0700, Merrigan wrote: > > > 1. I have the script popping all the files that need to be checked into > > > a list, and have it parsing the

Re: progress

2007-05-05 Thread half . italian
On May 5, 1:46 am, Merrigan <[EMAIL PROTECTED]> wrote: > Hi All, > > I have posted yesterday about an ftplib issue, this has been resolved. > > I actually want to ask something here... > > The script that that ftplib error was from...I was wondering - What do > I need to do to print the stats (spee

Re: os.path.join

2007-05-02 Thread half . italian
On May 2, 12:36 am, Ant <[EMAIL PROTECTED]> wrote: > On May 2, 8:03 am, [EMAIL PROTECTED] wrote: > > > On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > ... > > > I think it's a bug, but because it should raise TypeError instead. > > > The right usage is os.path.join(*pathparts) > ... >

Re: os.path.join

2007-05-02 Thread half . italian
On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 02 May 2007 02:31:43 -0300, <[EMAIL PROTECTED]> escribió: > > > A better question is why this doesn't work. > > pathparts = ["/foo", "bar"] > os.path.join(pathparts) > > ['/foo', 'bar'] > > > This should return a

Re: ScrolledText?

2007-05-01 Thread half . italian
On May 1, 3:12 pm, nik <[EMAIL PROTECTED]> wrote: > I've been trying to get the scrollbar and text box always going to the > last line and have been completely unsuccessful. > > I've tried, ScrolledText, text.see, and text.yview_pickplace without > success > > for instance this was the last setup:

Re: os.path.join

2007-05-01 Thread half . italian
On May 1, 9:23 pm, Elliot Peele <[EMAIL PROTECTED]> wrote: > On Tue, 2007-05-01 at 19:27 -0700, 7stud wrote: > > On May 1, 7:36 pm, Elliot Peele <[EMAIL PROTECTED]> wrote: > > > Why does os.path.join('/foo', '/bar') return '/bar' rather than > > > '/foo/bar'? That just seems rather counter intuitiv

Re: I can't inherit from "compiled" classes ?

2007-04-29 Thread half . italian
On Apr 29, 12:48 pm, "Maxim Veksler" <[EMAIL PROTECTED]> wrote: > Hello list, > > I'm trying to subclass socket and select, for both I get: > """ TypeError: Error when calling the metaclass bases > module.__init__() takes at most 2 arguments (3 given) """, I don't > understand this error. Why w

Re: Python Widget to read in user input box in blog

2007-04-23 Thread half . italian
On Apr 23, 6:57 pm, [EMAIL PROTECTED] wrote: > Hey, > > I am helping to develop a project that displays images based on user > input. One possible way of implementing this is via a widget that > when it is run, would read in the users input from an input text field > (probably from a blog), and re

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread half . italian
On Apr 23, 9:30 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > I need to be able to generate a PDF report which consists > mostly of vector images (which I can generate as encapsulated > Postscript, PDF, or SVG). What I need is a way to combine > these figures into a single PDF document. Right no

Re: Redirection problem

2007-04-23 Thread half . italian
On Apr 23, 9:10 am, CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote: > I am new to python. so be patient with me > > I am trying to redirect the output of os.popen command to a file. I > want to append to that file. but instead of appending. The file only > shows last command that was writtenn to it.

Re: recursion depth problem

2007-04-22 Thread half . italian
On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: > hello, > > i have a small function which mimics binary counting. it runs fine as > long as the input is not too long, but if i give it input longer than > 8 characters it gives > > RuntimeError: maximum recursion depth exceeded in cmp > > i

Re: NFS Help

2007-04-19 Thread half . italian
On Apr 19, 11:32 am, Clement <[EMAIL PROTECTED]> wrote: > how to get the file from NFS share in python.. You need to be more specific. If you just want to copy a file try shutil http://docs.python.org/lib/module-shutil.html ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: About installing new Python version.

2007-04-19 Thread half . italian
On Apr 19, 2:03 am, king kikapu <[EMAIL PROTECTED]> wrote: > Hi to all, > > i started with Python at v2.5 and now i see that a new version is > released. > As i already have a lot of stuff for Python installed in the site- > packages directory, which is the correct way to install a new Python > ver

Re: image sequence to Quicktime movie

2007-04-18 Thread half . italian
I haven't experimented with it myself, but you'll probably find what you need here. (Only works on original mac python distribution) [sean:~] sean% python Python 2.3.5 (#1, Aug 12 2006, 00:08:11) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "licens

Re: Minimal Linux system to run Python

2007-04-14 Thread half . italian
You basically just want to create a new startup mode, with only the needed modules loaded, and then set the system to boot up into that mode. I messed around with it a bit awhile ago, and managed to modify run-level 3 to accomplish what i wanted. After it had done one part of its thing, a python

Re: Prevent Modification of Script?

2007-04-04 Thread half . italian
Just throw out the .py files and let it run on the .pyc's alone. ~Sean On Apr 4, 8:03 pm, James Stroud <[EMAIL PROTECTED]> wrote: > ts-dev wrote: > > The root of my question is verifying the integrity of the application > > and the scripts being run. > > Google "md5sum". Then google "birthday att

Re: Circular Class Logic

2007-03-15 Thread half . italian
> > How is that really different from this: > > > class Disk(Folder): > > def __init__(self,driveLetter): > > Folder.Folder.__init__(self.path) # ??? Being that Folder is the > > superclass? > > Where did self.path come from? Even though Folder is the superclass, > self.path doesn't exist u

Re: Circular Class Logic

2007-03-15 Thread half . italian
> Just initialize Folder at module level - see below. > -- Paul > > class Disk(Folder): > def __init__(self,driveLetter): > super(Disk,self).__init__(driveLetter+":/") What is going on there? Is it just explicitly calling the super's init function? How is that really different from t

Re: Circular Class Logic

2007-03-15 Thread half . italian
> Remove the line above > and add this below: > def initFoo(): > import baz > Foo.baz = baz.Baz() > initFoo() I got it to work, but I had to add a check to see if the class variable had been set.. def initBaz(): import Baz Foo.baz = Baz.Baz() class Foo: baz = None def __init__(self):

Re: Circular Class Logic

2007-03-14 Thread half . italian
> > That is, each of the classes want to inherit from the others. That's not exactly what I'm doing, but your comment still might help. I actually want to include an instance of a subclass in it's superclass like this: = foo.py = import Baz class Foo: baz = Baz.Baz() def

Circular Class Logic

2007-03-14 Thread half . italian
I have a set of classes that describe Files, Folders, etc., that I use often in my scripts for moving files around, getting a files extension, converting paths, changing permissions, etc It's very similar to Jason Orendorff's 'Path' library, and is very useful to me. The base class 'Data.py' stor

  1   2   >