Re: Current install methodolgy eggs?

2010-09-12 Thread John Nagle
nd when it guessed wrong, you were stuck. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Static typing, Python, D, DbC

2010-09-12 Thread John Nagle
But it really matters in languages where you can. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: python27.exe vs python2.7.exe ...

2010-09-15 Thread John Nagle
Debian's Python policy. http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html at "Interpreter Name". They've addressed this. Consistency would be appreciated. Thank you. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

The trouble with "dynamic attributes".

2010-09-16 Thread John Nagle
ten by Javascript programmers. (In Javascript, an object and a dictionary are the same thing. In Python, they're not.) In new code, it's better to inherit from "dict". It eliminates the special cases. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread John Nagle
ncier "distutils" or "eggs", I'd suggest developing tools that take in "setup.py" files and make Windows installers, RPMs, or whatever the platform likes. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: SocketServer: replace network by hard drive

2010-09-24 Thread John Nagle
ming work files, marked them as in use, dialed up the credit card processing system, did the transaction, and wrote a response file. All the process coordination was through files. That was 1995 technology, before the banking system had direct Internet connections.

Re: sequence multiplied by -1

2010-09-25 Thread John Nagle
the CSV module? Are you sure? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: sequence multiplied by -1

2010-09-26 Thread John Nagle
dy have a range of methods which perform basic operations on the string and return a new string, so that's consistent. "xyz".dup(3) is clear enough. And allowing "xyz"*-3 was just lame. What reasonable use case does that have? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-27 Thread John Nagle
s through the wallpaper. There have been better strongly typed languages. Modula III was quite good, but it was from DEC's R&D operation, which was closed down when Compaq bought DEC. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Upload files with wsgi

2010-09-28 Thread John Nagle
s not clear. Are you trying to upload a Python program to a server, where a web server will run it in response to web requests? Or what? Does this involve an Apache server? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming orphaned over ssh

2010-09-29 Thread John Nagle
eaves something to be desired. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread John Nagle
alk encrypted to your attacker". John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread John Nagle
On 9/29/2010 3:51 PM, Antoine Pitrou wrote: On Wed, 29 Sep 2010 13:41:15 -0700 John Nagle wrote: The really stupid thing about the current SSL module is that it accepts a file of root certificates as a parameter, but ignores it. That's not true. You have to pass CERT_OPTION

Re: scheduler or infinite loop

2010-09-29 Thread John Nagle
On 9/29/2010 4:59 AM, harryos wrote: hi I am trying to write a program to read data from a site url. The program must read the data from site every 5 minutes. def get_data_from_site(pageurlstr): h=urllib.urlopen(pageurlstr) data=h.read() process_data(data) A key point here is

Re: discussion

2010-09-30 Thread John Nagle
age subject that describes the content of the message. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-10-01 Thread John Nagle
nsisted that the language should be very close to what a compiler of that form can do. This eventually killed Pascal. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: if the else short form

2010-10-01 Thread John Nagle
n "bool" values are NOT integers. They can be coerced to integers for historical reasons. But "str(True)" is "True". The above could be better written as button = gtk.Button(str(fill)) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: WSGI by HTTP GET

2010-10-03 Thread John Nagle
look for "val", and if the result starts with "t" or "T", accept it as True. Otherwise, False. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite is quite SQL compliant

2010-10-03 Thread John Nagle
r concurrent transaction handling, or replication. In other words, use SQLite in your desktop app to manage its data or configuration parameters. Use MySQL or Postgres for your web site. (Personally, I like MySQL, but I fear Oracle will mess it up.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite is quite SQL compliant

2010-10-03 Thread John Nagle
On 10/3/2010 5:40 PM, Lawrence D'Oliveiro wrote: In message<4ca8c9b6$0$1598$742ec...@news.sonic.net>, John Nagle wrote: (Personally, I like MySQL, but I fear Oracle will mess it up.) Doesn’t matter whether Oracle messes up the brand called “MySQL” or not. With Free Softwar

Re: if the else short form

2010-10-04 Thread John Nagle
; in Python. This was because the original design of Python didn't have "bool" (a rather strange mistake for a language designed this late) and the retrofit had to have some backwards compatibility. That's why lame results such as "True + True" being 2.

Re: sequence multiplied by -1

2010-10-04 Thread John Nagle
;>> a = numpy.array([1,2,3]) >>> a*2 array([2, 4, 6]) >>> a*-1 array([-1, -2, -3]) "numpy" gives "+" and "*" their arithmetic meaning. As an exercise to the reader, what's the result of: numpy.array([1,2,3]) + [4,5,6] Concate

Re: help!!!

2010-10-06 Thread John Nagle
n used to control the "for" statement. If N is >= 99, there will be a buffer overflow on "a". Also, starting to fill "a" from 1 looks like an error. Third, the program doesn't actually do anything. There's no output. It looks like this approach t

Re: frozendict (v0.1)

2010-10-09 Thread John Nagle
On 10/7/2010 2:39 PM, kj wrote: Following a suggestion from MRAB, I attempted to implement a frozendict class. That really should be built into the language. "dict" is the last built-in type that doesn't have an immutable form. Joh

Class-level variables - a scoping issue

2010-10-09 Thread John Nagle
d from an inner scope without a "global" statement. But that protection isn't applied to class-level variables referenced through 'self'. Perhaps it should be. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Class-level variables - a scoping issue

2010-10-10 Thread John Nagle
On 10/10/2010 12:53 AM, Lawrence D'Oliveiro wrote: In message<4cb14f8c$0$1627$742ec...@news.sonic.net>, John Nagle wrote: Within "fn1", the first reference to "self.classvar" references the class- level version of "classvar". The assignment overrides

Standardizing RPython - it's time.

2010-10-11 Thread John Nagle
re not inherently inefficient.) A significant advantage of having a well defined set of restrictions is that it encourages writing Python libraries which will run under both RPython and CPython. This makes migration to a faster system much easier.

Re: Standardizing RPython - it's time.

2010-10-11 Thread John Nagle
On 10/11/2010 1:01 PM, John Nagle wrote: (Correct Shed Skin tutorial link) > Shed Skin: > http://shedskin.googlecode.com/files/shedskin-tutorial-0.3.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Standardizing RPython - it's time.

2010-10-11 Thread John Nagle
On 10/11/2010 1:47 PM, Ryan Kelly wrote: On Mon, 2010-10-11 at 13:01 -0700, John Nagle wrote: It may be time to standardize "RPython". There are at least three implementations of "RPython" variants - PyPy, Shed Skin, and RPython for LLVM. The first two are up and runni

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-12 Thread John Nagle
n general, if you find yourself making millions of SQL database requests in a loop, you're doing it wrong. Big database loads are usually done by creating a text file with the desired data, then using a LOAD DATA INFILE command. This (in MySQL) is tens to hundreds of times faster than doing indiv

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread John Nagle
On 10/12/2010 6:01 PM, Lawrence D'Oliveiro wrote: In message<4cb4ba4e$0$1641$742ec...@news.sonic.net>, John Nagle wrote: In general, if you find yourself making millions of SQL database requests in a loop, you're doing it wrong. I’ve done this. Not millions, but certainly

Re: Difficulty in easy_install

2010-10-13 Thread John Nagle
#x27;t match them, installs fail with obscure error messages. "egg" files are really just "zip" files. It's sometimes necessary to unpack them, and run "python setup.py". John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: if the else short form

2010-10-13 Thread John Nagle
tialization order fiasco". Python is vulnerable to this problem in import loops, although the consequences aren't as severe as in C++. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread John Nagle
clue. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean value of generators

2010-10-15 Thread John Nagle
EOF. Reading ahead leads to deadlocks. The same logic applies to generators. A generator may be getting data from some source that can block. So an EOF test would lead to trouble. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How to display unicode char in Windows

2010-10-15 Thread John Nagle
cp 65001". If you try that with Python 2.6 and Windows 7, you get "LookupError: unknown encoding: cp65001", because "cp65001" isn't in Python's encoding tables. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes in a class: how to access variables from one in another

2010-10-18 Thread John Nagle
ords", a data attribute of the Zone object. You get back a filled-in Zone object, which you can then use. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: how to scrutch a dict()

2010-10-21 Thread John Nagle
nwanted items at all. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: functions, list, default parameters

2010-10-21 Thread John Nagle
lists (or anything mutable) as default argument values That really should be an error. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do module configuration properly

2010-10-22 Thread John Nagle
er to define a class, and initialize a singleton instance of the class from the main program, where you can handle errors. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: how to scrutch a dict()

2010-10-22 Thread John Nagle
On 10/22/2010 6:10 AM, Ethan Furman wrote: John Nagle wrote: class nonnulldict(dict) : def __setitem__(self, k, v) : if not (v is None) : dict.__setitem__(self, k, v) That creates a subclass of "dict" which ignores stores of None values. So you never store the unwanted items at a

Re: Exception Handling in Python 3

2010-10-24 Thread John Nagle
dicative of external problems, not a code error or cause for program termination with a traceback. Are exception semantics changing in a way which would affect that? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: downcasting problem

2010-10-25 Thread John Nagle
with a JIT has to trap stores into some internal variables and invalidate the generated code. This adds considerable complexity to the virtual machine. Java JVMs, for example, don't have to support that.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: ftplib - Did the whole file get sent?

2010-10-25 Thread John Nagle
to silent loss of data." "ftplib", in "storlines" and "storbinary", calls "close" without calling "shutdown" first. So if the other end disconnects after all data has been queued but not received, the sender will never know. FAIL. So there's your bug. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: is list comprehension necessary?

2010-10-26 Thread John Nagle
e. So far, that's mostly been resisted. Attempts to allow multiline lambdas have been averted. The weird "functional if" syntax additions were a cave-in to the functional crowd, and may have been a mistake. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode questions

2010-10-26 Thread John Nagle
On 10/19/2010 12:02 PM, Tobiah wrote: I've been reading about the Unicode today. I'm only vaguely understanding what it is and how it works. Please correct my understanding where it is lacking. http://justfuckinggoogleit.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: HTMLParser not parsing whole html file

2010-10-26 Thread John Nagle
tifulSoup, but it's being abandoned for the Python 3 transition. "http://www.crummy.com/software/BeautifulSoup/3.1-problems.html"; John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Why "flat is better than nested"?

2010-10-26 Thread John Nagle
a.util.regex import java.sql import java.util.logging As in Python 2: import urllib Python 3: import urllib.request, urllib.parse, urllib.error http://diveintopython3.org/porting-code-to-python-3-with-2to3.html John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How i can get data from an image

2010-10-26 Thread John Nagle
On 10/26/2010 1:46 PM, Krister Svanlund wrote: You should check out OpenCV. Yes. See http://code.google.com/p/pyopencv/ Note the "people detector" example. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: ActivePython 3.1.2.4 (with PyPM) is now available

2010-10-27 Thread John Nagle
7783 Does this mean it trashes installations of previous versions? Or can multiple versions coexist? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way of saying 'at least one of a, b, or c is in some_list'

2010-10-28 Thread John Nagle
_off = set('saturday','sunday') if not d1.isdisjoint(days_off) : ... This is cheaper than intersection, since it doesn't have to allocate and construct a set. It just tests whether any element in the smaller of the two sets is in the larger one. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception Handling in Python 3

2010-11-01 Thread John Nagle
aying information that should be sent in with a bug report. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalent of SOAP-ISIWoK

2010-11-02 Thread John Nagle
On 11/2/2010 1:58 AM, Johann Spies wrote: SOAP-ISIWoK is a Perl library for assessing Thomson Reuters Web of Knowledge Web Services. I don't know Perl well enough to use that library without spending too much time on it. Is there a Python equivalent available? The "Suds" library can call S

Re: Python documentation too difficult for beginners

2010-11-02 Thread John Nagle
itesearch=www.python.org&q=open http://www.google.com/search?q=Python+open John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-04 Thread John Nagle
quot; or "reindent" have smart semantics like CPython. The documentation doesn't say. If they don't, they should, or it should be documented that they're broken. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-05 Thread John Nagle
on. Today's editors are too dumb to do that right. They're text editors with the illusion of knowing something about the language, not language editors which also format text. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: http error 301 for urlopen

2010-11-07 Thread John Nagle
nually and follow all the individual links to find the problem. You may have to put in a bug request with the New York Times. Good luck with that. It's the New York Times' paywall. They're trying to set a cookie, and will redirect the URL until you store and return the cookie.

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread John Nagle
. Moral is many big companies do both for products and internally. Cheers, - Braden Faulkner YouTube was rewritten a few years ago, as it was scaled up. Not sure what it's written in now. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Pyhton - Functional Programming - How intersect/difference two dict with dict/values? fast!

2010-11-09 Thread John Nagle
0,42,'c4'],12],'as': [[1,3,'79b',45,65,'er4'],54],'ae': [[56,57,58,59],34]} intersect = filter(dict1.has_key, dict2.keys()) intersect result: ['ax', 'ac', 'ab'] When you've spent a year maintaining and fixing code written by others, come back and we'll talk. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Eval *always* Evil?

2010-11-11 Thread John Nagle
ee http://lybniz2.sourceforge.net/safeeval.html for something readable on how to use "eval" safely. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

os.tmpfile() vs. tempfile.TemporaryFile()

2010-11-11 Thread John Nagle
Is there any reason to prefer "tempfile.TemporaryFile()" over "os.tmpfile()"? Both create a nameless temporary file that will be deleted on close. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: A matter of queues, tasks and multiprocessing

2010-11-12 Thread John Nagle
error detection and recovery starts to dominate the problem. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: A matter of queues, tasks and multiprocessing

2010-11-12 Thread John Nagle
On 11/12/2010 12:18 PM, John Nagle wrote: On 11/10/2010 9:25 AM, Emanuele D'Arrigo wrote: Greetings everybody, I've tried to come up with this message for a couple of weeks now and it doesn't look like I'm getting any clearer in my thoughts so I decided that it's

Who still supports recent Python on shared hosting

2017-03-05 Thread John Nagle
something I have to sysadmin, just a small shared hosting account. John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Unicode support in Python 2.7.8 - 16 bit

2017-03-07 Thread John Nagle
3, it's 3.2.3, which rejects "u" Unicode string constants and has other problems in the MySQL area.) John Nagle -- https://mail.python.org/mailman/listinfo/python-list

What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
g1.decode("latin-1") '\\"Perfect Gift Idea\\"\x9d Each time' That just converts 0x9d in the input to 0x9d in Unicode. That's "Operating System Command" (the "Windows" key?) That's clearly wrong; some kind of quote was intended. Any ideas? John Nagle -- https://mail.python.org/mailman/listinfo/python-list

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 05:14 PM, John Nagle wrote: > I'm cleaning up some data which has text description fields from > multiple sources. A few more cases: bytearray(b'miguel \xe3\x81ngel santos') bytearray(b'lidija kmeti\xe4\x8d') bytearray(b'\xe5\x81ukasz zmywac

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 05:53 PM, Chris Angelico wrote:> On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: >> On 08/17/2017 05:14 PM, John Nagle wrote: >>> I'm cleaning up some data which has text description fields from >>> multiple sources. >> A few more

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
8 which had been run through an ASCII-type lower casing algorithm, that's a reasonable assumption. Thanks for looking at this, everyone. If a string won't parse as either UTF-8 or Windows-1252, I'm just going to convert the bogus stuff to the Unicode replacement character. I

Re: What extended ASCII character set uses 0x9D?

2017-08-18 Thread John Nagle
On 08/17/2017 05:53 PM, Chris Angelico wrote: On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: On 08/17/2017 05:14 PM, John Nagle wrote: I'm cleaning up some data which has text description fields from multiple sources. A few more cases: bytearray(b'\xe5\x81ukasz zmywaczy

<    8   9   10   11   12   13