On Thursday 28 May 2015 15:56, Gary Herron wrote:
> On 05/27/2015 10:29 PM, Marko Rauhamaa wrote:
>> Ben Finney :
>>
>>> It seems the existing ‘open’ implementation doesn't allow you to
>>> override the type of object returned.
>> The question is, can you assign to the builtin namespace. I'm guess
On 05/27/2015 10:29 PM, Marko Rauhamaa wrote:
Ben Finney :
It seems the existing ‘open’ implementation doesn't allow you to
override the type of object returned.
The question is, can you assign to the builtin namespace. I'm guessing
you can't.
Of course you can.
Python2:
>>> __builtins__.op
On Thu, May 28, 2015 at 3:29 PM, Marko Rauhamaa wrote:
> Ben Finney :
>
>> It seems the existing ‘open’ implementation doesn't allow you to
>> override the type of object returned.
>
> The question is, can you assign to the builtin namespace. I'm guessing
> you can't.
>
> Within a module, you can
Ben Finney :
> It seems the existing ‘open’ implementation doesn't allow you to
> override the type of object returned.
The question is, can you assign to the builtin namespace. I'm guessing
you can't.
Within a module, you can simply do:
open = MyFile
Also, in other modules, you can:
fr
Your cmake output doesn't mention that it tried to build libcv.so
so, I guess the reason you cannot find it is that it never tried
to make it.
You may already have fixed your problem by just installing the relevant
debian package. If not, it may be that you need to install this one
https://packag
On 28May2015 01:38, Jon Ribbens wrote:
On 2015-05-27, Karthik Sharma wrote:
I tried modifying the program as follows as per your
suggestion.Doesn't seem to work.
That's because you didn't modify the program as per their suggestion,
you made completely different changes that bore no relation
On 2015-05-28 00:51, Karthik Sharma wrote:
I tried modifying the program as follows as per your suggestion.Doesn't seem to
work.
import simplejson as json
import cjson
json_input = { "msgType": "0",
"tid": "1",
"data": "[{\"Severity\":\"warn\",\"Subject\":\"Reporting
\",\"Message\":
On Wed, May 27, 2015, at 19:51, Karthik Sharma wrote:
> I get the following error.
>
> Traceback (most recent call last):
> File "test_json.py", line 23, in
> print('message {} \n\n'.format(message['Message']))
> TypeError: list indices must be integers, not str
> karthik.sharma@aukksharm
Ben Finney writes:
> Steven D'Aprano writes:
>
> > but how do I tell open() to use MyFile?
>
> I haven't used it, but does the ‘opener’ parameter do what you want?
No, it doesn't; the ‘opener’ parameter doesn't have any say in the type
of object returned from ‘open’.
It seems the existing ‘ope
Steven D'Aprano writes:
> from io import TextIOWrapper
> class MyFile(TextIOWrapper):
> pass
>
> but how do I tell open() to use MyFile?
I haven't used it, but does the ‘opener’ parameter do what you want?
open(file, mode='r', buffering=-1, encoding=None,
errors=None, newli
I'd like to return a custom file object, say my own subclass. I can easily
subclass the file object:
from io import TextIOWrapper
class MyFile(TextIOWrapper):
pass
but how do I tell open() to use MyFile?
Answers for Python 3, thanks.
--
Steven
--
https://mail.python.org/mailman/lis
On Thu, 28 May 2015 06:03 am, Mark Lawrence wrote:
> You make the statement regarding Python3 "even while it is 10 to 20
> percent slower". Where is your evidence to support this statement?
Its well known that Python 3 is generally slower than Python 2. Cecil's
claim shouldn't be controversial,
On Thu, 28 May 2015 08:09 am, Vincent Davis wrote:
> I am trying to add a test to pandas Int the first case I assert that I get
> a NaT value, in the second I what to test that I get a value error.
Your sentence has just enough typos to lead me to doubt I understand you.
What do you mean, add a t
On 2015-05-27, Karthik Sharma wrote:
> I tried modifying the program as follows as per your
> suggestion.Doesn't seem to work.
That's because you didn't modify the program as per their suggestion,
you made completely different changes that bore no relation to what
they said.
> import cjson
What
On 27May2015 17:13, Vincent Davis wrote:
On Wed, May 27, 2015 at 4:55 PM, Cameron Simpson wrote:
First, test your test by hand running:
to_datetime('2015-02-29', coerce=False)
_Does_ it raise ValueError?
Well that was not expected. Thanks
See? If you'd just believed your unit test... :-
I tried modifying the program as follows as per your suggestion.Doesn't seem to
work.
import simplejson as json
import cjson
json_inpu
Hi Laura,
On 26-05-2015 11:21, Laura Creighton wrote:
In a message of Tue, 26 May 2015 10:24:30 -0300, Markos writes:
Hi,
I want to use OpenCV with Python.
I installed version 2.4.9
(http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/)
in debian Squeeze
On Wed, May 27, 2015 at 4:55 PM, Cameron Simpson wrote:
> First, test your test by hand running:
>
> to_datetime('2015-02-29', coerce=False)
>
> _Does_ it raise ValueError?
>
Well that was not expected. Thanks
Vincent Davis
--
https://mail.python.org/mailman/listinfo/python-list
On 27May2015 16:09, Vincent Davis wrote:
I am trying to add a test to pandas Int the first case I assert that I get
a NaT value, in the second I what to test that I get a value error.
def
test_day_not_in_month_coerce_true
() works
I am trying to duplicate them with coerce=
False which
will give
On 27May2015 15:23, Karthik Sharma wrote:
I have the JSON structure shown below and the python code shown below to
manipulate the JSON structure.
import json
json_input = {
"msgType": "0",
"tid": "1",
"data": "[{\"Severity\":\"warn\",\"Subject\":\"Reporting
\",\"Me
On 2015-05-27 21:01, Piyush Verma wrote:
Hi,
I'm facing traceback when using pudb python debugger to debug. Any help
to resolve it.
# python -m pudb file.py
main()
File "/usr/local/lib/python2.7/dist-packages/pudb/run.py", line 30,
in main
steal_output=options.steal_output)
Fil
On 2015-05-27 23:23, Karthik Sharma wrote:
I have the JSON structure shown below and the python code shown below to
manipulate the JSON structure.
import json
json_input = {
"msgType": "0",
"tid": "1",
"data": "[{\"Severity\":\"warn\",\"Subject\":\"Reportin
On Wed, May 27, 2015, at 18:23, Karthik Sharma wrote:
> The JSON structure is valid as shown by http://jsonlint.com/
>I want to be able to access the different fields inside `data` such as
>`severity`, `subject` and also fields inside `tdetails` such as `CPUs`
>and `Product`. How do I d
I have the JSON structure shown below and the python code shown below to
manipulate the JSON structure.
import json
json_input = {
"msgType": "0",
"tid": "1",
"data": "[{\"Severity\":\"warn\",\"Subject\":\"Reporting
\",\"Message\":\"tdetails:{\\\"Product\\\"
I am trying to add a test to pandas Int the first case I assert that I get
a NaT value, in the second I what to test that I get a value error.
def
test_day_not_in_month_coerce_true
() works
I am trying to duplicate them with coerce=
False which
will give a ValueError but I cant get the tests to wor
On 27 May 2015 at 19:00, Brian Blais wrote:
> On Mon, May 25, 2015 at 11:11 PM, Steven D'Aprano wrote:
>>
>> Let's compare three methods.
>>
>> def naive(a, b):
>> return math.sqrt(a**2 + b**2)
>>
>> def alternate(a, b):
>> a, b = min(a, b), max(a, b)
>> if a == 0: return b
>> if
On 5/27/2015 2:32 AM, Chris Angelico wrote:
On Wed, May 27, 2015 at 3:23 PM, Steven D'Aprano
wrote:
On Wednesday 27 May 2015 06:45, Mark Lawrence wrote:
Apart from breaking all the tools that rely on "self" being spelt "self"
this looks like an excellent idea.
Tools which rely on self being
On 5/27/2015 7:15 AM, anatoly techtonik wrote:
Hi.
This was labelled offtopic in python-ideas, so I edited and forwarded
it here. Please CC as I am not subscribed.
I am not subcribed either, but I do not need or want CCs.
python-list is mirrored at news.gmane.org where you can access it as
ei
On 27/05/2015 20:30, Gisle Vanem wrote:
Zachary Ware wrote:
Is there any particular reason you're setting PYTHONHOME in the first
place?
I have several GNU Makefiles that picks up this variable
(to find Python.h, python*.lib etc.). But using Python 27
and 35 w/o having a %PYTHONHOME set, seem
On 27/05/2015 16:18, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 16:51 CEST schreef Mark Lawrence:
On 27/05/2015 15:11, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:
On 27/05/2015 09:42, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 09:30 CEST schre
Hi,
I'm facing traceback when using pudb python debugger to debug. Any help to
resolve it.
# python -m pudb file.py
main()
File "/usr/local/lib/python2.7/dist-packages/pudb/run.py", line 30, in
main
steal_output=options.steal_output)
File "/usr/local/lib/python2.7/dist-packages/pudb/
Zachary Ware wrote:
Is there any particular reason you're setting PYTHONHOME in the first
place?
I have several GNU Makefiles that picks up this variable
(to find Python.h, python*.lib etc.). But using Python 27
and 35 w/o having a %PYTHONHOME set, seems to work fine.
I have to revise those Ma
On Wed, May 27, 2015 at 1:13 PM, Gisle Vanem wrote:
> I just installed the 32-bit Python 3.5b4 via the Web-installer.
> First, I was a bit annoyed by the fact it installed under
> 'f:\ProgramFiler-x86\Python35' instead of
> 'f:\ProgramFiler\Python35' as I customided for. But I guess
> this is
Hi!
I'm trying to use embedding of Python in my program.
Simple C-program, compiled in Debug, that uses py-script that just
imports "ctypes" gives me an error about "no module named "_ctypes".
How to compile python lib in Visual Studio statically with ctypes
support? Or how to use shared ctypes l
On Tuesday, May 26, 2015 at 3:53:25 PM UTC-5, Michael Torrie wrote:
> On 05/26/2015 08:57 AM, zipher wrote:
> > Comprende? I'm not trying to be cryptic here. This is a bit of OOP
> > theory to be discussed.
>
> No, sorry. Maybe an actual example (with use case) would spur discussion.
In the fi
I just installed the 32-bit Python 3.5b4 via the Web-installer.
First, I was a bit annoyed by the fact it installed under
'f:\ProgramFiler-x86\Python35' instead of
'f:\ProgramFiler\Python35' as I customided for. But I guess
this is a WOW64 thing. I'm on Win-8.1 (64-bit).
But then I noticed th
On Mon, May 25, 2015 at 11:11 PM, Steven D'Aprano wrote:
>
> Let's compare three methods.
>
> def naive(a, b):
> return math.sqrt(a**2 + b**2)
>
> def alternate(a, b):
> a, b = min(a, b), max(a, b)
> if a == 0: return b
> if b == 0: return a
> return a * math.sqrt(1 + b**2 /
Op Wednesday 27 May 2015 16:51 CEST schreef Mark Lawrence:
> On 27/05/2015 15:11, Cecil Westerhof wrote:
>> Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:
>>
>>> On 27/05/2015 09:42, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 09:30 CEST schreef alb:
> But here I have
On 27/05/2015 15:11, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:
On 27/05/2015 09:42, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 09:30 CEST schreef alb:
But here I have another question, as a python novice is there
really any reason for me to use an
Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:
> On 27/05/2015 09:42, Cecil Westerhof wrote:
>> Op Wednesday 27 May 2015 09:30 CEST schreef alb:
>>
>>> But here I have another question, as a python novice is there
>>> really any reason for me to use any particular version of Python?
>>
On 2015-05-27, Todd wrote:
> On Wed, May 27, 2015 at 2:40 PM, zipher wrote:
>
>> [some stupid crap]
>
> If your goal is to get people to stop calling you a troll, you are
> going about it the wrong way. If it isn't, why are you even here?
> Please remember the first rule of holes: if you find yo
On 27/05/2015 09:42, Cecil Westerhof wrote:
Op Wednesday 27 May 2015 09:30 CEST schreef alb:
But here I have another question, as a python novice is there really
any reason for me to use any particular version of Python?
Should I start directly with the newest? What about 2.7?
In principal y
A minor point is that if you just need to compare distances you don't need to
compute the hypotenuse, its square will do so no subtractions etc etc.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, May 27, 2015 at 2:40 PM, zipher wrote:
> On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote:
> > Steven D'Aprano writes:
> >
> > > On Wednesday 27 May 2015 14:39, Ben Finney wrote:
> > >
> > > > That kind of homophobic slur is inappropriate from anyone in this
> > > > commu
Chris Angelico apparantly has a problem with cc'd people who aren't
on the list. python-list is very quiet these days, so if you
subscribe it won't be drinking from the firehose. And you can
always turn off delivery when you are done. Or you can just
go read the archives:
https://mail.python.or
On Wed, 27 May 2015 09:15 pm, anatoly techtonik wrote:
> Hi.
>
> This was labelled offtopic in python-ideas, so I edited and forwarded
> it here. Please CC as I am not subscribed.
>
>
> In short. I need is a bulletproof way to convert from anything to
> unicode. This requires some kind of escap
On Wed, May 27, 2015, at 07:47, anatoly techtonik wrote:
> because Python 3 doesn't have non-unicode StringIO
That's actually not true - the non-unicode equivalent is BytesIO.
However, it's probably not actually what you want, if the point is to
display the filenames to the user.
--
https://mail.
On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote:
> Steven D'Aprano writes:
>
> > On Wednesday 27 May 2015 14:39, Ben Finney wrote:
> >
> > > That kind of homophobic slur is inappropriate from anyone in this
> > > community. Kindly cut it out altogether.
> >
> > I look forward to
On Wed, May 27, 2015, at 07:15, anatoly techtonik wrote:
> The solution is to have filter preprocess the binary string to escape all
> non-unicode symbols so that the following lossless transformation
> becomes possible:
>
>binary -> escaped utf-8 string -> unicode -> binary
>
> I want to kno
On Wed, May 27, 2015 at 9:52 PM, anatoly techtonik wrote:
> And the short answer is that we need unicode because we are printing this
> information to the stdout, and stdout is opened in text mode at least on
> Windows, and without explicit conversion, Python will try to decode stuff
> as being `a
On Wed, May 27, 2015 at 2:47 PM, anatoly techtonik wrote:
> On Wed, May 27, 2015 at 2:35 PM, Laura Creighton wrote:
>> I am missing something. Why do you need unicode at all? Why can you
>> not just keep your binary data as binary data?
>
> Good question. From the SCons code I see that we need
Dear Python Team,
currently I am working on a research project for my bachelor degree. A
LabVIEW application is used for current and power measurements, whereas the
measured data are sent to DataSocket Server, a technology by National
Instruments used for data exchange between computers and applic
On Wed, May 27, 2015 at 2:35 PM, Laura Creighton wrote:
> I am missing something. Why do you need unicode at all? Why can you
> not just keep your binary data as binary data?
Good question. From the SCons code I see that we need unicode, because
we switched to io.StringIO which is advertised as
I am missing something. Why do you need unicode at all? Why can you
not just keep your binary data as binary data?
I feel like I must be missing something obvious here ...
Laura
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano writes:
> On Wednesday 27 May 2015 14:39, Ben Finney wrote:
>
> > That kind of homophobic slur is inappropriate from anyone in this
> > community. Kindly cut it out altogether.
>
> I look forward to the day when people would read the earlier insult
> and be perplexed as to why it
Hi.
This was labelled offtopic in python-ideas, so I edited and forwarded
it here. Please CC as I am not subscribed.
In short. I need is a bulletproof way to convert from anything to
unicode. This requires some kind of escaping to go forward and back.
Some helper function like u2b() (unicode to
Op Wednesday 27 May 2015 09:30 CEST schreef alb:
> But here I have another question, as a python novice is there really
> any reason for me to use any particular version of Python?
>
> Should I start directly with the newest? What about 2.7?
In principal you should use the ‘latest’ 3. The only pr
On Wed, May 27, 2015 at 5:30 PM, alb wrote:
> But here I have another question, as a python novice is there really any
> reason for me to use any particular version of Python?
>
> Should I start directly with the newest? What about 2.7?
>
Start with the newest that's conveniently available. With
On Wed, May 27, 2015 at 5:39 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> Using some other name in place of "self" should definitely remain
>> *possible*, but not commonly done.
>
> You are effectively making the argument that Python has made a mistake
> by not giving "self" a special, langua
2015-05-27 9:30 GMT+02:00 alb :
> Hi Mark,
> Mark Lawrence wrote:
> []
>>>File
>>> "/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py",
>>> line 48
>>> empty_fill = u'∙'
>>>^
>>> SyntaxError: invalid s
Chris Angelico :
> Using some other name in place of "self" should definitely remain
> *possible*, but not commonly done.
You are effectively making the argument that Python has made a mistake
by not giving "self" a special, language-level status.
Marko
--
https://mail.python.org/mailman/listi
Hi Mark,
Mark Lawrence wrote:
[]
>>File
>> "/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py",
>> line 48
>> empty_fill = u'∙'
>>^
>> SyntaxError: invalid syntax
>>
[]
>
> Python 3.0 removed the 'u'
Hi Chris,
Chris Angelico wrote:
[]
>> Python 3.0 removed the 'u' for unicode in front of strings but due to
>> popular demand to ease porting it was reinstated in 3.3. Strip it away and
>> you should be fine to go.
>
> Or upgrade to 3.3 or better; is there anything holding you on 3.2?
> Buildin
I guess the RPi has no ADC and has a fixed system architecture, not willing to
include a co-processor running as watchdog or ADC, which is mandatory for
industrial control. However if you run RESTful embedded controllers as limited
functionality end devices, the RPi may act as main controller, i
64 matches
Mail list logo