Re: Place the timer in Python script

2009-09-18 Thread Avell Diroll
Vamsikrishna wrote: How to place the timer in python code. timeit ... it's in the standard library: http://docs.python.org/library/timeit.html Cheers, Ju -- Whomever controls the press, owns history -- Johann Gutenberg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python SSH interface

2009-09-04 Thread Avell Diroll
Mag Gam wrote: Is there something similar to NetSSH (http://search.cpan.org/dist/Net-SSH-Perl/) for python? I don't know much about perl modules functionalities, but paramiko might be what you are searching for. http://www.lag.net/paramiko/ Cheers Ju -- Those who do not understand Unix are

Re: Video?

2009-09-03 Thread Avell Diroll
David C Ullrich wrote: ... Is that correct? If so is there some other standard Python windowing kit that does include some sort of video functionality? (Talking Ubuntu Linux if it matters.) I don't know about video and wxpython, but gstreamer has some python bindings (python-gst0.10 on jaunty

Re: write iso 9660 with python

2007-11-21 Thread Avell Diroll
bryan rasmussen wrote: > Hi, > > I need to read in a system of files and write them to an iso 9660, any > libraries suited to this task that are up to date? Python 2.4 or 2.5 > should be assumed. You could subprocess a call to cdrecord ... There are also python bindings for libburn ... http://icc

Re: Bytes/File Size Format Function

2007-06-13 Thread Avell Diroll
Ben Finney wrote: > The symbol for "bit" is 'b'. The symbol for "byte" is 'B'. 'kb' is > 'kilobit', i.e. 1000 bits. 'mb' is a "metre-bit", a combination of two > units. And so on. The SI units have definitions that are only muddied > by misusing them this way. I have to disagree: 'mb' should stand

Re: SSH File Transfer Protocol or SFTP

2006-12-11 Thread Avell Diroll
Lad wrote: > Is there a module in Python available that I can use for uploading > files via > SFTP (SSH File Transfer Protocol)? > Or do you think that FTP protocol for files uploading is OK? > Thank you for replies > Lad. > I believe there are many of those, personally i am using paramiko :

Re: dictionaries - returning a key from a value

2006-09-01 Thread Avell Diroll
Michael Malinowski wrote: (snip) > However, I am curious to know if its possible to get the key from giving > a value (basically the opposite of what I did above, instead of getting > a value from a key, I want the key from a value). Is there a way of > doing this? Or would I need to cycle all the

Re: Newbie question about numpy

2006-08-24 Thread Avell Diroll
Paul Johnston wrote: (snip) > I noted the lack of matrices so installed numpy (snip) > _ > from numpy import * > > a = array([[1,2,3],[4,5,6],[1,2,3]]) > b = array([[1,3,6],[2,5,1],[1,1,1]]) (snip) > print "a * b is \n", a * b >

Re: String Formatting

2006-08-10 Thread Avell Diroll
OriginalBrownster wrote: > Hi there: > > I was wondering if its at all possible to search through a string for a > specific character. > > I want to search through a string backwords and find the last > period/comma, then take everything after that period/comma > > Example > > If i had a list:

Re: web searching scripts

2006-08-04 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > Does anyone know of a freely available script that can take a given URL > and follow every link within it? > > Ideally, I would like to start with this to build a quick application > to grab all the content off a website to publish it to a CD. > > Thanks, > > jul >

Re: Reinstalling Python Problem (Newbie)

2006-08-02 Thread Avell Diroll
beno wrote: > Avell Diroll wrote: >> beno wrote: >> *** tidying a little *** >>> >>> What do I do about the problems with mimetools and urllib2? >>> >> >> This is the last report of the 'make test' command and there shoul

Re: Reinstalling Python Problem (Newbie)

2006-08-02 Thread Avell Diroll
beno wrote: > I intend to do that. However, I think this is the RIGHT list to ask > questions pertinent to python... I didn't intend to be abrupt, ... I was just in an hurry, sorry for that. Anyway I still see this problem more as a program not compiling correctly on Freebsd than python not com

Re: Reinstalling Python Problem (Newbie)

2006-08-01 Thread Avell Diroll
beno wrote: > It's been years since I've done this. I had a programmer working for me > who disappeared one day, and now I'm taking over his responsibilities. I > need to re-configure Apache for mod_python which means I have to rebuild > python. I'm working with the latest distro. I'm heavily depen

Re: Checking File permissions

2006-07-20 Thread Avell Diroll
Anoop wrote: > Please tell me how to check the existence of a file and the read > permission to the file using python script You can check the os module (os.stat comes to mind). For an exemple you can have a look at : http://www.pixelbeat.org/talks/python/ls.py Regards, Avell -- http://mail.py

Re: Python at compile - possible to add to PYTHONPATH

2006-06-21 Thread Avell Diroll
rh0dium wrote: (snip) > I want to add /foo/bar to the PYTHONPATH build so I don't have to add > it later on. Is there a way to do this? (snip) If i understand correctly, you want to add a directory to your PYTHONPATH for a specific script without modifying the system PYTHONPATH global variable

Re: OS specific command in Python

2006-06-21 Thread Avell Diroll
[EMAIL PROTECTED] wrote: (snip) > I have a linux box, from where I remotely execute all the commands. The > remote machine is windows machine. I installed an OpenSSH server for > windows to send the shutdown command. I setup the public keys in such a > way that I could login to SSH server without u

Re: OS specific command in Python

2006-06-21 Thread Avell Diroll
3c273 wrote: > I was just trying to learn how to use .communicate() and all of the examples > I see have [0] after .communicate(). What is the significance of the [0]? From the Python Library Reference (http://docs.python.org/lib/node239.html), you learn that the method communicate() from the

Re: OS specific command in Python

2006-06-21 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > I have a question on getpass. Since I am a newbie you might find it a > little dumb. > > By using the getpass, are u trying to retrieve the username and > password of remote mahcine or local ? > the module getpass contains 2 functions, getuser() and getpass() : getuse

Re: OS specific command in Python

2006-06-20 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > When you connect (via ssh or telnet) to a remote machine, you need to > type (manually) > your username and your password. Programming that is never easy. > This is really eased by the module getpass (std library) : ### import getpass login = getpass.getuser() passwo

Re: OS specific command in Python

2006-06-20 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > I tried the following and it seemed to work > > import os > os.system('') > > Any comments > This is an simple way to proceed if you don't need your python script to know what happens to the launched process ... When you need to : * send some input to the command

Re: OS specific command in Python

2006-06-19 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > I want to write a python program and call OS specific commands in it. > So basically, instead of typing in on the command line argument I want > to have it in a python program and let it do the action. There are several ways to do so : * os.system() if you just want to l

Re: GUI and graph

2005-12-22 Thread Avell Diroll
questions? wrote: > I have a graph with different parameters along different parts of the > graph. > > I want to have a program that can display the graph with coloring for > different part of the graph. Is this possible in Python? What should I > read? > > Thanks for any comments > I would sug