[Tutor] Directory permission and ACLs

2005-09-02 Thread Pat Martin
I am new to python and wanted to write a program that looks at directory permissions and ext3 ACLs and also change them if needed. What modules would I be looking at for those functions? Thank you. Pat ___ Tutor maillist - Tutor@python.org http://mai

[Tutor] python-ldap

2005-11-22 Thread Pat Martin
I am new to python and fairly new to programming. I have written some ldap scripts in perl and am trying to learn how to do that in python. I found some code on the net using the python-ldap module (the unaltered code is at the bottom of this email) and have adapted it to my needs, the code wor

[Tutor] Life after beginner

2006-01-30 Thread Pat Martin
Hello,I have been reading about and playing with programming in python for awhile now. I have most of the basics down. I know what a tuple is, I know how to load modules, and I understand a fair amount of beginning programming theory. I have written some scripts for both home and work and have beco

[Tutor] Locking a file in linux with Python

2006-02-22 Thread Pat Martin
Hello,I am trying to find on the web how to lock a file with python in Linux. I am trying to process a group of files that are continually being written to and when I am working on one file I would like to be able to lock it. Can anyone point me in the right direction for that. Thanks-- Pat Martin

Re: [Tutor] Locking a file in linux with Python

2006-02-22 Thread Pat Martin
> I am trying to find on the web how to lock a file with python in Linux.> I am trying to process a group of files that are continually being > written to and when I am working on one file I would like to be able to> lock it. Can anyone point me in the right direction for that.Hi Pat,Take a look at

Re: [Tutor] Locking a file in linux with Python

2006-02-22 Thread Pat Martin
On 2/22/06, Pat Martin <[EMAIL PROTECTED]> wrote: > I am trying to find on the web how to lock a file with python in Linux. > I am trying to process a group of files that are continually being > written to and when I am working on one file I would like to be able to> lock it. C

Re: [Tutor] Locking a file in linux with Python

2006-02-23 Thread Pat Martin
Danny and Hugo,Thanks that really explains it better on what was going on. I may try renaming the file to see if I can get around it that way. -- Pat Martin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] usernames and uid in linux

2006-03-03 Thread Pat Martin
that returns the uid (the number).Thanks-- Pat Martin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] usernames and uid in linux

2006-03-03 Thread Pat Martin
stinctly native American criminal class save Congress-- Mark Twain___ Tutor maillist  -  Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutorI completely missed that. Thank you so much. -- Pat Martin __

[Tutor] Assigning a variable to an FTP directory listing

2013-12-11 Thread Pat Martin
Hello, I am writing a program that needs to pull all of the files from a specific directory. I have a few lines written that give me the list of files but when I try to assign it to a variable the variable ends up equaling "226 Directory send Ok", this is a snippet of my code. ftp=FTP(ftpserver)

Re: [Tutor] Assigning a variable to an FTP directory listing

2013-12-12 Thread Pat Martin
help. On Wed, Dec 11, 2013 at 4:22 PM, Steven D'Aprano wrote: > On Wed, Dec 11, 2013 at 03:55:50PM -0800, Pat Martin wrote: >> Hello, >> >> I am writing a program that needs to pull all of the files from a >> specific directory. I have a few lines written that gi

[Tutor] Select a string

2017-09-05 Thread Pat Martin
Hello all, I am trying to write a program for a programming class that finds the number of a specific string (bob) in a string of characters. I am using one of the sample strings they give me and it should find 2 instances of bob but my script returns 0. Since they want it to find 2 from the bobob

Re: [Tutor] Select a string

2017-09-06 Thread Pat Martin
s for that as well. The reason I haven't used regex/methods/etc is it hasn't been covered yet, we have only covered basic types, for, while and if statements. On Wed, Sep 6, 2017 at 1:54 AM, Alan Gauld via Tutor wrote: > On 06/09/17 06:34, Pat Martin wrote: > > > but my s

Re: [Tutor] Select a string

2017-09-06 Thread Pat Martin
t and have written a couple useful scripts but still very much a beginner and there are definite holes in my knowledge. Hoping this class fills in some of the holes. Thanks again all for the suggestions and the tips. On Wed, Sep 6, 2017 at 8:01 AM, Pat Martin wrote: > I knew it was an assi

[Tutor] Graphical/web program

2018-01-12 Thread Pat Martin
Hello, I have recently written a program to add switches and hosts to my ssh config file, I use argparse for some switches like user name and such and it has been working pretty well. I was thinking of turning this into a web app (one that is just run on my local machine) something like have a f

[Tutor] pythonic

2018-03-29 Thread Pat Martin
st', metavar="") parser.add_argument("-t", "--tags", type=str, required=True, help="Tags for post", metavar="") parser.add_argument("-a", "--author", type=str, default="Pat Martin",

Re: [Tutor] pythonic

2018-03-30 Thread Pat Martin
Thank you all for the ideas and comments, it is appreciated. I have some refactoring to do now. On Fri, Mar 30, 2018 at 2:22 AM, Peter Otten <__pete...@web.de> wrote: > Pat Martin wrote: > > > I have written the following program. It generates a template for Pelican &

[Tutor] Storing passwords and version control

2018-05-27 Thread Pat Martin
Hello all, I am writing a script that will be using an API to connect to some systems to pull info for a search. Since it will be a script I will be running through cron I won't be able to type the password at time of running. I also am going to be putting this in source control, using git specifi

[Tutor] (no subject)

2018-10-19 Thread Pat Martin
TLDR; How do you figure out if code is inefficient (if it isn't necessarily obvious) and how do you find a more efficient solution? I use code wars sometimes to get some practice with Python, there was a challenge to compare two strings and if string1 had enough characters to be rearranged to make

[Tutor] How to find optimisations for code

2018-10-19 Thread Pat Martin
Sorry my first email didn't have a subject line TLDR; How do you figure out if code is inefficient (if it isn't necessarily obvious) and how do you find a more efficient solution? I use code wars sometimes to get some practice with Python, there was a challenge to compare two strings and if strin

Re: [Tutor] How to find optimisations for code

2018-10-19 Thread Pat Martin
Mats Wichmann wrote: > > > On 10/19/2018 10:12 AM, Pat Martin wrote: > >> Sorry my first email didn't have a subject line > >> > >> TLDR; How do you figure out if code is inefficient (if it isn't > >> necessarily obvious) and how do you find

Re: [Tutor] How to find optimisations for code

2018-10-19 Thread Pat Martin
So should we always use sets or dictionaries if possible? Are these more efficient because of not keeping track of their position? On Fri, Oct 19, 2018 at 10:47 AM Pat Martin wrote: > That's correct sorry, I reassigned with replace back to string2, I forgot > that in my retyping of