Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-04 Thread Greg Ewing
Tim Roberts wrote: Are you running this on a different computer? No, it's the same computer. I can run 2.x and 3.x versions of the same test side by side, and the 2.x one has normal sized text whereas the 3.x one has tiny text. Oddly, it only seems to affect text drawn by the standard win32 c

Re: [python-win32] Possible trouble with pywin23-216 on python 3.2

2011-03-04 Thread Mark Hammond
The Python 3.2 32-bit build was the only one affected and I've uploaded a 216.1 build for this version only. It is identical to the 216 builds except for the build ID and the conversion of all files to py3k syntax. What went wrong? I was incorrect the other day about the 32bit and 64bit vers

Re: [python-win32] print file byte contents distribution

2011-03-04 Thread Tim Roberts
Ghostly wrote: > Thanks guys for your input > > As I need this for larger files (couple of tens even hundrets of MB) I > tested your suggestion and it seems that dict method is fastest. I decided to find out, so I ran "timeit" on both schemes using a 2MB file. The two methods are within 1% of eac

Re: [python-win32] print file byte contents distribution

2011-03-04 Thread Ghostly
Thanks guys for your input As I need this for larger files (couple of tens even hundrets of MB) I tested your suggestion and it seems that dict method is fastest. I ended with this: import sys try: counter = {} for bytes in open(sys.argv[1], "rb").read():

Re: [python-win32] print file byte contents distribution

2011-03-04 Thread Tim Roberts
Vernon Cole wrote: > What a nifty script! I love it! > Here's my version. I tested using a 800 KByte image file and it runs > in a blink. Dictionary access in Python is very fast. > > counter = {} > > for bytes in open('c:\\temp\\16.jpg', "rb").read(): >try: >counter[bytes] += 1 >

Re: [python-win32] print file byte contents distribution

2011-03-04 Thread Vernon Cole
What a nifty script! I love it! Here's my version. I tested using a 800 KByte image file and it runs in a blink. Dictionary access in Python is very fast. counter = {} for bytes in open('c:\\temp\\16.jpg', "rb").read(): try: counter[bytes] += 1 except KeyError: counter[bytes

Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-04 Thread Tim Roberts
Greg Ewing wrote: > I recently tried running PyGUI on Python 3 using > pywin32 build 216, and a couple of things are > not working quite the same way as they were with > Python 2 and build 213. > > 1) The default font used for control labels etc. > is slightly smaller. > > 2) When I calculate the w

[python-win32] print file byte contents distribution

2011-03-04 Thread Ghostly
Hi, As I don't see any CLI tool other then hex editor, I thought on writing small script that will display byte distribution from file content So I thought on this: - counter = {} for bytes in open('c:\\temp\\bin.dat', "rb").read(): counter[bytes] = counter.get(b

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread Ayaskanta Swain
Well, Here is how I have implemented in my script. Please take a look & let me know whether I am doing something wrong. Mine is a Windows-XP(SP3), 32-bit system. # Reads the windows shortcut & returns the target path def shortcut_target (shortcutfile): link = pythoncom.CoCreateInstance (

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread David Hutto
I probably forgot to include my sig, which means listen all of us like a hive queen instead of like a bullish king. -- According to theoretical physics, the division of spatial intervals as the universe evolves gives rise to the fact that in another timeline, your interdimensional counterpart rec

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread Tim Golden
On 04/03/2011 12:27, Ayaskanta Swain wrote: Thank you for sending me the link. I tried it by copying the “shortcut_target(filename)” function into my script. But it does the same thing as I had mentioned in my previous e-mail. i.e It returns me the target path correctly if the target exists physi

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread Ayaskanta Swain
Hi David, Yes I need to do some thing like you have suggested. Will try to open the link & catch the exception in case of any error. Though it's a indirect way but I am quite optimistic that it will work for me. Thanks Ayaskant- -Original Message- From: David Hutto [mailto:smok

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread David Hutto
On Fri, Mar 4, 2011 at 7:58 AM, David Hutto wrote: > On Fri, Mar 4, 2011 at 7:27 AM, Ayaskanta Swain > wrote: >> Hi, >> >> >> >> Thank you for sending me the link. I tried it by copying the >> “shortcut_target(filename)” function into my script. But it does the same >> thing as I had mentioned in

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread David Hutto
On Fri, Mar 4, 2011 at 7:27 AM, Ayaskanta Swain wrote: > Hi, > > > > Thank you for sending me the link. I tried it by copying the > “shortcut_target(filename)” function into my script. But it does the same > thing as I had mentioned in my previous e-mail. i.e It returns me the target > path correc

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread Ayaskanta Swain
Hi, Thank you for sending me the link. I tried it by copying the "shortcut_target(filename)" function into my script. But it does the same thing as I had mentioned in my previous e-mail. i.e It returns me the target path correctly if the target exists physically in my hard disk, but behaves in

Re: [python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread Tim Golden
On 04/03/2011 11:59, Ayaskanta Swain wrote: Hi, I want to know the target path of a windows shortcut. How do i read the short cut & retrieve the actual target path it is pointing to? I searched the internet & all the documents I found there refer to use Win32com.shell or win32com.client module b

[python-win32] How to read the target of a Windows Shortcut

2011-03-04 Thread Ayaskanta Swain
Hi, I want to know the target path of a windows shortcut. How do i read the short cut & retrieve the actual target path it is pointing to? I searched the internet & all the documents I found there refer to use Win32com.shell or win32com.client module but was not satisfied with the solutions gi

Re: [python-win32] [ANN] pywin32 build 216 released.

2011-03-04 Thread Michel Claveau
Hi! Could you also please try "wscript.exe win32com\test\testInterp.vbs" This is OK. BUT, if I add this line: import win32ui in the script C:\Python26\Lib\site-packages\win32com\servers\interp.py the test give the (allways same) error. I tried on : Python 2.6.5 with Windows 7

Re: [python-win32] Mapping Drives in Python

2011-03-04 Thread Vernon Cole
I've never used robocopy -- never heard about it until your post -- but it sounded funny to me that it should need to use drive letter mappings. Microsoft has been moving away from them since MS DOS days. Sure enough, this shiny new command line utility can be used with server share names as well a

Re: [python-win32] Fonts behaving differently with Py3/216

2011-03-04 Thread Vernon Cole
On Thu, Mar 3, 2011 at 8:37 PM, Mark Hammond wrote: [...] > > the 32 bit version of pywin32 appears to have 2.x syntax .py files). [...] No, not completely 2.x syntax, only "except SomeError, e" so if you get lucky, some modules might import okay.   The version of setup.py that I use in the stan