User Profile

Collapse

Profile Sidebar

Collapse
Eclipse
Eclipse
Last Activity: Jan 7 '08, 08:44 AM
Joined: Dec 31 '07
Location: Ipswich, Queensland, Australia
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Can anyone explain the difference between results of append method

    G'day all

    Can anyone explain the difference in the results to me as I don't understand why specifying the directory name in two different ways could give a different answer.

    In CODE 1 below i specified the directory path in the code.

    In CODE 2 below i specified the directory path through a wxPython dialog.

    When I run CODE 1 I get the following:

    ['d:\\temp,20070 512_xfer_2_CA.p df',...
    See more | Go to post
    Last edited by Eclipse; Jan 4 '08, 12:23 PM. Reason: To correct indentation in code

  • Eclipse
    started a topic Try: Except: not catching ValueError (Help)

    Try: Except: not catching ValueError (Help)

    G'day all

    In the code below I am trying to catch an error thrown if i enter any other value than an integer. (I used the string 'six' and the float '1.5')

    The error thrown in the command window by the code is:

    Traceback (most recent call last):
    File "C:\Documen ts and Settings\Smythv ille\My Documents\Pytho n\Stuff\Ch4\ex1-6.py", line 59, in <module>
    a = int(raw_input(" \nTry...
    See more | Go to post

  • Thanks for answering bvdet.

    I used your code and played around with it to see how the os.walk function worked. If I am not mistaken the os.walk function walks down through the directories from the path supplied and creates a list as follows (Directory path,[subdir1,subdir2],[filename1,filen ame2]).

    After looking at what os.walk returns I can see that what I was trying to do in the first post is not correct. What I was...
    See more | Go to post

    Leave a comment:


  • Eclipse
    started a topic Writing a list to A CSV file (Newbie needs help)

    Writing a list to A CSV file (Newbie needs help)

    G'day All

    I am just starting to learn programming and need a bit of help with this one.

    I want to be able to create a list containing Path, Directory, Filename and write them out to a csv file (ie path,dir,file). This is what i have so far:

    import os
    import csv

    writer = csv.writer(open ("C:\Documen ts and Settings\Smythv ille\My Documents\Pytho n\Stuff.csv", "wb"))
    ...
    See more | Go to post
No activity results to display
Show More
Working...