Re: How to create a file on users XP desktop

2007-10-09 Thread Tim Golden
On Oct 8, 9:19 am, goldtech [EMAIL PROTECTED] wrote: How did you learn Win32com? Other than the O'Reilly book, I've never found a lot of documentation. Trying to browse COM in PythonWin is tough - there's tons of stuff in there. I've never been able to find the Win32com classes, methods,

Re: How to create a file on users XP desktop

2007-10-08 Thread goldtech
from win32com.shell import shell, shellcon desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) /code I have a general problem with using win32com. It's the documentation. I never know what is available, what classes, methods, what they do. Even some of the existing

Re: How to create a file on users XP desktop

2007-10-08 Thread kyosohma
On Oct 7, 12:30 pm, Tim Golden [EMAIL PROTECTED] wrote: Tim Chase wrote: You are assuming the system is not localized, that won't work if you distribute your applications internationally. In my system it is not Desktop, it is Escritorio, and I guess it will vary with every locale. Does

Re: How to create a file on users XP desktop

2007-10-08 Thread goldtech
from win32com.shell import shell, shellcon desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) /code Tim, How did you learn Win32com? Other than the O'Reilly book, I've never found a lot of documentation. Trying to browse COM in PythonWin is tough - there's tons of stuff in

Re: How to create a file on users XP desktop

2007-10-08 Thread kyosohma
On Oct 8, 9:19 am, goldtech [EMAIL PROTECTED] wrote: from win32com.shell import shell, shellcon desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) /code Tim, How did you learn Win32com? Other than the O'Reilly book, I've never found a lot of documentation. Trying to

Re: How to create a file on users XP desktop

2007-10-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: On Oct 8, 9:19 am, goldtech [EMAIL PROTECTED] wrote: from win32com.shell import shell, shellcon desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) /code Tim, How did you learn Win32com? Other than the O'Reilly book, I've never found a lot of

Re: How to create a file on users XP desktop

2007-10-08 Thread kyosohma
On Oct 8, 10:11 am, Tim Golden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Oct 8, 9:19 am, goldtech [EMAIL PROTECTED] wrote: from win32com.shell import shell, shellcon desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) /code Tim, How did you learn Win32com?

Re: How to create a file on users XP desktop

2007-10-08 Thread Julius
On Monday 08 October 2007 17:11:25 Tim Golden wrote: [EMAIL PROTECTED] wrote: On Oct 8, 9:19 am, goldtech [EMAIL PROTECTED] wrote: from win32com.shell import shell, shellcon desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) /code Tim, How did you learn Win32com?

Re: How to create a file on users XP desktop

2007-10-07 Thread Craig Howard
On Oct 6, 2007, at 11:31 PM, goldtech wrote: Can anyone link me or explain the following: I open a file in a python script. I want the new file's location to be on the user's desktop in a Windows XP environment. fileHandle = open (., 'w' ) what I guess I'm looking for is an

Re: How to create a file on users XP desktop

2007-10-07 Thread goldtech
This is really a Windows question, not a Python question. You should have been able to figure it out yourself by examining existing environment variables. I agree, you're right. I learn more by figuring out the code myself. After Google briefly: In a DOS box type: SET This was too easy -

Re: How to create a file on users XP desktop

2007-10-07 Thread Ricardo Aráoz
Matimus wrote: On Oct 6, 8:31 pm, goldtech [EMAIL PROTECTED] wrote: Can anyone link me or explain the following: I open a file in a python script. I want the new file's location to be on the user's desktop in a Windows XP environment. fileHandle = open (., 'w' ) what I guess I'm

Re: How to create a file on users XP desktop

2007-10-07 Thread [EMAIL PROTECTED]
On Oct 7, 1:24 am, Scott David Daniels [EMAIL PROTECTED] wrote: goldtech wrote: ... I want the new file's location to be on the user's desktop in a Windows XP environment How about: import os.path handle = open(os.path.expanduser(r'~\DeskTop\somefile.txt'), 'w') ...

Re: How to create a file on users XP desktop

2007-10-07 Thread Tim Chase
You are assuming the system is not localized, that won't work if you distribute your applications internationally. In my system it is not Desktop, it is Escritorio, and I guess it will vary with every locale. Does someone know a way to find out what name does the desktop have? I believe you

Re: How to create a file on users XP desktop

2007-10-07 Thread Tim Golden
Tim Chase wrote: You are assuming the system is not localized, that won't work if you distribute your applications internationally. In my system it is not Desktop, it is Escritorio, and I guess it will vary with every locale. Does someone know a way to find out what name does the desktop

Re: How to create a file on users XP desktop

2007-10-07 Thread Tim Golden
Tim Chase wrote: You are assuming the system is not localized, that won't work if you distribute your applications internationally. In my system it is not Desktop, it is Escritorio, and I guess it will vary with every locale. Does someone know a way to find out what name does the desktop

How to create a file on users XP desktop

2007-10-06 Thread goldtech
Can anyone link me or explain the following: I open a file in a python script. I want the new file's location to be on the user's desktop in a Windows XP environment. fileHandle = open (., 'w' ) what I guess I'm looking for is an environmental variable that will usually be correct on most

Re: How to create a file on users XP desktop

2007-10-06 Thread Josh Bloom
I believe you can use something like '%USERPROFILE%\DESKTOP' as the path on a windows machine to get to the current users desktop directory. I'm not sure if the python open() command will expand that correctly, but give it a shot. -Josh On 10/6/07, goldtech [EMAIL PROTECTED] wrote: Can anyone

Re: How to create a file on users XP desktop

2007-10-06 Thread [EMAIL PROTECTED]
On Oct 6, 11:31 pm, goldtech [EMAIL PROTECTED] wrote: Can anyone link me or explain the following: I open a file in a python script. I want the new file's location to be on the user's desktop in a Windows XP environment. fileHandle = open (., 'w' ) what I guess I'm looking for is an

Re: How to create a file on users XP desktop

2007-10-06 Thread Scott David Daniels
goldtech wrote: ... I want the new file's location to be on the user's desktop in a Windows XP environment How about: import os.path handle = open(os.path.expanduser(r'~\DeskTop\somefile.txt'), 'w') ... -Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a file on users XP desktop

2007-10-06 Thread Matimus
On Oct 6, 8:31 pm, goldtech [EMAIL PROTECTED] wrote: Can anyone link me or explain the following: I open a file in a python script. I want the new file's location to be on the user's desktop in a Windows XP environment. fileHandle = open (., 'w' ) what I guess I'm looking for is an