Re: print function and unwanted trailing space

2013-09-12 Thread Albert Hopkins
On Wed, Sep 11, 2013, at 07:36 AM, Wayne Werner wrote: > On Sat, 31 Aug 2013, candide wrote: > > # - > > for i in range(5): > >print(i, end=' ') # <- The last ' ' is unwanted > > print() > > # - > > Then why not define end='' instead?

Re: Contact information for Jim Hugunin?

2013-07-24 Thread Albert Hopkins
On Mon, Jul 22, 2013, at 05:33 PM, Larry Hastings wrote: > > > Does anybody have an email address (or anything, really) for Jim > Hugunin? He left Google in May and appears to have dropped off the face > of the internet. Please email me privately. > > I swear I will use the information only

Re: Why is Ruby on Rails more popular than Django?

2013-03-06 Thread Albert Hopkins
On Wed, Mar 6, 2013, at 02:16 PM, Tim Johnson wrote: > I had problems getting django to work on my hostmonster account > which is shared hosting and supports fast_cgi but not wsgi. I put > that effort on hold for now, as it was just R&D for me, but > I would welcome you to take a look at

Re: Python Newbie

2013-02-24 Thread Albert Hopkins
> Most of what gets hung in art galleries these days is far less > visually pleasing than well-written code. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python "venerable"?

2013-02-20 Thread Albert Hopkins
On Tue, Feb 19, 2013, at 11:10 PM, Gene Heskett wrote: [...] > And even us old (78) farts are calling things Kewl now. 78??? Is that the year you were born or the years since you were born? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'

2013-02-14 Thread Albert Hopkins
On Thu, Feb 14, 2013, at 04:39 PM, Dave Angel wrote: [... snip] > For those of us using text-based email, the program in this message is > totally unreadable. This is a text mailing-list, so please put your > email program in text mode, or you'll lose much of your audience. For those of us n

Re: how to call shell?

2013-02-12 Thread Albert Hopkins
On Tue, Feb 12, 2013, at 12:12 AM, contro opinion wrote: > >>> import os > >>> os.system("i=3") > 0 > >>> os.system("echo $i") > > 0 > >>> > why i can't get the value of i ? Whenever you call os.system, a new shell is created and the command is run, system() then waits for the command to comple

Re: Is Python programming language?

2013-02-08 Thread Albert Hopkins
On Fri, Feb 8, 2013, at 08:03 AM, gmspro wrote: > Hello all, > > One said, Python is not programming language, rather scripting language, > is that true? > According to Wikipedia[1] a "scripting languages" are a subset of "programming languages" so it goes that any "scripting language" is, be

Re: Best Practice Question

2013-02-05 Thread Albert Hopkins
[...] > By the way, did someone ever notice that r'\' fails ? I'm sure there's a > reason for that... (python 2.5) Anyone knows ? > > r'\' > SyntaxError: EOL while scanning single-quoted string > > "Even in a raw string, string quotes can be escaped with a backslash, but the backslash remains in

Re: error in except

2013-02-04 Thread Albert Hopkins
On Mon, Feb 4, 2013, at 04:49 PM, Rodrick Brown wrote: > For the life of me I cant figure out why this exception is being thrown. > How could I use pdb to debug this? > > $ python udp_local2.py server > File "udp_local2.py", line 36 > except: > ^ > SyntaxError: invalid syntax > >

Re: sockobj.connect Errno 13 Permission denied

2013-01-26 Thread Albert Hopkins
On Sat, Jan 26, 2013, at 08:52 AM, Joel Goldstick wrote: > On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick > wrote: > > > > > > > > > On Sat, Jan 26, 2013 at 6:19 AM, nobody wrote: > > > >> Hi, > >> > >> I have a client program Client.py which has a statement of > >> sockobj.connect(), the port

Re: When is overriding __getattr__ is useful?

2013-01-07 Thread Albert Hopkins
On Mon, Jan 7, 2013, at 10:54 AM, Rodrick Brown wrote: > Can someone provide an example why one would want to override __getattr__ > and __getattribute__ in a class? They're good for cases when you want to provide an "attribute-like" quality but you don't know the attribute in advance. For exa

Re: Tarfile and usernames

2012-12-30 Thread Albert Hopkins
On Sun, Dec 30, 2012, at 01:57 PM, Nicholas Cole wrote: Dear List, I'm hoping to use the tarfile module in the standard library to move some files between computers. I can't see documented anywhere what this library does with userids and groupids. I can't guarantee that the computers invo

Re: who can give me some practical tutorials on django 1.4 or 1.5?

2012-11-04 Thread Albert Hopkins
On Sun, 2012-11-04 at 13:29 +0800, Levi Nie wrote: > Who can give me some practical tutorials on django 1.4 or 1.5? > Thank you. Is the official[1] tutorial not practical enough? [1] https://docs.djangoproject.com/en/1.4/intro/tutorial01/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest web framework

2012-09-24 Thread Albert Hopkins
On Sun, 2012-09-23 at 12:19 +0300, Andriy Kornatskyy wrote: > I have run recently a benchmark of a trivial 'hello world' application for > various python web frameworks (bottle, django, flask, pyramid, web.py, > wheezy.web) hosted in uWSGI/cpython2.7 and gunicorn/pypy1.9... you might find > it i

Re: 'indent'ing Python in windows bat

2012-09-19 Thread Albert Hopkins
On Tue, 2012-09-18 at 22:12 -0600, Jason Friedman wrote: > > I'm converting windows bat files little by little to Python 3 as I find time > > and learn Python. > > The most efficient method for some lines is to call Python like: > > python -c "import sys; sys.exit(3)" > > > > How do I "indent" if I

Re: subtle error slows code by 10x (builtin sum()) - replace builtin sum without using import?

2011-07-01 Thread Albert Hopkins
On Friday, July 1 at 19:17 (-0700), bdb112 said: > Question: > Can I replace the builtin sum function globally for test purposes so > that my large set of codes uses the replacement? > > The replacement would simply issue warnings.warn() if it detected an > ndarray argument, then call the origi

Re: float("nan") in set or as key

2011-05-28 Thread Albert Hopkins
On Sun, 2011-05-29 at 00:41 +0100, MRAB wrote: > Here's a curiosity. float("nan") can occur multiple times in a set or as > a key in a dict: > > >>> {float("nan"), float("nan")} > {nan, nan} > These two nans are not equal (they are two different nans) > except that sometimes it can't: > > >>

Re: changing current dir and executing a shell script

2011-05-28 Thread Albert Hopkins
On Sat, 2011-05-28 at 09:41 +0200, Peter Otten wrote: > > You don't want to do this because "cd" is a built-in shell command, > and > > subprocess does not execute within a shell (by default). > > The problem is not that cd is built-in, but that there is no shell at > all. > You can change that w

Re: changing current dir and executing a shell script

2011-05-27 Thread Albert Hopkins
On Fri, 2011-05-27 at 14:25 -0700, suresh wrote: > Hi, > I want to execute the following command line stuff from inside python. > $cd directory > $./executable > > I tried the following but I get errors > import subprocess > subprocess.check_call('cd dir_name;./executable') > > Due to filename p

Re: How To Make Fast Money Legally

2011-05-18 Thread Albert Hopkins
On Wed, 2011-05-18 at 15:48 -0400, D'Arcy J.M. Cain wrote: > On Wed, 18 May 2011 12:06:07 -0700 (PDT) > "tmac641...@yahoo.com" wrote: > > HOW TO MAKE EASY MONEY FAST AND LEGALLY > > Wow! Was this stuck in someone's mail queue since 1992? Me too! -- http://mail.python.org/mailman/listi

Re: FW: help please

2011-05-18 Thread Albert Hopkins
On Wed, 2011-05-18 at 13:39 +0100, Stuart MacKay wrote: > If you were required to answer the question then asking the poster to > phrase it better is going to help solve the issue faster but for a > mailing list like this simply ignore it. Which is what I've done. -- http://mail.python.org/ma

Re: FW: help please

2011-05-18 Thread Albert Hopkins
On Tue, 2011-05-17 at 21:46 -0300, Gabriel Genellina wrote: > En Tue, 17 May 2011 16:48:29 -0300, Albert Hopkins > escribió: > > On Tue, 2011-05-17 at 10:18 -0600, Littlefield, Tyler wrote: > > >> Not to be pedantic or anything, and I may not be able to help > >&

Re: FW: help please

2011-05-17 Thread Albert Hopkins
On Tue, 2011-05-17 at 10:18 -0600, Littlefield, Tyler wrote: > Not to be pedantic or anything, and I may not be able to help > regardless, but it looks like your space key is fixed, and I don't > really care to pick through and try to play hangman with your message. I actually, at first glance,

Re: if statement multiple or

2011-05-06 Thread Albert Hopkins
Correction: ('a' or 'b' or 'c') evaluates to 'a' -- http://mail.python.org/mailman/listinfo/python-list

Re: if statement multiple or

2011-05-06 Thread Albert Hopkins
On Fri, 2011-05-06 at 13:47 +0300, Lutfi Oduncuoglu wrote: > Hi, > > I am trying to write a script and I realised that I need to use > something like > > if ('a' or 'b' or 'c') not in line: >print line > The expression: ('a' or 'b' or 'c') evaluates to True True not in line Is

Re: PIL: The _imaging C module is not installed

2011-05-05 Thread Albert Hopkins
On Fri, 2011-05-06 at 01:45 +0200, Michel Claveau - MVP wrote: > Hi! > > > you need to install the appropriate libraries, among which are: > > libjpeg-devel > > freetype-devel > > libpng-devel > > OK, but where can I find it? I want use PIL with Python under Windows, > and I can't compile C's so

Re: PIL: The _imaging C module is not installed

2011-05-05 Thread Albert Hopkins
Oh I forgot to say, after installing these libraries, you will need to re-compile (install) PIL. -a -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL: The _imaging C module is not installed

2011-05-05 Thread Albert Hopkins
On Thu, 2011-05-05 at 15:35 +0200, Nico Grubert wrote: > Hi there > > I am having trouble to install PIL 1.1.7 on CentOS. > > I read and followed the instructions from > http://effbot.org/zone/pil-imaging-not-installed.htm > > However, I still get the "The _imaging C module is not installed" err

Re: How to concatenate unicode strings ???

2011-04-26 Thread Albert Hopkins
On Tue, 2011-04-26 at 17:58 +0200, Ariel wrote: > Hi everybody, how could I concatenate unicode strings ??? > What I want to do is this: > > unicode('this an example language ') + unicode('español') > > but I get an: > Traceback (most recent call last): > File "", line 1, in > UnicodeDecodeE

Re: Restarting a daemon

2011-04-26 Thread Albert Hopkins
On Tue, 2011-04-26 at 06:13 -0600, Jeffrey Barish wrote: > Not exactly a Python question, but I thought I would start here. > > I have a server that runs as a daemon. I can restart the server manually > with the command > > myserver restart > > This command starts a new myserver which first l

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Albert Hopkins
On Wed, 2010-12-01 at 02:14 +, MRAB wrote: > If the filenames are to be shown to a user then there needs to be a > mapping between bytes and glyphs. That's an encoding. If different > users use different encodings then exchange of textual data becomes > difficult. That's presentation, that's s

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-11-30 Thread Albert Hopkins
On Tue, 2010-11-30 at 11:52 +0100, Peter Otten wrote: Dan Stromberg wrote: > > > I've got a couple of programs that read filenames from stdin, and then > > open those files and do things with them. These programs sort of do > > the *ix xargs thing, without requiring xargs. > > > > In Python 2, t

Re: Why "flat is better than nested"?

2010-10-26 Thread Albert Hopkins
On Tue, 2010-10-26 at 09:45 -0700, John Nagle wrote: > On 10/25/2010 6:34 AM, Alex Willmer wrote: > > On Oct 25, 11:07 am, kj wrote: > >> In "The Zen of Python", one of the "maxims" is "flat is better than > >> nested"? Why? Can anyone give me a concrete example that illustrates > >> this point?

Re: PyCharm

2010-10-19 Thread Albert Hopkins
On Tue, 2010-10-19 at 10:05 -0700, CoffeeKid wrote: > Your video is childish When you have someone called "Kid" calling you childish... that's pretty low. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to detect a non-ASCII character in a list of strings.

2010-10-17 Thread Albert Hopkins
On Sun, 2010-10-17 at 14:59 -0500, Dun Peal wrote: > `all_ascii(L)` is a function that accepts a list of strings L, and > returns True if all of those strings contain only ASCII chars, False > otherwise. > > What's the fastest way to implement `all_ascii(L)`? > > My ideas so far are: > > 1. Matc

Re: Boolean value of generators

2010-10-15 Thread Albert Hopkins
On Fri, 2010-10-15 at 14:54 +, Grant Edwards wrote: > > so you could test for emptiness, look ahead at the next item without > > consuming it, etc. > > And what happens when the generator is doing things like executing > database transactions? You should also add prediction to the caching.

Re: Boolean value of generators

2010-10-14 Thread Albert Hopkins
On Thu, 2010-10-14 at 10:16 +0100, Tony wrote: > I have been using generators for the first time and wanted to check for > an empty result. Naively I assumed that generators would give > appopriate boolean values. For example > > def xx(): > l = [] > for x in l: > yield x > > y = xx() >

Re: How to find free resident memory in Linux using python

2010-10-02 Thread Albert Hopkins
On Sat, 2010-10-02 at 07:06 -0700, Sandy wrote: > Hi all, > I want to find how much free memory (RAM) is available in my system > using python. I tried psutil, parsing /proc/meminfo, top output etc > but not satisfied. For example my gnome-system-monitor gui shows I am > using 1GB (25%) of my RAM w

Re: Printing the name of a variable

2010-09-09 Thread Albert Hopkins
On Thu, 2010-09-09 at 12:43 -0700, Stephen Boulet wrote: > Does an arbitrary variable carry an attribute describing the text in > its name? I'm looking for something along the lines of: > > x = 10 > print x.name > >>> 'x' > > Perhaps the x.__getattribute__ method? Thanks. Variables are not objec

Re: SendKeys and Python 2.7

2010-09-09 Thread Albert Hopkins
On Thu, 2010-09-09 at 07:07 -0300, Jakson A. Aquino wrote: > Vim needs python 2.7 >From where do you base this assertion? I have been using vim 7.3 (with embedded python) with python 2.6 pretty much since it has been released. :version VIM - Vi IMproved 7.3 (2010 Aug 15, compiled

Re: The Samurai Principle

2010-09-07 Thread Albert Hopkins
On Mon, 2010-09-06 at 20:48 -0700, Phlip wrote: > Pythonistas: > > The "Samurai Principle" says to return victorious, or not at all. This > is why django.db wisely throws an exception, instead of simply > returning None, if it encounters a "record not found". How does that compare to, say, the "K

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Albert Hopkins
On Mon, 2010-09-06 at 17:37 -0700, ceycey wrote: > I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', > '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', > '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', > '9.0601']. What I want to do is

Re: Python [repair_cycorder_mov.py]

2010-09-05 Thread Albert Hopkins
On Sun, 2010-09-05 at 14:00 +, Steven D'Aprano wrote: > By the way, there's no need to send three messages in 10 minutes > asking > the same question, and adding FORM METHOD links to your post will > probably just get it flagged as spam by many people. Apparently it has, as I only got this

Re: Saving (unusual) linux filenames

2010-08-31 Thread Albert Hopkins
On Tue, 2010-08-31 at 16:49 +0200, amfr...@web.de wrote: > i have a script that reads and writes linux paths in a file. I save > the > path (as unicode) with 2 other variables. I save them seperated by "," > and > the "packets" by newlines. So my file looks like this: > path1, var1A, var1B > pa

Re: triangle python user's group?

2010-08-30 Thread Albert Hopkins
On Mon, 2010-08-30 at 12:38 -0700, Tim Arnold wrote: > Hi, > Is there a python users group in the Research Triangle Park area > (North Carolina, USA)? Google "triangle python user's group" -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Albert Hopkins
On Wed, 2010-08-18 at 06:58 -0700, Nan wrote: > Ah, I'd been told that there would be no conflict, and that this was > just reloading the configuration, not restarting Apache. > > I do need the web app to instruct Apache to reload because just before > this it's creating new VirtualHosts that need

Re: subprocess.Popen calling httpd reload never finishes

2010-08-17 Thread Albert Hopkins
On Tue, 2010-08-17 at 12:55 -0700, Nan wrote: > Hi folks -- > > I have a Python script running under Apache/mod_wsgi that needs to > reload Apache configs as part of its operation. The script continues > to execute after the subprocess.Popen call. The communicate() method > returns the correct t

Re: Python Script Cannot Write to Directory

2010-08-03 Thread Albert Hopkins
On Tue, 2010-08-03 at 21:01 -0700, Chris Brauchli wrote: > Hi, > > I am writing a script that, at one point, copies a file from directory > A to directory B. Directory B can only be written to by root, but the > script is always called with sudo, so this shouldn't be an issue, but > it is. I have

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

2010-08-01 Thread Albert Hopkins
On Mon, 2010-08-02 at 01:08 +0200, candide wrote: > Python is an object oriented langage (OOL). The Python main > implementation is written in pure and "old" C90. Is it for historical > reasons? > > C is not an OOL and C++ strongly is. I wonder if it wouldn't be more > suitable to implement an

Re: measuring a function time

2010-07-30 Thread Albert Hopkins
On Fri, 2010-07-30 at 14:28 +0200, Hrvoje Niksic wrote: > Steven D'Aprano writes: > > > On Thu, 29 Jul 2010 14:42:58 +0200, Matteo Landi wrote: > > > >> This should be enough > >> > >import time > >tic = time.time() > >function() > >toc = time.time() > >print toc - tic > > >

Re: Possible to include \n chars in doctest code samples or output?

2010-07-16 Thread Albert Hopkins
On Fri, 2010-07-16 at 01:26 -0400, pyt...@bdurham.com wrote: > I understand what you're saying, but I'm struggling with how to > represent the following strings in doctest code and doctest results. > No > matter what combination of backslashes or raw strings I use, I am > unable > to find a way to

Re: Python 2.4.2 Installation error

2010-07-01 Thread Albert Hopkins
On Thu, 2010-07-01 at 21:51 +0530, Dhilip S wrote: > Hello Everyone.. > > I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 > got error message while doing make command. anybody can tell tell, How > to overcome this error "this" error apparently did not get included in you

Re: Scan until random delimiter.

2010-06-27 Thread Albert Hopkins
On Sun, 2010-06-27 at 22:41 +0200, Laurent Verweijen wrote: > In contrast to java or c python seems not be able to use a random > delimiter. > > In java, you can do: > > > Code: > > import java.util.Scanner > > Scanner sc = new Scanner(System.in).useSeperator(" ") > int a = sc.nextInt() > >

Re: I strongly dislike Python 3

2010-06-26 Thread Albert Hopkins
Python 3 is, by design, not 100% backwards compatible with Python 2. Not that I'm completely happy with everything in Python 3 but, in it's defense, discussion of Python 3 has been ongoing for years, almost as long as the existence of Python 2. So the discussion of what went into Python 3 is so o

Re: Import fails (newbie)

2010-06-17 Thread Albert Hopkins
On Thu, 2010-06-17 at 12:04 -0700, mhorlick wrote: > Hello, > > I'm a newbie and I have a small problem. After invoking IDLE --> > > Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > >>> imp

Re: Challenging Job Opportunity for a C# Architect/ Developer

2010-06-01 Thread Albert Hopkins
On Tue, 2010-06-01 at 19:44 -0700, rzzzwilson wrote: > http://www.catb.org/~esr/faqs/smart-questions.html#forum werd. -- http://mail.python.org/mailman/listinfo/python-list

Re: max time wait for a function

2010-05-18 Thread Albert Hopkins
On Tue, 2010-05-18 at 02:45 -0700, pacopyc wrote: > Hi, I've a question for you. I'd like to call a function and waiting > its return value for a time max (30 sec). > The function could not respond and then I must avoid to wait for > infinite time. OS is Windows XP. > Can you help me? > > Thank T

Re: Django as exemplary design

2010-05-06 Thread Albert Hopkins
On Thu, 2010-05-06 at 16:38 -0700, Patrick Maupin wrote: > I don't know how this applies to reading other peoples' code, but > recent research shows we learn more from success than failure That's good to learn, because for years I have been intentionally failing in order to learn from it and beco

Re: pythonrag

2010-04-05 Thread Albert Hopkins
On Mon, 2010-04-05 at 11:38 +, Jason Friedman wrote: > I saw this posted in the July issue but did not see any follow-up there: > > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
This appears to be Issue 5380[1] which is still open. I've cc'ed myself to that issue. [1] http://bugs.python.org/issue5380 -- http://mail.python.org/mailman/listinfo/python-list

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
On Tue, 2010-03-02 at 17:32 +, MRAB wrote: > The documentation also mentions the 'pty' module. Have you tried that > instead? I tried to use pty.fork() but it also produces the same error. I also tried passing 'r', and 'rb' to fdopen() but it didn't make any difference. -a -- http://mail

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
On Tue, 2010-03-02 at 17:32 +, MRAB wrote: > The documentation also mentions the 'pty' module. Have you tried that > instead? I haven't but I'll give it a try. Thanks. -a -- http://mail.python.org/mailman/listinfo/python-list

Re: os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
On Tue, 2010-03-02 at 13:25 -0500, Terry Reedy wrote: > To get help, or report a bug, for something like this, be as specific as > possible. 'Linux' may be too generic. This is on Python on Gentoo Linux x64 with kernel 2.6.33. > > > However, with CPython 3.1 I get: > > > > input =

os.fdopen() issue in Python 3.1?

2010-03-02 Thread Albert Hopkins
I have a snippet of code that looks like this: pid, fd = os.forkpty() if pid == 0: subprocess.call(args) else: input = os.fdopen(fd).read() ... This seems to work find for CPython 2.5 and 2.6 on my Linux system. However, with CPython 3.1 I

Re: pythonpath

2010-03-01 Thread Albert Hopkins
On Mon, 2010-03-01 at 02:48 -0800, luca72 wrote: > Sorry for my stupid question if i have to load module from a folder i > have to append it to the sys path the folder? > ex: > if my folder module is /home/lucak904/Scrivania/Luca/enigma2 > i do this : > import sys > sys.path.append('/home/lucak90

Re: Detecting new removable drives in Linux

2010-03-01 Thread Albert Hopkins
On Mon, 2010-03-01 at 10:48 +0100, Bart Smeets wrote: > Hello, > > > I'm trying to write a script which detects when a new removable drive > is connected to the computer. On #python I was advised to use the > dbus-bindings. However the documentation on this is limited. Does > anyone know of an ex

Re: import bug

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 16:27 +, kj wrote: > >2) this has been fixed in Py3 > > In my post I illustrated that the failure occurs both with Python > 2.6 *and* Python 3.0. Did you have a particular version of Python > 3 in mind? I was not able to reproduce with my python3: $ head ham/*

Re: Are *.pyd's universal?

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 23:58 +1300, Lawrence D'Oliveiro wrote: > I just checked my Debian installation: > > l...@theon:~> find /lib /usr/lib -name \*.so -a -not -name lib\* > -print | wc -l > 2950 > l...@theon:~> find /lib /usr/lib -name \*.so -print | wc -l > 4708 > > So 63% of th

Re: Python 2.6.4: ./configure does not work

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 03:07 -0700, knipknap wrote: > Hi, > > Running ./configure in the 2.6.4 sources produces the following error: > > config.status: error: cannot find input file: Makefile.pre.in > > Indeed, such a file is not contained anywhere in the Pakage. Which sources are you referring

Re: datetime question

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 20:34 +1100, Ben Finney wrote: > Fixing ‘time’, ‘datetime’, and ‘calendar’ was the reason for Python 3? > No, it wasn't. > > Or perhaps you mean that any backward-incompatible change was a reason > to have Python 3? Even more firmly no. The extent of changes was > severely li

Re: datetime question

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 10:08 +1100, Ben Finney wrote: > The ‘datetime’ module focusses on individual date+time values (and the > periods between them, with the ‘timedelta’ type). > > For querying the properties of the calendar, use the ‘calendar’ > module. > > Yes, it would be nice if the ‘time’,

Re: Are *.pyd's universal?

2009-10-31 Thread Albert Hopkins
On Sat, 2009-10-31 at 21:32 +1300, Lawrence D'Oliveiro wrote: > Modules will sometimes find > > themselves on the path in Windows, so the fact that Windows performs > a > > library search on the path is quite significant. > > Why is it only Windows is prone to this problem? I think as someone po

Re: OT: DARPA red balloon challenge

2009-10-30 Thread Albert Hopkins
On Thu, 2009-10-29 at 20:27 -0700, Adam N wrote: [...] > On December 5, DARPA will raise 10 red weather balloons somewhere in > the US. The first person to get the location of all 10 balloons and > submit them will be given $40k. Hasn't the U.S. had enough weather balloon-related publicity stunt

Re: Aaaargh! "global name 'eggz' is not defined"

2009-10-29 Thread Albert Hopkins
On Thu, 2009-10-29 at 17:27 -0500, Robert Kern wrote: > I consider "import *" the first error to be fixed, so it doesn't > bother me much. :-) But does pyflakes at least *warn* about the use of "import *" (I've never used it so just asking)? -- http://mail.python.org/mailman/listinfo/python-li

Re: popen function of os and subprocess modules

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 07:15 -0700, banu wrote: > > Thanks for the reply Jon > Basically I need to move into a folder and then need to execute some > shell commands(make etc.) in that folder. I just gave 'ls' for the > sake of an example. The real problem I am facing is, how to stay in > the folder

Re: Web development with Python 3.1

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote: > > return HttpResponse(unmaintanable_html % data) > > > > That's fine for single variables, but if I need to output a table of > unknown rows? I assume that return means the end of the script. > Therefore I should shove the whole table into a

Re: Web development with Python 3.1

2009-10-28 Thread Albert Hopkins
On Wed, 2009-10-28 at 15:32 +0200, Dotan Cohen wrote: > > def index(request): > >unmaintanable_html = """ > > > > > >Index > > > > > >Embedded HTML is a PITA > >but some like pains... > > > > > > """ > >return HttpResponse(unmaintanable_html) > > > > And if I need to

Re: Passing values from html to python

2009-10-22 Thread Albert Hopkins
On Thu, 2009-10-22 at 10:44 +0200, Ahmed Barakat wrote: > Hi guys, > > I am new to python and wed-development, I managed to have some nice > example running up till now. > I am playing with google app engine, I have this situation: > > I have a text box in an html page, I want to get the value in

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 09:17 -0700, dpapathanasiou wrote: > > Which is *really* difficult (for me) to read. Any chance of providing a > > "normal" traceback? > > File "/opt/server/smtp/smtps.py", line 213, in handle > email_replier.post_reply(recipient_mbox, ''.join(data)) > File "/opt/ser

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 08:16 -0700, dpapathanasiou wrote: > > And where might we be able to see that stack trace? > > This is it: > > Exception: ('AttributeError', '', [' File "/opt/server/smtp/ > smtps.py", line 213, in handle\ne > mail_replier.post_reply(recipient_mbox, \'\'.join(data))\n',

Re: Parsing email attachments: get_payload() produces unsaveable data

2009-10-04 Thread Albert Hopkins
On Sun, 2009-10-04 at 07:27 -0700, dpapathanasiou wrote: > When I try to write the filedata to a file system folder, though, I > get an AttributeError in the stack trace. And where might we be able to see that stack trace? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: creating class objects inside methods

2009-10-04 Thread Albert Hopkins
Just by a brief look at your code snippet there are a few things that I would point out, stylistically, that you may consider changing in your code as they are generally not considered "pythonic": * As already mentioned the "state" class is best if given a name that is capitalized.

Re: Opinions, please, on PEP 8 and local, 3rd party imports

2009-10-02 Thread Albert Hopkins
On Fri, 2009-10-02 at 20:22 -0400, Simon Forman wrote: > 2.5 +1 I'd like to suggest 2.46 instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: UnboundLocalError with extra code after return

2009-09-29 Thread Albert Hopkins
On Tue, 2009-09-29 at 21:15 -0700, Rich Healey wrote: > However: > > def callonce(func): > def nullmethod(): pass > def __(): > return func() > func = nullmethod > return ret > return __ > > @callonce > def t2(): > print "T2 called" > t2() > > Gives me: >

Re: Is there a similar mailing list about django?

2009-09-13 Thread Albert Hopkins
On Sun, 2009-09-13 at 18:46 -0400, Joel Goldstick wrote: > Thanks.. I saw the google group, but I was hoping for a list that I > can > read in my thunderbird client. Thanks all for the good pointers And if you simply go to the Django web site and click on "Community" there is a form where you ca

Re: Is there a similar mailing list about django?

2009-09-13 Thread Albert Hopkins
On Sun, 2009-09-13 at 21:27 +0200, Andreas Waldenburger wrote: > Didn't like http://groups-beta.google.com/group/django-users ? > > (Second hit for "django mailing list", but I know Google results vary > from country to country, so you might not have seen it.) Or, better yet, go to Django's web s

Re: How to define a function with an empty body?

2009-09-13 Thread Albert Hopkins
On Sat, 2009-09-12 at 22:37 -0500, Peng Yu wrote: > Hi, > > I want to define a function without anything in it body. In C++, I can > do something like the following because I can use "{}" to denote an > empty function body. Since python use indentation, I am not sure how > to do it. Can somebody l

Re: How can I use my modules here?

2009-09-11 Thread Albert Hopkins
On Fri, 2009-09-11 at 02:29 -0700, Chris Rebert wrote: > For some reason, your Python program is being executed by bash as if > it were a shell script, which it's not. > No idea what the cause is though. Because the first 2 bytes of the file need to be #!/path/to/interpreter, the OP has:

Re: AttributeError: 'module' object has no attribute 'pack'

2009-09-10 Thread Albert Hopkins
On Thu, 2009-09-10 at 21:07 +0300, Sampsa Riikonen wrote: > Dear List, > > I have a freshly installed opensuse 11.2 and I am experiencing the following > problem with the module "subprocess": > > sam...@linux-912g:~> python > Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) > [GCC 4.3.2 [gcc-4_3-bra

Re: start default application for read a pdf from python

2009-09-08 Thread Albert Hopkins
On Tue, 2009-09-08 at 22:22 +0200, Angelo Ballabio wrote: > My problem is a way to run a default application to read and show a > pdf > file from unix or windows, i have a mixed ambient in the office, so I > am > try to find a way to start a application to show this pdf file I > generate whith r

Re: wxGlade question - How to add new event to a button in events tab?

2009-09-08 Thread Albert Hopkins
Could you not post the exact same message 3 times within an hour? -- http://mail.python.org/mailman/listinfo/python-list

Re: Usage of main()

2009-09-04 Thread Albert Hopkins
On Fri, 2009-09-04 at 22:55 +1000, Ben Finney wrote: > * having a module that can be imported without side effects helps > select > pieces of the module's functionality > > * any module should be importable without side effects to make it > easier > to run unit tests for that module > +1 --

Re: Try Except Problem

2009-09-03 Thread Albert Hopkins
On Tue, 2009-09-01 at 13:45 -0500, Victor Subervi wrote: > Hi: I have this code: [blah] It's hard to tell because: 1. You posted code in HTML format, which is really hard to read 2. Even when viewed as plain text, you use non-standard indentation which is really hard to read

Re: issue with grep command

2009-09-03 Thread Albert Hopkins
On Thu, 2009-09-03 at 11:51 -0700, Jul wrote: [Stuff about tcsh and grep deleted] What on earth does this have to do with Python? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for 64bit Linux version

2009-09-03 Thread Albert Hopkins
On Thu, 2009-09-03 at 13:30 -0500, Bhanu Srinivas Mangipudi wrote: > > I just want to that s there a 64 bit Linux version for python ? if yes > can you provide me any links for it.I could find a 64bit windows > version but could not find Linuux version If you are using a 64bit Linux distribution

Re: Is behavior of += intentional for int?

2009-08-30 Thread Albert Hopkins
On Sun, 2009-08-30 at 04:49 -0700, Carl Banks wrote: > It's pretty common for people coming from "name is a location in > memory" languages to have this conception of integers as an > intermediate stage of learning Python's object system. Even once > they've understood "everything is an object" an

Re: Is behavior of += intentional for int?

2009-08-30 Thread Albert Hopkins
On Sun, 2009-08-30 at 10:44 +, Steven D'Aprano wrote: > It also follows from the idea that there is one abstract entity which > English speakers call "three" and write as 3. There's not two > identical > entities with value 3, or four, or a million of them, only one. That's not true. There

Re: [OT] How do I reply to a thread by sending a message to python-list@python.org

2009-08-28 Thread Albert Hopkins
On Fri, 2009-08-28 at 19:04 +1000, Xavier Ho wrote: > On Fri, Aug 28, 2009 at 6:54 PM, Ben Finney +pyt...@benfinney.id.au> wrote: > Fortunately, the messages that come from the list enable any > mail client > to know the correct address for “reply to list”. It only >

Re: (Simple?) Unicode Question

2009-08-27 Thread Albert Hopkins
On Thu, 2009-08-27 at 22:09 +0530, Shashank Singh wrote: > Hi All! > > I have a very simple (and probably stupid) question eluding me. > When exactly is the char-set information needed? > > To make my question clear consider reading a file. > While reading a file, all I get is basically an array

  1   2   3   >