User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 456,557 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,433 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 677 | Replies: 1 | Solved
Reply
Join Date: Oct 2007
Posts: 7
Reputation: jai.mahadeokar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jai.mahadeokar jai.mahadeokar is offline Offline
Newbie Poster

returning true and false...

  #1  
Oct 24th, 2007
I am trying to use the function cmpfile of the cmp module which returns true or false if filepaths passed are same or not...
But the interpreter flashes an error "undefined global name false"...
Also it doesnt accept true or false in other functions also..
what might be the problem???
please help...

also can somebody tell me a way to find askii value of a character...
the ascii function in curses module is not working...
In the curses module there is a call to _curses module which the interpreter cant find and neither can i....

I am using recently released python25....
Can someone help...
Please....
Last edited by jai.mahadeokar : Oct 24th, 2007 at 3:04 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 2
Reputation: Pierre Maurette is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Pierre Maurette Pierre Maurette is offline Offline
Newbie Poster

Re: returning true and false...

  #2  
Oct 24th, 2007
Hello,
The keywords are True and False

I dont remember why, but I use comparisons on begginnings of strings got with os.path.normpath, something like in:
    def select_project(self):
        LOG.debug(self.__class__.__name__)
        ldpath = self.iniframe.entries['localdir'].get()
        path = tkFileDialog.askdirectory(initialdir=ldpath, title='Choisir le dossier du projet...')
        if os.path.normpath(path[:len(ldpath)]) == os.path.normpath(ldpath):
            self.iniframe.set_entry_text('projdir', '/' + path[len(ldpath):].strip('/'))
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 5:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC