Re: [Tutor] Better way to check *nix remote file age?

2014-06-26 Thread Albert-Jan Roskam
> I'd probably rather try Paramiko's SFTPClient and retrieve the file > modified date directly: > http://paramiko-docs.readthedocs.org/en/latest/api/sftp.html#paramiko.sftp_client.SFTPClient > (see the SFTPFile.stat() method in particular, which gives you back a > stat object containing mtime,

Re: [Tutor] Object instance package wide with Jython 2.7

2014-06-26 Thread Dave Angel
"Jorge L." Wrote in message: (please post in text mode, as html carries a number of problems in a text list like this one) class Server(object) def __init__(self, name) self.name = name def some_operation(self) # stuff to be done with JLI

Re: [Tutor] Better way to check *nix remote file age?

2014-06-26 Thread leam hall
On Thu, Jun 26, 2014 at 12:41 PM, Walter Prins wrote: > On 26 June 2014 14:39, leam hall wrote: > > Python 2.4.3 > > > > Writing a function that takes the string from "ssh ls -l > > /var/log/yum.log" and tries to see if the file is more than a couple > months > > old. The goal is to only run py

Re: [Tutor] Better way to check *nix remote file age?

2014-06-26 Thread Walter Prins
On 26 June 2014 14:39, leam hall wrote: > Python 2.4.3 > > Writing a function that takes the string from "ssh ls -l > /var/log/yum.log" and tries to see if the file is more than a couple months > old. The goal is to only run python on the local server and it will ssh into > the remote server. > >

[Tutor] Object instance package wide with Jython 2.7

2014-06-26 Thread Jorge L.
To avoid duplicated work: This a cross posting of a SE question: http://programmers.stackexchange.com/questions/246161/object-attribute-needed-at-package-level-with-python Let's consider the following scenario. We have a Python 2.7 package which serves as a library for some scripting projects. W

Re: [Tutor] Explicitly define the lib path for python during build time

2014-06-26 Thread Alan Gauld
On 26/06/14 10:23, Tony Wang wrote: But my needs is quite special here, I need to statically link python with gdb, and I hope the python in gdb I build can run on other PC. This list is for people learning the Python language and library. As such your question is extremely specialized and adva

[Tutor] Better way to check *nix remote file age?

2014-06-26 Thread leam hall
Python 2.4.3 Writing a function that takes the string from "ssh ls -l /var/log/yum.log" and tries to see if the file is more than a couple months old. The goal is to only run python on the local server and it will ssh into the remote server. Is there a better way to do this? Thanks! Leam

[Tutor] Explicitly define the lib path for python during build time

2014-06-26 Thread Tony Wang
Hi there, I'm building python2.7 from src code. Usually, after make, if I define a user folder to install the python, the python will depends on the lib folder in the installer folder. But my needs is quite special here, I need to statically link python with gdb, and I hope the python in gdb I bu

Re: [Tutor] IndexError: list index out of range

2014-06-26 Thread Alan Gauld
On 26/06/14 09:18, Myunggyo Lee wrote: Hi all I just started to learn python language. Welcome. I'm trying to figure out the reason of error but i couldn't find it. first imports short.txt(is attached to this mail) and read in dictionary named gpdic1 Others have pointed out the specific pr

Re: [Tutor] How to list/process files with identical character strings

2014-06-26 Thread Steven D'Aprano
On Wed, Jun 25, 2014 at 09:47:07PM -0700, Alex Kleider wrote: > Thanks for elucidating this. I didn't know that "several thousand" > would still be considered a small number. On a server, desktop, laptop or notepad, several thousand is not many. My computer can generate a dict with a million i

Re: [Tutor] IndexError: list index out of range

2014-06-26 Thread Dave Angel
Myunggyo Lee Wrote in message: You apparently posted this in html, and you tried to attach a data file. Each of those will cause problems for some readers. Please tell your email program to use text mail, and paste in your data, don't attach it. gpdic1={} while 1: line= inf2.readli

Re: [Tutor] IndexError: list index out of range

2014-06-26 Thread Peter Otten
Myunggyo Lee wrote: > I'm trying to figure out the reason of error but i couldn't find it. > first imports short.txt(is attached to this mail) > and read in dictionary named gpdic1 > > > Traceback (most recent call last): > File "/home/ercsb/test.py", line 11, in > hgene = lines[1] > Inde

[Tutor] IndexError: list index out of range

2014-06-26 Thread Myunggyo Lee
Hi all I just started to learn python language. I'm trying to figure out the reason of error but i couldn't find it. first imports short.txt(is attached to this mail) and read in dictionary named gpdic1 Traceback (most recent call last): File "/home/ercsb/test.py", line 11, in hgene = line