Error importing __init__ declared variable from another package

2012-02-27 Thread Jason Veldicott
Hi, I have a simple configuration of modules as beneath, but an import error is reported: /engine (__init__ is empty here) engine.py /sim __init__.py The module engine.py imports a variable instantiated in sim.__init__ as follows: from sim import var_name var_name.func() The fo

Question about sub-packages

2012-02-27 Thread Frank Millman
Hi all This is a follow-up to my recent question about circular imports, but on a different subject, hence the new thread. My application has grown to the point that it makes sense to split it up into sub-packages. >From a certain point of view, each package can be said to have an API, not ju

Re: America's CONTEMPTUOUS KANGAROO courts VERSUS ISRAELI courts (in JEW-vs-JEW case)

2012-02-27 Thread Ian Kelly
On Mon, Feb 27, 2012 at 8:13 PM, Tonico wrote: > Idiot Please don't reply to spam. You're just making it show up in the inboxes of those of us who already have these idiots kill-filed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about circular imports

2012-02-27 Thread OKB (not okblacke)
Frank Millman wrote: >> >> To avoid the tedious reference, follow this with >> read = sound.formats.wavread # choose the identifier you prefer >> > > @Terry and OKB > > I tried that, but it does not work. > > a.py > /b > __init__.py > c.py >d.py > > a.py - > from b import c > c

Re: America's CONTEMPTUOUS KANGAROO courts VERSUS ISRAELI courts (in JEW-vs-JEW case)

2012-02-27 Thread Tonico
On Feb 28, 12:43 am, small Pox wrote: > America's KANGAROO courts VERSUS ISRAELI courts (in JEW-vs-JEW case > atleast) > > This message is in part to the FBI racists as well as well as to the > RACIST KANGAROO courts of AMERICA. > > In the Jew rapist, Roman Polansky versus Semantha Geimi (Gentile

wcout issue

2012-02-27 Thread Ben Held
Hello, After upgrading from Python 2.6 to 3.2 in our application we noticed that after calling Py_Initialize, our output from std::wcout has extra spaces in it: wcout << L"Just a test\n"; now prints out: J u s t a t e s t Any clue why? Ben Held -- http://mail.python.org/mailman/listinfo

Re: Udacity CS 101

2012-02-27 Thread Ray Clark
On Feb 25, 4:20 pm, Josh English wrote: > Has anyone here looked at Udacity's open CS101 course > (http://www.udacity.com/overview/Course/cs101) that started this week? The > goal of the seven week course is to build a web crawler. > > So far, I'm not impressed with the speed or content of the c

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread MRAB
On 27/02/2012 16:57, Eric Frederich wrote: Still freezing sometimes, like 1 out of 10 times that I run it. Here is updated code and a couple of outputs. [snip] I don't know what the problem is. All I can suggest is a slightly modified version. If a worker that says it's terminating without fir

Re: Question about circular imports

2012-02-27 Thread Ian Kelly
On Mon, Feb 27, 2012 at 6:01 PM, Terry Reedy wrote: > On 2/27/2012 1:16 AM, Frank Millman wrote: >>> >>> >>> To avoid the tedious reference, follow this with >>> read = sound.formats.wavread # choose the identifier you prefer > > > I tested something like this with stdlib, but there must be some i

Re: Question about circular imports

2012-02-27 Thread Terry Reedy
On 2/27/2012 1:16 AM, Frank Millman wrote: To avoid the tedious reference, follow this with read = sound.formats.wavread # choose the identifier you prefer I tested something like this with stdlib, but there must be some important difference I did not notice. It make be in the contents of __

Re: Python math is off by .000000000000045

2012-02-27 Thread Michael Torrie
On 02/27/2012 10:28 AM, Ethan Furman wrote: > jmfauth wrote: >> On 25 fév, 23:51, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: >>> On Sat, 25 Feb 2012 13:25:37 -0800, jmfauth wrote: >>> (2.0).hex() '0x1.0p+1' >>> (4.0).hex() '0x1.0p+2' >>>

Re: Python urllib2 problem: Name or service not known

2012-02-27 Thread Steven D'Aprano
On Mon, 27 Feb 2012 12:48:27 -0800, Alex Borghgraef wrote: > Hi all, > > Some time ago I've written some python code to read video data off an IP > camera connected via a router to a laptop. Now I try to run this code on > a different laptop and router combination, but now I can't access the > ca

Transfer files via bluetooth for Blackberry devices

2012-02-27 Thread isragaytan
Hi! I am newby on python. I am looking for a utility or a library for transfer files via bluetooth to blackberry. I am seeing that with obex may be is an option. Can you give me any advices on that?. Really appreciated Thanks! -- http://mail.python.org/mailman/listinfo/python-list

America's CONTEMPTUOUS KANGAROO courts VERSUS ISRAELI courts (in JEW-vs-JEW case)

2012-02-27 Thread small Pox
America's KANGAROO courts VERSUS ISRAELI courts (in JEW-vs-JEW case atleast) This message is in part to the FBI racists as well as well as to the RACIST KANGAROO courts of AMERICA. In the Jew rapist, Roman Polansky versus Semantha Geimi (Gentile Minor Girl) the JEW RAPIST Roman Polansky sits FREE

PEP 414 has been accepted

2012-02-27 Thread Vinay Sajip
PEP 414 has been accepted: http://mail.python.org/pipermail/python-dev/2012-February/116995.html This means that from Python 3.3 onwards, you can specify u'xxx' for Unicode as well as just 'xxx'. The u'xxx' form is not valid syntax in Python 3.2, 3.1 or 3.0. The idea is to make porting code from

Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-02-27 Thread Ben Finney
Benjamin Peterson writes: > Ben Finney benfinney.id.au> writes: > > > > Putting “RELEASED” in the subject, when they're not released and are > > instead *candidates for* release, is confusing and muddies the issue of > > what you even mean by “release”. > > > > {alpha, beta, release candidate,

Python urllib2 problem: Name or service not known

2012-02-27 Thread Alex Borghgraef
Hi all, Some time ago I've written some python code to read video data off an IP camera connected via a router to a laptop. Now I try to run this code on a different laptop and router combination, but now I can't access the camera. Some minimal example code: import urllib2 url = urllib2.urlo

Re: How can I make an instance of a class act like a dictionary?

2012-02-27 Thread Benjamin Kaplan
On Mon, Feb 27, 2012 at 3:09 PM, John Salerno wrote: > On Feb 27, 1:39 am, Chris Rebert wrote: >> On Sun, Feb 26, 2012 at 11:24 PM, John Salerno wrote: >> > Hi everyone. I created a custom class and had it inherit from the >> > "dict" class, and then I have an __init__ method like this: >> >> >

Re: How can I make an instance of a class act like a dictionary?

2012-02-27 Thread John Salerno
On Feb 27, 1:39 am, Chris Rebert wrote: > On Sun, Feb 26, 2012 at 11:24 PM, John Salerno wrote: > > Hi everyone. I created a custom class and had it inherit from the > > "dict" class, and then I have an __init__ method like this: > > > def __init__(self): > >        self = create() > > > The crea

Re: Question about circular imports

2012-02-27 Thread Ian Kelly
On Sun, Feb 26, 2012 at 3:42 AM, Frank Millman wrote: > Hi all > > I seem to have a recurring battle with circular imports, and I am trying to > nail it once and for all. > > Let me say at the outset that I don't think I can get rid of circular > imports altogether. It is not uncommon for me to fi

Re: pickle handling multiple objects ..

2012-02-27 Thread Ian Kelly
On Sun, Feb 26, 2012 at 6:00 AM, Chris Angelico wrote: > Additionally, you'll get a weird crash out of your program if load() > returns something other than a sequence of length 3. Remember, > everything that comes from outside your code is untrusted, even if you > think you made it just two secon

Re: Python math is off by .000000000000045

2012-02-27 Thread Ethan Furman
jmfauth wrote: On 25 fév, 23:51, Steven D'Aprano wrote: On Sat, 25 Feb 2012 13:25:37 -0800, jmfauth wrote: (2.0).hex() '0x1.0p+1' (4.0).hex() '0x1.0p+2' (1.5).hex() '0x1.8p+0' (1.1).hex() '0x1.1999ap+0' jmf What's your point? I'm afraid my cr

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread Eric Frederich
Still freezing sometimes, like 1 out of 10 times that I run it. Here is updated code and a couple of outputs. code #!/usr/bin/env python import sys import Queue import multiprocessing import time def FOO(a, b, c): print 'foo', a, b, c return (a + b) * c class MyWorker(mu

Re: emacs user interface design? a talk by Bret Victor

2012-02-27 Thread Brad
On Feb 26, 7:01 pm, NanoThermite FBibustards wrote: > @Xah Lee, he only tell one point, fast interpreter avoiding Edit- > Compile-Run cycle, and make it INTERACTIVE, the guy did not teach > nothing of design. The principle was first given by Margaret Hamilton > and Zeldin. > Bret's main point is t

Re: Python math is off by .000000000000045

2012-02-27 Thread Michael Torrie
On 02/27/2012 08:02 AM, Grant Edwards wrote: > On 2012-02-27, Steven D'Aprano wrote: >> On Sun, 26 Feb 2012 16:24:14 -0800, John Ladasky wrote: >> >>> Curiosity prompts me to ask... >>> >>> Those of you who program in other languages regularly: if you visit >>> comp.lang.java, for example, do peop

Re: windows executable calling python script

2012-02-27 Thread Andrea Crotti
On 02/27/2012 02:21 PM, Andrea Crotti wrote: At the moment I ended up with something like this: #include #include #include #include // the function takes as arguments only the python interpreter full path int main(int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "Usage = ./

Re: Python math is off by .000000000000045

2012-02-27 Thread Grant Edwards
On 2012-02-27, Steven D'Aprano wrote: > On Sun, 26 Feb 2012 16:24:14 -0800, John Ladasky wrote: > >> Curiosity prompts me to ask... >> >> Those of you who program in other languages regularly: if you visit >> comp.lang.java, for example, do people ask this question about >> floating-point arithme

Re: Question about circular imports

2012-02-27 Thread Jean-Michel Pichavant
Frank Millman wrote: Hi all I seem to have a recurring battle with circular imports, and I am trying to nail it once and for all. Let me say at the outset that I don't think I can get rid of circular imports altogether. It is not uncommon for me to find that a method in Module A needs to ac

Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-02-27 Thread Jean-Michel Pichavant
Ben Finney wrote: Chris Angelico writes: On Sun, Feb 26, 2012 at 7:51 PM, Ben Finney wrote: If you're pleased to announce their immediate availability, then please do that! Isn't it perfectly accurate to say that the RCs are now available? Yes. What's not reasonab

Re: windows executable calling python script

2012-02-27 Thread Andrea Crotti
On 02/27/2012 01:57 PM, Andrea Crotti wrote: I am creating an installer for python projects, using CMake and NSIS. Now my goal is to be able to select at installer time the python executable that will run that project, and then associate them. I saw that setuptools is able to generate exe wra

Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3

2012-02-27 Thread Benjamin Peterson
Ben Finney benfinney.id.au> writes: > > Putting “RELEASED” in the subject, when they're not released and are > instead *candidates for* release, is confusing and muddies the issue of > what you even mean by “release”. > {alpha, beta, release candidate, final} \subsetof releases -- http://mai

Re: pickle handling multiple objects ..

2012-02-27 Thread 88888 Dihedral
在 2012年2月26日星期日UTC+8下午9时00分31秒,Chris Angelico写道: > On Sun, Feb 26, 2012 at 11:04 PM, Peter Otten <__pete...@web.de> wrote: > > This is however a bit errorprone. If you accidentally write the loading code > > as > > > > fruit, beverages, vegetables = pickle.load(f) > > > > you'll end up drinking pot

windows executable calling python script

2012-02-27 Thread Andrea Crotti
I am creating an installer for python projects, using CMake and NSIS. Now my goal is to be able to select at installer time the python executable that will run that project, and then associate them. I saw that setuptools is able to generate exe wrappers, but how does that work exactly? From w

setting the length of the backtrace output in pdb

2012-02-27 Thread Matt Funk
Hi, this might be a rather silly question, but i cannot figure out how to make pdb give me more than 10 lines of output whenever i issue a backtrace command. Is there an easy way to do this? thanks matt -- http://mail.python.org/mailman/listinfo/python-list

Re: [semi OT]: Smartphones and Python?

2012-02-27 Thread Amirouche Boubekki
for which I could write Python programs. > Android is good bet, kivy has official support for it http://kivy.org/docs/guide/android.html -- http://mail.python.org/mailman/listinfo/python-list

Re: FBI **B-U-S-T-A-R-D-S** pays a fine of 5.8 Million to Steven Hatfill + Judge Sanctions FBI Re: * * * kangaroo courts of amierca * * *

2012-02-27 Thread R Kym Horsell
In sci.physics NanoThermite FBibustards wrote: > test fail. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-27 Thread Neil Cerutti
On 2012-02-26, Wolfgang Meiners wrote: > but it really does not look intuitive. Hmm. My idea was that > None is a perfect Value for infinity since there is no > infinitely large number. But as i see it, you must have two > comparisons then. Maybe someone has a better idea? I do. A truncated strin

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-27 Thread Jean-Michel Pichavant
Rick Johnson wrote: On Feb 25, 11:54 am, MRAB wrote: [...] That should be: if maxlength is not None and len(string) <= maxlength: Using "imaginary" infinity values defiles the intuitive nature of your code. What is more intuitive? def confine_length(string, maxlength=INFINITY): i

Re: How can I make an instance of a class act like a dictionary?

2012-02-27 Thread Dan Sommers
On Sun, 26 Feb 2012 23:24:31 -0800, John Salerno wrote: > Hi everyone. I created a custom class and had it inherit from the "dict" > class, and then I have an __init__ method like this: > I know I could do self.variable = create() and that works fine, but I > thought it would be better (and clean

Re: From Cain To Khazaria: The True Genealogy of the Jewish People, Documented From the Bible and From Jewish Writings

2012-02-27 Thread Tonico
On Feb 27, 11:38 am, NanoThermite FBibustards wrote: > A copy of “The Great Impersonation” can be obtained for $37 (Postpaid) > from my website,www.anglo-saxonisrael.comvia Paypal, or by mail from > ANP POB 411373, Chicago IL 60641. > > From Cain To Khazaria: > > The True Genealogy of the Jewish P

Re: Numerical Linear Algebra in arbitrary precision

2012-02-27 Thread Albert van der Horst
In article , Ken wrote: >Brand new Python user and a bit overwhelmed with the variety of >packages available. Any recommendation for performing numerical >linear algebra (specifically least squares and generalized least >squares using QR or SVD) in arbitrary precision? I've been looking at >mpm

Re: FBI **B-U-S-T-A-R-D-S** pays a fine of 5.8 Million to Steven Hatfill + Judge Sanctions FBI Re: * * * kangaroo courts of amierca * * *

2012-02-27 Thread NanoThermite FBibustards
test -- http://mail.python.org/mailman/listinfo/python-list