I have a bunch of files I need to remove in dirs and subdirs when they are
older than 7 days.
I was looking at os.path.walk, to recurse the directories, but I'm having
some difficulties with getting it to return the directory names or find
examples of it's use for something like this.
So far, I a
Gauld wrote:
>
> "Becky Mcquilling" wrote
>
> The Second script written here, always raises the exception and I'm
>> missing
>> why, any advice?
>> class Log_Parser:
>> def __init__(self):
>> self.re_backup_status = re.compile(r
So I'm new to doing creating classes in python and took a script I had
written to parse a log file and tried to create a class just to understand
it a little better. The first script below works fine.
It looks at the log, checks the date and if it's too old, raises the
exception and returns a set
Thanks, you are correct of course. I need to just scrap this and start
over, but I understand it a lot better now.
On Sun, May 22, 2011 at 4:57 PM, Alan Gauld wrote:
> "Becky Mcquilling" wrote
>
> I'm doing a tutorial and was given a problem, using shelve.
>>
I realize this is a fairly generic type of question, but being new to
programming, I'm not sure how best to approach it.
I'm doing a tutorial and was given a problem, using shelve. It's taking a
user name and then asking for scores in a game, until you end the loop.
Whatever score is the high sc
I have a code snippet that I have used to count the duplicates in a list as
such:
from sets import Set
def countDups(duplicateList):
uniqueSet = Set(item for item in duplicateList)
return[(item, duplicateList.count(item)) for item in uniqueSet]
lst = ['word', 'word', 'new', 'new', 'new']
pr
Thanks, Steve. For the first step, I just wasn't sure how to write the
file.
I appreciate the help.
Becky
On Sun, Apr 17, 2011 at 12:34 AM, Steven D'Aprano wrote:
> Becky Mcquilling wrote:
>
>> I'm trying to work out a method to create a binary file of 1mb and I
I'm trying to work out a method to create a binary file of 1mb and I'm
somewhat confused by the docs I'm reading is there a method that will do
this?
Becky
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail
Hi, all:
I'm doing a tutorial online and I have run across an assignment to write a
unit test. One of the tests is working fine, the other one is failing.
The goal of this particular one is:
1) Create a directory
2) Create files in the directory that are listed in the text files
3) Crea
Thanks, everyone:
Your suggestions worked. I will make sure to include full information next
time.
Becky
On Sat, Mar 12, 2011 at 12:14 AM, Steven D'Aprano wrote:
> Becky Mcquilling wrote:
>
>> If anyone is familiar with python-gnupg, I am having some difficulty with
>>
If anyone is familiar with python-gnupg, I am having some difficulty with
the syntax. I've tried the following:
f = open('c:/test/filename.txt', 'r')
datae = gpg.encrypt_file(f.read(), 'ladym...@gmail.com',
output=open('c:/gpg_test/data.gpg2', 'w'))
or
file_to_encrypt = open('c:/gpg_test/data.gp
Thanks, Sander. That was simple enough, as I'm learning I sometimes get
caught up in these all too silly mistakes.
Becky
On Mon, Mar 7, 2011 at 11:38 PM, Sander Sweers wrote:
> On Tue, 8 Mar 2011, 07:44:31 CET, Becky Mcquilling <
> ladymcse2...@gmail.com> wrote:
> >
I'm working on a Windows machine and want to use subprocess to run several
commands from the command line.
Normally with bat files or some of the other scripting languages on Windows,
I would set up a variable with the path to the command like so:
gpg = 'c:/program files (x86)/gnu/gnupg/gpg2.exe'
Thanks, that helped. I took a second look and realized where I had tried
calling the .strip() method was wrong. Appreciate the pointer.
Becky
On Thu, Mar 3, 2011 at 5:37 PM, Kushal Kumaran <
kushal.kumaran+pyt...@gmail.com> wrote:
> On Fri, Mar 4, 2011 at 6:48 AM, Becky Mcquilling
I am creating a dictionary by parsing a text file.
The code is below:
backup_servers = {}
fo = open('c:/test/backup_shares.txt')
for line in fo:
backup_server = line.split(',')
backup_servers[backup_server[0]]=backup_server[1]
for i, v in backup_servers.items():
backup_shares = i
archive
Thanks, as always. It all works.
Becky
On Tue, Feb 1, 2011 at 7:08 AM, Alan Gauld wrote:
> "Becky Mcquilling" wrote
>
>
> Basically, I need to format a string as an example:
>>
>> "He is {what}.format("{wild}")
>>
>> I want to in
Quick question to the group to solve an immediate problem and then if anyone
has a dead simple reference on formatting strings it would be greatly
appreciated as I'm finding this to be pretty confusing.
Basically, I need to format a string as an example:
"He is {what}.format("{wild}")
I want to
I'm fairly new to python and I am trying to do some math with tuples.
If I have a tuple:
t =( (1000, 2000), (2, 4), (25, 2))
I want to loop through and print out the results of the multiplying the two
numbers like so:
1000 x 2000
2 x 4
etc.
I'm not sure of the syntax for that. Any ideas?
Bec
wrote:
>
> "Becky Mcquilling" wrote
>
> Good points. I guess being as new as I am I'm not always sure of the
>> obvious way to do something or what I think is right,
>>
>
> One thing to remember is that it is always subjective.
> There is no such thing as
Good points. I guess being as new as I am I'm not always sure of the
obvious way to do something or what I think is right, may not be an having
explained examples are best, particularly after I've spent time solving the
problem.
But others may not find this useful. I admit that learning this stu
mped and a few hints would go a long
way, then having the answer presented, with an explanation, even further.
Becky
On Wed, Dec 9, 2009 at 4:19 PM, Alan Gauld wrote:
>
> "Becky Mcquilling" wrote
>
>
> Is there a good Tutorial that you guys recommend, where you actually ge
Is there a good Tutorial that you guys recommend, where you actually get a
useful exercise to try and do and then you can be walked through different
solutions? I'm not a Programmer by trade, but I do a bit of coding for
Administrator type functions and have to debug stuff and starting to do this
22 matches
Mail list logo