Fw: See example

2020-12-04 Thread Arthur R. Ott
   Sent from my BlackBerry - the most secure mobile device

   From: art...@gmail.com
   Sent: December 4, 2020 10:40 AM
   To: python-list@python.org
   Subject: See example

   Microsoft Windows [Version 10.0.19042.630]
   (c) 2020 Microsoft Corporation. All rights reserved.
   I am sure you can help me
   From the Windows10 command line, either in Admin mode or otherwise this is
   the error message I get. I want to program a Microprocessor for the first
   time and I am already stuck. I have spent a lot of time on both the
   internet and YouTube following different solutions. This entry worked two
   days ago and then the next day didn't. The "help" worksand the program
   appears to be operating normally.
   What can you suggest
   C:\WINDOWS\system32>python
   Python 3.9.0a2 (tags/v3.9.0a2:6202d85, Dec 18 2019, 22:54:12) [MSC v.1916
   64 bit (AMD64)] on win32
   Type "help", "copyright", "credits" or "license" for more information.
   >>> pip --version
   Traceback (most recent call last):
     File "", line 1, in 
   NameError: name 'pip' is not defined
   >>> python --version
   Traceback (most recent call last):
     File "", line 1, in 
   NameError: name 'python' is not defined
   >>>
   Cheers
        Art
   To God goes the glory for creation
      Not to chance
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Arthur Endlein Correia
Yes, considering the OP request, pygame would be better, or one of Mark's
suggestions:
mcsp.wartburg.edu/zelle/python/graphics.py
Seems really easy to use.



---
Arthur Endlein Correia
arthur.corr...@usp.br
endart...@gmail.com
55 11 968 606 174
IGc, USP

On Wed, Jan 10, 2018 at 3:36 PM, Michael Torrie  wrote:

> On 01/10/2018 10:22 AM, Igor Korot wrote:
> >  Hi,
> > wxPython/Phoenix.
> > It can do everything you need and more
>
> But the OP isn't looking for a full-blown GUI toolkit.  I went back and
> re-read his post to be sure I wasn't misunderstanding.  Therefore I
> don't think the suggestion to use wxPython or PyQt is that helpful.
>
> Do you have any other suggestions?
>
> Even Cairo is pretty complicated (requiring pens and contexts) for what
> he's asking for.
>
> Personally I don't think it gets much easier or simpler than this sort
> of thing:
> https://github.com/Mekire/pygame-samples
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Simple graphic library for beginners

2018-01-10 Thread Arthur Endlein Correia
Tkinter can look nice and not terribly hard to use, as I found out in this
tutorial:
http://www.tkdocs.com/tutorial/onepage.html
Having said that, nowadays I pretty much always use PyQt (or Pyside)
together with qtdesigner to build GUI applications.




---
Arthur Endlein Correia
arthur.corr...@usp.br
endart...@gmail.com
55 11 968 606 174
IGc, USP

On Wed, Jan 10, 2018 at 12:08 PM,  wrote:

> On Wednesday, January 10, 2018 at 12:42:07 PM UTC, Jan Erik Moström wrote:
> > I'm looking for a really easy to use graphic library. The target users
> > are teachers who have never programmed before and is taking a first (and
> > possible last) programming course.
> >
> > I would like to have the ability to draw lines, circles, etc. Nothing
> > fancy, as little window management as possible (possible buttons),
> > perhaps simple events like button presses or clicks on canvas - think:
> > making simple diagrams or simple figures. Cross-platform
> >
> >
> > Yes, I know about tkinter.
> >
> > Yes, I know about various block languages like Scratch but they are not
> > relevant in this case.
> >
> > Any suggestions?
> >
> > = jem
>
> Take a look at https://python-sfml.org/, https://www.ogre3d.org/about or
> mcsp.wartburg.edu/zelle/python/graphics.py
>
> --
> Kindest regards.
>
> Mark Lawrence.
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Rawest raw string literals

2017-04-20 Thread Arthur Havlicek
No escaping is not something possible, in your suggested syntax ") is 
ambigous. E.g. raw("abcd")") is ambigous.


Any sequence delimited string involves escaping, the only thing that 
wouldnt would be size-defined strings but they are impractical.


Le 20/04/2017 à 18:03, Mikhail V a écrit :

On 20 April 2017 at 17:55, Chris Angelico  wrote:

On Fri, Apr 21, 2017 at 1:44 AM, Mikhail V  wrote:

What I think: why there is no some built-in function, for example like:
s = raw("ffmpeg -i  "\\server-01\D\SER_Bigl__"")

which would just need *one* quote sign in the beginning and on the end.
Would it be useful, what do you think? I think looks better than triple quote.
In the past there were quite a lot additions to string manipulation,
probably there is already something like this.

What would be the argument passed to this function?

ChrisA


Yeah that is right, I cant imagine how this would work.
But I think you get the idea- I'd want something dedicated
to input raw strings with cute syntax and *no* escaping
at all.


Mikhail


--
https://mail.python.org/mailman/listinfo/python-list


Re: cryptography default_backend is "hazmat"?

2017-03-18 Thread Arthur Darcet
On Sat, 18 Mar 2017 at 23:29, Ian Pilcher  wrote:

> On 03/18/2017 05:15 PM, Chris Angelico wrote:
> > So the question is: How well do you trust the examples? Are they
> > likely to be instructing you in a safe way to use this
> > potentially-dangerous module?
>
> But as far as I can tell, there's no way to use many of the non-hazmat
> functions (e.g. parsing a certificate) without a backend, and all of the
> backends are "hazmat".
>
> So what's the point of marking something as hazmat, if a large portion
> of the rest of the module can't be used without it?
>

If I'm not mistaken, the hazmat module contains functions that are easy to
misuse, which is why they are hazardous.
Using those same functions through the "safe" part of the library isn't
dangerous




> --
> 
> Ian Pilcher arequip...@gmail.com
>  "I grew up before Mark Zuckerberg invented friendship" 
> 
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-06 Thread Arthur Havlicek
2016-11-05 12:47 GMT+01:00 Chris Angelico :

> On Sat, Nov 5, 2016 at 9:50 PM, Arthur Havlicek
>
> But here's the thing. For everyone who writes a decorator function,
> there could be dozens who use it.
>

The day that one guy leaves the team, suddenly you have code that's become
a bit tricky to maintain. Our philosophy is that everyone should be able to
contribute anywhere although I agree with you: there is such thing as using
a decorator as a black box, and even diving into it isn't that hard. Notice
I didn't say we don't use these features at all, we just tend to avoid them
when a more familiar approach exist. Even so, maybe we are wrong to do so,
and the code would be clearer if we used more features. Maybe we just lack
the expertise and we are indeed stuck in an old mindset, after all. Anyway,
I have some directives to make my code easy to access and must compose with
what I would call industrial constraints.

As a gambler I can't refuse that bet proposal, no sir :) Expect me to come
back with a piece of code and/or questions about CPython engine.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-05 Thread Arthur Havlicek
2016-11-05 9:42 GMT+01:00 Steve D'Aprano :

>
> I don't know who you are quoting there. It is considered impolite to quote
> people without giving attribution, and makes it harder to respond.
>

My bad. I was unaware of that. This was quoted from Ned Batchelder's mali.


2016-11-05 9:42 GMT+01:00 Steve D'Aprano :

> I trust that isn't actually the case, but by describing decorators and
> lambda as too fancy to use, you're giving a good impression of somebody who
> doesn't know what they're doing.
>

I was a bit humorous here, making fun about the fact I do not write
anything sophisticated.

However, the fact that we do avoid them is entirely true ! We do so because
these concepts are foreign to the average developer (lambda being a bit
apart: it's easily understood, but functional constructs may not, so its a
result of us avoiding functional constructs as well).

Pick 10 programmers for hire and count how many know how to write a
decorator. If you have specified you needed python specialists, you may
have 3-4. If not, you are lucky to find even one. And where I live we don't
have the luxury of finding competent Python experts by kicking a tree. In
our open space, we are 6 devs (+ one ex-dev being my manager), only 2 had
previous Python experience: me and the CEO. And the other 4 are doing fine
! Locking ourselves in Python-specific semantics, over time, will make us
loose precious dev time. The best code is the one everyone can understand.
That is why I point this as "complex, non-obvious", and my manager wouldn't
have so kind words (but he is a Java fan, so he doesn't count.)


2016-11-05 9:42 GMT+01:00 Steve D'Aprano :

> - you would have to demonstrate a good reason to think that this new
> feature
> will actually be more efficient and faster
>

This is easy but time-consuming, I could roll my implementation and
showcase a few benchs. I am very confident that is the case. I would have
bet that I would need to do it at some point, but I wanted to poll opinions
a bit beforehand.


2016-11-05 9:42 GMT+01:00 Steve D'Aprano :

> In other words, in my opinion:
>
> - you would need to prove that there is a widespread need for in-place
> modification of lists, where the lists are big enough that using a
> temporary list is not practical
>

However this is tricky, I may very well be an exception.

About your bench: I don't really know why you are surprised the for loop is
slower. That's the result of comprehension being native while for loop
isn't. That does not mean writing to a copy would save time for exchange of
memory. In my opinion, the fact that we will win something is guaranteed
because we save a copy call and do the exact same operation. There is
nothing like cache magic optimization that could happen because the mapping
needs to read the first list anyway. Nor we need a temporary buffer to
cache operations since they are independent. Really, I am ready to make a
serious bet.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-04 Thread Arthur Havlicek
> If slice assignment is done as I hope it will optimize remain memory
operations.

Bad news.

http://stackoverflow.com/questions/4948293/python-slice-assignment-memory-usage/4948508#4948508

> If you want something like C++ move semantics, use C++.

I don't see anything like this in my proposal. If any in-place operation is
"C++ semantics" how do you explain there is already a bunch of in-place
operator stuffed in Python that have even less justification to their
existance than map or filter does such as sort/sorted, reverse/reversed ?
Especially troubling since the optimisation in a sort operation is likely
to be less significant than in a linear algorithm.

2016-11-04 1:03 GMT+01:00 Terry Reedy :

> On 11/3/2016 2:56 AM, arthurhavli...@gmail.com wrote:
>
> lst = [ item for item in lst if predicate(item) ]
>> lst = [ f(item) for item in lst ]
>>
>> Both these expressions feature redundancy, lst occurs twice and item at
>> least twice. Additionally, the readability is hurt, because one has to dive
>> through the semantics of the comprehension to truely understand I am
>> filtering the list or remapping its values.
>>
> ...
>
>> A language support for these operations to be made in-place could improve
>> the efficiency of this operations through reduced use of memory.
>>
>
> We already have that: slice assignment with an iterator.
>
> lst[:] = (item for item in list if predicate(item))
> lst[:] = map(f, lst)  # iterator in 3.x.
>
> To save memory, stop using unneeded temporary lists and use iterators
> instead.  If slice assignment is done as I hope it will optimize remain
> memory operations.  (But I have not read the code.) It should overwrite
> existing slots until either a) the iterator is exhausted or b) existing
> memory is used up.  When lst is both source and destination, only case a)
> can happen.  When it does, the list can be finalized with its new contents.
>
> As for timings.
>
> from timeit import Timer
> setup = """data = list(range(1))
> def func(x):
> return x
> """
> t1a = Timer('data[:] = [func(a) for a in data]', setup=setup)
> t1b = Timer('data[:] = (func(a) for a in data)', setup=setup)
> t2a = Timer('data[:] = list(map(func, data))', setup=setup)
> t2b = Timer('data[:] = map(func, data)', setup=setup)
>
> print('t1a', min(t1a.repeat(number=500, repeat=7)))
> print('t1b', min(t1b.repeat(number=500, repeat=7)))
> print('t2a', min(t2a.repeat(number=500, repeat=7)))
> print('t2b', min(t2b.repeat(number=500, repeat=7)))
> #
> t1a 0.5675313005414555
> t1b 0.7034254675598604
> t2a 0.518128598520
> t2b 0.5196112759726024
>
> If f does more work, the % difference among these will decrease.
>
>
>
> --
> Terry Jan Reedy
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pre-pep discussion material: in-place equivalents to map and filter

2016-11-03 Thread Arthur Havlicek
I understand that, the cost of change is such that it's very unlikely
something like this ever goes into Python, but I feel like the interest of
the proposition is being underestimated here, that's why I'm going to argue
a few points and give a bit more context as needed.

> While mapping and filtering are common operations, I'm not sure mapping
> and filtering and then reassigning back to the original sequence is
> especially common.

It depends of your context. On the last 3 months, I stumbled across this at
least 3 times, which is 3 times more than I used a lambda or a metaclass or
a decorator or other fancy language feature that we simply avoid whenever
possible. It also happened to my collegue. I remember these examples
because we had a bit of humour about how nice can be inlined ternaries
inside comprehensions, but I could be missing a lot more.

The reason I'm being especially impacted by this is because I am maintainer
of a decent-sized Python application (~50-100K lines of code) that
extensively uses lists and dictionaries. We value "low level" data
manipulation and efficiency a lot more than complex, non-obvious
constructs. In other contexts, it may be very different. Note that my
context is only relevant for illustration here, I don't expect a feature to
save me since we are currently shipping to Centos 6 and thus will not see
the light of Python 3.7 in the next 10 years (optimistic estimation).

> Arthur, I would suggest looking at what numpy and pandas do.

In my example context, their benefits can't apply, because I'm not going to
rewrite code that uses lists for them to uses np.array instead for example.
Although the performance boost is likely to be bigger if used properly, I
would have prefered a lesser boost that comes for (almost) free.

Like most Python programmers, I'm not in the case of needing a performance
boost very bad, but that does not mean I disregard performance entirely.
The need of performance is not so binary that it either don't matter at all
or is enough to motivate a rewrite.

> To my eyes, this proposed syntax is completely foreign

I must admit I don't have much imagination for syntax proposals...all that
mattered to me here was to make it clear you are doing an in-place
modification. Feel free to completely ignore that part. Any proposal
welcomed of course.
About Readability & Redundancy

I have misused the terms here, but I wasn't expecting so much nitpicking. I
should have used the term maintenability, because that one is bland and
subjective enough that nobody would have noticed :D

How about "I find that cooler." Good enough ?

In a less sarcastic tone:

What I truely meant here is that when you contain the behavior of your code
inside a specific keyword or syntax, you are making your intentions clear
to the reader. It may be harder for him to gain access to the knowledge in
the first place, but makes it easier over time.

Famous example:

When you learned programming, you may have had no idea what "+=" was doing,
but now you do, you probably rate "a += 2" syntax to be much better than "a
= a + 2". You make the economy of a token, but more important, you make
your intentions clearer because "+=" rings a bell, wihle "=" is a more
generic syntax with a broader meaning.

> So map() here is less than a factor of two slower. I wouldn't call
> that "especially bad" -- often times, a factor of two is not important.
> What really hurts is O(N**2) performance, or worse.

When you evaluate your application bottleneck or your average daily
algorithmic evaluation, perhaps. When regarding language core features we
are not on the same scale. If a language X is 2 times faster than a
language Y to do the same task, that's a huge seller, and is of real
importance.
-- 
https://mail.python.org/mailman/listinfo/python-list


UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54:

2016-04-24 Thread arthur sherman
m using a python web applic (adagios, a nagios configuration tool).
when attempting a certain operation on the client side browser i get the above 
error.
the client side is ubunti 14.04. servers side is debian 8. browser is ff or 
chrome.
both show:
echo $LANG
en_US.UTF-8

before i dive into the code, r there any OS level things to try? 
here's the full error traceback:

Traceback (most recent call last):
File "/opt/adagios/adagios/views.py", line 43, in wrapper
result = view_func(request, *args, **kwargs)
File "/opt/adagios/adagios/objectbrowser/views.py", line 191, in edit_object
c['form'] = PynagForm(pynag_object=my_object, 
initial=my_object._original_attributes)
File "/opt/adagios/adagios/objectbrowser/forms.py", line 312, in __init__
self.fields[field_name] = self.get_pynagField(field_name, css_tag="inherited")
File "/opt/adagios/adagios/objectbrowser/forms.py", line 418, in get_pynagField
_('%(inherited_value)s (inherited from template)') % {'inherited_value': 
smart_str(inherited_value)}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54: 
ordinal not in range(128)

tnx in advance for any assistance,
ams
avraham
 
Posts: 2
Joined: Wed Mar 25, 2015 8:58 am
Top
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: socket issue with recv()

2014-08-23 Thread Arthur Clarck
I forgot to mention that with this code:

total = '' 
while True: 
   data = s.recv(1024) 
   total += data 
   if (total != ''): 
  print total 
  total = ''
 
Everything is fine.
I am still looping but I get the complete data flow sent by the remote server.
The data flow is not corrupted with extra characters.
But I do not detect the closing of the socket on the remote server.
Why is recv not blocking !!!


Le samedi 23 août 2014 10:23:14 UTC+2, Arthur Clarck a écrit :
> Hello,
> 
> 
> 
> I am starting socket scripting with python.
> 
> I do understand from the doc that a socket is bmocking by default.
> 
> I wrote 2 basics script to verify this behaviour.
> 
> 
> 
> my "tcp_server.py":
> 
> 
> 
> 
> 
> import socket, sys
> 
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> 
> 
> 
> HOST = '192.168.0.103'
> 
> PORT = 1060
> 
> 
> 
> s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
> 
> s.bind((HOST, PORT))
> 
> while True:
> 
>s.listen(1)
> 
>print 'Listening at', s.getsockname()
> 
>sc, sockname = s.accept()
> 
>print 'We have accepted a connection from', sockname
> 
>print 'Socket connects', sc.getsockname(), 'and', sc.getpeername()
> 
>while True:
> 
>   data = sc.recv(1024)
> 
>   if data:
> 
>  print 'Got from client:', repr(data)
> 
>  data = ''
> 
>   else:
> 
>  #raise EOFError('socket closed')
> 
>  print 'socket closed by remote client'
> 
>  sc.close()
> 
>  sys.exit()
> 
> 
> 
> 
> 
> and my "tcp_client.py"
> 
> 
> 
> import socket, sys, time
> 
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> 
> 
> 
> HOST = '192.168.0.103'
> 
> PORT = 1060
> 
> 
> 
> s.connect((HOST, PORT))
> 
> print 'Client has been assigned socket name', s.getsockname()
> 
> while True:
> 
>data = raw_input('cmd:')
> 
>if (data == '\x05'):
> 
>   print 'closing socket and exit'
> 
>   s.close()
> 
>   sys.exit()
> 
>s.sendall(data)
> 
> 
> 
> When both are running everything what I type in the client is received by the 
> server.
> 
> When nothing is sent from the client the server is waiting (socket is 
> blocking)
> 
> for next datas.
> 
> If I close the client with Ctrl-E (or a kill) the socket on the server is 
> getting a null value and the server exit.
> 
> So everything is fine. And everything is clear in my mind.
> 
> 
> 
> The problem I have now is the following.
> 
> I have a script to connect to some telecom service.
> 
> The script is forking (parent/child)
> 
> The child is only reading what comes from the remote server.
> 
> Here the problematic code:
> 
> 
> 
> total = ''
> 
> while True:
> 
>data = s.recv(1024)
> 
>total += data
> 
>if (data == ''):
> 
>   print 'remote site is closed'
> 
>   s.close()
> 
>   sys.exit()
> 
> 
> 
> What is happening is that I got some datas from the remote site,
> 
> Something like 'Contacting BH: ...'
> 
> But directly followed by 'remote site is closed.
> 
> And if I remove the 2 lines (s.close;sys.exit) my script is looping
> 
> So it means data=='' 
> 
> This makes no sense at all.
> 
> Why is the socket not waiting for the next datas flow ??
> 
> Why is the socket not blocking ?
> 
> 
> 
> 
> 
> With Perl I just have to write:
> 
> 
> 
>   while (sysread($socket,$data,1024)){
> 
>  syswrite(STDOUT,$data)
> 
>   }
> 
> 
> 
> And it works perfectly.
> 
> 
> 
> Any hint about what I missed in Python ?
> 
> 
> 
> kr,
> 
> Arthur.
-- 
https://mail.python.org/mailman/listinfo/python-list


socket issue with recv()

2014-08-23 Thread Arthur Clarck
Hello,

I am starting socket scripting with python.
I do understand from the doc that a socket is bmocking by default.
I wrote 2 basics script to verify this behaviour.

my "tcp_server.py":


import socket, sys
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

HOST = '192.168.0.103'
PORT = 1060

s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
while True:
   s.listen(1)
   print 'Listening at', s.getsockname()
   sc, sockname = s.accept()
   print 'We have accepted a connection from', sockname
   print 'Socket connects', sc.getsockname(), 'and', sc.getpeername()
   while True:
  data = sc.recv(1024)
  if data:
 print 'Got from client:', repr(data)
 data = ''
  else:
 #raise EOFError('socket closed')
 print 'socket closed by remote client'
 sc.close()
 sys.exit()


and my "tcp_client.py"

import socket, sys, time
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

HOST = '192.168.0.103'
PORT = 1060

s.connect((HOST, PORT))
print 'Client has been assigned socket name', s.getsockname()
while True:
   data = raw_input('cmd:')
   if (data == '\x05'):
  print 'closing socket and exit'
  s.close()
  sys.exit()
   s.sendall(data)

When both are running everything what I type in the client is received by the 
server.
When nothing is sent from the client the server is waiting (socket is blocking)
for next datas.
If I close the client with Ctrl-E (or a kill) the socket on the server is 
getting a null value and the server exit.
So everything is fine. And everything is clear in my mind.

The problem I have now is the following.
I have a script to connect to some telecom service.
The script is forking (parent/child)
The child is only reading what comes from the remote server.
Here the problematic code:

total = ''
while True:
   data = s.recv(1024)
   total += data
   if (data == ''):
  print 'remote site is closed'
  s.close()
  sys.exit()

What is happening is that I got some datas from the remote site,
Something like 'Contacting BH: ...'
But directly followed by 'remote site is closed.
And if I remove the 2 lines (s.close;sys.exit) my script is looping
So it means data=='' 
This makes no sense at all.
Why is the socket not waiting for the next datas flow ??
Why is the socket not blocking ?


With Perl I just have to write:

  while (sysread($socket,$data,1024)){
 syswrite(STDOUT,$data)
  }

And it works perfectly.

Any hint about what I missed in Python ?

kr,
Arthur.
-- 
https://mail.python.org/mailman/listinfo/python-list


Non hashable object (without __dict__)

2011-04-20 Thread Arthur Mc Coy
Hello,


I have a C++ application, I used SWIG to call the python code. I pass
myModule.myObject object to the method of python code and what to
store it in JSON format.

The problem is when I do:

o = myModule.myObject()


inside python, the o object has __dict__ property, but if I take the
passed object o like:

def myMethod(self, objects):
for o in objects:
print o.__dict__


it fails saying no SwigPyObject does not have __dict__ property. The
only way to use o properties is to call it by name like here:

print o.MyProperty


But in order to use json.dump( objects, file, default =
self.MyJSONEncode ) I MUST to pass to MyJSONEncode method an object
that has __dict__ as its property.



So, what is the best way to correct my objects, which are coming from C
++ code to make them available for putting in JSON format ?


Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Currently trying to pick up my ava http://en.gravatar.com/christinasanders21
for StackOverflow, which site I found very good for my questions,
didn't I?
Yes, and there are problem when adding a picture. Web admins should be
careful.
Can anyone explain me my problem ? :

Christina
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Common guys, help me, sweet heart to finish my job and go with my
friend in the bar. Today we have a blues night :) Love it!

Christina
-- 
http://mail.python.org/mailman/listinfo/python-list


How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Hi people,

I've created very nice post here:
http://stackoverflow.com/questions/5274690/how-to-get-python-class-serializable-and-well-parsed-by-json-custom-encoder-deco

Yes, there are solutions over the internet, but nothing works for my
custom types.
If you could answer, please read it.

Be happy!
Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python data types in c++ code

2011-03-06 Thread Arthur Mc Coy
In short, the answer is to use PyObject dictionary ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python data types in c++ code

2011-03-06 Thread Arthur Mc Coy
Stephan, you are lead developer over there :))) It's marketing,
however very nice solution.. I will propose my bosses to rediscover
their world assumptions. You know, they are still using SVN, they are
very loosely coupled to the past. I have to wash their brains...

Meantime still battling with PyObject properties which are so diverse
and disperse that I don't know...


Keep talking guys


Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python data types in c++ code

2011-03-06 Thread Arthur Mc Coy
Stefan, great suggestion !!

I will definitely bookmark this page and consider later. But my
project dictate me use SWIG. I'm almost near the happy subend. Very
curios on question I asked in previous message.

Dear all, I love you too much :)

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python data types in c++ code

2011-03-06 Thread Arthur Mc Coy
Ok people,


I do:
for (Py_ssize_t i = 0; i< PyList_Size(py_list); ++i) {
 PuObject* obj = PyList_GetItem(py_list, i);
 if (obj != NULL) {
   // howto get obj properties of different types
(map, list, string, int, bool) ?
 }
}

Very clear code. The question is in the comment :)
Let's play more,
it's like jazz,
let's explore,
Baby baby baby bass


Keep yourselves,
Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


python data types in c++ code

2011-03-06 Thread Arthur Mc Coy
Hi all,


Ok, I managed to work with c++ data types in python and can store
serialize c++ objects to store in json.

Now the task is backward. I wrote a c++ code to get the list of
objects using again python interface. The list of objects is returned.
PyList.

But I can't see how to convert PyObject as element of PyList to c++
data type or even how to convert or iterate PyList which is PyObject
too.


Please, whisper me the proper way I will go for.
Be happy :)

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: c++ data types in python script

2011-03-06 Thread Arthur Mc Coy
Great!

The solution is to use self.benchmarks = list(object.benchmarks).

Now I'm battling with time_t type. C++ time_t converts to python int
but it causes memore leaks due to destructor absence. I'm trying to
figure it out. If anyone know, please share your thoughts.

Be happy :)

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


c++ data types in python script

2011-03-06 Thread Arthur Mc Coy
Hi people,

I've used SWIG module to embed python inside c++ app. I pass a list of
objects (with lots of different properties of types string, float,
custom types like URL, Software and finally of list of strings).

Now I'm in python. URL and Software has str() method that converts
their value to string recognizable by JSON. But the problem is with
list of strings.

So, as I said I passed std::list myObjects to python
function.
Then I iterate it and for each object in myObjects I create a python
copy (serialize it) to be able to put into JSON format and store in
appropriate file.

object has property benchmarks of type list.
I do:
...
class PythonObject:
def __init__(self, object):
self.benchmarks = list()
for s in object.benchmarks:
self.benchmarks.append(s)
...
and it fails, also I do:
...
class PythonObject:
def __init__(self, object):
self.benchmarks = [unicode(s) for s in object.benchmarks]
...
and it fails, also I do:
...
class PythonObject:
def __init__(self, object):
for s in object.benchmarks:
print s[0] + s[1] + s[2]
print type(s)
...
and it fails printing
   wor
   
   Segmentation fault (core dumped)
$
also I do:
...
class PythonObject:
def __init__(self, object):
self.benchmarks = unicode(object.benchmarks)
...
and it does not fail, instead it puts in JSON this string:
...
"benchmarks": " > *' at
0xb63ed4e8>>",
...
but it is not what I need

What I'm trying to stress is that c++ objects should be converted
(serialized) before putting them into json. Otherwise type errors
occur and process fails.


I love learning python and hope somebody may suggest me or tell
something.

Thank you all anyway!

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Still need the answer to the question: " howto embed given python file
(which contains python class and its members) into the c++
application ? "

I have to pass the arguments from c++ to python and back so I need to
do conversions. They are ok. Fails PyImport_Import(my_module) call
saying "No module called mymodule". Then I need to create a mymodule
based on given python file (its name mymodule.py). Can it be achieved
using SWIG ?

I'm very curious and looking for some feedback if possible :)
Be happy.

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Using simple words: I have mymodule.py file and c++ application.
mymodule.py file contains two classes A and B. A class is a custom data
type. B class contains functions putJSON, getJSON which I want to run from
within C++ code. These functions are members of class B. So I need to import
mymodule.py inside C++ app and call its members.

Documentation does not explain this or it is written in a way that hard to
catch out.

I guess SWIG can help me to create a python module interface, but I can't do
that since SWIG documentation is also poor in my case.

Thank you for any help

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
The problem is "how to write python module under SWIG for C++
application"

Nor SWIG documentation neither embeding python documentation does not
answer to this.


If you can help, please, share your idea.

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Yes, I did. Here the link
http://docs.python.org/extending/extending.html#providing-a-c-api-for-an-extension-module

It does not cover .py file embeding. So it is not my case.

On Fri, Mar 4, 2011 at 7:03 PM, Santoso Wijaya wrote:

> Have you read the doc [1] on extending/embedding Python?
>
> ~/santa
>
> [1] http://docs.python.org/extending/
>
> On Fri, Mar 4, 2011 at 8:27 AM, Arthur Mc Coy <1984docmc...@gmail.com>wrote:
>
>> Hi all,
>>
>>
>> I have a C++ application. I have a .cpp file which is not a main
>> program, but a class where I want to call python script
>> (doSomething.py file).
>>
>> I'm using embed python like in a tutorial here:
>> http://www.codeproject.com/KB/cpp/embedpython_1.aspx
>>
>> But the tutorial is bad. It does not explain howto create python
>> module which they call in their example. doSomething.py file contains
>> two classes, one of them I use externally (its functions).
>>
>> So I need to PyImport_Import(py_module) by name of this py file, but
>> when I try to do that it fails. Please, give me some examples.
>>
>>
>> If needed, I can attach my code as well.
>> Thank you, waiting for anybody's response!
>> Be happy.
>>
>> Arthur
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Hi all,


I have a C++ application. I have a .cpp file which is not a main
program, but a class where I want to call python script
(doSomething.py file).

I'm using embed python like in a tutorial here:
http://www.codeproject.com/KB/cpp/embedpython_1.aspx

But the tutorial is bad. It does not explain howto create python
module which they call in their example. doSomething.py file contains
two classes, one of them I use externally (its functions).

So I need to PyImport_Import(py_module) by name of this py file, but
when I try to do that it fails. Please, give me some examples.


If needed, I can attach my code as well.
Thank you, waiting for anybody's response!
Be happy.

Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python simplejson decoding

2011-03-04 Thread Arthur Mc Coy
Good day people,


So I have python file which can handle json data to put and get back
it from a file say objects.json. Great.

Now I want to run this code from within C++ application. I used swig
to wrap the C++ class, which wants to call python code. It works fine,
because when I import native python modules like simplejson or os.path
the operation is successfull.

But how to import my custom python code (not native builtin modules) ?
There are following ways:
- import as python module
- call python file and its functions

I prefer second way because I do not know how to define my custom
module.

If you know some examples, let me know please. Yes, I'm googling and
reading off docs, but have not yet understood them.


Arthur
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arbitrary precision linear algebra

2011-03-02 Thread Arthur Mc Coy
> Are you saying python cares whether I express a number as 0.001 or
> scaled by 10^5 to read 100? If this is the case, I'm still stuck. I
> need the full range of eigenvalues from 1 to 1E-300, so the entire
> range could be scaled by 1E300 but I would still need better precision
> than 1E19

If python package can't compute 1E-300, then you can't use it.
You can try to split your task onto small subtasks, which can be
handled by specific python package.

Then you need to think of the way to do that. Mathematically. If no
way, then you can leave your task alone.
Programming is limiting, that is true.

I have heard about grid computing. You may find scientists working on
grid and ask how do they split their tasks.
But I think they do not an answer as well.

Also google uses its matrix to rank web pages. It computes the maximum
eigenvalue from the matrix which contain near zero entries too. Maybe
you can find how do they store those values.

Sorry, can't help anymore. I also have computing problems which I
can't yet solve :)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python simplejson decoding

2011-03-02 Thread Arthur Mc Coy
Hi Peter,


I implemented my decoder using your approach. Very positive.

But that is for simple objects. My objects have nested lists. For
example MyObject has property (member) called benchmarks, which is the
list of defined benchmarks. I'm not sure if obj.__dict__.update will
help me to copy nested information. I will see later. Now, when the
testing environment is ready, I go for real world application.


Thank you!

Kostia

On Mar 2, 4:24 pm, Peter Otten <__pete...@web.de> wrote:
> Arthur Mc Coy wrote:
> > Hi all,
>
> > I'm trying an example (in attached file, I mean the bottom of this
> > message).
>
> > First, I create a list of 3 objects. Then I do:
>
> > PutJSONObjects(objects)
> > objects = GetJSONObjects()
> > PutJSONObjects(objects, "objects2.json")
>
> > 1) PutJSONObjects(objects) method creates objects.json file (by
> > default). It works fine.
> > 2) Then objects = GetJSONObjects() method get the file contents and
> > return.
>
> > 3) Finally the script fails on the third method
> > PutJSONObjects(objects, "objects2.json")
> > saying: AttributeError: 'dict' object has no attribute '__dict__'
>
> > That is true, because objects returned by GetJSONObjects() is not a
> > list of objects, but simple string
>
> > So here is the question, please, how should I DECODE .json file into
> > list of python objects so that I will be able to put the copy of these
> > objects into a new file called objects2.json ?
>
> > simplejson docs are hard to follow - without examples.
>
> I suggest that you use json instead which is part of the standard library
> since Python 2.6. The documentation is here:
>
> http://docs.python.org/library/json.html
>
> If you know that there are only MyObject instances you need a function to
> construct such a MyObject instance from a dictionary. You can then recreate
> the objects with
>
> objects = [object_from_dict(d) for d in json.load(f)]
>
> or, if all dictionaries correspond to MyObject instances
>
> objects = json.load(f, object_hook=object_from_dict)
>
> A general implementation for old-style objects (objects that don't derive
> from object) is a bit messy:
>
> # idea copied from pickle.py
> class Empty:
>     pass
>
> def object_from_dict(d):
>     obj = Empty()
>     obj.__class__ = MyObject
>     obj.__dict__.update((str(k), v) for k, v in d.iteritems()) # *
>     return obj
>
> If you are willing to make MyClass a newstyle class with
>
> class MyObject(object):
>     # ...
>
> the function can be simplified to
>
> def object_from_dict(d):
>     obj = object.__new__(MyObject)
>     obj.__dict__.update((str(k), v) for k, v in d.iteritems()) # *
>     return obj
>
> (*) I don't know if unicode attribute names can do any harm,
> obj.__dict__.update(d) might work as well.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arbitrary precision linear algebra

2011-03-02 Thread Arthur Mc Coy
On Mar 2, 5:26 pm, Ben123  wrote:
> On Mar 2, 9:04 am, Arthur Mc Coy <1984docmc...@gmail.com> wrote:
>
> > What do you mean by "arbitrary precision" ? Each method of calculating
> > of something has its own precision...
>
> If you are unfamiliar with arbitrary precision, I'm referring 
> tohttp://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic
>
> Suppose I find the eigenvalues of a matrix and the eigenvalues range
> from 1 to 0.0001. This can be handled by numpy in Python because the
> smallest eigenvalue is larger than then numerical precision of 1E-19.
> However, if the range of eigenvalues is 1 to 1E-40, then I will need
> to increase the precision of all calculations leading up to finding
> the eigenvalues.
>
> I am working with complex valued matrices and I expect to get real
> eigenvalues back (based on the physics of the system). The precision
> of numpy is apparent from the imaginary component of the eigenvalues I
> find, currently 1E-19 or 1E-20. I need better precision for small
> eigenvalues.
>
> In case you are curious, the complex-valued matrices are 20x20.
>
> Thanks

You probably have to change the method of finding eigenvalues.
Which one do you use? Power or algebraic ?
Do you use Gaussian method to simplify matrices ?

Languages can't support infinitely large or small numbers, so try to
multiply the inner variables by 10^n to increase their values if this
will not involve on the method. For example, I did this when was
calculating geometric means of computer benchmarks.
In such way you will be storing the number of zeros as n.

Yes, interesting what are you calculating.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: arbitrary precision linear algebra

2011-03-02 Thread Arthur Mc Coy
What do you mean by "arbitrary precision" ? Each method of calculating
of something has its own precision...
-- 
http://mail.python.org/mailman/listinfo/python-list


python simplejson decoding

2011-03-02 Thread Arthur Mc Coy
Hi all,



I'm trying an example (in attached file, I mean the bottom of this
message).

First, I create a list of 3 objects. Then I do:


PutJSONObjects(objects)
objects = GetJSONObjects()
PutJSONObjects(objects, "objects2.json")


1) PutJSONObjects(objects) method creates objects.json file (by
default). It works fine.
2) Then objects = GetJSONObjects() method get the file contents and
return.

3) Finally the script fails on the third method
PutJSONObjects(objects, "objects2.json")
saying: AttributeError: 'dict' object has no attribute '__dict__'


That is true, because objects returned by GetJSONObjects() is not a
list of objects, but simple string

So here is the question, please, how should I DECODE .json file into
list of python objects so that I will be able to put the copy of these
objects into a new file called objects2.json ?

simplejson docs are hard to follow - without examples.



Please, help me. Be happy!

Arthur



# Python-JSON method for caching my objects.

import simplejson as json
import os.path
from datetime import datetime


def GetJSONObjects():

# determine the json data file path
filename = "objects.json"
filepath = "/home/docmccoy/Documents/" + filename
if os.path.isfile(filepath):
filename = filepath
f = open(filename, 'r')
objects = json.load( f )
print objects
else:
objects = list()

return objects


def PutJSONObjects(objects, filename = "objects.json"):

# determine the json data file path
filepath = "/home/docmccoy/Documents/" + filename
if os.path.isfile(filepath):
filename = filepath

f = open(filename, 'w')
json.dump([o.__dict__ for o in objects], f, indent = 4 * ' ' )


class MyObject:
def __init__(self, ID, url, category, osfamily, createDate):
self.id = ID
self.url = url
self.category = category
self.osfamily = osfamily
self.createDate = createDate


o1 = MyObject(1, "http://google.com";, "search", "linux",
unicode(datetime.now()))
o2 = MyObject(2, "http://localhost";, "mycomp", None,
unicode(datetime.now()))
o3 = MyObject(3, "http://milan.com";, "football", "windows",
unicode(datetime.now()))

objects = list()
objects.append(o1)
objects.append(o2)
objects.append(o3)

PutJSONObjects(objects)
objects = GetJSONObjects()
PutJSONObjects(objects, "objects2.json")
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python library for mail/news message headers & bodies?

2010-10-26 Thread Arthur Divot
Chris Rebert wrote:

> On Mon, Oct 25, 2010 at 7:18 PM, Arthur Divot  wrote:
> > Is there a python library equivalent to Perl's News::Article
> > (load a file containing a news or mail message into an
> > object, manipulate the headers and body, create a new empty
> > one, save one to a file)?
> 
> The `email` package in the std lib?:
> http://docs.python.org/library/email.html

That's just what I need. Thanks.

> The Global Module Index is your friend:
> http://docs.python.org/modindex.html

Yes it is!

-- 
http://mail.python.org/mailman/listinfo/python-list


python library for mail/news message headers & bodies?

2010-10-25 Thread Arthur Divot
Is there a python library equivalent to Perl's News::Article
(load a file containing a news or mail message into an
object, manipulate the headers and body, create a new empty
one, save one to a file)?

Thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list


Over a billion people believe Allah will provide 72 virgins to some Muslims.

2007-04-04 Thread Frank Arthur

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Please visit www.nkusa.org, www.911blogger.com, www.stj911.org:
>
> I am surprised at the number of un-informed, ill-informed sheeple on
> earth as well as politically correct hypocrites.
And you are one of them <[EMAIL PROTECTED]>

Over a billion people believe Allah will provide 72 virgins to some Muslims.
That doesn't mean it is at all true! 


-- 
http://mail.python.org/mailman/listinfo/python-list


It is good to blow up a marketplace full of people buying and selling food

2007-02-04 Thread Frank Arthur
It is good to blow up a marketplace full of people buying and selling food
in Iraq.
This is how Muslim insurgents will drive "the enemy" out of their country.
By killing and maiming fellow Iraqis! The traditional Muslim way.
The way of Allah! The way of the Quaran! The way of Mohammed!
They don't need any democracy. They don't need free elections. They are true
believers!

Suicide truck bomber kills at least 130 in Baghdad
By Tina Susman, Times Staff Writer
11:23 AM PST, February 3, 2007


BAGHDAD -- A suicide bomber posing as a trucker hauling food drove into a
busy market in central Baghdad today and blew himself up, killing at least
130 people, injuring more than 300, and capping a particularly volatile day
in Iraq's sectarian war.

Seven car bombs also tore through the northern city of Kirkuk, leaving two
dead in attacks that underscored tensions enveloping the oil-rich region as
Arabs and Kurds vie for power. Another person died south of Baghdad in a
separate car bombing.


The incidents illustrated the breadth of polarization plaguing Iraq as U.S.
and Iraqi officials prepare for what they vow will be a decisive crackdown
on insurgents.

The Interior Ministry said the blast in the market in Sadriya killed at
least 130 people and injured 305. It came in the early evening as shoppers
thronged the stalls and tiny shops to stock up for the evening meal. Hamed
Majed, a butcher, was tending to customers when he saw a large yellow truck
trying to navigate down the narrow, alley-like street leading through the
market.


<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> First the tiny hezbollah destroyed merkevas one after another using
> precision anti-tank weapons reducing the israelis to madness of
> indiscriminate cluster bombing.
>
> But the Iranians are the smartest of these Islamics. Grand chess
> masters ... who once saved the ass of jews under Cyrus the Great from
> Nebuchadnezzer
>
> =
>
> Open house at Iranian nuclear site
>
> Isfahan, Iran
> February 5, 2007
> AdvertisementAdvertisement
>
> Iran has opened one of its nuclear sites to local and international
> reporters and ambassadors to show the transparency of its program
> before a UN Security Council deadline this month.
>
> Tehran has kept up efforts to give the site at Isfahan more publicity.
> A tourism official said late last year that Iran planned to open it
> and other nuclear plants to foreign tourists.
>
> Iran's ambassador to the International Atomic Energy Agency, Ali
> Asghar Soltanieh, said the purpose of the tour was to assure the world
> that Iran's program was peaceful.
>
> "In fact we have representatives from all over the world," Mr
> Soltanieh said. "We decided to have them come here and see for
> themselves," he said.
>
> He made a point of emphasising the IAEA surveillance cameras at
> Isfahan.
>
> Photographers and video camera operators were not allowed to take
> pictures in the outside area of the compound.
>
> Uranium ore is converted into yellowcake and gas at Isfahan. The gas
> is transferred to the more sophisticated plant at Natanz, where it
> could be enriched with centrifuges.
>
> Reporters at the weekend passed the Natanz site but were not allowed
> inside, where Iran recently said it was installing 3000 centrifuges.
>
> NEW YORK TIMES
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Germany issues warrants for 13 American CIA agents

2007-01-31 Thread Frank Arthur

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Here is the daily good news.
> 
Is it now 39 "American CIA agents"
or did you just posted this 3 times? 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Frank Arthur
Islamist bastard <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> FBI spook bastard  that speaks french also
>
> On Jan 29, 8:13 am, "Hampton Din" <[EMAIL PROTECTED]> wrote:
>>  stupid troll
>
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Excellent Interview with Dennis D'Souza, full of laughs

2007-01-29 Thread Frank Arthur
Real funny? Holocaust Deniers Convention in Iran?

Sick, sick Islamists!

<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> http://a1135.g.akamai.net/f/1135/18227/1h/cchannel.download.akamai.com/
> 18227/podcast/PORTLAND-OR/KPOJ-AM/1-23-07%20POJ-cast.mp3?


-- 
http://mail.python.org/mailman/listinfo/python-list


Best way to do data source abstraction

2006-06-01 Thread Arthur Pemberton
What is the best way to do data source abtraction? For example have
different classes with the same interface, but different
implementations.

I was thinking of almost having classA as my main class, and have
classA dynamically "absorb" classFood into to based on the extension
of the input file received by classA. But this doesn't seem possible.

Please advise.

Thank you.

-- 
To be updated...
-- 
http://mail.python.org/mailman/listinfo/python-list


Any other config parsing modules besides ConfigParser ?

2006-05-29 Thread Arthur Pemberton
Are there any other good config parser modules for python? I am
looking for something a bit more versatiles than ConfigParser.

Thank you.

-- 
To be updated...
-- 
http://mail.python.org/mailman/listinfo/python-list


Best way to check that a process is running on a Unix system?

2006-05-27 Thread Arthur Pemberton
Hello list,

What is the best way to check that a process is running (or better yet
number of instances) based on the name of the process? Would have to
work on a unix/linux system.

Thank you.

-- 
To be updated...
-- 
http://mail.python.org/mailman/listinfo/python-list


RAD tutorials and tools for GUI development with Python?

2006-03-08 Thread Arthur Pemberton
Hey guys,

I would really like to code a few more widely useable apps, but coding
the GUI just seems so boring and unnecessarily complex. Maybe I was
spoilt by Borland's Delphi/Kylix. But is there any way to do as little
coding of the GUI as possible, and worry about the logic? The best I've
seen is using one tool with a modification to output python code, which
then has to be regenerated after any change to the GUI, which to me,
kinda defeats the "rapid" in RAD.

Thanks, advice would be much apperciated. If it helps to know, I am
currently more interested in Python/Gtk (but not because I particularly
like the look of Gtk)

Arthur.-- As a boy I jumped through Windows, as a man I play with Penguins.
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-07 Thread Arthur
Arthur wrote:
> 
> My ability to grok Python to any extent, from that starting point, was 
> based on an understanding that it was my responsibility to come to 
> Python, not it to me. And concerted, almost obsessive effort, And time.
> 
> OTOH - because of exactly these factors - I have actively resented and 
> resisted promulgation of the Python is Easy meme.
> 
> Pity that this stance has separated me from a sense of belonging to the 
> community, which seems to so highly value that meme.

What Python *is*, to me, is a game worth playing.  Not something I come 
across all that often.  And easy games, almost invariably, are not.

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about idioms for clearing a list

2006-02-07 Thread Arthur
Raymond Hettinger wrote:
> 
> There was a pithy Tim Peters quotation to the effect that he was
> unpersuaded by language proposals predicated on some hypothetical
> average programmer not being smart enough to understand something that
> the rest of us find to be basic.

Peters pithy ;)

As someone coming to Python as a well less than the average programmer, 
I agree wholeheartedly with Mr. Peters.

My ability to grok Python to any extent, from that starting point, was 
based on an understanding that it was my responsibility to come to 
Python, not it to me. And concerted, almost obsessive effort, And time.

OTOH - because of exactly these factors - I have actively resented and 
resisted promulgation of the Python is Easy meme.

Pity that this stance has separated me from a sense of belonging to the 
community, which seems to so highly value that meme.

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Detecting line endings

2006-02-07 Thread Arthur
Arthur wrote:
> Alex Martelli wrote:
> 
> I just got flummoxed by this issue, working with a (pre-alpha) package 
> by very experienced Python programmers who sent file.readline to 
> tokenizer.py without universal newline support.  Went on a long (and 
> educational) journey trying to figure out why my file was not being 
> processed as expected.

For example, the widely used MoinMoin source code colorizer sends files 
to tokenizer without universal newline support:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298

Is my premise that tokenizer needs universal newline support to be 
reliable correct?

What else could put it out of sync with the complier?

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Detecting line endings

2006-02-07 Thread Arthur
Alex Martelli wrote:
> Fuzzyman <[EMAIL PROTECTED]> wrote:
> 
> 
>>Hello all,
>>
>>I'm trying to detect line endings used in text files. I *might* be
>>decoding the files into unicode first (which may be encoded using
> 
> 
> Open the file with 'rU' mode, and check the file object's newline
> attribute.

Do you think it would be sensible to have file.readline in universal 
newline support by default?

I just got flummoxed by this issue, working with a (pre-alpha) package 
by very experienced Python programmers who sent file.readline to 
tokenizer.py without universal newline support.  Went on a long (and 
educational) journey trying to figure out why my file was not being 
processed as expected.

Are there circumstances that it would be sensible to have tokenizer 
process files without universal newline support?

The result here was having tokenizer detect indentation inconstancies 
that did not exist - in the sense that the files were compiled and ran 
fine by Python.exe.

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


readline tokenizer newline sticky wicket

2006-02-06 Thread Arthur
Given a "linemess.py" file with inconsistent line ending:

line 1 \r
\r\n
line \n

tokenized as per:

import tokenize
f=open('linemess.py','r')
tokens=tokenize.generate_tokens(f.readline)
for t in tokens:
print t

get output as follows:

(1, 'line', (1, 0), (1, 4), 'line 1\r\n')
(2, '1', (1, 5), (1, 6), 'line 1\r\n')
(4, '\r\n', (1, 6), (1, 8), 'line 1\r\n')
(1, 'line', (2, 0), (2, 4), 'line 2\n')
(2, '2', (2, 5), (2, 6), 'line 2\n')
(4, '\n', (2, 6), (2, 7), 'line 2\n')
(0, u'', (3, 0), (3, 0), u'')

So that the Windows \r\n is tokenized as a single literal token rather 
than as \n under the convention of universal newline support.

Isn't this a problem? 

I think this must have been at the  route of the issue I ran into when a 
file of messy inconsistent line ending that nonetheless compiled and ran 
without a problem was rejected by tokenizer.py as  having an indent issue.

On the theory that if tokenizer needs to fail when crap is thrown at it, 
it should do so more gracefully - is this bug reportable?

Art




-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie Help!

2006-02-05 Thread Arthur Cannell
Stephen wrote:
> Hi All,
> im new to python i just have a few questions and was wondering if 
> you could help me??
> 
> 1. what programming langaugue does python use? or which is most popular?
> 
> 2. Does anyone know where i could get hold of practice code
> 
> 3. Any good ebooks or links to start with. (according to the web this is the 
> best place to start.)
> 
> i know you probally get asked these questions all the time! but im trying to 
> mirgrate for windows to linux.
> 
> Cheers all
> CFR 
> 
> 

Type "python" into Google's search text input.
Hit "I'm Feeling Lucky".
Enjoy.
Good luck with the migration.
-- 
http://mail.python.org/mailman/listinfo/python-list


Photogallery written in Python?

2005-12-30 Thread Arthur Pemberton
Does anyone know of a photo gallery implemented in python? Preferably one as featureful as those used at kde-look.org and art.gnome.org?Thank you.
-- As a boy I jumped through Windows, as a man I play with Penguins.
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-21 Thread Arthur Clune
Kent Johnson wrote:
> 
> OK I'll try. First let me say I have no interest in a licensing flame war, 
> there are valid 
> reasons why an author might prefer one license over another and certainly 
> there are good 
> reasons to choose GPL. However the work I do is commercial and proprietary 
> and I doubt I 
> could get approval to release it under GPL. So I am restricted to projects 
> with more 
> liberal licenses such as MIT, BSD and Apache licenses. These allow 
> closed-source 
> distribution of products based on them.
> 

As long as the author holds copyright on all the code, he can release it to you 
under
any license he wants, as well as via GPL to the world (this is how MySQL and 
SleepyCat
opterate).

So you could, for example, offer him X pounds/dollars/euros for a BSD version + 
support
etc.

Arthur

-- 
Arthur Clune
-- 
http://mail.python.org/mailman/listinfo/python-list


Seperating logic code from gui code

2005-12-04 Thread Arthur Pemberton
Hello,

I am new to Qt programming and PyQt. I am attempting to build a client
for AllofMp3.com, I already have most of the logic code down. But now I
want to build a GUI with PyQt. What rules should I follow to make the
program useable in the console, but also with a GUI?

Thank you.-- As a boy I jumped through Windows, as a man I play with Penguins.
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Arthur
On Thu, 03 Nov 2005 23:25:45 +1100, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:

> Accounting software comes to mind. But just because Microsoft
>did not, or was unable to, illegally squelch competition in one market
>does not excuse them for doing so in another.

Just as a factual matter, while Micorsoft has not achieved a monopoly
on accounting software, it is not for not trying.  The Business
Solutions unit is hard at work on the project.  

It is not judgemental - sinply factual  - that among the strategies
being employed is to buy accounting software vendors for the express
purpose of burying their offering, creating less options in the
marketplace, and of course offering a migration path to Microsoft
alternatives for the software they are buying to bury.

Not a pleasant thing to watch, and not sure why it doesn't get more
attention from regulators. 

but to the extent it doesn't, it is playing within the rules.

"Roll-ups" of this sort are in fact happening all over the economy -
in muffler shops as well as accoutning software.  Consumers benefits
from the economies of scale achioeved.

Whether they like it or not ;)

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


coloring a complex number

2005-10-21 Thread Arthur
Spending the morning avoiding responsibilities, and seeing what it would
take to color some complex numbers.

class color_complex(complex):
 def  __init__(self,*args,**kws):
 complex.__init__(*args)
 self.color=kws.get('color', 'BLUE')

>>> a=color_complex(1,7)
>>> print a
(1+7j)  #good so far
>>> a=color_complex(1,7,color='BLUE') 
Traceback (most recent call last):
  File "", line 1, in -toplevel-
a=color_complex(1,7,color='BLUE')
TypeError: 'color' is an invalid keyword argument for this function

No good... it seems that I am actually subclassing the built_in function
'complex' when I am hoping to have been subclassing the built_in numeric
type - complex.

but some googling sends me to lib/test/test_descr.py

where there a working subclass of complex more in
accordance with my intentions.

class color_complex(complex):
def __new__(cls,*args,**kws):
result = complex.__new__(cls, *args)
result.color = kws.get('color', 'BLUE')
return result

>>> a=color_complex(1,7,color='BLUE')
>>> print a
(1+7j)
>>> print a.color
BLUE

which is very good.

But on the chance that I end up pursuing this road, it would be good if
I understood what I just did. It would certainly help with my
documentation  ;)

Assistance appreciated.

NOTE:

The importance of the asset of the depth and breadth of Python archives
-  for learning (and teaching) and real world production - should not be
underestimated, IMO. I could be confident if there was an answer to
getting the functionality I was looking for as above, it would be found
easily enough by a google search.  It is only with the major
technologies that one can hope to pose a question of almost any kind to
google and get the kind of relevant hits one gets when doing a Python
related search.  Python is certainly a major technology, in that
respect.  As these archives serve as an extension to the documentation,
the body of Python documentation is beyond any  normal expectation.

True, this asset is generally better for answers than explanations.

I got the answer I needed.  Pursuing here some explanation of that answer.

Art


-- 
http://mail.python.org/mailman/listinfo/python-list


Problem building Python bindings for subversion

2005-06-28 Thread Arthur Chereau
Hi,

I'm trying to setup viewcvs to work with subversion 1.2.0 on Linux with
Python 2.4.1. The last viewcvs (from CVS) needs subversion python
bindings. I installed swig and built subversion from source with it.
Everything works fine until I try to build the Python bindings.

When I try "make swig-py" I get the following, Python related, error:

# make swig-py
/bin/sh /usr/src/subversion-1.2.0/libtool --tag=CC --silent
--mode=compile gcc -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE  -DSWIGPYTHON -g -O2  -g -O2
-pthread  -DNEON_ZLIB -DNEON_SSL
-I/usr/src/subversion-1.2.0/subversion/bindings/swig
-I/usr/src/subversion-1.2.0/subversion/include
-I/usr/swig/share/swig/1.3.25 -DSVN_SWIG_VERSION=103025
-DSWIG_TABLE_TYPE=subversion -I/usr/src/subversion-1.2.0/apr/include
-I/usr/src/subversion-1.2.0/apr-util/include
-I/usr/Python/include/python2.4
-I/usr/src/subversion-1.2.0/subversion/bindings/swig/python/libsvn_swig_py
-I./subversion/include -I./subversion
-I/usr/src/subversion-1.2.0/neon/src -I/usr/subversion/include/neon
-I/usr/src/subversion-1.2.0/apr/include
-I/usr/src/subversion-1.2.0/apr-util/include  -o
subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.lo -c
/usr/src/subversion-1.2.0/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

In file included from /usr/Python/include/python2.4/Python.h:8,
 from
/usr/src/subversion-1.2.0/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:20:
/usr/Python/include/python2.4/pyconfig.h:844: warning: `_XOPEN_SOURCE'
redefined
*Initialization*:1: warning: this is the location of the previous
definition
In file included from
/usr/src/subversion-1.2.0/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c:44:
/usr/swig/share/swig/1.3.25/runtime.swg:28: macro `SWIG_GetModule' used
without args
/usr/swig/share/swig/1.3.25/runtime.swg:34: macro `SWIG_GetModule' used
without args
make: ***
[subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.lo] Error 1

Is there something I'm doing wrong ?

Thanks,

AC

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Arthur
On Mon, 30 May 2005 14:24:54 -0400, "Terry Reedy" <[EMAIL PROTECTED]>
wrote:

>
>"D H" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>> Elliot Temple wrote:
>>> Hi I have two questions.  Could someone explain to me why Python is
>>> case sensitive?  I find that annoying.
>>
>> I do too.
>
>I don't.
>
>>  As you've found, the only reason is because it is,
>
>False.  As someone else already pointed out in this thread, and as some 
>said years ago when Guido brought up the subject, standard math notation 
>*is* case sensitive and some people like Python because they can directly 
>translate math expressions into Python expressions.

False.

In the sense that it is the way it is only because Guido kept it the
way it is, but he did so without acknowledging that your argument or
anyone else's argument was in the least bit pursuasive to him.

>I am annoyed by the disinformation and slander ('anti-newbie') repeated 
>indefinitely by some case-folding advocates.  Difference annoyances for 
>different folks, I guess.

I am annoyed that Guido skated while those of us vocally annoyed that
Guido could be influenced into this substanceless "newbie" issue, and
influence so many others to contemplate it with such solemnity - did
not skate as well.

Art 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Arthur
On Thu, 26 May 2005 16:24:39 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote:

>"Elliot Temple" <[EMAIL PROTECTED]> writes:
>
>> Hi I have two questions.  Could someone explain to me why Python is
>> case sensitive? I find that annoying.
>
>Because it comes from a language background of case sensitive
>languages (C, shell, etc.). But read what the BDFL has to say about
>it: http://mail.python.org/pipermail/python-list/2001-July/054788.html >

As Guido's statement on his position on case sensitivity/insensitivity
cited above was in response to a post/provocation of mine, its gives
me, and I shall indulge myself in, an opportunity to partake of a
favorite pasttime - venting,

I will make it short:

It gauls the hell out of me that that the Python community mass "head"
was in such a strange place at that moment that I had to take the pose
of maniacal extremist to have a sensible converstaion.

Or that's the history I am writing, in any case.

Art 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Case Sensitive, Multiline Comments

2005-05-29 Thread Arthur
On 26 May 2005 17:33:33 -0700, "Elliot Temple" <[EMAIL PROTECTED]>
wrote:

>Thanks for the link on case sensitivity.  I'm curious about the person
>who found case sensitivity useful though: what is it useful for?

I am curious about why you find case sensitivity annoying.  But just
mildly curious.

Martelli can tell you why Guido keeping case sensitivity in Python was
him bowing to the stupidity of the masses.

I have been neutral on the subject except to the extent the impetous
for going case insensitive would be to statisfy the needs - as Guido
uses the word -  "non-programmers".

a) its probably better to design a programming language around the
needs of programmers than around those of non-porgrammers.  that much
always seemed quite obvious to me. 

b) it would only help non-programmers who were more comfortable with
case insensitivity but hurt non-progammers more comfortable with case
sensitivity.

That Martelli so strongly favors case insensitivity for his own use,
is one of many indications that this is not an issue that cuts along
the lines of quantity of programming experience..

That much also seemed pretty obvious, but it didn't seem to stop the
folks who wanted case insensitivity from making the non-programmer
accessibility issue paramount. and on the flimiest of evidence.  Those
who prefer sensitivity were anti-accessbility elitists. Damn near
Republicans.  

Classic politics.

Thankfully Guido seemed to have lost patience for the whole thing.  I
think the position is pretty much that Python will be case sensitive
becasue it has been case sensitive.

Art


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python for a 10-14 years old?

2005-03-27 Thread Arthur
On Fri, 25 Mar 2005 00:50:36 -0700, Jules Dubois
<[EMAIL PROTECTED]> wrote:

>On Wednesday 23 March 2005 22:03, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>(<[EMAIL PROTECTED]>) wrote:
>
>> Is there something out there like "Python for kids" which would explain
>> *basic* programming concepts in a way which is accessible and
>> entertaining for kids aged 10-14
>
>It's not what you asked for, but you should consider Squeak Smalltalk and
>eToys.  The GUIs that we use today are largely the work of Alan Kays's
>group at Xerox in the 1970s.  Dr. Kay has spent the last 35 years trying to
>make computers educational and fun for children.  If you're interested, see
>
>  http://www.squeak.org/ (The Squeak Smalltalk site)
>  http://www.squeakland.org/ (The eToys site)
>
>Squeak runs on Linux, MacOS, and even Windows, and it's free.

I again take the opportunity to raise a hand in protest.

Going to these sites I learn that Kay is the "Father of the Personal
Computer" working from "a deep understanding of how children learn".

He also may be someone who married himself to a bad idea 30 years ago,
in which he has invested too much, thereby crippling his ability to
confront scientific evidnce in an evenhanded manner.

He is also someone ex of Disney, now of HP, who lectures us on the
destructive infleunce of the profit motive on the development of
computer science and its capacity to enhance our world.

I understand better how Xah Lee got to be Xah Lee when confronted with
the cult of Kay.

Art


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A great Alan Kay quote

2005-02-13 Thread Arthur
On Sun, 13 Feb 2005 18:48:03 +0100, Francis Girard >
>My deepest apologies,
>
>Francis Girard

Sorry if I helped get you into this, Francis.

I have read and seen enough of Kay and his visions to find him as a
bug where *my* moon don't shine. When the appropriate opportunity
comes, I find it hard not to mention the fact. 

All for reasons I have gone into on other fourms, but won;t repeat
here.

His loyaliss are stongly loyal..

FWIW, my issues have nothing to do with Smalltalk.  They have to do
with Kay as a puiblic personage. He may, for all I know, be a
sweetheart, privately.  And this most recent interview is one of the
more reasonable  I have heard from him.  Perhaps he is touching down
in reality, more often.

But at  this point isn't it fair to consider that Kay has forked from
Smalltalk. I'd probably have more problems with him, not less, if I
were a committed Smalltalk guy.

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie needs help with canvas.create_image !

2005-02-12 Thread Arthur
On Sat, 12 Feb 2005 18:24:11 +0100, "Fredrik Lundh"
<[EMAIL PROTECTED]> wrote:

>Antti Isomursu wrote:
>
>> With code below I get a red box with given width and height. When I
>> use that create_image, nothing happens. I only see that same red box.
>> Why is that?
>> The loop.bmp is working fine when I use show() method.
>>
>>win = Toplevel()
>>
>>canvas = Canvas(win, width=100, height=100, background='red')
>>canvas.pack()
>>
>>im = Image.open("loop.bmp")
>>photo = ImageTk.PhotoImage(im)
>>
>>canvas.create_image(8, 8, anchor="nw", image=photo)
>
>the problem might be that the PhotoImage is garbage collected before being
>displayed.  see the note on the bottom of this page for details:
>
>http://effbot.org/zone/tkinter-photoimage.htm
>
> 

I had run into this for the first time recently as well.

and found this tutor thread helped.

http://starship.python.net/pipermail/python-de/2002q4/002834.html

Declaring "im" as global is one way to go (there I said it). In fact,
IMO, probably the clearest (though not the prettiest) way to go under
under the circumstances.  

I don't think anyone is particularly defending the circumstances. I
have heard the circumstances described as a bug, and the various
"solutions"  are perhaps better thought of as work-arounds.

Art




-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Vectors in Visual Python

2005-02-10 Thread Arthur
On Thu, 10 Feb 2005 09:59:41 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:

>Arthur <[EMAIL PROTECTED]> wrote:
>
>> thinking that the visciousness with wihich you were attacking someone
>> suggesting a proposal for an optional feature - even if an iill
>> adivised proposal for and ill advised optional feature (I frankly
>> don't care much about that part of the discussion one way or another)
>
>While in my case it's essentially ALL that I care about in this
>discussion: the technical aspects of Python.

Then *only * talk about the technical aspects of Python,  Is my, or
anybody else's stupidity, a technical aspect of Python?
>
>> - was unwarranted, and more importantly *unwise* for someone in a
>
>If, like you, I didn't care about the technical aspects of Python, it
>sure would be unwise to get upset -- I could let the language go to hell
>in a handbasket, as long as I made sure I looked good myself.

Save your fire for real threats - was the exact point I was trying to
make.

Is the questionaing of a newbie on a list Guido doesn't even read a
threat to the fate of Python - technical or otherwise.  Not in the
slightest, tiniest way . What is much more a threat to Python is an
inhospitable, dogmatic.and intimidating community ethos.

Let's not get to Altamont  before we need to.

>
>Caring deeply and passionately about something greater than oneself,
>particularly something which may seem dry and abstract to those who
>don't care a whit for it, might no doubt be deemed intrinsically unwise
>-- and yet, there is much to be said for such passion.  Without the
>ability to get passionate and inflamed, we might perhaps be wiser, but
>we'd be Vulcans, not humans.  Moreover, unless some of us felt such
>passion for certain technical issues, you guys who don't care would not
>get the benefits of the time and energy we freely devote to them -- so
>it's unwise, even from a strictly selfish viewpoint, to try to turn us
>firebrands into such coolly calculating Vulcans.

I appreciate your books indeed,Alex.  They are calm .I'm a customer. I
can study expositions. Not rants.

>
>> postion of community leadership - considering past, recent, and
>> undoubtedly future issues that have and will arise. 
>> 
>> What don't *you* understand about that??
>
>Could you _really_ believe, considering the many years of consistent
>history of my posts on this group, that by reviving the issue you could
>get *any* other effect but fanning the flames all over again?  THAT is
>what I don't understand: whether you're doing that _deliberately_, or
>out of almost-unbelievable levels of cluelessness.

What issue was being "revived"?  There was no issue there being
discussed that is on the table in any serious way.  In that sense it
was a harmless discussion, inititated by someone new to Python, and in
the almost inevitable why this? why that? exploratory assessment
stage.  I think you were candid enough to admit you had had such a
stage yourself. 

Being hardcoded less into any alternative view of the universe when
coming to Python  - i.e. ignorant - I faced much less of this.
Knowing little, I had a very smalll unlearning curve.

My struggle has been almost the opposite - and my lament has not been
why this?, why that?  - but why change this? and why change that?

>
>> We all have are own kinds of stupidities, it seems to me.
>
>This is no doubt the case.  For example, many of us instinctively brake
>and swerve when a small animal jumps into the road in front of the car
>they're driving, seriously endangering themselves and the passengers
>thereby.  If we were presented the issue in a context giving us time to
>reflect and react rationally -- "To how much danger to life and limb
>would you subject yourself, your wife, and your children, to increase
>the likelihood of survival for some stupid cat who can't wait to cross
>the road?" -- we'd probably react quite differently.  And yet, while it
>IS objectively stupid to behave that way, it _is_ one of the stupidities
>that make us human.

If that is your way of admitting perhaps some human overreaction -
attacking as a threat something that rationally is or was not - its
appreciated that you are able to do so.

>
>A _deliberate_ and consistent preference can be disagreed with, but it's
>pretty pointless to call it "stupid" or "unwise"; there is just no
>accounting for tastes.  If you _prefer_ the flame about declarations to
>continue for its own sake (or because you believe it makes you look
>good, whatever), while not caring about its contents, I may consider
>that evil and hateful, but it's neither intelligent nor stupid _per se_.
>If your preferences

Re: A great Alan Kay quote

2005-02-09 Thread Arthur
On Wed, 9 Feb 2005 21:23:06 +0100, Francis Girard
<[EMAIL PROTECTED]> wrote:
>
>I love him.

I don't.
>
>It's also interesting to see GUIs with windows, mouse (etc.), which apparently 
>find their origin in is mind, probably comes from the desire to introduce 
>computers to children.


Alfred Bork, now 
Professor Emeritus
Information and Computer Science
University of California, Irvine 92697

had written an article in 1980 called  

"Interactive Learning" which began

"We are at the onset of a major revolution in education, a revolution
unparalleled since the invention of the printing press. The computer
will be the instrument of this revolution."

In 2000 he published:

"Interactive Learning: Twenty Years Later"

looking back on his orignal article and its optimistic predictions and
admitting "I was not a very good prophet"

What went wrong?

Among other things he points (probably using a pointing device) at the
pointing device

"""
Another is the rise of the mouse as a computer device. People had the
peculiar idea that one could deal with the world of learning purely by
pointing.

"""
The articles can be found here:

http://www.citejournal.org/vol2/iss4/seminal.cfm 

One does not need to agree or disagree, it seems to me about this or
that point on interface, or influence, or anything else. What one does
need to do is separate hope from actuality, and approach the entire
subject area with some sense of what is at stake, and with some true
sense of the complexity of the issues, in such a  way that at this
stage of the game the only authentic stance is one of humility,

Kay fails the humility test, dramatically. IMO.

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Vectors in Visual Python

2005-02-09 Thread Arthur
On Thu, 10 Feb 2005 00:16:05 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:
>  Having found out how to
>build a lasting killfile, I'd like to see if using it liberally on
>people who appear to post here just to provoke flamewars, rather than to
>offer and receive help, and participate in interesting discussion, can

You are an accomplished provocateur. 

It is true that I joined the variable declaration discussion without
the intent of offering or receiving help.  I joined it actually to try
to make a point that I thought was community spirited - 
thinking that the visciousness with wihich you were attacking someone
suggesting a proposal for an optional feature - even if an iill
adivised proposal for and ill advised optional feature (I frankly
don't care much about that part of the discussion one way or another)
- was unwarranted, and more importantly *unwise* for someone in a
postion of community leadership - considering past, recent, and
undoubtedly future issues that have and will arise. 

What don't *you* understand about that??

We all have are own kinds of stupidities, it seems to me.

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Vectors in Visual Python

2005-02-09 Thread Arthur
On Thu, 10 Feb 2005 00:16:05 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:

>Arthur <[EMAIL PROTECTED]> wrote:
>
>
>Please clarify if you were making a lame joke without smilies, are
>utterly confused about what "declaration" *MEANS*, or what other folly
>prompted you to this astounding remark, thanks.  

Interesting pedagogical technique all-in-all  Mr. Martelli.

What point is there in trying to help you understand the basis of my
confusion, if my confusion is nothing more than a point of ridicule.

I know exactly what "declaration" is - a fucking word, nothing more
nothing less.

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Vectors in Visual Python

2005-02-09 Thread Arthur
On 9 Feb 2005 02:29:35 -0800, "FLChamp" <[EMAIL PROTECTED]>
wrote:

>SOrry if this message is a little confused, it most probably reflects
>the state of the author!

One bit of confusion is in names.  There was a name space clash early
on.  As things shook out "Visual Python" is ActiveState's Python
developement environment for Visual Studio .Net
http://www.activestate.com/Products/Visual_Python/ 
and the  3d programming environmnet to which you question refers
became " VPython".  Just a point of information.  Certainly no great
confusion in the context of your question, but there could be in other
contexts.
>
>I have made a small program that plots the orbit of a planet in visual
>python using visual.vector for all values. If i run the program it is
>clear that the orbit is non-keplerian as the planets gradually moves
>away from the sun. I am pretty sure the orbit should be keplerian so i
>guess there must be some source of error in the program.
>
>I am using "from __future__ import division" and the initial conditions
>I have are from NASA's horizons system, all values are accuracte to
>more than 10 decimal places.
>
>I was wondering if there was a way to specify the type of number used
>by visual.vector, for example, when using an array it is possible to
>specify the type as float64. If visual.vector was using a smaller
>amount of memory to store the number could this be the source of the
>error I am finding? If not what else could be the culprit?

My understanding:

is that VPython "vectors" are in effect flat 3 element Numeric arrays,
and Numeric ararys can be constructed with Float64 specified as the
datatype.  (wonder if that speciufication is a "declaration", and if
so whether that would indicate some conflict between Python's ideology
(Alex's version) and that of its defacto standard numerical processing
library - but I digress) .

Have you tried feeding the VPython the vectors,  arrays declared as
Float64 types.  

May, or may not, get you somewhere.

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: variable declaration

2005-02-08 Thread Arthur
On Sat, 5 Feb 2005 17:00:15 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:

>Alexander Zatvornitskiy
><[EMAIL PROTECTED]> wrote:
>   ...
>>  AM> The fact that in Python there are ONLY statements, NO declarations,
>> ===
>> def qq():
>>  global z
>>  z=5
>> ===
>> What is "global"? Statement? Ok, I fill lack of "var" statement:)
>
>'global' is an ugly wart, to all intents and purposes working "as if" it
>was a declaration.  If I had to vote about the one worst formal defect
>of Python, it would surely be 'global'.

Venturing in - again - over my head. Brave or stupid.  

But the fact that I cannot dissect Python byte code, doesn't mean I
can't follow the logic or illogic of an argument. Or hear, or
interpret reasonably well what I hear.

I will accept that global is a horribly wart for reasons that I don't
understand.  (worse than print>> for more reasons I don't understand
as well ?)

But making the argument that it is a wart *because* it is declarative,
and therefore a violation  of Python's purity is hard for me. 

"""
The fact that in Python there are ONLY statements, NO declarations, is
a completely different LEVEL of issue -- a totally deliberate design
choice taken in full awareness of all of its implications.  
"""

Global is there. It was put there by someone who presumably knows his
declaratives. So simply as a matter of logic, your assertion doesn't
hold up.

And as we learn, what is true of Python today is not necessarily what
is true of Python tomorrow.  And my understanding of the arguments
surrounding the decorator debate suggested to me that there is
decently strong sentiment among a segment of the folks who represent
"the community" much better than do I, that if there indeed has been
any purist stricture about the use of declaratives in the kanguage, it
may be wise to loosen it.

Why is it logical to believe that a language that is purely anything
will best do.  Python prides itself on being multi-paradigm, thought
I. Except Ales says no declarations allowed, with great authority. 

Do they belong in any language? Solve problems in any language?

If so, why is that Python is denied them?

Ultimately I don't think Guido chooses to be restricted by these kinds
of notions of purity.  And suspect that if and when declarations best
solve real problems, they will brought to bare - without regard to
such notions.

I am sure you could if you wanted provide a highly competent - OK
brilliant - answer to why given this and that aspect of Python it
can't and won't and shouldn't be.. 

But you are a polemicist at heart, it seems to me - on observation
from non-techncial discussion.

So all my technical limitations aside, I still don't think I could
decipher where polemics ends, and analysis begins.

Squash me like a bug, it you like. But I am not - just so you know -
meaning to be even unfriendly, much less hostile.


Art


>
>Fortunately, it's reasonably easy to avoid the ugliness, by avoiding
>rebinding (within functions) global variables, which tend to be easy. 
>
>What you keep demanding is a way to inject far worse ugliness, and in a
>context in which the typical behavior of pointy-haired bosses will be to
>make it unavoidable for many of the people who work with Python.  I am
>strongly convinced that, if you had your wish, the total amount of
>happiness in the world would be quite substantially diminished, and I
>will do anything I can to stop it from happening.
>
>
>>  >> Fine! Let interpreter never show us errors like division by zero,
>>  >> syntax errors, and so on. If file not found, library don't need to
>>  >> say it. Just skip it!!! Because every, even simple, test will find
>>  >> such bugs. Once you have unit tests, the added value of 
>>  >> is tiny, and their cost remains.
>>  AM> Another false assertion, and a particularly ill-considered one in ALL
>>  AM> respects. Presence and absence of files, for example, is an
>   ...
>> Here, you take one detail and bravely fight with it. Just try to understand
>> meaning of my sentence, in all. It will help:)
>
>I tear ONE of your examples to pieces in gory detail, because it's not
>worth doing the same over and over again to every single piece of crap
>you filled that sentence with -- very similar detailed arguments show
>how utterly inane the whole assertion is.
>
>There IS no meaning to your (several) sentences above-quoted, that it
>can help anybody to "try to undestand": it's simply an insanely bad
>attempt at totally invalid parallels.
>
>>  AM> In brief: you're not just wrong, you're so totally, incredibly,
>>  AM> utterly and irredeemably wrong that it's not even funny.
>> Hey, take it easy! Relax, reread that piece of text. It was written with 
>> smile
>> on my lips. Here it is for your convenience:
>
>Do yourself a favor: don't even _try_ to be funny in a language you have
>so much trouble with.  Your communication in English is badly enough
>impaired even without such lame attempts at humor: don't made bad things
>even worse -- th

Re: declarations summary

2005-02-07 Thread Arthur
On Mon, 07 Feb 2005 08:52:40 -0500, Arthur <[EMAIL PROTECTED]>
wrote:
> I happen to think Guido's choice was a good and
>courageous one.

which given my perceived track record (in some quarters), is probably
not a very good sign.

Or else by agreeing with Guido sometimes, I get to be right sometimes.

;)

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: declarations summary

2005-02-07 Thread Arthur
On 6 Feb 2005 20:34:22 -0800, "Michael Tobis" <[EMAIL PROTECTED]> wrote:

>
>General usage has "declaration" meaning "statement which does not
>generate executable bytecode but merely affects the compiler". My
>assertion that decorator syntax is "declarative" is therefore formally
>false.

I'm not sure what this adds to the discussion, but I think it worth
noting that PEP318 and Guido's own discussion make it very clear that
the choice of Python decorator syntax was influenced - presumable by
the drawing of some analogy - to Java Annotation syntax:

http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html

The documentation as to Java annotations seems clear tht annotations
are considered as declarative, within the context of the Java
language.

But also in those docs:

"""
Typical application programmers will never have to define an
annotation type, but it is not hard to do so.  
"""

IMO, there was that analogy as well that had some influence on the
decision.  It needed to be something that communicated decorators as
something beyond the scope of "everyday Python".  Which would mean
something not too deeply embedded, which may account for the reason
that the proposals with more obvious surface aesthetic appeal like the
one's you refer to were rejected.

Beauty of course being only skin deep.  Given that the decorators had
to happen when they happened (that being a separate point of
contention), I happen to think Guido's choice was a good and
courageous one.

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: variable declaration

2005-02-06 Thread Arthur
On Sun, 06 Feb 2005 08:20:29 -0500, Jeremy Bowers <[EMAIL PROTECTED]>
wrote:

>On Sun, 06 Feb 2005 07:30:33 -0500, Arthur wrote:
>> What if:
>> 
>> There was a well conducted market survey conclusive to the effect that
>> adding optional strict variable declaration would, in the longer run,
>> increase Python's market share dramatically.
>> 
>> It just would.
>> 
>> Why would it?
>
>What if, by eating a special mixture of cheddar and marshmallows, you
>could suddenly fly?
>
>It just would.
>
>Why would it?
>
>(The point, since I don't trust you to get it: The "absurd question" is
>neither a valid argument technique, nor is it even good rhetoric. You
>might as well go straight to "What if I'm right and you're wrong? What
>then, huh?")

You miss my point in so many ways, its not worth enumerating.  Most
essentially is the fact that I am making no effort to be right about
anything, and don't care to be right about anything, and know better
than to hope to be  right about anything here.

>
>> My sense of how the real world works is that there is going to be one
>> anti-Python advocate lying in wait for the first bug he can find that he
>> can say would have been caught if Python had strict variable declaration,
>> as he always knew it should.
>> 
>> He wants to be the PHB someday. The current PHB knows that, and since
>> being sensitive to these kinds of realities is how he got to be the PHB,
>> he is too smart to open himself up to this kind of risk.
>> 
>> The PHB can pretty safely make the use of the option optional.  As long as
>> he is a position to jump down the throat of the programmer who created the
>> bug.
>
>You really aren't very good at this "debate" thing.

I'm a lot bettter at  it, I think, when I am trying to debate.  

*You* don't get it. I'm not. 

>
>"Look, I can construct a certain scenario whereby the dangers you propose
>don't occur (assuming that I'm even right about my scenario in the first
>place which is highly questionable). How do you respond to *that*? Huh?
>Huh? Huh? Where's your precious 'overwhelming pattern' now?"
>
>It hasn't gone anywhere.
>
>> What is the correct language design decision in light of these realities?
>
>In light of the above, I question your use of the plural.

And you would question the use of the singular, as well, if I catch
your dirft. 

>
>> But isn't this kind of where Python is at the moment?
>
>Only for you.
>
>Despite the tone of the rest of this message, I mean that. It's obviously
>a huge stumbling block for you. It isn't for the rest of us, and once
>again, I assure you, it's going to take more than spinning implausible
>isolated entirely theoretical examples to convince us otherwise.

I don't know who the rest of you are.  Whoever the rest of you are,
I'm OK with not being one of you. Really I am.

>Not only do you argue solely from anecdote, even the aforementioned
>"implausible isolated entirely theoretical" anecdote, it appears to be all
>you understand. You're going to have to do better than that. Producing a
>*real* study that shows declaration would be a good thing, instead of an
>implausible entirely theoretical one, would be a good start.

I am arguing, to the extent that I am arguing, from the hypothetical.
You can counter by saying that my hypothical premise is not even a
possiblity.

Among what you don't understand. I think, is that I would be wishing
that you were right.  But of course you wouldn't be.

Art 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: variable declaration

2005-02-06 Thread Arthur
On Sun, 6 Feb 2005 08:47:31 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:

>
>Even the various "success stories" we've collected (both on websites,
>and, more impressive to PHBs, into paper booklets O'Reilly has printed)
>play a role.  ``NASA uses it for space missions, so of course we must
>use it to control our hot dog franchises'' -- we DID say we're talking
>about stupid firms, right?

>This is a good development, overall.  Against stupidity, the gods
>themselves contend in vain; Python's entrance into stupid firms broadens
>its potential appeal from less than 10% to around 100% of the market,
>which is good news for sellers of books, tools, training, consultancy
>services, and for Python programmers everywhere -- more demand always
>helps.  *BUT* the price is eternal vigilance...

What if:

There was a well conducted market survey conclusive to the effect that
adding optional strict variable declaration would, in the longer run,
increase Python's market share dramatically.

It just would. 

More books. more jobs, etc.

Why would it?

My sense of how the real world works is that there is going to be one
anti-Python advocate lying in wait for the first bug he can find that
he can say would have been caught if Python had strict variable
declaration, as he always knew it should. 

He wants to be the PHB someday. The current PHB knows that, and since
being sensitive to these kinds of realities is how he got to be the
PHB, he is too smart to open himself up to this kind of risk.

The PHB can pretty safely make the use of the option optional.  As
long as he is a position to jump down the throat of the programmer who
created the bug.   

"The option is there, why the hell didn't you use it".

What is the correct language design decision in light of these
realities?

My answer is, I think, the same as your answer. In fact, its simpler
for me - I don't write Python books.

But isn't this kind of where Python is at the moment?

Art 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: variable declaration

2005-02-05 Thread Arthur
On Sat, 5 Feb 2005 20:02:44 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:

>Arthur <[EMAIL PROTECTED]> wrote:
>
>> On Sat, 5 Feb 2005 17:00:15 +0100, [EMAIL PROTECTED] (Alex Martelli)
>> wrote:
>> >
>> >I consider this one of the worst ideas to have been proposed on this
>> >newsgroup over the years, which _IS_ saying something. \
>> 
>> I would disagree, but only to the extent that nothing that is only a
>> request for an option toggle should qualify for this award.  For
>> anyone not interested in it's effects, it's business as usual.
>
>You must have lead a charmed life, I think, unusually and blissfully
>free from pointy-haired bosses (PHBs).  In the sublunar world that most
>of us inhabit, ``optional'' idiocies of this kind soon become absolutely
>mandatory -- thanks to micromanagement by PHBs.

It seems to me that you would be more accurate (and calmer) if you
generalized from your own experience, rather than in direct
contradiction to it.

That the firms that advocate the use of Python are the one's  least
likely to be dominated by PHB's who DKTAFTE (who don't know their ass
from their elbows).

Unless I am misintepreting  you. 

Do the STUPID firms use Python as well.   

Why?  

Clearly there are stupider choices.

I prefer to use VB when doing certain kinds of stupid things.  It's
the right tool in those cases.  

Really.

Perhaps the answer here has more to do with backing off efforts to
make Python ubiquitous. 

Why shouldn't the community stay a bit elitist? 

Or else maybe that's where you started on this thread, in fact - and
in your own way.

If so, I agree - within reason.  

One doesn't toggle between VB and Python, perhaps is the point.  They
are of different species. 

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: variable declaration

2005-02-05 Thread Arthur
On Sat, 5 Feb 2005 17:00:15 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:
>
>I consider this one of the worst ideas to have been proposed on this
>newsgroup over the years, which _IS_ saying something. \

I would disagree, but only to the extent that nothing that is only a
request for an option toggle should qualify for this award.  For
anyone not interested in it's effects, it's business as usual.  

They can even reward themselves with the knowledge that among the time
and typing they did not waste was in asking for the toggle to be on.

It is also true that mplementation might be a diversion of efforts
from the implementation of features solving more generally recognized
problems. There *are* a lot of bad things to say about the idea. 

But I think it worth mentioning that the OP is requesting only a
toggle.

Why is it worth mentioning?

Because maybe one needs to save the heaviest rhetoric for when this is
not the case.

There was a simple answer to those who hate decorators - don't use
them. I won't.

And the most controversial suggestions about optional static typing
all perserve their sanity by remaining suggestions about something
defined as optional.

Generally speaking, it might then be said to be good community poilcy
to hold one's fire at least a bit if a feature request, or accepted
PEP, will not impact one's own code writing beyond the extent one
might choose  it to.

Though I  do think there *should* be a worst feature request contest
at PyCon,   

What is with this white space business, anyway?

;)

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Go visit Xah Lee's home page

2005-02-01 Thread Arthur
On Mon, 31 Jan 2005 16:07:41 -0800, aurora <[EMAIL PROTECTED]> wrote:

>Let's stop discussing about the perl-python non-sense. It is so boring.
>
>For a break, just visit Mr Xah Lee's personal page  
>(http://xahlee.org/PageTwo_dir/Personal_dir/xah.html). You'll find lot of  
>funny information and quotes from this queer personality. Thankfully no  
>perl-python stuff there.
>
>Don't miss Mr. Xah Lee's recent pictures at
>
>   http://xahlee.org/PageTwo_dir/Personal_dir/mi_pixra.html
>
>My favor is the last picture. Long haired Xah Lee sitting contemplatively  
>in the living room. The caption says "my beautiful hair, fails to resolve  
>the problems of humanity. And, it is falling apart by age."


And of each of us contributed something 50% as worthwhile as well
executed as his geometry pages to the Web, the Web would begin to
deliver 10% of its promise.

POST GET this ;)

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: variable declaration

2005-02-01 Thread Arthur
On 31 Jan 2005 19:41:27 -0800, "Michael Tobis" <[EMAIL PROTECTED]> wrote:

>> You may call it a strawberry, if you wish, but that doesn't mean it
>will
>> taste good with fresh cream.  It's nothing more and nothing less than
>an
>> arguably weird syntax for a perfectly executable statement:
>
>This may well be true in implementation, but cognitively it is a
>declaration that modifies the reference and not the referent. I see
>that it is a big deal to ask for more of these, but I don't see why.

Thank you for bringing it and respecting the cognitive factor.  My
"expereince* of the decorator, disassembly of internals quite aside,
is that it breaks old rules - or, if prferred, breaks new ground -  by
impacting code one wouildn't expect it to kow about.

It frightens me a bit when the road to Guru seems to move in the
direction of most completely transcending the normal user experience,
rather than in best comprehending it.

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The next Xah-lee post contest

2005-01-31 Thread Arthur
On Mon, 31 Jan 2005 07:40:40 -0500, Steve Holden <[EMAIL PROTECTED]>
wrote:

>[EMAIL PROTECTED] wrote:
>
>> Tragi-comic.  really.  BTW you forgot cross-post to c.l.scheme, C,
>> smalltalk and C++
>> 
>Would there, I wonder, be any enthusiasm for a "Best Xah Lee impression" 
>prize at PyCon?

And the rules of the game, if he shows?  

I guess "no ringers", would have to be the rule.


Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The next Xah-lee post contest

2005-01-30 Thread Arthur
On Sat, 29 Jan 2005 15:41:00 +0100, PA <[EMAIL PROTECTED]>
wrote:

>
>On Jan 29, 2005, at 15:32, rbt wrote:
>
>> Unix donkey! You not elegant. You have poor design.
>> Sloppy Perl monkey! You be lazy! You code very very bad.
>>
>> Xah know all!
>
>Follow The True Path, follow The Xah Way To Enlightenment:
>
>"The Unix Pestilence"
>http://www.xahlee.org/UnixResource_dir/freebooks.html
>
>Cheers

Not sure how Xah got himself into all this.  When I actually read the
substance of Xah's articles like the one referenced above, and ignore
the stuff in Red, I don't find it all that bizarre - or uninformative.
He links to substantive resources.  He has postive things to say about
lots of things, including Python.

Guess I am prejudiced by the fact that I have always enjoyed his plane
curve pages, and after David Eppsteins Geometry Junkyard and a few
others, consider it one of the more interesting web resources in
respect to geometry.  I knew of him for this, well before I knew of
him as the Usenet character he is.

Wish he would do himself the favor of better separating he various
"interests".  One can google on "plane curves", and the first hit will
be Xah's site. I certainly find it interesting and well done.

On the other hand, if one goes by way of his home page, one is greeted
first with a vitriolic message expressing a sentiment not all that
uncommon but not very relevant to the substance of much of what is to
be found at the site.

Oh well.

Art
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Another scripting language implemented into Python itself?

2005-01-25 Thread Arthur
On Tue, 25 Jan 2005 23:08:06 GMT, [EMAIL PROTECTED] (Cameron Laird)
wrote:

>In article <[EMAIL PROTECTED]>,
>Terry Reedy <[EMAIL PROTECTED]> wrote:
>   .
>   .
>   .
>>worrying about Python security seems superfluous.  Why worry, for instance, 
>>about os.unlink when the user can just do the same much easier in a text or 
>>gui shell?
>   .
>   .
>   .
>It's an apt question--and one with several answers.  I'll
>hint at the range by observing that part of security has
>to do with prevention not of malicious acts, but of common
>mistakes.  I entirely agree with you that it's crucial to
>think of wider context, and whether a particular choice's
>costs are worth its benefits.

As long as we include the cost of treating adults as children, and
take it seriously as the kind of cost it is, I'm OK.

I think Terry's point covers a wide range of the real world
situations. Though certainly not all.

My "real" life is in the mid-market business world, not as a geometry
software developer.  And I see a sort of hysteria descending, in this
realm on this subject. Of theY2k ilk, but with actually, it seems to
me, less substance.  Family businesses out on the limb, as a business,
in a myriad of ways - because they are after all in business, focusing
on remote scenarios because they are somehow becoming convinced that
is what business people do (they don't), and demoralizing folks in the
process.  Folks who know that if they wanted to hurt this business
they could have done so a hundred times in a hundred ways over the
years.  But it wouldn't be by screwing with their computer system
because they wouldn't know how. So isn't it funny that is what the
boss is so concerned about - all of a sudden? 

(They always knew they were smarter then him. More proof)

Art

 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Another scripting language implemented into Python itself?

2005-01-25 Thread Arthur
On Mon, 24 Jan 2005 19:40:31 -0500, Roy Smith <[EMAIL PROTECTED]> wrote:

>In article <[EMAIL PROTECTED]>,
> Quest Master <[EMAIL PROTECTED]> wrote:
>
>
>Python *is* a scripting language.  Why not just let your users write 
>Python modules which you them import and execute via some defined API?

This is the tact I take with PyGeo.

The burden is on myself, as the API designer and documenter to make it
as accessible as I might want it to be.  And I think I can accomplish
that without building in crippling limitations as to  what depth a
"scripter" might want to explore - even to the extent of extending the
API itself.

I guess its a matter of the audience one hopes to reach.  There are a
number of other dynamic geometry applications out there.  Despite my
own interest in the subject, it was precisely the limitations their
API, whether GUI based or otherwise, that led me to the explorations
that is becoming PyGeo.  It was the limitaions in exploring *geometry*
to which I refer. Having no per se interest in programming, I would
not impose the assumption of such an interest on my users.

I guess I hope to reach others like myself.  With no particular
interest in programming, per se. Just with what you can get do with
it.

Art


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zen of Python

2005-01-22 Thread Arthur
On 21 Jan 2005 20:32:46 -0800, Paul Rubin
 wrote:

>Of course in that case, since the absence of lexical scope was a wart
>in its own right, fixing it had to have been on the radar.  So turning
>the persistent listcomp loop var into a documented feature, instead of
>describing it in the docs as a wart that shouldn't be relied on,
>wasn't such a hot idea.  Adding lexical scope and listcomps at the
>same time might have also been a good way to solve the issue.


Most of us go about our business without a fine grained reading of the
documentation.  I don't think I would be unusual in having learned
about listcomp lakkage by tracing a hard to fathom bug to its source.

I can't say I understood at that point that for loops *do* leak.  But
apparently *did* understand intutively that I shouldn't rely on it not
doing so. because I chose my local variable names in a way that I
couldn't get hurt in any case  My intution apparently felt safe in
doing otherwise in the vicinity of a list comp, which is how I got
burnt. The fact is there was carelessness in the code that surrounded
the bug. But it was carelessness of the kind that would, in the
absence of list com leakage,  have led to an easy to recgnize error
message and a quick fix.

Nobody likes to hear coulda, shoulda s for done deals. 

But the issue is an a basic one, in some sense, it seems to me.

The question around decorators did not seem too dissimilar.  There was
those would thought that a better solution to the problem being
addressed would most likely naturally present itself further down the
road as Python evolved. And that inaction at this time was the best
action.

 Or that a solution should be found that addressed that issue,
toigether with related issues, in a way that was less of a "best to to
done under the cirucmstances as of now", before a trigger was pulled.

woulda, coulda shoulda.

Art  


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: java 5 could like python?

2005-01-13 Thread Arthur
On Wed, 12 Jan 2005 11:18:17 -0500, Istvan Albert
<[EMAIL PROTECTED]> wrote:

>vegetax wrote:
>
>> previus two python proyects where relatively big,and python didnt feel 
>> well suited for the task.
>
>One typical problem that others might talk about in more detail
>is that you might be writing java code in python. That means
>using Java style class hierarchies, methods and overall
>organization. That does not work well in python.

On the other hand in could be argued that the language seems to be
evolving in a direction in which this is too possible - the
distinctive "voice" of Python being muffled in static and class
methods, type declarations and the like.

Perhaps Python is forced in this direction as an appropriate admission
of the advantages of the architecture encouraged by the Java/C# class
of langauge. And is being courageous in these admission.

Or perhpas it is an unfortunate result of trying to find acceptance
and establish some compatibility in an atmosphere in which these
language approaches dominate the current mainstream. And trying too
hard to avoid a LISPish fate.

Or else everything is just as it should be.

I honestly don't pretend to know.

But am a little confused about the lack of the discussion here about
the developments in this direction.

Art 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python + Lisp integration?

2004-12-29 Thread Arthur
On 29 Dec 2004 14:50:53 +0200, Simo Melenius
<[EMAIL PROTECTED]> wrote:

>
>Hi,
>
>I'm wondering (after a bit of googling) whether there exists a Python
>binding to any open source Lisp environment (like librep or some
>Scheme or Common Lisp implementation) that could be recommended for
>non-toy use?

Not sure this is going to help much,

but Lush - Lisp Universal Shell - is mature and has bindings to the
Python C API.

http://lush.sourceforge.net/lush-manual/f0288067.html

The bindings are specific to Python22.  I had trouble getting all the
demos working against Python23.

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: what would you like to see in a 2nd edition Nutshell?

2004-12-29 Thread Arthur
On Wed, 29 Dec 2004 11:35:18 +0100, [EMAIL PROTECTED] (Alex Martelli)
wrote:

>So, if there's any advice or request about a 2nd edition of the
>Nutshell, this is the right time for y'all to let me know.  Feedback is
>welcome, either privately or right here.  Thanks in advance -- _and_
>apologies in advance because I know I just won't be able to accomodate
>all the requests/advice, given the constraints on book size &c.

I understand in advance that my comments are not fully practical:

The gap in the "market" against which I am currently bumpiong up
against a wall is in gaining an understanding of threads,
sub-processes, sockets, signals and such in Python - having no
background in these concepts from outside of Python.

Programming concepts up to this level can all (or mostly all)
succesfully be learned and understood from materials out there
speaking in Python. As to these concepts, the implicit point of view
seems to be to leave Python to learn the concepts, and return to
Python to understand its implementation of the details, once the
concepts are well grasped.

It seems to me important that this gap be filled. somehow at some
point.  The advice of "go learn threads in Java" and come back then
seems a pity. Some of the other concepts which I am confronting I
understand to be basic for the C programmer.  "This is how Python
implements these C concepts, which we of course all understand".
My hand has been held nicely, too this point then

Learn C and come back?  Love to. Don't have the time.  I am a
practicing Python programmer, hoping that can be enough.  

If I want to no more than be able to follow, say, the current Idle
code of the PyShell module, I can find very little guidance from
within the canon of Python literature.

Help?

Art

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How is Python designed?

2004-12-03 Thread Arthur Rambo
Limin,

Look at this: http://wiki.cs.uiuc.edu/cs427/PYTHON
I think it may help.

Arthur

Limin Fu <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> To clarify, I mean the internal structure and design
> of python interpreter. Any hint? Thanks.
> Regards,
> Limin
> 
> 
>   
> __ 
> Do you Yahoo!? 
> Yahoo! Mail - 250MB free storage. Do more. Manage less. 
> http://info.mail.yahoo.com/mail_250
-- 
http://mail.python.org/mailman/listinfo/python-list