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 Win3

Re: How to create a file on users XP desktop

2007-10-08 Thread Julius
One point to bear in mind that, more or less, the pywin32 stuff > just wraps the MS API really closely, mostly doing just enough > of the messy plumbing to present the API "objects" as Python > objects. That's to say: find out how to do it from a C++ or VB > or Delphi tut

Re: How to create a file on users XP desktop

2007-10-08 Thread kyosohma
the MS API really closely, mostly doing just enough > of the messy plumbing to present the API "objects" as Python > objects. That's to say: find out how to do it from a C++ or VB > or Delphi tutorial and translating into Python often isn't hard. > > As it happens

Re: How to create a file on users XP desktop

2007-10-08 Thread Tim Golden
l and translating into Python often isn't hard. As it happens I've been using Windows APIs for a few years, so I have a bit of a head start. But I've answered quite a few questions on python-win32 by putting the subject line into Google, picking a likely-looking response and translatin

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) > > > > > Tim, > > How did you learn Win32com? > > Other than the O'Reilly book, I've never found a lot of > documentation.

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) > > 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 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 >

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) > > > 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 documentat

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 de

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 de

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 beli

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 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 gues

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 eas

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 enviro

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 a

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 [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

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 any

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 XP