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 402,703 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 2,394 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: 1373 | Replies: 5 | Solved
Join Date: Dec 2006
Posts: 21
Reputation: trihaitran is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
trihaitran trihaitran is offline Offline
Newbie Poster

Setting directory for opening files

  #1  
Dec 31st, 2006
This is a really simple question but it's been stumping me for a while. I want to open a file that is in the same directory as the .py script, but I want to specify that directory without using a universal path.

filepath1 = '/Users/username/Documents/Python/TC/TC cedict final.txt'
file = open(filepath1, 'rU')

Also an unrelated question is: If I make a program using wxpython into a .app for Macintosh or .exe for Windows, then does the person running it also have to have python and wxpython installed?
AddThis Social Bookmark Button
Reply With Quote  

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 6:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC