Python bug?!? Var assignment fails?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luke14free
    New Member
    • Apr 2007
    • 79

    #1

    Python bug?!? Var assignment fails?

    Hello, I do believe my python is mad or I'm mad...
    I want python to open a file

    Code:
    sp=self.listBox1.GetStringSelection().split("-")
          
    new="%s-%s-%s-%s-%s" % (sp[0],sp[3],sp[2],sp[1],sp[4])
    
    var="%s%s.fty" % (percorsob,mnew)
    print "THIS IS VAR: ", var
            
    f=open(var).read()
    Output?
    Code:
    THIS IS VAR: C:\Documents and Settings\All Users\Documenti\fatture\handle\Client2-2008-01-11-35.fty
    Errors?
    Code:
    IO Error, no such file or Directory C:\Documents and Settings\All Users\Documenti\fatture\handle\Client2-2008-01-13-35.fty
    But my var value ended for 11-35.fty not with 13-35.fty!
    What's happening with my python?
    (i don't have vars with the same name...python cannot make confusion!)
Working...