Re: [Tutor] raw_input a directory path

2010-05-13 Thread Spencer Parker
In these files I also have some special characters I need to remove, but I cannot figure out how to specify this. I need to remove a vertical tab and a formfeed character. How would I specify to remove these characters? I have tried \v and \f On Thu, May 13, 2010 at 8:48 AM, Spencer Parker

Re: [Tutor] raw_input a directory path

2010-05-13 Thread Spencer Parker
I figured out the issue...for some reason it works with the trailing slash, but not without it. Once I do that...everything is all good... On Wed, May 12, 2010 at 8:00 PM, Dave Angel wrote: > > > Spencer Parker wrote: > >> Here is the code: >> http://dpaste.com/

[Tutor] raw_input a directory path

2010-05-12 Thread Spencer Parker
I have a search and replace script that I am having the user put in the directory path as raw_input. The problem lies when I run the script it doesn't pick that up for some reason. Is there an appropriate way to take a directory path as input? ___ Tutor

Re: [Tutor] raw_input a directory path

2010-05-12 Thread Spencer Parker
esktop\\test On Wed, May 12, 2010 at 3:07 PM, Spencer Parker wrote: > Spreading it to the list... > > > -- Forwarded message -- > From: Spencer Parker > Date: Wed, May 12, 2010 at 3:07 PM > Subject: Re: [Tutor] raw_input a directory path > To: Luke Paire

[Tutor] Fwd: raw_input a directory path

2010-05-12 Thread Spencer Parker
Spreading it to the list... -- Forwarded message -- From: Spencer Parker Date: Wed, May 12, 2010 at 3:07 PM Subject: Re: [Tutor] raw_input a directory path To: Luke Paireepinart Forget all of what I said...I found the problem...I was encasing the variable with quotes instead

[Tutor] raw_input a directory path

2010-05-12 Thread Spencer Parker
I have a search and replace script that I am having the user put in the directory path as raw_input. The problem lies when I run the script it doesn't pick that up for some reason. Is there an appropriate way to take a directory path as input? This is on windows... ___

Re: [Tutor] simple search and replace...

2010-03-31 Thread Spencer Parker
more flexibility. Thanks again! On Wed, Mar 31, 2010 at 1:51 PM, ALAN GAULD wrote: > > *From:* Spencer Parker > ***Cc:* tutor@python.org > *Sent:* Wednesday, 31 March, 2010 20:30:56 > *Subject:* Re: [Tutor] simple search and replace... > > That was only a small example of a

Re: [Tutor] simple search and replace...

2010-03-31 Thread Spencer Parker
...terminology confusion in my head. On Wed, Mar 31, 2010 at 11:58 AM, Alan Gauld wrote: > > "Spencer Parker" wrote > > MSH|~^\&|SCW|SMED|COR||20100305123742||ORU^R01|100305123742891|P|2.2|||PID|||001109660||TEST^Man||19920519|M||00055254593|699-63-1152|||

[Tutor] simple search and replace...

2010-03-31 Thread Spencer Parker
I am writing a script to help me add line breaks at certain segments of HL7 messages. Not sure if anyone here is familiar with what an HL7 message is or not. We receive them out of our database with all the segments on one line. I am trying to write a script to allow me to separate them at a cer

[Tutor] Threading...

2009-04-24 Thread Spencer Parker
I have a script that I want to test MySQL sonnections with. The way I have the script working is to just create connections, but I realized that it is going to wait for the first one to stop before starting a new connection. I want to throw a ton of open connections at it to see what the connecti

[Tutor] print items in a list...

2009-04-16 Thread Spencer Parker
I have a script that is putting elements into a list. Now instead of adding a for blah in blah statement...is there an easy way to print out the elements in a list that is similar to this? I don't have an absolute length on the size of the list either since it changes depending on what I am searc

Re: [Tutor] regular expression problem

2009-04-15 Thread Spencer Parker
After he said that...I realized where I was being dumb... On Wed, Apr 15, 2009 at 10:29 AM, bob gailer wrote: > Spencer Parker wrote: > >> I have a python script that takes a text file as an argument. It then >> loops >> through the text file pulling out specific lines

[Tutor] regular expression problem

2009-04-15 Thread Spencer Parker
I have a python script that takes a text file as an argument. It then loops through the text file pulling out specific lines of text that I want. I have a regular expression that evaluates the text to see if it matches a specific phrase. Right now I have it writing to another text file that outp

Re: [Tutor] ideas on how to process a file

2009-04-10 Thread Spencer Parker
The question is now...what do I do to find duplicate entries in the text file I am reading. I just want to filter them out. There are a ton of duplicate entries in there. On Fri, Apr 10, 2009 at 10:43 AM, Spencer Parker wrote: > Oh...nice...this makes things much easier than what I had bef

Re: [Tutor] ideas on how to process a file

2009-04-10 Thread Spencer Parker
, Apr 10, 2009 at 10:18 AM, Kent Johnson wrote: > On Fri, Apr 10, 2009 at 12:04 PM, Spencer Parker > wrote: > > > > This is my code: > > http://pastebin.com/m11053edf > > I guess you have something like this now: > > for line in text_file.readlines

Re: [Tutor] ideas on how to process a file

2009-04-10 Thread Spencer Parker
M, Alan Gauld wrote: > > "Spencer Parker" wrote in message > > I have a flat file database that I want to get information from. The >> basic >> text looks like this: >> >> ITEM{ >> "FULLNAME" "apps114.chgit.com!file:

[Tutor] Reading a file and best approach for it...

2009-04-10 Thread Spencer Parker
I have a flat file database that I want to get information from. The basic text looks like this: ITEM{ "FULLNAME" "apps114.chgit.com!file:/etc" "RECOVERY" "0" } They are all on a separate line in the text file. I had thought about trying to drop it into a list or a

[Tutor] ideas on how to process a file

2009-04-10 Thread Spencer Parker
I have a flat file database that I want to get information from. The basic text looks like this: ITEM{ "FULLNAME" "apps114.chgit.com!file:/etc" "RECOVERY" "0" } They are all on a separate line in the text file. I had thought about trying to drop it into a list or a

Re: [Tutor] Class definition...

2009-02-27 Thread Spencer Parker
. On Thu, Feb 26, 2009 at 11:42 AM, Alan Gauld wrote: > > "Spencer Parker" wrote > > I am looking for a good tutorial to walk through that really explains >> class >> definition. This has been one sticking point that always messes me up >> > > I as

[Tutor] Class definition...

2009-02-26 Thread Spencer Parker
I am looking for a good tutorial to walk through that really explains class definition. This has been one sticking point that always messes me up for the most part. That and when people use "self". For some reason I just can't grasp what people say. Any good pointers to throw at me? I really w

[Tutor] passig parameter with CGI...

2009-02-16 Thread Spencer Parker
I am looking for a little instruction on how one would process a set of parameters being sent to it through CGI. I have a script that sends info to another script that lives on another server. The second script would then process the information that is passed to it through a parameters list in a

Re: [Tutor] df type function in python

2009-01-07 Thread Spencer Parker
What I did was just grep for anything starting with "/" It then just outputs it to a single line now...and I can split it as needed. Thanks again!!1 On Wed, Jan 7, 2009 at 11:33 AM, Kent Johnson wrote: > On Wed, Jan 7, 2009 at 1:08 PM, Spencer Parker > wrote: > > Is t

Re: [Tutor] df type function in python

2009-01-07 Thread Spencer Parker
Is there anyway to get rid of the header information? I just want the output that it gives me for the device. On Wed, Jan 7, 2009 at 11:02 AM, Stuart Sears wrote: > On 07/01/09 16:42, Spencer Parker wrote: > >> I am looking for a function in python that would operate similar to df.

[Tutor] df type function in python

2009-01-07 Thread Spencer Parker
do is get some information on a drive I have mounted. I have a disk image that I have mounted on temp folder that I need to see how much total pace it is taking up. It gives me a more accurate representation of my xen disk images that just an ls -sk or something on the file. -- Spencer P

Re: [Tutor] Leaving PHP for Python

2008-11-25 Thread Spencer Parker
on Web > Services. Also, I'd like to write some server side scripts to serve as a > backend to some Adobe AIR apps. > > Any and all advice is extremely appreciated. > > Thanks for your time! > > Sincerely, > > Jason > > ____

Re: [Tutor] WMI

2008-09-17 Thread Spencer Parker
n Wed, Sep 17, 2008 at 11:20 AM, Steve Willoughby <[EMAIL PROTECTED]>wrote: > On Wed, Sep 17, 2008 at 10:52:33AM -0600, Spencer Parker wrote: > > We have a web interface where people can provision virtual machines. > > Currently we do this with Linux machines and it se

Re: [Tutor] WMI

2008-09-17 Thread Spencer Parker
whole process. We have a windows VM now that will control the process for Windows VM's. On Wed, Sep 17, 2008 at 10:38 AM, Steve Willoughby <[EMAIL PROTECTED]>wrote: > On Wed, Sep 17, 2008 at 10:31:50AM -0600, Spencer Parker wrote: > > Is there a way to remotely trigger an even

Re: [Tutor] WMI

2008-09-17 Thread Spencer Parker
all of our VM's. I can find ways of doing it from a windows to windows, but not linux to windows. Any clues? Thanks again for all of the help. On Wed, Sep 17, 2008 at 10:13 AM, Tim Golden <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > >> I just need to create a loca

Re: [Tutor] WMI

2008-09-17 Thread Spencer Parker
Is there a way to create new users in WMI? I was trying to research this on MSDN, but couldn't find it anywhere... On Tue, Sep 16, 2008 at 2:10 PM, Tim Golden <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > >> It does of course help to spell IPAddress correctly

Re: [Tutor] WMI

2008-09-16 Thread Spencer Parker
It does of course help to spell IPAddress correctly to get this to work in the first place. LOL. It is working...thanks again for the help and the wonderful module! On Tue, Sep 16, 2008 at 1:36 PM, Spencer Parker <[EMAIL PROTECTED]>wrote: > This is the code that I currently have: &

Re: [Tutor] WMI

2008-09-16 Thread Spencer Parker
alue = adapter.EnableStatic(IPAddress=ip, SubnetMask=subnet) On Tue, Sep 16, 2008 at 1:01 PM, Tim Golden <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > >> Has anyone here had any experience with WMI extensions in Python? >> >> I am trying to remotely change the IP

[Tutor] WMI

2008-09-16 Thread Spencer Parker
Has anyone here had any experience with WMI extensions in Python? I am trying to remotely change the IP, Subnet, and gateway of a windows machine, but I cannot figure out what it needs to change this. -- Spencer Parker ___ Tutor maillist - Tutor

Re: [Tutor] Win32 extensions

2008-09-11 Thread Spencer Parker
That was what I was afraid of...I might have to go the virtualization route instead. PXE = pre-execution environment On Thu, Sep 11, 2008 at 5:31 PM, Alan Gauld <[EMAIL PROTECTED]>wrote: > > "Spencer Parker" <[EMAIL PROTECTED]> wrote > > 2003. I was wonde

[Tutor] Win32 extensions

2008-09-11 Thread Spencer Parker
a windows server in order to run these scripts. I do not want to use VB is I don't have or a windows server. I am deploying Windows Servers from behind a linux PXE. -- Spencer Parker ___ Tutor maillist - Tutor@python.org http://mail.pytho

Re: [Tutor] Help with checking for a data type

2008-09-04 Thread Spencer Parker
Those worked for me...thanks again!!! On Thu, Sep 4, 2008 at 3:26 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 4:56 PM, Spencer Parker <[EMAIL PROTECTED]> > wrote: > > I have a script that is taking a directory list, the script then splits > the

[Tutor] Help with checking for a data type

2008-09-04 Thread Spencer Parker
I have a script that is taking a directory list, the script then splits the name up by the hyphens in the name. The first part of the name should be a number, but it isn't always a number. Is there a way to say: if its a number then post this dataif not discard? -- Spencer P

Re: [Tutor] Excluding a directory in a script...

2008-05-07 Thread Spencer Parker
here is the code: http://dpaste.com/48734/ On Wed, May 7, 2008 at 1:57 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 3:34 PM, Spencer Parker <[EMAIL PROTECTED]> > wrote: > > I have a script that is just basically looking for a disk image in a > &

[Tutor] Excluding a directory in a script...

2008-05-07 Thread Spencer Parker
directory will never contain disk.img in there...it causes the script to error out since it didn't find that in there. How can I exclude this directory from being listed? -- Spencer Parker ___ "if you can't go to heaven, may you

Re: [Tutor] Looking for something similar to du...

2008-05-05 Thread Spencer Parker
locks allocated for file), >> st_blksize(filesystem blocksize), >> st_rdev (type of device if an inode device). st_flags (user defined flags >> for file). >> > So apparently os.stat() can get this info from *nix, but not Windows... > maybe behind the scenes, it runs du? &

[Tutor] Looking for something similar to du...

2008-05-05 Thread Spencer Parker
I am wondering if there is a way to do something that du does in Linux. I have several disk images and I need a way to get the size used...not the size of the image. If you type in du and the disk image path it gives you this number. is there anyway to do this in python? -- Spencer Parker

Re: [Tutor] Regular expressions...

2008-05-02 Thread Spencer Parker
;/xen/domains2/machinename/disk.img all I need is 'machinename' On Fri, May 2, 2008 at 10:23 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Fri, May 2, 2008 at 12:08 PM, Spencer Parker <[EMAIL PROTECTED]> > wrote: > > I need to use a regular expression to get a couple

[Tutor] Regular expressions...

2008-05-02 Thread Spencer Parker
and then stick it into a database. What I need to get is just the size numbers using regular expressions. I tried using an index, but since the disk images can up to 20 gig and be as low as 5 gig...the index changes. I also need to get the 'machinename' portion of the path as well to st

Re: [Tutor] XMLRPC

2008-04-22 Thread Spencer Parker
ks perfectly. > > maybe if you describe your problem i can provide you with some code. > > -- Spencer Parker ___ "if you can&

[Tutor] XMLRPC

2008-04-22 Thread Spencer Parker
elves. What I need it to do is accept a certain level of parameters and the run a command according to that. Is this even possible? -- Spencer Parker ___ "if you can't go to heaven, may you at least

Re: [Tutor] CSV file processing...

2008-03-24 Thread Spencer Parker
I took out the quotes around the second part of the INSERT statement and that made it work fine. On Mon, Mar 24, 2008 at 10:49 AM, Spencer Parker <[EMAIL PROTECTED]> wrote: > Okay...so I don't know what I was missing...but I copied the code from a > file I had without the lo

Re: [Tutor] CSV file processing...

2008-03-24 Thread Spencer Parker
AIL PROTECTED]> wrote: > Spencer Parker wrote: > > I am pretty sure it is trying to tell me that the data I have is not > > matching up with the columns I have in mysql. > > Yes, I think so. > > > > The output I get from the print next is this: > > > > [&#x

Re: [Tutor] CSV file processing...

2008-03-24 Thread Spencer Parker
;, '0', '0', '0', '0', '5', '4', '0.0', '12495360', '818688', '0', '36', 'core.none.com', '0.', '0.', '', ''

Re: [Tutor] CSV file processing...

2008-03-24 Thread Spencer Parker
ror is resolved...then it should be done. The good thing is I think I could actually do this again and understand what I am doing...I guess there is progress there. On Mon, Mar 24, 2008 at 9:27 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > > I am

Re: [Tutor] CSV file processing...

2008-03-24 Thread Spencer Parker
I am at a loss as to why this isn't working properly: #!/usr/bin/python import MySQLdb import csv import sys try: db = MySQLdb.connect (host = "localhost",user = "root",passwd = "",db = "stats") except MySQLdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit (

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
= db.cursor() csv_data = csv.reader(file('output.txt','r')) headers = csv_data.next() row = csv_data.next() prefix = row[:17] for i in range(17, len(row), 8): next = prefix + row[i:i+8] co.execute('''

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
I took that loop out...I had that in from something else and forgot to take it out...I took it out and it still does the same error. On Fri, Mar 21, 2008 at 1:44 PM, Spencer Parker <[EMAIL PROTECTED]> wrote: > That loop was some weird indentation that was caused when I pasted it...it

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
That loop was some weird indentation that was caused when I pasted it...it wasn't suppose to be indented like that... On Fri, Mar 21, 2008 at 1:42 PM, Spencer Parker <[EMAIL PROTECTED]> wrote: > This is all that I get when I run it... > > Traceback (most recent call last): &g

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
eError: not all arguments converted during string formatting On Fri, Mar 21, 2008 at 1:34 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > > I posted it in a previous message on the list...but here it is... > > Looks new to me... > > > > #!

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
int "Error %d: %s" % (e.args[0], e.args[1]) sys.exit (1) db.commit() db.close() On Fri, Mar 21, 2008 at 1:18 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > > Okay...so I got it mostly working...it now dies with this trackback: > > It would b

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
% db.literal(args) On Fri, Mar 21, 2008 at 11:54 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > > So if my long row is row two...how do I tell it to use row 2? > > csv_data = csv.reader(file('output.txt','r')) > headers = csv_dat

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
So if my long row is row two...how do I tell it to use row 2? On Thu, Mar 20, 2008 at 5:42 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Spencer Parker wrote: > > I am trying to read a CSV file and the get that information into a MySQL > > database. I am able to do thi

Re: [Tutor] CSV file processing...

2008-03-21 Thread Spencer Parker
) Sorry for the confusion I caused everyone...trying to run out of work...and write an email is not the best combo ever. Thanks again for all of the help. On Thu, Mar 20, 2008 at 9:08 PM, bob gailer <[EMAIL PROTECTED]> wrote: > On Thu, Mar 20, 2008 at 03:16:05PM -0600, Spencer Pa

[Tutor] CSV file processing...

2008-03-20 Thread Spencer Parker
the end of the line. Any ideas? -- Spencer Parker ___ "if you can't go to heaven, may you at least die in Ireland." ___ ___ Tutor mai