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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Is Unicode support so hard...

2013-04-20 Thread Neil Hodgson
Hi jmf, This gives me plenty of ideas to test the "flexible string representation" (FSR). I should recognize this FSR is failing particulary very well... This is too vague for me. Which string representation should Python use? 1) UTF-32 2) UTF-8 3) Python 3.3 -- 1, 2, or 4 bytes per

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Neil Hodgson, replying to self: The assembler (32-bit build) for each PyUnicode_READ looks like Don't have 64-bit MSVC 2010 set up but the code from 64-bit MSVC 2012 is better since there are an extra 8 registers in 64-bit mode: ; 10431: c1 = PyUnicode_READ(kind1, dat

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Dave Angel: That would seem to imply that the speed regression on your data is NOT caused by the differing size encodings. Perhaps it is the difference in MSC compiler version, or other changes made between 3.2 and 3.3 Its not caused by there actually being different size encodings but tha

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
rusi: Can you please try one more experiment Neil? Knock off all non-ASCII strings (paths) from your dataset and try again. Results are the same 0.40 (well, 0.001 less but I don't think the timer is that accurate) for Python 3.2 and 0.78 for Python 3.3. Neil -- http://mail.python.org/

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Roy Smith: On the other hand, how long did it take you to do the directory tree walk required to find those million paths? I'll bet a long longer than 0.78 seconds, so this gets lost in the noise. About 2 minutes. But that's just getting an example data set. Other data sets may be loaded

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Reran the programs taking a bit more care with the encoding of the file. This had no effect on the speeds. There are only a small amount of paths that don't fit into ASCII: ASCII 1076101 Latin1 218 BMP 113 Astral 0 # encoding:utf-8 import codecs, os, time from os.path import join, getsize w

Re: Performance of int/long in Python 3

2013-04-02 Thread Neil Hodgson
Chris Angelico: I'd be curious to know the sorts of characters used. Given that it's probably a narrow-vs-wide Python difference we're talking here, the actual distribution of codepoints may well make a difference. I was going to upload it but then I thought of potential client -confidenti

Re: Performance of int/long in Python 3

2013-04-02 Thread Neil Hodgson
Terry Jan Reedy: What system *and* what compiler and compiler options. Unless 3.2 and 3.3 are both compiler with the same compiler and settings, we do not know the source of the difference. The version signatures are: 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] 3.3.

Re: Performance of int/long in Python 3

2013-04-02 Thread Neil Hodgson
rusi wrote: ... a 'micro-benchmark' - I'd just like to avoid adding email access to get this over the threshold. What does that last statement mean? Its a reference to a comment by Jamie Zawinski (relatively famous developer of Netscape Navigator and other things): "Every program at

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

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-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: 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: 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
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
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: WxPython versus Tkinter.

2011-01-24 Thread Neil Hodgson
rantingrick: > Not if we used the underlying MS library! Windows has such a rich > library why not use it? Why must we constantly re-invent the wheel? It is up to the GUI toolkit or application to implement the interfaces defined by Windows Automation API on every object it displays. The stand

Re: WxPython versus Tkinter.

2011-01-24 Thread Neil Hodgson
Octavian Rasnita: > There are no many people that know about this thing, > but there are standards like MSAA that can be followed > by them if they really want to offer accessibility. I > guess that if Tkinter would support MSAA (Microsoft > Active Accessibility) in its Windows version, the screen

Re: Tkinter: The good, the bad, and the ugly!

2011-01-20 Thread Neil Hodgson
Emile van Sebille: > The problem with QT is the license. > > From http://qt.nokia.com/products/licensing/: > > Qt Commercial Developer License > The Qt Commercial Developer License is the correct license to use for > the development of proprietary and/or commercial software ... The LGPL vers

Re: will Gnome 3.0 kill pygtk?

2010-09-30 Thread Neil Hodgson
Tracubik: > i'm studying pygtk right now, am i wasting my time considering that my > preferred platform is linux/gnome? I expect the dynamic binding will be very similar to the current static binding but easier to keep up-to-date. There's already some use of dynamic binding in the recent PyGT

Re: How Python works: What do you know about support for negative indices?

2010-09-11 Thread Neil Hodgson
Ben Finney: > For those who think the problem may be with the recipient's software, I > see the same annoying line-wrapping problems in the archived message > http://mail.python.org/pipermail/python-list/2010-September/1255167.html>. That looks well-formatted to me and just the same as I see i

Re: How Python works: What do you know about support for negativeindices?

2010-09-09 Thread Neil Hodgson
Mark Tolonen: > It came across fine for me (on much maligned Outlook Express, no less). Yes, looks fine to me both in Thunderbird (news, not mailing list) and at Google Groups. There is a single text part with all lines except an URL easily within 80 columns. Perhaps there is a problem in Ben'

Re: Is there any way to minimize str()/unicode() objects memory usage [Python 2.6.4] ?

2010-08-06 Thread Neil Hodgson
dmtr: > What I'm really looking for is a dict() that maps short unicode > strings into tuples with integers. But just having a *compact* list > container for unicode strings would help a lot (because I could add a > __dict__ and go from it). Add them all into one string or array and use indexe

Microsoft lessening commitment to IronPython and IronRuby

2010-08-06 Thread Neil Hodgson
There is a blog post from Jimmy Schementi who previously worked at Microsoft on IronRuby about the state of dynamic language work there. http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python not written in C++ ?

2010-08-05 Thread Neil Hodgson
Paul Rubin: > C has all kinds of undefined behavior. "Might need to rely on" is not > relevant for this kind of issue. Ada's designers had the goal that that > Ada programs should have NO undefined behavior. Ada achieves this by describing a long list of implementation defined behaviour (Ann

Re: Why is python not written in C++ ?

2010-08-03 Thread Neil Hodgson
Grant Edwards: > That said, the last time I looked the Ada spec was only something like > 100 pages long, so a case could be made that it won't take long to > learn. I don't know how long the C++ language spec is, but I'm > betting it's closer to 1000 than 100. The Ada 2012 Language Reference

Re: Sun Grid Engine / NFS and Python shell execution question

2010-07-22 Thread Neil Hodgson
J.B. Brown: > I believe the source of this problem is that os.popen() or os.system() > calls spawn subshells which then reference my shell resource files > (.zshrc, .cshrc, .bashrc, etc.). > But I don't see an alternative to os.popen{234} or os.system(). > os.exec*() cannot solve my problem, becau

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-08 Thread Neil Hodgson
sturlamolden: > Windows did this too (msvcrt.dll) up to the VS2003 release, which came > with msvcr71.dll in addition. Since then, M$ (pronounced Megadollar > Corp.) have published msvcr80.dll, msvcr90.dll, and msvcr100.dll (and > corresponding C++ versions) to annoy C and C++ developers into > co

Re: Python dynamic attribute creation

2010-06-26 Thread Neil Hodgson
WANG Cong: > From what you are saying, Smalltalk picks a way similar to setattr() in > Python? addInstVarName is a method on ClassDescription objects. > Because you mentioned 'addInstVarName' which seems to be a > method or a builtin function. If so, that is my point, as I mentioned > earlier

Re: Python dynamic attribute creation

2010-06-25 Thread Neil Hodgson
WANG Cong: > 4) Also, this will _somewhat_ violate the OOP princples, in OOP, > this is and should be implemented by inherence. Most object oriented programming languages starting with Smalltalk have allowed adding attributes (addInstVarName) to classes at runtime. Low level OOPLs like C++ and

Re: Encoding troubles

2010-05-17 Thread Neil Hodgson
JB: > as hypens (–) and apostrophes (’) are in an odd encoding. When passed > to the database using sqlalchemy they appear as – and other > characters. The encoding is UTF-8. Normally the best way to handle encodings is to convert to Unicode strings (unicode(s, "UTF-8")) as soon as possible

Re: Download Visual Studio Express 2008 now

2010-04-15 Thread Neil Hodgson
Martin v. Loewis: > Python 2.6, 2.7, and 3.1 are all built with that release (i.e. 2008). > Because of another long tradition, Python extension modules must be > built with the same compiler version (more specifically, CRT version) as > Python itself. So to build extension modules for any of these

Re: msvcr90.dll is MIA?

2010-04-15 Thread Neil Hodgson
Filip: > But what's so special about msvcr and visual studio compiler? Python > compiles fine with gcc under unixes, so is it a problem to compile > python interpreter with mingw and get rid of the proprietary runtime > dependecies? MinGW uses an older version of Microsoft's runtime MSVCRT.DLL.

Re: Generating a rainbow?

2010-04-08 Thread Neil Hodgson
Me: >You should use different variables for the two loops. Actually it is closing the divs that makes it work in FireFox: import colorsys sat = 1 value = 1 length = 1000 for h in range(0, length + 1): hue = h / float(length) color = list(colorsys.hsv_to_rgb(hue, sat, value

Re: Generating a rainbow?

2010-04-08 Thread Neil Hodgson
Tobiah: > for x in range(0, length + 1): > ... > for x in range(3): You should use different variables for the two loops. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Python unicode and Windows cmd.exe

2010-03-14 Thread Neil Hodgson
Guillermo: > 2) My script gets output from a Popen call (to execute a Powershell > script [new Windows shell language] from Python; it does make sense!). > I suppose changing the Windows codepage for a single Popen call isn't > straightforward/possible? You could try SetConsoleOutputCP and Set

Re: Python unicode and Windows cmd.exe

2010-03-14 Thread Neil Hodgson
Guillermo: > Is this an enforced convention under Windows, then? My head's aching > after so much pulling at my hair, but I have the feeling that the > problem only arises when text travels through the dos console... The console is commonly using Code Page 437 which is most compatible with old

Re: Python unicode and Windows cmd.exe

2010-03-14 Thread Neil Hodgson
Guillermo: > I then open the file m.txt with notepad, and I see "mañana" normally. > I save (again, no actual modifications), go back to the dos prompt, do > type m.txt and this time it works! I get "mañana". When notepad opens > the file, the encoding is already UTF-8, so short of a UTF-8 bom bei

Re: file seek is slow

2010-03-10 Thread Neil Hodgson
Metalone: > As it turns out each call is only > 646 nanoseconds slower than 'C'. > However, that is still 80% of the time to perform a file seek, > which I would think is a relatively slow operation compared to just > making a system call. A seek may not be doing much beyond setting a current

Re: Passing FILE * types using ctypes

2010-03-05 Thread Neil Hodgson
Zeeshan Quireshi: > Hello, I'm using ctypes to wrap a library i wrote. I am trying to pass > it a FILE *pointer, how do i open a file in Python and convert it to a > FILE *pointer. For this to work, your library should have been compiled with the same compiler as Python and possibly the same c

Re: Spam from gmail

2010-02-24 Thread Neil Hodgson
Steve Holden: > Spam is, at least from my point of view, UCE: unsolicited commercial > e-mail. Spam is more commonly defined as UBE (Unsolicited Bulk Email) of which UCE is a large subset. Its just as much spam if its pushing a political party or charity even though there may be no commercial

Re: TABS in the CPython C source code

2010-02-07 Thread Neil Hodgson
Aahz: > BTW, in case anyone is confused, it's "svn blame" vs "cvs annotate". Possibly earlier versions of SVN only supported "blame" but the variants "annotate", "ann", and "praise" all work with the version of SVN (1.6.5) I have installed. Neil -- http://mail.python.org/mailman/listinfo/

Re: TABS in the CPython C source code

2010-02-06 Thread Neil Hodgson
Alf P. Steinbach: > The size-8 tabs look really bad in an editor configured with tab size 4, > as is common in Windows. I'm concluding that the CPython programmers > configure their Visual Studio's to *nix convention. Most of the core developers use Unix. > Anyways, I would suggest converting

Re: PEP 3147 - new .pyc format

2010-01-30 Thread Neil Hodgson
John Roth: > 4. I'm in favor of putting the source in the .pyr directory as well, > but that's got a couple more issues. One is tool support, which is > likely to be worse for source, and the other is some kind of algorithm > for identifying which source goes with which object. Many tools work

Re: [OT] Perl 6 [was Re: myths about python 3]

2010-01-28 Thread Neil Hodgson
Looks to me like the problem with Perl 6 was that it was too ambitious, wanting to fix all perceived problems with the language. Python 3 is much more limited in scope: at its core its Python with Unicode fixed and old junk removed. Neil -- http://mail.python.org/mailman/listinfo/python-lis

Re: myths about python 3

2010-01-27 Thread Neil Hodgson
Carl Banks: > There is also no hope someone will fork Python 2.x and continue it in > perpetuity. Well, someone might try to fork it, but they won't be > able to call it Python. Over time there may be more desire from those unable or unwilling to upgrade to 3.x to work on improvements to 2.x,

Re: chr(12) Form Feed in Notepad (Windows)

2010-01-15 Thread Neil Hodgson
W. eWatson wrote: > I am writing a txt file. It's up to the user to print it using Notepad > or some other tool. WordPad will interpret chr(12) as you want. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.1 cx_Oracle 5.0.2 "ImportError: DLL load failed: The specified module could not be found."

2009-11-20 Thread Neil Hodgson
André: > Apparently the error is caused by cx_Oracle not being able to find the > Oracle client DLLs (oci.dll and others). The client home path and the > client home path bin directory are in the PATH System Variable and > oci.dll is there. Open the cx_Oracle extension with Dependency Walker (

Re: Recommended number of threads? (in CPython)

2009-10-29 Thread Neil Hodgson
mk: > I found that when using more than several hundred threads causes weird > exceptions to be thrown *sometimes* (rarely actually, but it happens > from time to time). If you are running on a 32-bit environment, it is common to run out of address space with many threads. Each thread allocat

Re: umlauts

2009-10-17 Thread Neil Hodgson
The server is sniffing the User-Agent header to decide whether to send UTF-8 or ISO-8859-1. Try this code: import urllib2 r = urllib2.Request("http://www.google.de/ig/api?weather=Muenchen";, None, {"User-Agent":"Mozilla/5.0"}) f = urllib2.urlopen(r) i = f.info() print(i) xml = f.read()

Re: save windows clipboard content temporarily and restore later

2009-10-12 Thread Neil Hodgson
kakarukeys: > I followed your hints, and wrote the following code. It works for most > clipboard formats except files. Selecting and copying a file, followed > by backup() and restore() throw an exception: For some formats the handle stored on the clipboard may not be a memory handle so may no

Re: save windows clipboard content temporarily and restore later

2009-10-09 Thread Neil Hodgson
kakarukeys: > Restoring the data with that format could result in information loss, > for example when HTML text is saved in ordinary text format. There is > no format that could preserve 100% of any kind of clipboard content. > > Does anyone has a brilliant solution? Enumerate all the clipbo

Re: unicode issue

2009-10-01 Thread Neil Hodgson
Dave Angel: > I know that the clipboard has type tags, but I haven't looked at them in > so long that I forget what they look like. For text, is it just ASCII > and Unicode? Or are there other possible encodings that the source and > sink negotiate? The normal thing seen is that the clipboar

Re: Signing extensions

2009-09-25 Thread Neil Hodgson
Roger Binns: > The Windows Python distribution is signed by PGP and the normal Microsoft > way using a Verisign class 3 cert. (If you read their issuer statement it > ultimately says the cert isn't worth the bits it is printed on :-) One of > those certs is $500 per year which is out of the ques

Re: Open file on remote linux server

2009-09-23 Thread Neil Hodgson
The Bear: > Hi I'm looking to do something like this > > f = f.openfileobj(remotefileloc, localfilelikeobj) > > my remote files are on a solaris box that i can access using ssh (could > prehap request othe protocols if necessary) You could look into GIO which is a virtual file system API used

Re: How do I post to the wxPython mailing list?

2009-09-09 Thread Neil Hodgson
PythonAB: > No, but it means that more of my data goes into the same company. > There's no way to use my own email accounts from my own domain, > and I don't have a choice anymore. I just checked and it allowed me to use an account from my domain so I expect it will work with yours. > In othe

Re: How do I post to the wxPython mailing list?

2009-09-07 Thread Neil Hodgson
PythonAB: > I dont want to register with a google account, > is there any way to use a non-gmail account? A Google account does not mean you have to use gmail. The Google account is used to handle your interaction with Google services and can be used in conjunction with arbitrary email account

Re: An assessment of the Unicode standard

2009-08-29 Thread Neil Hodgson
Chris Jones: > Is the implication that the principal usefulness of such languages as > Hindi and "other Indian languages" is us selling "things" to them..? Unicode was developed by a group of US corporations: Xerox, Apple, Sun, Microsoft, ... The main motivation was to avoid dealing with mult

Re: An assessment of the Unicode standard

2009-08-29 Thread Neil Hodgson
Benjamin Peterson: > Like Sanskrit or Snowman language? Sanskrit is mostly written in Devanagari these days which is also useful for selling things to people who speak Hindi and other Indian languages. Not sure if you are referring to the ☃ snowman character or Arctic region languages like

Re: An assessment of the Unicode standard

2009-08-29 Thread Neil Hodgson
r: > Unicode (*puke*) seems nothing more than a brain fart of morons. And > sadly it was created by CS majors who i assumed used logic and > deductive reasoning but i must be wrong. Why should the larger world > keep supporting such antiquated languages and character sets through > Unicode? What p

Re: Annoying octal notation

2009-08-28 Thread Neil Hodgson
Steven D'Aprano: > Obviously I can't speak for Ken Thompson's motivation in creating this > feature, but I'm pretty sure it wasn't to save typing or space on > punchcards. The original implementation of UNIX was on a PDP-7 which was an 18-bit machine. Octal = 3 bits at a a time which evenly

Re: Read C++ enum in python

2009-08-19 Thread Neil Hodgson
AggieDan04: > file_data = open(filename).read() > # Remove comments and preprocessor directives > file_data = ' '.join(line.split('//')[0].split('#')[0] for line in > file_data.splitlines()) > file_data = ' '.join(re.split(r'\/\*.*\*\/', file_data)) For some headers I tried it didn't work unti

Re: Is python buffer overflow proof?

2009-08-04 Thread Neil Hodgson
Thorsten Kampe: > You cannot create "your own" buffer overflow in Python as you can in C > and C++ but your code could still be vulnerable if the underlying Python > construct is written in C. Python's standard library does now include unsafe constructs. import ctypes x = '1234' # Munging b

Re: No PyPI search for 3.x compatible packages

2009-07-30 Thread Neil Hodgson
Francesco Bochicchio : > Are you sure? I note that for example pygtk has as language tags both > C and python. So maybe a C extension > for python3 would have both C and python 3 as language tags. > > I suspect that the 109 packages you found are the only ones obf the > 4829 which works with pyth

No PyPI search for 3.x compatible packages

2009-07-29 Thread Neil Hodgson
There appears to be no way to search PyPI for packages that are compatible with Python 3.x. There are classifiers for 'Programming Language' including 'Programming Language :: Python :: 3' but that seems to be for implementation language since there are so many packages that specify C. There are

Re: Mutable Strings - Any libraries that offer this?

2009-07-26 Thread Neil Hodgson
Mark Lawrence: > If my sleuthing is correct the problem is with these lines > > ilow *= self->itemSize; > ihigh *= self->itemSize; > > in GapBuffer_slice being computed before ilow and ihigh are compared to > anything. This particular bug was because ihigh is the maximum 32 bit integer 21474

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Neil Hodgson
milanj: > and all of them use native threads (python still use green threads ?) Python uses native threads. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutable Strings - Any libraries that offer this?

2009-07-20 Thread Neil Hodgson
casebash: > I have searched this list and found out that Python doesn't have a > mutable string class (it had an inefficient one, but this was removed > in 3.0). Are there any libraries outside the core that offer this? I wrote a gap buffer implementation for Python 2.5 allowing character, uni

Re: pxssh submit su commands = very very slow

2008-06-28 Thread Neil Hodgson
gert: This works but after the su command you have to wait like 2 minutes before each command gets executed ? s.sendline ('su') s.expect('Password:') A common idiom seems to be to omit the start of the expected reply since it may not be grabbed quickly enough. Then t

Re: finding icons for Apps

2008-05-24 Thread Neil Hodgson
Sanoski: Where can I find icons to use with my programs? http://sourceforge.net/projects/icon-collection/ Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Any other UI kits with text widget similar to that in Tk?

2008-05-11 Thread Neil Hodgson
Kenneth McDonald: I'm wondering if any of the other GUI kits have a text widget that is similar in power to the one in Tk. The main text widget in GTK+ was modeled after Tk but I don't know how well it succeeded in implementing this. Neil -- http://mail.python.org/mailman/listinfo/pyth

Re: MESSAGE RESPONSE

2008-04-25 Thread Neil Hodgson
ajaksu: Me too. That is, until I tried to Google Belcan and Blubaugh together. Or google for "Blubaugh, David" or similar. Repeating a message you object to actually increases its visibility and includes you in its footprint. Neil -- http://mail.python.org/mailman/listinfo/python-lis

Re: Confused about Boost.Python & bjam

2008-04-14 Thread Neil Hodgson
Till Kranz: > I tried to get started with Boost.Python. unfortunately I never used the > bjam build system before. As it is explained in the documentation I > tried to adapt the the files form the examples directory. I copied > 'Jamroot', 'boost_build.jam' and 'extending.cpp' to '~/test/'. But

Re: Which way to access Scintilla

2008-03-17 Thread Neil Hodgson
Alex: > I also want to embed Scintilla in Tkinter-created window (create the > rest of the GUI in Tkinter), or rather, I want to know if that's > possible at all. Any suggestions are appreciated. While it may be possible with sufficient dedication, it is unlikely to be simple. If you reall

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-01-31 Thread Neil Hodgson
Steve Holden wrote: > ... > Look guys, I thought we'd agreed that the PSU was no longer to be How did Steve manage to click send again after the para -- http://mail.python.org/mailman/listinfo/python-list

Re: Looping through the gmail dot trick

2008-01-20 Thread Neil Hodgson
Martin Marcher: > are you saying that when i have 2 gmail addresses > > "[EMAIL PROTECTED]" and > "[EMAIL PROTECTED]" > > they are actually treated the same? That is plain wrong and would break a > lot of mail addresses as I have 2 that follow just this pattern and they > are delivered correctly

  1   2   3   >