Off Topic thread

Our Community Forums General Discussion Off Topic thread

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #938384
    jrenaut
    Participant

    Are you stuck with Python 2.5, or can you upgrade? A quick Google suggests that unzipping got a lot easier with 2.6.

    I’m not quite sure what you mean on #2 – is this something you could do outside of Python, like in GoogleEarth or something? Or are you asking both if it can be done, and if so if it can be done in Python?

    I’m I guess an experienced amateur in Python. I don’t use it at work, but i use it for all my personal projects. And I generally use 2.7.

    #938385
    SpokeGrenadeSR
    Participant

    HA! I’m literally sitting here unzipping hundreds of .tar.gz files one after another. I’ve never dealt with them before this task.

    The best way i found of extracting them was by downloading the program called 7-zip (hopefully you have windows as that’s its only compatibility).
    That program will let you unzip any type of zip basiclally.
    Right click it as usual, go to the 7-zip option, click “extract files” or “extract here” if you want it put in the same folder you’re currently in.

    (The .tar.gz will create a new folder in which you’ll find a .tar, just right click and extract that one as well and you’ll finally get the whole thing opened.)

    #938403
    creadinger
    Participant

    Thanks for the replies guys.

    @jrenaut 17188 wrote:

    Are you stuck with Python 2.5, or can you upgrade? A quick Google suggests that unzipping got a lot easier with 2.6.

    I think I found similar information too. I think I’ll suggest we upgrade our python then because you’re right, it did seem much easier according to programmer forum posts. If upgrading is possible, hopefully my other little programs will still work.

    I’m I guess an experienced amateur in Python. I don’t use it at work, but i use it for all my personal projects. And I generally use 2.7.

    I’m kinda the same way, but less so. I generally learn enough to do what I need to do with it and nothing more.

    #2 is a separate non-python question. It’s more about familiarity with kml files, GoogleEarth and GIS. For example, I created a kml wrapper to display 12-18 MODIS images from the NASA website at one time as overlays on GoogleEarth. Similarly I used a small kml wrapper to overlay the tif file, which is a global modeled snow forecast but it’s an impossible to see gray scale and basically useless. I suppose I could try downloading the shapefile and see about automatically manipulating it in ArcMap instead? Oiy… I don’t know if I’m capable of that!

    @Spokes
    We started using 7-zip here too and it’s very user friendly. Ultimately I’m trying to automate the downloading and unzipping process though so that one doesn’t have to do it by hand at all. Like if you had a little untar/unzip python program you could probably get the program running then spend the next 30 minutes shopping for your dream bike while the program does all the work. :)

    #938410
    jrenaut
    Participant

    Ok, #2 I can’t really help – I don’t know anything about KML and related stuff.

    I think going from 2.5 to 2.6 or 2.7 isn’t a big deal. 3, on the other hand . . .

    #938413
    SpokeGrenadeSR
    Participant

    @creadinger 17207 wrote:

    We started using 7-zip here too and it’s very user friendly. Ultimately I’m trying to automate the downloading and unzipping process though so that one doesn’t have to do it by hand at all. Like if you had a little untar/unzip python program you could probably get the program running then spend the next 30 minutes shopping for your dream bike while the program does all the work. :)

    then please, for the love of god pass this info along when you figure it out. i just had to unzip 500 of those things manually. yesterday and friday.

    #938452
    creadinger
    Participant

    @SpokeGrenadeSR 17217 wrote:

    then please, for the love of god pass this info along when you figure it out. i just had to unzip 500 of those things manually. yesterday and friday.

    Hey man, I think I figured it out! I did a lot more searching and digging and finally found a piece of code that I could use. Here’s an example mini-program that opens a .tar.gz file, extracts all the files in it, and then closes the file again.

    #!/usr/bin/python
    import tarfile

    #This part opens file, extracts contents, and puts them in a designated folder.
    print ‘Uncompressing files’
    tar = tarfile.open(‘PathtofileFile.tar.gz’)
    tar.extractall(‘Pathtoputextractedstuff\’)
    tar.close()

    If you’re more of a programming wiz than me, then you could have it loop over all of the files you have to open. Otherwise, you could just hardwire it to extract all 500 of the files you have to do. If they have a naming pattern or similar names at least you could pretty quickly build up the lines of code using a excel, or a word macro.

    #938455
    jrenaut
    Participant

    I think os.listdir will list filenames in your folder, so you could pass those to tarfile.open()

    Don’t have Python on my work computer (damn federal government) so I can’t check.

    #939852
    creadinger
    Participant

    I was early on the scene to a medical emergency in Arlington yesterday – On Columbia Pike near S. Glebe Rd. I was one of the first to call 911 and I’ve never ever done that before, which was a tad scary. There was an unresponsive elderly person in a car parked in the left lane of Columbia Pike. Does anyone know where I could possibly get an update on their condition? It was a bit traumatic to see the FD pull up to the scene and initiate CPR.

    This is the only info I can find in the traffic section of ARLnow as it was happening yesterday.
    http://www.arlnow.com/2012/04/26/lane-closures-on-the-pike-due-to-medical-emergency/

    #939865
    DaveK
    Participant

    @creadinger 18824 wrote:

    I was early on the scene to a medical emergency in Arlington yesterday – On Columbia Pike near S. Glebe Rd. I was one of the first to call 911 and I’ve never ever done that before, which was a tad scary. There was an unresponsive elderly person in a car parked in the left lane of Columbia Pike. Does anyone know where I could possibly get an update on their condition? It was a bit traumatic to see the FD pull up to the scene and initiate CPR.

    This is the only info I can find in the traffic section of ARLnow as it was happening yesterday.
    http://www.arlnow.com/2012/04/26/lane-closures-on-the-pike-due-to-medical-emergency/

    I’ve wondered about this sort of thing since I saw someone undergoing CPR at the Cherry Blossom 10-miler. I take the fact that I never heard any follow-up as good news. I figure if they had died, the information would have been released, but if they were in medical care it was still confidential.

    Don’t know if that’s true but it helps me sleep at night.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.