Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
Is there something special you have to do to get a wxPython app to run remotely under xwindows? My Tkinter apps always automatically work that way, so I was surprised to even be confronted with this problem. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
On Feb 28, 3:50 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Sean DiZazzo wrote: Is there something special you have to do to get a wxPython app to run remotely under xwindows?  My Tkinter apps always automatically work that way, so I was surprised to even be confronted

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
On Feb 28, 3:50 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Sean DiZazzo wrote: Is there something special you have to do to get a wxPython app to run remotely under xwindows?  My Tkinter apps always automatically work that way, so I was surprised to even be confronted

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
On Feb 28, 5:26 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: On Feb 28, 3:50 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Sean DiZazzo wrote: Is there something special you have to do to get a wxPython app to run remotely under xwindows?  My Tkinter apps always automatically

Re: Run wxPython app remotely under XWindows

2008-02-29 Thread Sean DiZazzo
On Feb 29, 8:19 am, Mike Driscoll [EMAIL PROTECTED] wrote: On Feb 28, 7:49 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: On Feb 28, 5:26 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: On Feb 28, 3:50 pm, Bjoern Schliessmann usenet- [EMAIL PROTECTED] wrote: Sean DiZazzo wrote

os.path.getsize() on Windows

2008-03-18 Thread Sean DiZazzo
Hi all, I'm seeing some behavior that is confusing me. I often use a simple function to tell if a file is growing...ie being copied into a certain location. (Can't process it until it's complete) My function is not working on windows, and I'm wondering if I am missing something simple, or if I

Re: os.path.getsize() on Windows

2008-03-18 Thread Sean DiZazzo
On Mar 18, 2:27 pm, Duncan Booth [EMAIL PROTECTED] wrote: Sean DiZazzo [EMAIL PROTECTED] wrote: On windows, this returns the size of the file as it _will be_, not the size that it currently is.  Is this a feature?  What is the proper way to get the current size of the file?  I noticed

Re: os.path.getsize() on Windows

2008-03-20 Thread Sean DiZazzo
On Mar 20, 6:42 am, Duncan Booth [EMAIL PROTECTED] wrote: Steven D'Aprano [EMAIL PROTECTED] wrote: On Wed, 19 Mar 2008 12:34:34 +, Duncan Booth wrote: By default Python on Windows allows you to open a file for reading unless you specify a sharing mode which prevents it: But the OP is

Re: text adventure game problem

2008-04-14 Thread Sean DiZazzo
On Apr 8, 6:01 pm, [EMAIL PROTECTED] wrote: okay, I'm having this one problem with a text adventure game. It's kind of hard to explain, but I'll do my best. [code] def prompt_kitchen():     global gold     gold_taken = False     while True:         prompt_kit = raw_input('')         if

Re: TypeError: unsupported operand type(s) for /: 'NoneType' and 'NoneType'

2008-05-01 Thread Sean DiZazzo
On May 1, 5:21 pm, Jordan Harry [EMAIL PROTECTED] wrote: I'm trying to write a simple program to calculate permutations.  I created a file called mod.py and put the following in it: def factorial(n):     a = n     b = n     while a0 and b1:         n = (n)*(b-1)         b = b-1 def

setattr() on object instance

2009-03-15 Thread Sean DiZazzo
Why is it that you can setattr() on an instance of a class that inherits from object, but you can't on an instance of object itself? o = object() setattr(o, x, 1000) Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'object' object has no attribute 'x' class

Re: How to run PyOS_InputHook from python code (i.e. yield to event loops)

2008-09-08 Thread Sean DiZazzo
On Sep 6, 1:00 pm, [EMAIL PROTECTED] (Ville M. Vainio) wrote: Background: PyOS_InputHook is something that gets run when python is doing raw_input. TkInter and friends use it to run their event loops, so that their events are handled while python is doing raw_input. What I'd like to do is run

Re: Catching subprocess stdout stream

2008-09-10 Thread Sean DiZazzo
On Sep 8, 8:37 am, Thomas Jansson [EMAIL PROTECTED] wrote: Dear all I have tkinkter based frontend to a Fortran based program. I use subprocess to launch the fortran program as a child process and I wish to see the output of the fortran program as it is created in the console. The fortran

Re: formating a filesystem with python

2008-09-10 Thread Sean DiZazzo
On Sep 10, 1:57 pm, Ricardo Tiago [EMAIL PROTECTED] wrote: Hi all, is there a package in python that allows to mount/umount and format (to ext3) a filesystem? I know that this is possible by just calling the os commands 'mount/umount and mkfs' but this would imply to have to change sudoers

Re: PLEASE HELP ME WITH THIS ASSIGNMENT...PLEASE....

2008-09-10 Thread Sean DiZazzo
On Sep 10, 3:33 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: I know I'm to late to ask you for helpbut please help me out..I am really new to unix and dont know how to finish this assignment on time.proff. said he will be using MOSS to detect whether I downloaded the

Re: SSH using PEXPECT

2008-09-10 Thread Sean DiZazzo
On Sep 10, 6:04 pm, [EMAIL PROTECTED] wrote: Hey , I need to SSH into a server .. (10.8.42.38) using pexpect the username is 'admin' and password is 'abc123' so far i have the following code import pexpect import sys import time import os foo = pexpect.spawn('ssh [EMAIL PROTECTED]')

Re: Python platform.

2008-09-11 Thread Sean DiZazzo
On Sep 11, 9:59 am, Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I want to build a desktop application. I am searching for some kind of environment that would provide all the elements ready (Windows...). Then I would have to code the business logic only. start here:  

Re: Python platform.

2008-09-11 Thread Sean DiZazzo
On Sep 11, 11:39 am, Sean DiZazzo [EMAIL PROTECTED] wrote: On Sep 11, 9:59 am, Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I want to build a desktop application. I am searching for some kind of environment that would provide all the elements ready (Windows

Re: Good python web programming books

2008-09-12 Thread Sean DiZazzo
On Sep 12, 6:08 pm, Chris Rebert [EMAIL PROTECTED] wrote: I've heard good things about The Django Book:http://www.djangobook.com/ - Chris On Fri, Sep 12, 2008 at 5:57 PM, bhaarat Sharma [EMAIL PROTECTED] wrote: Hi Guys, I am very new to python.  I am looking for a good book about python

Re: Good programming style

2008-09-14 Thread Sean DiZazzo
On Sep 14, 7:10 pm, Grant Edwards [EMAIL PROTECTED] wrote: On 2008-09-15, Ben Finney [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] writes: On 2008-09-14, Ben Finney [EMAIL PROTECTED] wrote: Second: please do yourself a favour and drop the camelCaseNames. Follow PEP 8

Re: explain slice assignment to newb

2008-09-20 Thread Sean DiZazzo
On Sep 20, 2:20 pm, Andrew [EMAIL PROTECTED] wrote: please explain this behavior to a newb: a = [1,2,3,4] b = [a,b,c,d] a [1, 2, 3, 4] b ['a', 'b', 'c', 'd'] a[0:2] [1, 2] a [1, 2, 3, 4] b[2:4] ['c', 'd'] a[0:2] = b[0:2] b[2:4] = a[2:4] a ['a', 'b', 3, 4] b ['a',

Re: appending * to glob returns files with '*' !!

2008-09-21 Thread Sean DiZazzo
On Sep 19, 1:37 pm, John [H2O] [EMAIL PROTECTED] wrote: I have a glob.glob search: searchstring = os.path.join('path'+'EN*') shouldn't that be os.path.join(path, 'EN*') ? ___ This returns some files: EN082333 EN092334 EN* Mine doesn't return that last string. My routine cannot

Re: Folder Actions on Mac OSX Leopard?

2008-09-24 Thread Sean DiZazzo
On Sep 24, 12:31 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Greetings, I've been trying to figure out if it's possible to attach a Python script to an action via Mac OSX Leopard's File Actions system. I'm wanting to call a Python script every time a file is added to the monitored folder.

Re: empty csv file attachments

2008-09-24 Thread Sean DiZazzo
On Sep 24, 1:17 pm, Bobby Roberts [EMAIL PROTECTED] wrote: hi group. I'm new to python but a veteran at programming.  This one has me stumped.  I have a simple contact form which the user fills out.  The email is sent to the site user as well and it is delivered with the content in the body

Re: Off topic: Sent from my Foo messages

2008-09-24 Thread Sean DiZazzo
-- Steven I don't appreciate the two lines you put above your name in your posts. Please remove them in the future. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer -- turning off request log?

2008-09-25 Thread Sean DiZazzo
On Sep 25, 6:01 pm, [EMAIL PROTECTED] wrote: My SimpleXMLRPCServer program prints to stderr a line like this for each request: ohm..pixar.com - - [25/Sep/2008 17:57:50] POST /RPC2 HTTP/1.0 200 - Is there a way to turn this logging off?  I have RTFM and can't seem to find a way to do so.

Re: SimpleXMLRPCServer -- turning off request log?

2008-09-25 Thread Sean DiZazzo
On Sep 25, 9:04 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: On Sep 25, 6:01 pm, [EMAIL PROTECTED] wrote: My SimpleXMLRPCServer program prints to stderr a line like this for each request: ohm..pixar.com - - [25/Sep/2008 17:57:50] POST /RPC2 HTTP/1.0 200 - Is there a way to turn

Re: Writing a well-behaved daemon

2008-09-25 Thread Sean DiZazzo
On Sep 25, 10:08 pm, Ben Finney [EMAIL PROTECTED] wrote: Howdy all, Writing a Python program to become a Unix daemon is relatively well-documented: there's a recipe for detaching the process and running in its own process group. However, there's much more to a Unix daemon than simply

Re: Writing a well-behaved daemon

2008-09-26 Thread Sean DiZazzo
On Sep 26, 12:13 am, Ben Finney [EMAIL PROTECTED] wrote: Sean DiZazzo [EMAIL PROTECTED] writes: Looks like somebody did the same thing I did and posted it. http://svn.plone.org/svn/collective/bda.daemon/trunk/bda/daemon/daemo... Thanks, I've not seen that before. It still seems loony

Re: how to search multiple textfiles ?

2008-09-26 Thread Sean DiZazzo
On Sep 26, 6:35 am, Stef Mientki [EMAIL PROTECTED] wrote: hello, I want to search multiple textfiles (python source files) for a specific word. I can find all files, open them and do a search, but I guess that will be rather slow. I couldn't find any relevant information through google.

Re: check if file is MS Word or PDF file

2008-09-27 Thread Sean DiZazzo
On Sep 27, 4:01 pm, Chris Rebert [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 3:42 PM, Michael Crute [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 5:43 PM, A. Joseph [EMAIL PROTECTED] wrote: What should I look for in a file to determine whether or not it is a MS Word file or an Excel

Re: Web programming in Python.

2008-09-29 Thread Sean DiZazzo
On Sep 28, 4:51 pm, Kurda Yon [EMAIL PROTECTED] wrote: 1. On my server (in my directory) I found cgi-bin subdirectory. 2. In the cgi-bin I have created a file test.py. 3. In that file I put: #!/usr/bin/python2.4 python print Hello, World! (I have checked, I have /usr/bin/python2.4

Re: PYTHON WORKING WITH PERL ??

2008-09-29 Thread Sean DiZazzo
On Sep 29, 12:44 pm, Blubaugh, David A. [EMAIL PROTECTED] wrote: Sir, You are absolutely correct.  I was praying to G_d I did not have to slaughter my project's source code in this manner.  However, like life itself, I was given legacy source code (i.e. someone else errors to fix) in Perl.  

Re: python sms

2008-09-29 Thread Sean DiZazzo
On Sep 29, 8:47 pm, sui [EMAIL PROTECTED] wrote: Hii i want a script to send sms to any mobile. can u help me ?? Thanks in advance.. Must...be...smarter...than...cell...phone... -- http://mail.python.org/mailman/listinfo/python-list

Re: using SSh problem!

2008-10-02 Thread Sean DiZazzo
On Oct 2, 3:27 am, sa6113 [EMAIL PROTECTED] wrote: No, my problem isn't entering password or not ? I want to know what should I do to connect between different platform and copy a file . Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], sa6113 wrote: I want to connect form a

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Sean DiZazzo
On Oct 8, 11:24 am, Samuel A. Falvo II [EMAIL PROTECTED] wrote: On Oct 7, 6:23 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: Is your shell script doing something else, apart from invoking the java   process? Obviously, yes.  The script is some 150 lines long.  But the hang-up occurs

Re: Developing for Python (2.x or 3)?

2008-10-21 Thread Sean DiZazzo
I would use 2.5.2 or 2.6. I don't think 3 is anywhere near stable yet. Paulo J. Matos wrote: Hi all, I am in the process of choosing which Python version for a brand new application. Van Rossum in an interview recently advised all new applications to use Python3 but I am afraid, most

Re: How to open a shell prompt from an existing shell prompt

2008-10-21 Thread Sean DiZazzo
On Oct 21, 4:52 am, gaurav kashyap [EMAIL PROTECTED] wrote: Dear all, I have a file in which i have written some shell commands to execute. Herein i require to open another shell prompt from this file. or simply i want to open a new shell prompt from an existing shell prompt. How could this

Python for Kids

2008-07-08 Thread Sean DiZazzo
Pretty cool!! Our base will be *much* bigger in about twenty years. I remember doing Basic on my dads Apple IIe. http://wiki.laptop.org/go/Pippy#Summary -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining when a file has finished copying

2008-07-11 Thread Sean DiZazzo
On Jul 9, 5:34 pm, keith [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program

RegExp Help

2007-12-13 Thread Sean DiZazzo
Hi group, I'm wrapping up a command line util that returns xml in Python. The util is flaky, and gives me back poorly formed xml with different problems in different cases. Anyway I'm making progress. I'm not very good at regular expressions though and was wondering if someone could help with

Re: RegExp Help

2007-12-13 Thread Sean DiZazzo
On Dec 13, 5:49 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: Hi group, I'm wrapping up a command line util that returns xml in Python. The util is flaky, and gives me back poorly formed xml with different problems in different cases. Anyway I'm making progress. I'm not very good at regular

Elementtree tag

2007-12-13 Thread Sean DiZazzo
I have a another question... using elementtree, is there a proper way to get at the data '123456789' in this tag? 'id 123456789 /' I tried making it an element, but the only attribute that returns anything is the tag attribute. Does that section of a tag have any proper name that I'm missing?

Re: Elementtree tag

2007-12-13 Thread Sean DiZazzo
On Dec 13, 8:46 pm, Waldemar Osuch [EMAIL PROTECTED] wrote: On Dec 13, 7:52 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: I have a another question... using elementtree, is there a proper way to get at the data '123456789' in this tag? 'id 123456789 /' I tried making it an element

Re: RegExp Help

2007-12-14 Thread Sean DiZazzo
On Dec 14, 12:04 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Thu, 13 Dec 2007 17:49:20 -0800, Sean DiZazzo wrote: I'm wrapping up a command line util that returns xml in Python. The util is flaky, and gives me back poorly formed xml with different problems in different cases

Re: RegExp Help

2007-12-14 Thread Sean DiZazzo
On Dec 14, 3:06 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 14 Dec 2007 06:06:21 -0300, Sean DiZazzo [EMAIL PROTECTED] escribió: On Dec 14, 12:04 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Thu, 13 Dec 2007 17:49:20 -0800, Sean DiZazzo wrote: I'm wrapping up

Keyword args to SimpleXMLRPCServer

2007-12-17 Thread Sean DiZazzo
Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? server.py import SocketServer from SimpleXMLRPCServer import SimpleXMLRPCServer,SimpleXMLRPCRequestHandler # Threaded mix-in class

Re: Keyword args to SimpleXMLRPCServer

2007-12-17 Thread Sean DiZazzo
On Dec 17, 4:13 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? server.py import SocketServer from SimpleXMLRPCServer import SimpleXMLRPCServer

askopenfilename() as root window

2007-12-18 Thread Sean DiZazzo
Is there any way to open a Tkinter.askopenfilename() without opening a root window alongside the file chooser? I simply want a script to open a dialog and return the chosen file's path to stdout. from tkFileDialog import askopenfilename print askopenfilename() ...does the job, but it opens

Re: askopenfilename() as root window

2007-12-18 Thread Sean DiZazzo
On Dec 18, 6:06 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: On 18 dic, 22:43, Sean DiZazzo [EMAIL PROTECTED] wrote: Is there any way to open a Tkinter.askopenfilename() without opening a root window alongside the file chooser? I simply want a script to open a dialog and return

Re: read_nonblocking error in pxssh

2008-01-16 Thread Sean DiZazzo
Just glanced at the docs, but it might be worth a shot... try: import pxssh s=pxssh.pxssh() s.login(myhost,root,mypass, auto_prompt_reset=False) Maybe??? Otherwise, I have used and modified this script with great success: (ssh_session.py)

Re: Doubt

2008-07-23 Thread Sean DiZazzo
On Jul 23, 7:51 am, ജഗന്നാഥ് [EMAIL PROTECTED] wrote: Friends I am a Perl programmer new to Python. I have a small doubt. How to convert the perl notation $a = ; expression in Python ? How to represent the loop for ($a = $b; $a=$c;$a++){ } in Python Jagan Linguist On most occasions

Re: applescript/python question

2008-08-01 Thread Sean DiZazzo
On Aug 1, 5:41 pm, [EMAIL PROTECTED] wrote: I can't seem to figure this out.  I just installed Python 2.5.2 a few days ago on my OS X 10.4.11 system.  It runs fine and if I type Python -V in the Terminal it outputs Python 2.5.2 which is correct.  However, if I try to run a 'do shell script'

Re: Teething troubles with Python on a Mac

2008-08-03 Thread Sean DiZazzo
Question 1: How can I locate the Python installation? There a few files under Applications MacPython 2.5, but this is clearly not the entire installation. find / -name site-packages Will lead you to where SciPy and Numpy should be installed for each Python installation. You can work

Re: Why doesn't import work?

2008-08-04 Thread Sean DiZazzo
On Aug 4, 3:34 pm, ssecorp [EMAIL PROTECTED] wrote: I have in Lib/site-packages a module named pdfminer. when I do import pdfminer it complains: import pdfminer Traceback (most recent call last):   File pyshell#3, line 1, in module     import pdfminer ImportError: No module named

Re: Testing for the first few letters of a string

2008-08-07 Thread Sean DiZazzo
try string1 = My name is alex string2 = My name is alex, and I like pie if string2.startswith(string1): process() or if you want to match a set number of characters you can use a slice: if string2[:15] == string1[:15]: process() or if you dont care where the characters appear in the

Re: Create a short way to save typing script over and over....

2008-08-07 Thread Sean DiZazzo
On Aug 7, 11:56 am, frankrentef [EMAIL PROTECTED] wrote: I have a statement url = 'http://xyzserver/'  so in my code every time I need to use xyzserver I state url + What I' m now trying to do is create a call to a login process.  The script for the login process is below.  I'd like to

Re: SSH utility

2008-08-11 Thread Sean DiZazzo
On Aug 11, 5:17 am, [EMAIL PROTECTED] wrote: for similar tasks, I use pexpecthttp://pypi.python.org/pypi/pexpect. spawning bash process and simulate an interactive session. Here sending ls command, retrieving results and exiting. In the spawned process ssh or any other command, is just

Re: searching through a string and pulling characters

2008-08-20 Thread Sean DiZazzo
On Aug 19, 6:11 am, Wojtek Walczak [EMAIL PROTECTED] wrote: On Mon, 18 Aug 2008 15:34:12 -0700 (PDT), Alexnb wrote: Also, on a side-note, does anyone know a very simple dictionary site, that isn't dictionary.com or yourdictionary.com. This one is my favourite:http://www.lingro.com/ --

Re: Seeking ideas for a cron implementation

2008-08-22 Thread Sean DiZazzo
On Aug 22, 1:30 pm, Karthik Gurusamy [EMAIL PROTECTED] wrote: Hi, I'm working on a cron like functionality for my application. The outer loops runs continuously waking every x seconds (say x=180, 300, ..). It needs to know what events in cron has expired and for each event do the work

Re: Wild Card String Comparison

2008-08-27 Thread Sean DiZazzo
On Aug 27, 8:49 pm, W. eWatson [EMAIL PROTECTED] wrote: Is it possible to do a search for a wild card string in another string. For example, I'd like to find v*.dat in a string called bingo. v must be matched against only the first character in bingo, and not simply found somewhere in bingo,

Access to Windows Add/Remove Programs?

2008-09-03 Thread Sean DiZazzo
Hi all, I'm trying to find a way to get a list of all the installed programs on a Windows box via Python. I thought of a few hacks that might partially work, and then thought about Add/Remove Programs Seems like the right way to go. I looked over the pywin32 docs a bit, but nothing slapped me

Re: Access to Windows Add/Remove Programs?

2008-09-03 Thread Sean DiZazzo
On Sep 3, 7:13 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 03 Sep 2008 21:51:59 -0300, Sean DiZazzo [EMAIL PROTECTED]   escribi : I'm trying to find a way to get a list of all the installed programs on a Windows box via Python.  I thought of a few hacks that might partially

SQLObject - Connect to established DB with non-int 'id' field

2007-10-19 Thread Sean DiZazzo
Hi all, I am just beginning with TurboGears and have run into a problem with SQLObject. I'm trying to connect to an established mysql DB, and use TurboGears to display results from the DB only. The problem is that the DB already has an 'id' field that is a string as opposed to an int. SQLObject

Re: SQLObject - Connect to established DB with non-int 'id' field

2007-10-20 Thread Sean DiZazzo
On Oct 19, 11:51 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Sean DiZazzo schrieb: Hi all, I am just beginning with TurboGears and have run into a problem with SQLObject. I'm trying to connect to an established mysql DB, and use TurboGears to display results from the DB only

Re: popen function of os and subprocess modules

2009-10-28 Thread Sean DiZazzo
On Oct 28, 7:15 am, banu varun.nagp...@gmail.com wrote: On Oct 28, 3:02 pm, Jon Clements jon...@googlemail.com wrote: On 28 Oct, 13:39, banu varun.nagp...@gmail.com wrote: Hi, I am a novice in python. I was trying to write a simple script on Linux (python 3.0) that does the

Re: ImportError: No module named _md5 - Please help

2009-10-29 Thread Sean DiZazzo
On Oct 29, 8:49 am, wadi wadi wadie...@gmail.com wrote: I can't alter the import statement as the error log is pointing to one of the installed python files 'hashlib.py' /python/2.6.2/lib/python2.6/hashlib.py and I don't have the right permissions to alter the python installation. Any idea?

Re: substituting list comprehensions for map()

2009-11-02 Thread Sean DiZazzo
On Nov 2, 9:01 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Anh Hai Trinh anh.hai.tr...@gmail.com writes: Yes, just about any ‘map()’ operation has a corresponding list comprehension. (Does anyone know of a counter-example, a ‘map()’ operation that doesn't have a correspondingly

Re: extracting info from media files

2009-11-07 Thread Sean DiZazzo
MediaInfo is your best bet. http://mediainfo.sourceforge.net/en ~Sean On Nov 6, 11:59 pm, Michele Simionato michele.simion...@gmail.com wrote: I would like to extract some simple info from media files, such as size, resolution, duration, codec. What's the simplest way to do it? Once in a

Re: Reading a file that is changing and getting the new lines

2009-12-01 Thread Sean DiZazzo
On Dec 1, 3:09 pm, Ouray Viney ovi...@gmail.com wrote: Problem: = I want to read a ASCII text file that can have data appended to it. Example scenario:  As the python script is running a user/application adds new entries to the end of the test case file, example, adds the following

daemon.DaemonContext and logging

2009-12-10 Thread Sean DiZazzo
I'm finally getting around to trying out the python-daemon module and have hit a wall. I'm trying to set up logging inside of the with daemon.DaemonContext block. But when I try to use a logger inside the block it throws an error: ~~ from __future__ import

Re: daemon.DaemonContext and logging

2009-12-10 Thread Sean DiZazzo
On Dec 10, 5:37 pm, Sean DiZazzo half.ital...@gmail.com wrote: I'm finally getting around to trying out the python-daemon module and have hit a wall.  I'm trying to set up logging inside of the with daemon.DaemonContext block.  But when I try to use a logger inside the block it throws an error

Re: insert unique data in a list

2009-12-13 Thread Sean DiZazzo
On Dec 13, 8:37 am, mattia ger...@gmail.com wrote: How can I insert non-duplicate data in a list? I mean, is there a particular option in the creation of a list that permit me not to use something like: def append_unique(l, val):     if val not in l:         l.append(val) Thanks, Mattia

Re: python 2.x and running shell command

2009-12-23 Thread Sean DiZazzo
On Dec 23, 1:57 pm, tekion tek...@gmail.com wrote: All, some of the servers I have run python 2.2, which is a drag because I can't use subprocess module.  My options that I know of is popen2 module.  However, it seems it does not have io blocking capabilities.   So every time run a command I

Re: python 2.x and running shell command

2009-12-24 Thread Sean DiZazzo
On Dec 24, 5:34 am, tekion tek...@gmail.com wrote: On Dec 23, 5:22 pm, Sean DiZazzo half.ital...@gmail.com wrote: On Dec 23, 1:57 pm, tekion tek...@gmail.com wrote: All, some of the servers I have run python 2.2, which is a drag because I can't use subprocess module.  My options

Re: Printing plain text with exact positioning on Windows

2010-01-06 Thread Sean DiZazzo
On Jan 5, 11:40 am, KvS keesvansch...@gmail.com wrote: On Jan 5, 7:16 pm, Nobody nob...@nowhere.com wrote: On Tue, 05 Jan 2010 04:40:14 -0800, KvS wrote: Did you mean borderless printing? Every printer needs his margins, some more some less. Some printers have the ability to do

Re: PIL how to display multiple images side by side

2010-01-08 Thread Sean DiZazzo
On Jan 8, 1:43 pm, suresh.amritapuri suresh.amritap...@gmail.com wrote: Hi, In PIL, how to display multiple images in say m rows and n colums when I have m*n images. suresh Sounds like a good project to learn PIL with. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

setattr() oddness

2010-01-15 Thread Sean DiZazzo
Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr() oddness

2010-01-15 Thread Sean DiZazzo
On Jan 15, 2:22 pm, Terry Reedy tjre...@udel.edu wrote: On 1/15/2010 3:37 PM, Sean DiZazzo wrote: Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' Different people have different opinions as to whether setattr

Re: deriving MySQLdb class

2010-01-21 Thread Sean DiZazzo
On Jan 21, 5:48 pm, tekion tek...@gmail.com wrote: All, I am trying to write a class which inherits from MySQLdb class.  Below is code snippet: import MySQLdb import sys class  msql_connect(MySQLdb):     def __init__(self):         self.host     =  hostname         self.user     = user  

Re: deriving MySQLdb class

2010-01-21 Thread Sean DiZazzo
On Jan 21, 8:00 pm, tekion tek...@gmail.com wrote: Sean, Thanks.  This is useful.  For future reference, how do I know what class is in MySQLdb module? You have to explore. ;) I found the MySQLdb module, and looked inside the __init__.py. Then looked for connect and followed the trail. --

Re: deriving MySQLdb class

2010-01-21 Thread Sean DiZazzo
On Jan 21, 8:17 pm, tekion tek...@gmail.com wrote: Sean, I did a little investigation, there are other classes besides Connection. So, could I only set up a derived class from Connection and still be able to use the connection to query database and retrieve data? Im not sure I understand you

Re: Terminal application with non-standard print

2010-01-25 Thread Sean DiZazzo
On Jan 24, 11:27 am, Rémi babedo...@yahoo.fr wrote: Hello everyone, I would like to do a Python application that prints data to stdout, but not the common way. I do not want the lines to be printed after each other, but the old lines to be replaced with the new ones, like wget does it for

Re: Wrap a function

2010-01-28 Thread Sean DiZazzo
On Jan 28, 12:13 pm, Joan Miller pelok...@gmail.com wrote: On 28 ene, 19:58, John Posner jjpos...@optimum.net wrote: On 1/28/2010 2:24 PM, Joan Miller wrote: On 28 ene, 19:16, Josh Hollandj...@joshh.co.uk  wrote: On 2010-01-28, Joan Millerpelok...@gmail.com  wrote: I've to call to

Re: get error install MySQLdb on Mac OS X

2010-01-28 Thread Sean DiZazzo
On Jan 28, 12:53 pm, PS.OHM ps.o...@gmail.com wrote: Hello Guys I have get some error when i install MySQLdb on Mac OS X after i key command $python setup.py build rusult is : : error: command 'gcc-4.0' failed with exit status 1 How to config this poblem? Please show a little bit more

Re: SimpleXMLRPCServer daemon

2010-01-29 Thread Sean DiZazzo
On Jan 29, 7:54 am, Thomas Allen thomasmal...@gmail.com wrote: I have a script that runs an instance of SimpleXMLRPCServer and in general it works as expected. In its __del__, it is supposed to clean up its PID file (written on boot). I have two problems with this server instance: The first is

Re: PEP 3147 - new .pyc format

2010-01-31 Thread Sean DiZazzo
Here is a recent list of magic numbers:        Python 2.6a0: 62151 (peephole optimizations and STORE_MAP opcode)        Python 2.6a1: 62161 (WITH_CLEANUP optimization)        Python 2.7a0: 62171 (optimize list comprehensions/change LIST_APPEND)        Python 2.7a0: 62181 (optimize

Re: Your beloved python features

2010-02-04 Thread Sean DiZazzo
On Feb 4, 3:03 pm, Julian maili...@julianmoritz.de wrote: Hello, I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread hidden features of Python. I want to design a poster for an open source conference, the

Re: equivalent of Ruby's Pathname?

2010-02-04 Thread Sean DiZazzo
On Feb 3, 6:08 pm, alex23 wuwe...@gmail.com wrote: On Feb 4, 8:47 am, Phlip phlip2...@gmail.com wrote: Yes, calling os.path.walk() and os.path.join() all the time on raw strings is fun, but I seem to recall from my Ruby days a class called Pathname, which presented an object that behaved

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 11:02 am, T misceveryth...@gmail.com wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands.  Specifically, the program will call plink.exe to create a reverse SSH tunnel.  Right now I'm using subprocess.Popen

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 4:57 pm, T misceveryth...@gmail.com wrote: Thanks for the suggestions -  I think my next step is to try running it under an admin user account, as you guys both mentioned.  Alf - you're absolutely right, Microsoft has srvany.exe, which allows you to run any EXE as a Windows service.  

Re: Executing Commands From Windows Service

2010-02-08 Thread Sean DiZazzo
It's working fine when I run it via servicename debug - that's how I was testing before.  It's when I start the service that it fails - and you can see that, when you run it with debug, plink.exe runs under my username.  When I run it as a service, it runs under System... You can have the

Re: Executing Commands From Windows Service

2010-02-09 Thread Sean DiZazzo
On Feb 9, 6:52 am, T misceveryth...@gmail.com wrote: On Feb 8, 2:25 pm, David Bolen db3l@gmail.com wrote: T misceveryth...@gmail.com writes: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands.  Specifically, the

Re: equivalent of Ruby's Pathname?

2010-02-09 Thread Sean DiZazzo
On Feb 8, 2:36 pm, a...@pythoncraft.com (Aahz) wrote: In article dcace5fc-5ae9-4756-942d-6da7da2f6...@s36g2000prh.googlegroups.com, Sean DiZazzo  half.ital...@gmail.com wrote: On Feb 3, 6:08=A0pm, alex23 wuwe...@gmail.com wrote: There was also a PEP with another possible implementation

Re: How do you implement a Progress Bar

2010-02-13 Thread Sean DiZazzo
On Feb 12, 11:33 pm, J Wolfe vorticitywo...@gmail.com wrote: I would really appreciate some help with this.  I'm fairly new to using classes...What am I doing wrong? All I get is a blank window. I can't seem to figure out how to initialize this Progress Bar. Study and hack on this:

Re: Question about getmtime

2010-02-19 Thread Sean DiZazzo
On Feb 19, 10:06 am, MRAB pyt...@mrabarnett.plus.com wrote: Brandon wrote: Hi everyone, Does copying or moving a file affect the return value of os.path.getmtime(path)? The modification time of a copied file should be the same as the original. The creation time of a copied file will

Re: Executable problem - correction

2010-02-24 Thread Sean DiZazzo
On Feb 24, 9:22 pm, Gib Bogle g.bo...@auckland.no.spam.ac.nz wrote: The program doesn't fail with the write error on the other XP machine, it actually fails to execute at all, complaining about the configuration information.  Therefore I'm seeing different behaviour on three XP machines: Box

Re: Updates about Tk

2010-02-27 Thread Sean DiZazzo
Are the new Tk comaprable with other toolkits(Qt, GTK,Wx?)? Does Tk lack other features compared to the Qt,GTK,Wx...? (Or: is there things you can't simply do with Tk?) Thanks in advance for replying tkinter is a good starting point. You can get some definite benefits going to wx or Qt. I

Re: basic thread question

2009-08-19 Thread Sean DiZazzo
On Aug 18, 4:58 pm, birdsong david.birds...@gmail.com wrote: On Aug 18, 3:18 pm, Derek Martin c...@pizzashack.org wrote: On Tue, Aug 18, 2009 at 03:10:15PM -0500, Derek Martin wrote: I have some simple threaded code...  If I run this with an arg of 1 (start one thread), it pegs one

Re: Permanently adding to the Python path in Ubuntu

2009-08-29 Thread Sean DiZazzo
On Aug 29, 5:39 pm, Chris Colbert sccolb...@gmail.com wrote: I'm having an issue with sys.path on Ubuntu. I want some of my home built packages to overshadow the system packages. Namely, I have built numpy 1.3.0 from source with atlas support, and I need it to overshadow the system numpy 1.2.1

  1   2   >