Hi,
I wonder if someone can help me with a function I need for programming my robot.
I want to update an 2D occupancy grid based on sonar data. The sonar “view
angle” is cone shaped. So I need to calculate all cells of a 30° slice of a
filled circle.
Something like this: http://www.intechopen.co
On Sun, Nov 24, 2013 at 5:30 PM, Victor Hooi wrote:
> The advice seems to be either to run it from the parent directory of
> furniture with:
>
> python -m furniture.chair.build_chair
Yes. More pedantically, run it from somewhere such that the furniture
package is importable. For example, if
On 11/24/2013 06:55 PM, Himanshu Garg wrote:
> I want that a script should only be executed when it is called from
> another script and should not be directly executable through linux
> command line.
>
> Like, I have two scripts "scrip1.py" and "script2.py" and there is a
> line in "script1.py" t
On Sun, 24 Nov 2013 17:55:08 -0800 (PST), Himanshu Garg
wrote:
Like, I have two scripts "scrip1.py" and "script2.py" and there is
a line in "script1.py" to call "script2.py" as
subprocess.call(["python", "script2.py"]).
Then this is should call script2 but I should not be able to
directly
On Mon, Nov 25, 2013 at 12:55 PM, Himanshu Garg wrote:
> I want that a script should only be executed when it is called from another
> script and should not be directly executable through linux command line.
>
> Like, I have two scripts "scrip1.py" and "script2.py" and there is a line in
> "scr
I want that a script should only be executed when it is called from another
script and should not be directly executable through linux command line.
Like, I have two scripts "scrip1.py" and "script2.py" and there is a line in
"script1.py" to call "script2.py" as subprocess.call(["python", "scri
Hi,
Ok, this is a topic that I've never really understood properly, so I'd like to
find out what's the "proper" way of doing things.
Say I have a directory structure like this:
furniture/
__init__.py
chair/
__init__.py
config.yaml
build_ch
On 11/24/2013 02:00 PM, Larry Hastings wrote:
Python 3.4 includes a range of improvements of the 3.x series, including
hundreds of small improvements and bug fixes. Major new features and
changes in the 3.4 release series include:
Whoops, sorry, I missed a couple of PEPs there:
* PEP 428, a "
On behalf of the Python development team, it's my privilege to announce
the first beta release of Python 3.4.
This is a preview release, and its use is not recommended for
production settings.
Python 3.4 includes a range of improvements of the 3.x series, including
hundreds of small improvement
On 24/11/2013 17:12, Ruben van den Berg wrote:
I'm on Windows XP SP3, Python 2.7.1. On running
import cx_Oracle
I got the error
ImportError: DLL load failed: This application has failed to start because the
application configuration is incorrect. Reinstalling the application may fix
this pro
On Saturday 2013 November 23 23:32, Devin Jeanpierre wrote:
> This list needs stronger moderation
Rule #1: The ML should not disseminate any message which contains an
unquoted "please".
--
Yonder nor sorghum stenches shut ladle gulls stopper torque wet
strainers.
--
https://mail.python.org/m
On Mon, Nov 25, 2013 at 4:12 AM, Ruben van den Berg
wrote:
> ImportError: DLL load failed: This application has failed to start because
> the application configuration is incorrect. Reinstalling the application may
> fix this problem.
>
> I then ran Dependency Walker on cx_Oracle.pyd. Its first
I'm on Windows XP SP3, Python 2.7.1. On running
import cx_Oracle
I got the error
ImportError: DLL load failed: This application has failed to start because the
application configuration is incorrect. Reinstalling the application may fix
this problem.
I then ran Dependency Walker on cx_Oracle.
On 24/11/2013 14:15, Steven D'Aprano wrote:
That was the case up to 3.3, but Python 3.4 has the import machinery re-
written in pure Python (except for a tiny bit of bootstrapping machinery,
if I understand correctly). I understand that nobody understood the
import machinery in full (although th
Op 24-11-13 12:03, Peter Otten schreef:
> Antoon Pardon wrote:
>
>> Op 23-11-13 10:01, Peter Otten schreef:
>>
>>>
>>> Your script is saying that a staticmethod instance is not a callable
>>> object. It need not be because
>>>
>>> Foo.foo()
>>>
>>> doesn't call the Foo.foo attribute directly, it c
Op 24-11-13 11:43, Peter Otten schreef:
> Antoon Pardon wrote:
>
>> Foo.foo() being legal and Foo.foo not being callable is IMO a bug in
>> python.
>
> Foo.foo() is legal, and Foo.foo is callable.
Indeed, I had a kink in my brain which made it difficult to see
where I was going wrong myself. So
On Mon, 25 Nov 2013 01:37:12 +1100, Chris Angelico wrote:
> class Magic_HTTP_Thing:
> @property
> def attribute(self):
> result = CallableString(self.do_get())
> result.function = lambda: self.do_put()
> return result
> def do_get(self):
> # Do a HTTP GE
On 24/11/2013 14:27, Steven D'Aprano wrote:
On Sat, 23 Nov 2013 19:53:32 +, Rotwang wrote:
On 22/11/2013 11:26, Steven D'Aprano wrote:
A frequently missed feature is the ability to chain method calls:
[...]
chained([]).append(1).append(2).append(3).reverse().append(4) =>
returns [3, 2, 1
On Mon, Nov 25, 2013 at 1:48 AM, Marc Aymerich wrote:
> But still I'll reconsider an interface with less magic :P
Yeah, I would definitely recommend that :) Magic can be fun sometimes,
but it's often not worth the hassle.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Nov 24, 2013 at 3:37 PM, Chris Angelico wrote:
> On Mon, Nov 25, 2013 at 1:16 AM, Marc Aymerich wrote:
>> ... def do_get(self):
>> ... # Do a HTTP GET request.
>> ... return "Get stuff"
>> ... def do_put(self):
>> ... # Do a HTTP PUT request.
>> ...
On Sun, Nov 24, 2013 at 3:13 PM, Chris Angelico wrote:
> On Mon, Nov 25, 2013 at 12:45 AM, Steven D'Aprano
> wrote:
>> Not quite impossible. All you need is an object that behaves like a
>> string, except it has a __call__ method. Here's a sketch of a solution,
>> completely untested.
>>
>> class
On Mon, Nov 25, 2013 at 1:31 AM, Steven D'Aprano
wrote:
> I don't think the REPL handles return values inside loops any different
> from how it handles them outside loops. The difference is that file.write
> methods used to return None in Python 2, in Python 3 they return the
> number of bytes wri
On Mon, Nov 25, 2013 at 1:16 AM, Marc Aymerich wrote:
> ... def do_get(self):
> ... # Do a HTTP GET request.
> ... return "Get stuff"
> ... def do_put(self):
> ... # Do a HTTP PUT request.
> ... return "Put stuff"
To make this a bit more realistic, try this
On Sun, 24 Nov 2013 01:16:18 +1100, Chris Angelico wrote:
> On Sun, Nov 24, 2013 at 12:26 AM, Frank Millman
> wrote:
>> for i in range(10):
>> sys.stdout.write('.')
>> sys.stdout.flush()
>> time.sleep(1)
>> sys.stdout.write('\n')
>>
>> I tried it under Python3, and found that it differs in
On Mon, Nov 25, 2013 at 1:21 AM, Roy Smith wrote:
> If the REST interface is designed properly, all the GETs are
> nullipotent, so modulo efficiency, it should all work.
Yes, but "modulo efficiency" is not something you want to do when
you're talking network traffic. If this were just allocating
On Sat, 23 Nov 2013 19:53:32 +, Rotwang wrote:
> On 22/11/2013 11:26, Steven D'Aprano wrote:
>> A frequently missed feature is the ability to chain method calls:
[...]
>> chained([]).append(1).append(2).append(3).reverse().append(4) =>
>> returns [3, 2, 1, 4]
>
> That's pretty cool. However,
On Mon, Nov 25, 2013 at 1:15 AM, Steven D'Aprano
wrote:
> On Sun, 24 Nov 2013 19:07:38 +1100, Chris Angelico wrote:
>
>> I know the recent Pythons give a lot of import power to the script. But
>> maybe I'm just asking too much, and some of this stuff really is magical
>> and implemented in C?
>
>
In article ,
Chris Angelico wrote:
> On Mon, Nov 25, 2013 at 12:45 AM, Steven D'Aprano
> wrote:
> > Not quite impossible. All you need is an object that behaves like a
> > string, except it has a __call__ method. Here's a sketch of a solution,
> > completely untested.
> >
> > class Magic_HTTP_T
On Sun, 24 Nov 2013 11:30:14 +0100, Antoon Pardon wrote:
> Foo.foo() is legal here. So Foo.foo is callable.
Incorrect. Foo.foo() is legal for *any* identifiers Foo and foo. Since
Python is an extremely dynamic language, the compiler cannot (easily, or
at all) prohibit "illegal" combinations. T
On Sun, 24 Nov 2013 19:07:38 +1100, Chris Angelico wrote:
> I know the recent Pythons give a lot of import power to the script. But
> maybe I'm just asking too much, and some of this stuff really is magical
> and implemented in C?
That was the case up to 3.3, but Python 3.4 has the import machine
On Sun, Nov 24, 2013 at 2:45 PM, Steven D'Aprano
wrote:
> On Sun, 24 Nov 2013 05:04:16 -0800, Devin Jeanpierre wrote:
>
>> On Sun, Nov 24, 2013 at 4:52 AM, Marc Aymerich
>> wrote:
>>> Hi,
>>> I'm playing with python internals to make objects behave like this:
>>>
>>> if I access to "object.attrib
On Mon, Nov 25, 2013 at 1:04 AM, Devin Jeanpierre
wrote:
> and also "impossible" is often a nice shorthand for "the
> possibility is extraordinarily awful".
+1 QOTW!
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Nov 25, 2013 at 12:45 AM, Steven D'Aprano
wrote:
> Not quite impossible. All you need is an object that behaves like a
> string, except it has a __call__ method. Here's a sketch of a solution,
> completely untested.
>
> class Magic_HTTP_Thing:
> @property
> def attribute(self):
>
On Sun, Nov 24, 2013 at 5:45 AM, Steven D'Aprano
wrote:
> On Sun, 24 Nov 2013 05:04:16 -0800, Devin Jeanpierre wrote:
>> Uh oh. What you want is impossible. You cannot call an attribute without
>> first accessing it. :(
>
> Not quite impossible. All you need is an object that behaves like a
> stri
On Sun, 24 Nov 2013 05:04:16 -0800, Devin Jeanpierre wrote:
> On Sun, Nov 24, 2013 at 4:52 AM, Marc Aymerich
> wrote:
>> Hi,
>> I'm playing with python internals to make objects behave like this:
>>
>> if I access to "object.attribute" I want to return the result of an
>> HTTP GET request. Howeve
On Sun, Nov 24, 2013 at 11:52 PM, Marc Aymerich wrote:
> if I access to "object.attribute" I want to return the result of an
> HTTP GET request. However if i call "object.attribute()" I want an
> HTTP POST request to be executed.
That's fundamentally difficult, because object.attribute() first
ev
On Sun, Nov 24, 2013 at 4:52 AM, Marc Aymerich wrote:
> Hi,
> I'm playing with python internals to make objects behave like this:
>
> if I access to "object.attribute" I want to return the result of an
> HTTP GET request. However if i call "object.attribute()" I want an
> HTTP POST request to be e
Hi,
I'm playing with python internals to make objects behave like this:
if I access to "object.attribute" I want to return the result of an
HTTP GET request. However if i call "object.attribute()" I want an
HTTP POST request to be executed.
So far I have been able to do the POST part, using two c
On Sun, Nov 24, 2013 at 4:05 AM, Chris Angelico wrote:
> Undocumented... that explains why I didn't know about it! But that
> does appear to be what I'm looking for, so is there some equivalent
> planned as a replacement?
Hmm, playing around with importlib a bit, this seems to work:
from importl
On Sun, Nov 24, 2013 at 8:50 PM, Ian Kelly wrote:
> On Sun, Nov 24, 2013 at 2:18 AM, Christian Gollwitzer wrote:
>> Am 24.11.13 04:41, schrieb Chris Angelico:
>>
>>> As part of a post on python-ideas, I wanted to knock together a quick
>>> little script that "imports" a file based on its name, in
Antoon Pardon wrote:
> Op 23-11-13 10:01, Peter Otten schreef:
>
>>
>> Your script is saying that a staticmethod instance is not a callable
>> object. It need not be because
>>
>> Foo.foo()
>>
>> doesn't call the Foo.foo attribute directly, it calls
>>
>> Foo.foo.__get__(None, Foo)()
>
> I t
On Sun, Nov 24, 2013 at 3:30 AM, Antoon Pardon
wrote:
> Op 23-11-13 22:51, Peter Otten schreef:
>> Antoon Pardon wrote:
>>
>>> Op 23-11-13 10:01, Peter Otten schreef:
>>>
Your script is saying that a staticmethod instance is not a callable
object. It need not be because
Fo
Antoon Pardon wrote:
> Foo.foo() being legal and Foo.foo not being callable is IMO a bug in
> python.
Foo.foo() is legal, and Foo.foo is callable.
--
https://mail.python.org/mailman/listinfo/python-list
Op 23-11-13 22:51, Peter Otten schreef:
> Antoon Pardon wrote:
>
>> Op 23-11-13 10:01, Peter Otten schreef:
>>
>>>
>>> Your script is saying that a staticmethod instance is not a callable
>>> object. It need not be because
>>>
>>> Foo.foo()
>>>
>>> doesn't call the Foo.foo attribute directly, it c
On Sun, Nov 24, 2013 at 2:18 AM, Christian Gollwitzer wrote:
> Am 24.11.13 04:41, schrieb Chris Angelico:
>
>> As part of a post on python-ideas, I wanted to knock together a quick
>> little script that "imports" a file based on its name, in the same way
>> that the Python interpreter will happily
Am 24.11.13 04:41, schrieb Chris Angelico:
As part of a post on python-ideas, I wanted to knock together a quick
little script that "imports" a file based on its name, in the same way
that the Python interpreter will happily take an absolute pathname for
the main script.
Is it imp.load_source()
On Sun, Nov 24, 2013 at 7:00 PM, Ian Kelly wrote:
> The importer mechanism as far as I know only accepts module names, not
> filesystem paths; I believe this is by design. You could imitate it by
> doing something like this:
>
> import imp
> import sys
>
> mod = imp.new_module('spam')
> exec(open
On Nov 23, 2013 9:42 PM, "Chris Angelico" wrote:
> As part of a post on python-ideas, I wanted to knock together a quick
> little script that "imports" a file based on its name, in the same way
> that the Python interpreter will happily take an absolute pathname for
> the main script. I'm sure th
48 matches
Mail list logo