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 423,142 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 4,204 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

Setting directory for opening files

Join Date: Aug 2005
Location: England - York
Posts: 136
Reputation: a1eio is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 9
a1eio's Avatar
a1eio a1eio is offline Offline
Junior Poster

Re: Setting directory for opening files

  #2  
Jan 1st, 2007
I'm not sure if I'm reading your question correctly, but if you want to open a file that's in the SAME place as your .py script that opens the file, you don't need to set any form of path name. You just type in the name of the file on it's own, for example:

f = file("test.txt","r")
print f.read()

if you saved that into a folder, as long as the file: "test.txt" is in the same folder then it'd run fine.

As for your second question, i don't really know much about wxpython but as far as i was aware python programs were all interpreted, meaning they cant be made into 'stand-alone' .exe/.app programs, the only work around i know of is py2exe. If you used that then no the user wouldn't need to have python or wxpython installed, the downside to py2exe however is that it bundles all the dependencies together which means you might end up with a very large program folder.

Hope this helps
Reply With Quote  
All times are GMT -4. The time now is 7:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC