Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. blacknred

    install fails

    Hi all, Trying to install a perl pgm here & it fails on my machine with below error: XML::SAX must be installed first at.... ppm install failed: Command exits with 2: C:\Perl\bin\perl.exe install_script stopped P.S I'm using activestate perl. Any thoughts? Thanks in advance David
  2. blacknred

    deleting all files in a dir

    Yes I am connected to that share and dir \\192.168.0.12\myshare1 is listin out the files for me.
  3. blacknred

    deleting all files in a dir

    yes when i try the print, it shows the path as expected, but when I edit the script as import os folder = r'\\192.168.0.12\myshare1' for the_file in os.listdir(folder): file_path = os.path.join(folder, the_file) try: if os.path.isfile(file_path)...
  4. blacknred

    deleting all files in a dir

    I have a share -//192.168.0.11/myshare which has many files in it. Which is the best way to delete all the files in this directory using python? I tried: import os folder = '\\192.168.0.12\myshare1' for the_file in os.listdir(folder): file_path = os.path.join(folder, the_file) try...
  5. blacknred

    regex puzzle

    Hi, I'm trying to 'grep' the string which comprises of all non-zero values 0x0000000a in this case. >>> match = re.search('0x0000000[1-9,a-z]', "My values are value=0x00000000 0x00000000 0x0000000a 0x00000000 0x00000000 0x00000000") This works but in this case, but not over any string as in...
  6. blacknred

    logging to csv

    yes, i got around this with output = stdout.read().rstrip('\r\n') now I get a file like task1 1200 task2 1300 task3 1500 Now I require to label column 1 as tasks and column 2 as time and then introduce a third column called 'duration' to look task1 1200 task2 1300 100 task3...
  7. blacknred

    logging to csv

    import time,subprocess,csv fd=open('my2.csv','a') #spamWriter = csv.writer(open('eggs2.csv', 'wb'), delimiter=' ',quoting=csv.QUOTE_MINIMAL) #while True: proc = subprocess.Popen([" cat /home/myfile.txt |grep -m 1 \"my game\""], stdout=subprocess.PIPE, shell=True) (out, err) = proc.communicate()...
  8. blacknred

    logging to csv

    Hi, I'm intend to do the following -do a calculation ; record the value with timestamp to excel (csv format will do) -repeat above step; append a new row to csv with newly calculated value and timestamp. ... ... continue in endless loop. Could someone give me some pointers on this. This...
  9. blacknred

    changing timestamps in a log file

    Works a charm :)
  10. blacknred

    changing timestamps in a log file

    That helps, but I wish to do it on a file as opposed to a string ....
  11. blacknred

    changing timestamps in a log file

    I'm trying to parse xml file and convert all the unixtimestamps in it to datetime... <Sample> <TimeStamp>1291052077</TimeStamp> blah blah blah blah </Sample> <Sample>...
  12. blacknred

    List Manipulation for a ssy admin task

    Hi I just started with python, and trying to implement some system admin tasks and running into some rough. Basically I need to do some task on whichever share exists on their corresponding server. eg Server A has shares 1,2 and 3 Server B has share 1 and so on. Any help is appreciated :)...

Part and Inventory Search

Back
Top