Re: Why do Perl programmers make more money than Python programmers

2013-05-07 Thread Neil Hodgson
jmfauth: 2) More critical, Py 3.3, just becomes non unicode compliant, (eg European languages or "ascii" typographers !) ... This is not demonstrating non-compliance. It is comparing performance, not compliance. Please show an example where Python 3.3 is not compliant with Unicode.

Re: Making safe file names

2013-05-07 Thread Neil Hodgson
Andrew Berg: This is not a Unicode issue since (modern) file systems will happily accept it. The issue is that certain characters (which are ASCII) are not allowed on some file systems: \ / : * ? "< > | @ and the NUL character The first 9 are not allowed on NTFS, the @ is not allowed on ext

Re: Installing PyGame?

2013-06-08 Thread Neil Hodgson
Eam onn: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in

Re: Version Control Software

2013-06-13 Thread Neil Hodgson
Grant Edwards: The last time we made the choice (4-5 years ago), Windows support for get, bzr, and hg was definitely lacking compared to svn. The lack of something like tortoisesvn for hg/git/bzr was a killer. It looks like the situation has improved since then, but I'd be curious to hear from

Re: Is this PEP-able? fwhile

2013-06-25 Thread Neil Hodgson
jim...@aol.com: Syntax: fwhile X in ListY and conditionZ: There is precedent in Algol 68: for i from 0 to n while safe(i) do .. od which would also make a python proposal that needs no new key words: for i in range(n) while safe(i): .. The benefit of the syntax would be to concent

Re: Python list code of conduct

2013-07-03 Thread Neil Hodgson
Dennis Lee Bieber: So who would enforce any rules? I doubt it could be ported to a new (if approval could even be obtained) comp.lang.python.mod(erated) so nothing can be enforced on the comp.lang.python side; and what would you do with Google Groups? The current news group charter

Re: hex dump w/ or w/out utf-8 chars

2013-07-13 Thread Neil Hodgson
wxjmfa...@gmail.com: The FSR is naive and badly working. I can not force people to understand the coding of the characters [*]. You could at least *try*. If there really was a problem with the FSR and you truly understood this problem then surely you would be able to communicate the pr

Re: RE Module Performance

2013-07-30 Thread Neil Hodgson
MRAB: The disadvantage there is that when you move the cursor you must move characters around. For example, what if the cursor was at the start and you wanted to move it to the end? Also, when the gap has been filled, you need to make a new one. The normal technique is to only move the gap

Re: Script that converts between indentation and curly braces in Python code

2013-07-31 Thread Neil Hodgson
Musical Notation: Is there any script that converts indentation in Python code to curly braces? The indentation is sometime lost when I copy my code to an application or a website. pindent.py in the Tools/Scripts directory of Python installations does something similar by adding or removi

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Neil Hodgson
Nobody: Maybe. On Unix, it's possible that the current directory no longer has a pathname. Its also possible that you do not have permission to successfully call getcwd. One example of this I have experienced is the OS X sandbox where you can run Python starting in a directory where you h

Re: How do I display unicode value stored in a string variable using ord()

2012-08-21 Thread Neil Hodgson
Steven D'Aprano: Using variable-sized strings like UTF-8 and UTF-16 for in-memory representations is a terrible idea because you can't assume that people will only every want to index the first or last character. On average, you need to scan half the string, one character at a time. In Big-Oh, w

Re: Flexible string representation, unicode, typography, ...

2012-08-23 Thread Neil Hodgson
wxjmfa...@gmail.com: Small illustration. Take an a4 page containing 50 lines of 80 ascii characters, add a single 'EM DASH' or an 'BULLET' (code points> 0x2000), and you will see all the optimization efforts destroyed. sys.getsizeof('a' * 80 * 50) 4025 sys.getsizeof('a' * 80 * 50 + '•') 80

Re: Flexible string representation, unicode, typography, ...

2012-08-27 Thread Neil Hodgson
wxjmfa...@gmail.com: Go "has" the integers int32 and int64. A rune ensure the usage of int32. "Text libs" use runes. Go has only bytes and runes. Go's text libraries use UTF-8 encoded byte strings. Not arrays of runes. See, for example, http://golang.org/pkg/regexp/ Are you claiming

Re: Comparing strings from the back?

2012-09-04 Thread Neil Hodgson
Roy Smith: I'm wondering if it might be faster to start at the ends of the strings instead of at the beginning? If the strings are indeed equal, it's the same amount of work starting from either end. Most people write loops that go forwards. This leads to the processor designers prioritiz

Re: Comparing strings from the back?

2012-09-17 Thread Neil Hodgson
Ethan Furman: *plonk* I can't work out who you are plonking. While more than one of the posters on this thread seem worthy of a good plonk, by not including sufficient context, you've left me feeling puzzled. Is there a guideline for this in basic netiquette? Neil -- http://mail.pyt

Re: How to debug pyd File in Vs???

2013-01-25 Thread Neil Hodgson
Junze Liu: Third, use the embed interpreter to execute a .py File.The .py File include the module that in .pyd File I created. Here, the problem comes out! When I start my main project. I can only debug the problems in my main project, when my main project use the python interpreter

Re: Python argv and special characters

2005-09-23 Thread Neil Hodgson
Jakob Simon-Gaarde: > How can I ensure a safe passing of arguments maybe having speciel > characters within. Use ctypes to call the Windows GetCommandLine function. The CommandLineToArgvW function can be used to break up the command line string into arguments. Neil -- http://mail.pyth

Re: Python argv and special characters

2005-09-23 Thread Neil Hodgson
Jakob Simon-Gaarde: > thanks :-) It seems a little overkill though, is it really the > only/best way? Yes. I should have mentioned you want the wide version of the function GetCommandLineW. I wrote a patch to allow unicode in argv but later agreed that the patch should be rejected: https:/

Re: cElementTree clear semantics

2005-09-25 Thread Neil Hodgson
Paul Boddie: > Regardless of anyone's alleged connection with Boo or newsgroup > participation level, the advice to contact the package > author/maintainer is sound. It happens every now and again that people > post questions to comp.lang.python about fairly specific issues or > packages that woul

Re: PEP 350: Codetags

2005-09-26 Thread Neil Hodgson
Paul Rubin: > Mere conventions that are not checked by the compiler are just more > stuff for people to remember. That doesn't say they're always useless > but in general they should not be the subject of PEP's. The PEP system allows for the documentation of a convention as an "Informationa

Re: Font management under win32

2005-09-28 Thread Neil Hodgson
Stefano Masini: > Indeed, win32gui does contain an EnumFontFamilies (without the > trailing "Ex") function, but I found no usage example, and I couldn't > figure out how to use LOGFONT handles (since such a thing is required > as the first parameter to the call). So I decided to punt on it and > a

Re: Overhead of individual python apps

2005-09-28 Thread Neil Hodgson
Dennis Lee Bieber: > I've not investigated -- but what is the default stack size given to > an application? Python has a stack reserve of 200 bytes but that is an allocation of virtual space. Pages are realised in that allocation as required with an initial stack commit of one pag

Re: What encoding is used when initializing sys.argv?

2005-09-30 Thread Neil Hodgson
Petr Prikryl: > ... I have discovered that > I do not understand what encoding should be used > to convert the sys.argv into unicode. Martin mentioned CP_ACP. In Python on Windows, this can be accessed as the "mbcs" codec. import sys print repr(sys.argv[1]) print repr(unicode(sys.argv[1], "

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Neil Hodgson
C++ and C# are converging with implicitly typed languages to the extent that many declarations will be able to omit types. In the next C++ standard and in C# 3.0 it may be possible to write, where Fn is a function returning any particular type: auto spam = Fn(); // C++0x var spam = Fn

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-06 Thread Neil Hodgson
Grant Edwards: > Where exactly did you see all these > sub-titled British TV/movies? I've noticed this too when travelling but can't recall precise details. Perhaps it is on the international versions of American channels such as CNN which are commonly watched by people with less English a

Re: non descriptive error

2005-10-09 Thread Neil Hodgson
Timothy Smith: > FYI i have located where the problem was. in the first if statement > there was an unbalanced ). now since when does python not give a > descriptive error for that? I see this with the arrow pointing at the extra ')': >pythonw -u "xx.py" File "xx.py", line 3 if Decimal

Re: win32api.FindFiles Win2003, problem with Short Name

2005-10-13 Thread Neil Hodgson
Frank Borell: > I'm having a problem retrieving the ShortName from a file that was > written by a MAC and only from a Windows 2003 server. > > I realize the file has a space after it, but I can retrieve the short > name from Windows XP and 2000; Does your Windows 2003 machine have short file

Re: win32api.FindFiles Win2003, problem with Short Name

2005-10-14 Thread Neil Hodgson
Frank Borell: > On all three types of PC/Servers they are set to 0. > > For now I'll have to process this script on non 2003 servers?!? What do you get if you call win32api.GetShortPathName on the long name? Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: wierd threading behavior

2005-10-14 Thread Neil Hodgson
Qun Cao: > import thread > def main(): > thread.start_new(test.()) > > def test(): > print 'hello' > > main() > " > this program doesn't print out 'hello' as it is supposed to do. > while if I change main() The program has exited before the thread has managed to run. It is undefine

Re: win32api.FindFiles Win2003, problem with Short Name

2005-10-17 Thread Neil Hodgson
Frank Borell: > My initial issue was trying to rename/move files on a SAN that were > written from Mac's. I've never used a SAN. It is possible that it has its own name system and what you are seeing is the result of different views of that. > While the easier messed up files names were e

Re: [OT] Python vs Ruby

2005-10-24 Thread Neil Hodgson
Scott David Daniels: > Sorry, I was being too cute by half. If Simula is the fore father > (4 away) then Smalltalk is half as far (2) away. Hence the "toofather." > "Toofather" by analogy with the homophones "fore" and "four" we use the > homophones "two" and "too". We could smear the homop

Re: Spambayes modifications with web services

2005-10-28 Thread Neil Hodgson
benmorganpowell: > So, as a web programmer and someone who specialises in getting good > results on Google, I realised that I could simply post every spammer > website on a Google optimized page, which if searched for on Google > would return something like: > > "WARNING: DO NOT BUY FROM THIS WEB

Re: [OT] Map of email origins to Python list

2005-11-07 Thread Neil Hodgson
Claire McLister: > We try to get a best guess estimate of the originating IP and its > location. If we cannot find that, we fall back on the earliest server > that has a location information. Clearly this marks quite a few email > origins in the wrong way. It doesn't do the collection of ALL gm

Re: how to modify code while debugging it without having to stop and then restart debugger

2005-11-09 Thread Neil Hodgson
Steven D'Aprano: > You write a function: > > def myfunct(s): > # input arg s is a string > foo = s*3 > bar = s.upper() + foo # LINE 2 > blob = foo.lower() + bar > return blob > > You enter the debugger and single-step to the marked line LINE 2. Then you > edit the code to t

Re: path module / class

2005-11-16 Thread Neil Hodgson
Chris: > What is the status of the path module/class PEP? Did somebody start > writing one, or did it die? I would really like to see something like > Jason Orendorff's path class make its way into the python standard > library. There is no PEP yet but there is a wiki page. http://wiki.pyth

Re: check if com api is still available

2005-11-18 Thread Neil Hodgson
Hermann Maier: > i am using the com api of a program and if this program is shut down and > my program calls a method of the api, it crashs. that means, i need to > check, if the com server is still available, before i can call for it. The server should not shut down while clients have outs

Re: path module / class

2005-11-19 Thread Neil Hodgson
Peter Hansen: > Compelling to whom? I wonder if it's even possible for Guido to find > compelling anything which obsoletes much of os.path and shutil and > friends (modules which Guido probably added first and has used the most > and feels most comfortable with). To me, most uses of path.

Re: path module / class

2005-11-20 Thread Neil Hodgson
Peter Hansen: >> There is a cost to the change as there will be two libraries that have >> to be known to understand code. > > Could you please clarify? Which two do you mean? At that point I was thinking about os.path and path.py. Readers will encounter code that uses both of these libr

Re: sort the list

2005-11-22 Thread Neil Hodgson
Nick Craig-Wood: > Since no-one mentioned it and its a favourite of mine, you can use the > decorate-sort-undecorate method, or "Schwartzian Transform" That is what the aforementioned key argument to sort is: a built-in decorate-sort-undecorate. >>> lst = [[1,4],[3,9],[2,5],[3,2]] >>> pri

Re: about sort and dictionary

2005-11-23 Thread Neil Hodgson
Magnus Lycka: > Except when it isn't obvious. What constitutes mutation of an object? > C++ handles this with 'const', and lets the programmer cheat by using > transient member variables, since there are cases when you actually > want to mutate objects a little, but claim that you don't... Ru

Re: return in loop for ?

2005-11-24 Thread Neil Hodgson
Steve Holden: > What are the claimed advantages for a single exit point? I'd have > thought it was pretty obvious the eight-line version you gave is far > more likely to contain errors than Mike's three-line version, wouldn't > you agree? Single exit point is an ancient Dijkstraism. It was

Re: unicode speed

2005-11-29 Thread Neil Hodgson
David Siroky: > output = '' I suspect you really want "output = u''" here. > for c in line: > if not unicodedata.combining(c): > output += c This is creating as many as 5 new string objects of increasing size. To build large strings, some common faster t

Re: windows paging Q

2005-11-29 Thread Neil Hodgson
Gerry Blais: > My program has a memory usage of 30 MB according to the task manager, > and is doing 1000+ page faults / second (page fault delta, high speed > refresh rate). > > With memory available, any idea why I'm paging so much, and what I > might do about it? Many page faults are sof

Re: Avoiding deadlocks in concurrent programming

2005-06-22 Thread Neil Hodgson
Eloff: > So I think you would need multiple locks so clients only acquire what > they need. This would let multiple threads access the data at once. But > now I have to deal with deadlocks since clients will usually acquire a > resource and then block acquiring another. It is very likely that one

Re: List of all installed applications (XP)?

2005-06-23 Thread Neil Hodgson
Not only is it difficult to tell which applications are installed, it is difficult to tell if an application is still installed as all too many applications do not remove all their registry keys upon uninstall. I was going to suggest using a commercial application due to the messiness o

Re: odd python/linux/cherrypy behavior

2005-07-16 Thread Neil Hodgson
Bill Mill: > ... a FAT partition for data as a dmz which both linux and NT can > access ... > Yesterday, I downloaded the new release of cherrypy, and stuck it on > the dmz drive. ... > Eventually, after thinking it's a hosts file problem, or a firewall > problem, I figure out that if I move it

Re: odd python/linux/cherrypy behavior

2005-07-16 Thread Neil Hodgson
Bill Mill: > Definitely not mounted with short file names, and there aren't any > non-ASCIIs in the file names; in both cases I imagine that the file > wouldn't run at all. In this case, however, the file does run, and > open a socket, it just can't seem to receive connections on it. I have > trie

Re: os.path.expanduser on Windows: UnicodeEncodeError

2005-07-18 Thread Neil Hodgson
Bob Swerdlow wrote: > My application is getting this error on Windows XP (works fine on Mac OS > X) when it calls os.path.expanduser: >UnicodeEncodeError: 'ascii' codec can't encode characters in position > 52-56: ordinal not in range(128) What does your environment look like? You can fi

Re: PEP on path module for standard library

2005-07-22 Thread Neil Hodgson
Reinhold Birkenfeld: > And it is much more "Pythonic" in my eyes. Though that word may be inaccurate > when it comes from someone else that Guido, I feel that endless chains of > '[os.path.join(os.path.join(z, "a"), x) for x in > os.path.listdir(os.path.join(z, "a") if os.path.isfile(os.path.join

Re: PEP on path module for standard library

2005-07-22 Thread Neil Hodgson
Scott David Daniels: > Isn't it even worse than this? > On Win2K & XP, don't the file systems have something to do with the > encoding? So D: (a FAT drive) might naturally be str, while C: > (an NTFS drive) might naturally be unicode. This is generally safe as Windows is using unicode inte

Re: PyGTK or wxPython (not a flame war) on Windows

2005-07-22 Thread Neil Hodgson
One thing I don't like with GTK+ on Windows is that it uses GTK+ file dialogs rather than system file dialogs. wxWidgets uses file dialogs that appear very similar to the system dialogs. Depends on your customers but I don't think this is reasonable for most applications. http://www.scintill

Re: Block-structured resource handling via decorators

2005-07-29 Thread Neil Hodgson
John Perks: > When handling resources in Python, where the scope of the resource is > known, there seem to be two schools of thought: > ... This is part of what PEP 343 addresses: http://www.python.org/peps/pep-0343.html Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Neil Hodgson
Paul Rubin: > I haven't used Ruby on Rails but from the description I saw, its distro > includes everything needed, which I assume includes Ruby itself. Whatever led you to assume that? * Install Ruby * Install RubyGems * Invoke gem to install rails http://download.rubyonrails.c

Re: How to determine that if a folder is empty?

2005-08-07 Thread Neil Hodgson
could ildg: > I want to check if a folder named "foldername" is empty. > I use os.listdir(foldername)==[] to do this, > but it will be very slow if the folder has a lot of sub-files. > Is there any efficient ways to do this? The first thing to do is measure the performance of this operation

Re: How to determine that if a folder is empty?

2005-08-08 Thread Neil Hodgson
could ildg > so you mean that this is not platform-independent? Your existing code is platform-independent but I think for faster code you will need to write platform-dependent code. FindFirstFile is only available on Windows. Neil -- http://mail.python.org/mailman/listinfo/python-lis

Re: new python debugger

2005-08-11 Thread Neil Hodgson
Nir: > Winpdb is still a BETA despite the version number which is 1.0.1 > so I will appreciate feedback on bugs, unexpected behavior, or > suggestions. Value tips when you hover over variables in the editor would be useful. A hovering user can be detected with the wxEVT_STC_DWELLSTART notif

Re: Windows message pump problems

2005-08-16 Thread Neil Hodgson
Cantankerous Old Git: > Problem 1: > If I have another thread call DestroyWindow after a delay, it gets an > error "permission denied". I really can't see why. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/wind

Re: Unix diff command under Window.

2005-08-24 Thread Neil Hodgson
Thomas Heller: > Yes. There's a script in your Python distribution: > Tools/scripts/diff.py > > See also the docs for the 'difflib' standard library module. Is the opposite code, a Python equivalent to 'patch' available? I have endless trouble receiving patch files that assume one of Windo

Re: Windows/win32all, unicode and long filenames

2005-08-27 Thread Neil Hodgson
Kevin Ollivier: > On Windows, it's very common to have a string of long directories in the > pathname for files, like "C:\Documents and Settings\My Long User Name\My > Documents\My Long Subdirectory Name\...". For a wxPython application I'm > working on, this has actually caused me to run into wha

Re: Unicode-aware file shortcuts in Windows

2005-09-16 Thread Neil Hodgson
Stanislaw Findeisen: > E:\Documents and Settings\Staszek\Progs\Python-Windows\test_1>cf.py > Traceback (most recent call last): > File "E:\Documents and > Settings\Staszek\Progs\Python-Windows\test_1\cf.py", line 7, in ? > shortcut.Save() > File ">", line 2, in Save > pywintypes.com_error

Re: SCons build tool speed

2005-02-13 Thread Neil Hodgson
ted: > How does the speed of the Scons build tool compare with Ant? > Right now with out Ant builds take around an hour. Hoping to > speed that up. Scons emphasises accuracy over speed and is normally a little slower than other build tools although still fast enough for most purposes. One c

Re: os.rename() doesn't work w/unicode??

2005-02-15 Thread Neil Hodgson
fanbanlo: > The filename is supposed to be in Chinese, on NTFS (WinXP). However, > when i print it, they are all '???', and that caused os.rename() to break. > > How to force os.walk to return a list of unicode filename? The convention in the unicode file name support is that calls with unico

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-18 Thread Neil Hodgson
Peter Maas: > Perhaps we will soon see a triumphant publication with the title > "Ilias Lazaridis - the ELIZA of the 21st century. A milestone towards > the perfect Turing test" ;) as laridis Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode encoding usablilty problem

2005-02-18 Thread Neil Hodgson
Martin v. Löwis: > Eventually, the primary string type should be the Unicode > string. If you are curious how far we are still off that goal, > just try running your program with the -U option. Tried both -U and sys.setdefaultencoding("undefined") on a couple of my most used programs and saw a

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Neil Hodgson
Martin v. Löwis: > So I have to guess what you could have meant. If you want > to be understood, you might have phrased the question like > this: > > "Should I take answers from people which do not respect coherence > of writings serious?" The main grammatical problem with the question is the

Re: Pythonwin: Red squiggley underline and syntax error

2005-02-28 Thread Neil Hodgson
Steven Bethard: > You've probably mixed tabs with spaces in your indentation somewhere. > Either replace all tabs with spaces or replace all spaces with tabs. You can see what characters are being used with the View | Whitespace command which shows tabs as arrows and spaces as centred dots.

Re: Share your SciTEGlobal.properties pls~~~~

2005-02-28 Thread Neil Hodgson
DENG: > im new to Python, i chose SciTE as my Python editor. but the problem is > SciTE needs to be config carefully, are there anyone use SciTE too? can > you share your SciTEGlobal.properties file? black background solution > is prefered:) http://scintilla.sourceforge.net/SciTEFAQ.html#BlackBac

Re: looking for expertise

2005-03-02 Thread Neil Hodgson
Michael: > 5. file operations seem to be delicate; at least I got an error when I > passed a filename that contains special characters as unicode to > os.access(), so I guess that whenever I do file operations > (os.remove(), shutil.copy() ...) the filename should be encoded back > into system enc

Re: looking for expertise

2005-03-02 Thread Neil Hodgson
Michael: > Like I said, it's only supposed to run on linux; anyway, is it likely > that problems will arise when filenames I have to handle have > basically three sources: > ... > 3. filenames created by user input Have you worked out how you want to handle user input that is not representable

Re: PythonWin, AutoDoc and german keyboards...

2005-03-03 Thread Neil Hodgson
Werner Merkl: > When we enter range with us keyboard we get: > >>> range( > [range([start,] stop[, step]) -> list of integers] > > When we do this with German keyboard we get... nothing, >... > BTW: Changes to Python24\Lib\site-packages\pythonwin\pywin\default.cfg > didn't help. It

Re: PythonWin line spacing

2005-03-09 Thread Neil Hodgson
Thomas Philips: > I've just downloaded and installed ActivePython and am trying to > customize the PythonWin editor. Its line spacing seems to default to 2, > and consequently, I cannot see many lines of code on a screen. How do I > set the line spacing to 1? I presume you are talking about th

Re: PythonWin

2005-03-12 Thread Neil Hodgson
Thomas Philips: > However, if I run it in ActivePython's PythonWin, a small message > box pops up, with hardly any space to diplay msg and a smallish > space into which I can type my answer. How can I force PythonWin > to get its input from the execution window You will have to implement t

Re: Tkinter Bitmap Newbie question

2005-03-14 Thread Neil Hodgson
Wim Goffin: > But just to make sure I'm on the right track, > - Is XBM the best way to for bitmaps? The ones I saw so far are all black > and white. Do they also exist in color? XPM is the version of XBM with colour. > - Is XBM also the best format for glyphs on the Windows platform? Or woul

Re: survey of modules to be added to stdlib

2005-03-18 Thread Neil Hodgson
Alia Khouri: > ctypes - Thomas Heller I would like this to go in but it won't be added as it allows unsafe code, such as dereferencing bad pointers. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: C type buffer copy

2005-03-22 Thread Neil Hodgson
Joe: > testCode(unsigned char buf, unsigned long len) > { > unsigned long data=0x0; > while (len--) > { > *buf++ = (unsigned char)data++ This C code will crash since buf is declared as an unsigned char, not an unsigned char*. Stop thinking in terms of translating low level

Re: I've broken PythonWin2.4 - Dialogs don't pop up!

2005-04-06 Thread Neil Hodgson
Michael Murdock: > I have broken PythonWin and I don't know how or why. It worked great > until recently. I have installed / removed several apps since it worked > last. I could have a virus unknown to my antivirus program, I guess. > I'm stumped. You have tried rebooting? PythonWin can be

Re: I've broken PythonWin2.4 - Dialogs don't pop up!

2005-04-11 Thread Neil Hodgson
Michael Murdock: > Rebooting does not help. I uninstalled and removed everything from > c:\python2.4 and then downloaded and installed the latest version. > Right after installing it, everything worked fine. But when I rebooted, > the problem came back. Do you have a copy of win32ui.pyd on th

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Neil Hodgson
Jim, > 1.Could someone tell me how to terminate execution in PythonWin? Use the "Break into running code" command on the context menu of the PythonWin icon in the bottom right of the taskbar. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: terminate exectutioin in PythonWin

2005-04-13 Thread Neil Hodgson
Jim: > Great thanks! PythonWin isn't hot on keyboard shortcuts but ironically > calls this a KeyboardInterrupt :| I don't think the keyboard can be accessed in this situation so the icon is provided. > Know any keyboard shortcuts for debug view? e.g. open it, run(debug), > step etc. No

Re: Using python from a browser

2005-04-14 Thread Neil Hodgson
Philippe: > I read that IE had the capability to embedd Python scripts, but what > about the others ? While Python can be set up as a scripting language for IE, this is normally disabled as it could be a security hole. The open call is available from Python scripts so a web site could read

Re: Using python from a browser/security hole

2005-04-15 Thread Neil Hodgson
Philippe: > Since I need to access a local/client device from the page and > that I wish to be cross-platform; does that mean Java is my only > way out ? Java is designed to be safe and not allow access to client devices. There is a mechanism where you can attempt to ask for permission from

Re: Using python from a browser/security hole

2005-04-15 Thread Neil Hodgson
Philippe: > Would Jpython let me do that ? > Would java let me call an external Python script - which in turn would > access my device ? Not without asking for more permissions than accessing the device as being able to execute arbitrary code is very dangerous. Think of this from the point o

Dr Dobbs "with" keyword

2005-04-15 Thread Neil Hodgson
In the March 2005 issue of Dr Dobbs Journal there is an article "Resource Management in Python" by Oliver Schoenborn. One paragraph (first new paragraph, page 56) starts "Starting with Python 2.4, a new type of expression lets you use the keyword /with/". It continues, mentioning PEP 310 (Re

Re: To decode the Subject =?iso-8859-2?Q?=... in email in python

2005-04-20 Thread Neil Hodgson
Dan Polansky: > When parsing messages using python's libraries email and mailbox, the > subject is often encoded using some kind of = notation. Apparently, the > encoding used in this notation is specified like =?iso-8859-2?Q?=... or > =?iso-8859-2?B?=. Is there a python library function to decode

Re: win32ui CreateFileDialog SLOW (since the SP2 Windows XP patch?)

2005-04-27 Thread Neil Hodgson
Kitty: > Now it can take up to 4 minutes for the file dialog box to appear. No > problems with speed in PythonWin, of course, but she is not used to > doing that. Any suggestions? Anyone know why it is so slow? I have seen similar issues in the past but mainly on Windows 9x with particular st

Re: Stripping characters from windows clipboard with win32clipboard from excel

2013-09-12 Thread Neil Hodgson
Stephen Boulet: From the clipboard contents copied from the spreadsheet, the characters s[:80684] were the visible cell contents, and s[80684:] all started with "b'\x0" and lack any useful info for what I'm trying to accomplish. Looks like Excel is rounding up its clipboard allocation to

Re: Stripping characters from windows clipboard with win32clipboard from excel

2013-09-18 Thread Neil Hodgson
Dave Angel: So is the bug in Excel, in Windows, or in the Python library? Somebody is falling down on the job; if Windows defines the string as ending at the first null, then the Python interface should use that when defining the text defined with CF_UNICODETEXT. Everything is performing

Re: python IDE and function definition

2013-09-23 Thread Neil Hodgson
Chris Friesen: where I could highlight the "stop" and ask it to go to the definition. (Where the definition is in a different file.) I'm running into issues where my current IDE (I'm playing with Komodo) can't seem to locate the definition, I suspect because it's too ambiguous. Some IDEs

Re: Language Enhancement Idea to help with multi-processing (your opinions please)

2011-10-13 Thread Neil Hodgson
jkn: > FWIW, this looks rather like the 'PAR' construct of Occam to me. > > http://en.wikipedia.org/wiki/Occam_%28programming_language%29 Earlier than that, 'par' is from Algol 68: http://en.wikipedia.org/wiki/ALGOL_68#par:_Parallel_processing Neil -- http://mail.python.org/mailman/listi

Re: LangWart: Method congestion from mutate multiplicty

2013-02-10 Thread Neil Hodgson
Rick Johnson: The Ruby language attempted to save the programmer from the scourge of obtaining a four year degree in linguistics just to create intuitive identifiers "on-the-fly", and they tried to remove this ambiguity by employing "post-fix-punctuation" of the exclamation mark as a visual c

Re: LangWart: Method congestion from mutate multiplicty

2013-02-10 Thread Neil Hodgson
Rick Johnson: Really? Yes. >> a = [1,2] => [1, 2] >> a.push(3) => [1, 2, 3] >> a => [1, 2, 3] This could be called "mutation without exclamation". >> require 'WEBrick' => true >> vowels = "[aeiou]+" => "[aeiou]+" >> vowels.object_id => 2234951380 >> WEBrick::HTTPUtils._make_regex!(vow

Re: Largest possible size for executemany() in PEP-249 (Database API)

2013-02-28 Thread Neil Hodgson
Roy Smith: _mysql_exceptions.OperationalError: (1153, "Got a packet bigger than 'max_allowed_packet' bytes") Is there any way (other than trial and error) to know how many records I can pass in one call before I blow up? Its unlikely to be a limit in the number of records but a limit on t

Re: String performance regression from python 3.2 to 3.3

2013-03-16 Thread Neil Hodgson
Steven D'Aprano: So while you might save memory by using "UTF-24" instead of UTF-32, it would probably be slower because you would have to grab three bytes at a time instead of four, and the hardware probably does not directly support that. Low-level string manipulation often deals with bl

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Neil Hodgson
Ian Foote: Specifically, indexing a variable-length encoding like utf-8 is not as efficient as indexing a fixed-length encoding. Many common string operations do not require indexing by character which reduces the impact of this inefficiency. UTF-8 seems like a reasonable choice for an in

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Neil Hodgson
Steven D'Aprano: Some string operations need to inspect every character, e.g. str.upper(). Even for them, the increased complexity of a variable-width encoding costs. It's not sufficient to walk the string inspecting a fixed 1, 2 or 4 bytes per character. You have to walk the string grabbing 1 b

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Neil Hodgson
MRAB: Implementing the regex module (http://pypi.python.org/pypi/regex) would have been more difficult if the internal representation had been UTF-8, because of the need to decode, and the implementation would also have been slower for that reason. One way to build regex support for UTF-8 i

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Neil Hodgson
Chris Angelico: But both this and your example of case conversion are, fundamentally, iterating over the string. What if you aren't doing that? What if you want to parse and process? Parsing is also normally a scanning operation. If you want to process pieces of the string based on the par

Re: Performance of int/long in Python 3

2013-04-01 Thread Neil Hodgson
Mark Lawrence: You've given many examples of the same type of micro benchmark, not many examples of different types of benchmark. Trying to work out what jmfauth is on about I found what appears to be a performance regression with '<' string comparisons on Windows 64-bit. Its around 30% s

Re: Performance of int/long in Python 3

2013-04-02 Thread Neil Hodgson
jmfauth: 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] [0.8343414906182101, 0.8336184057396241, 0.8330473419738562] 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit [1.3840254166697845, 1.3933888932429768, 1.391664674507438] That's a larger performa

Re: Performance of int/long in Python 3

2013-04-02 Thread Neil Hodgson
Ian Kelly: Micro-benchmarks like the ones you have been reporting are *useful* when it comes to determining what operations can be better optimized, but they are not *important* in and of themselves. What is important is that actual, real-world programs are not significantly slowed by these kin

  1   2   3   >