Re: Python Tk Tix GUI documentation & builder overview and tips

2015-01-04 Thread Christian Gollwitzer

Am 03.01.15 um 22:57 schrieb Terry Reedy:

On 1/3/2015 1:30 PM, aba...@gmail.com wrote:

Hi,

I have had issues running Tix on python 2.7.6 and 3.4.2:

More details on the issue here.

http://stackoverflow.com/questions/27751923/tix-widgets-installation-issue

Has anyone had similar issues with Tix?


The current doc is wrong in any case.  I opened
http://bugs.python.org/issue23156



Tix is a compiled extension, so this tix8.4.3.dll is needed as well as a 
couple of .tcl file including pkgIndex.tcl, which makes the package 
available to the Tcl interpreter. tix*.dll was never part of tk*.dll.


Note that Tix is LEGACY. There are much better options for its widgets 
available that are based on ttk. Just to try, I compiled Tix under OSX 
for my Tk8.6.3 and ran the widget demos.


Instead of

* Hierarchical Listbox use ttk::treeview, tablelist_tile or tkTreeCtrl, 
with increasing order of capabilities and install complexity


* TList: I think tkTreeCtrl can do it, never have used this layout

* CheckList: tablelist can be used with an editable field

* Grid widget: use tkTable

* NoteBook, PanedWindow, ComboBox, LabelFrame -> ttk::notebook, 
ttk::panedwindow, ttk::combobox, ttk::labelframe


* Balloon: tcllib::tooltip

Not to mention that the Tix widgets are extremely ugly, while the 
widgets from ttk have a near-native look and feel.


Caveat emptor: I've never used Tix, so this is just my impression as an 
experienced Tk programmer from running the widget demo


Christian

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


Forward of moderated message

2015-01-04 Thread python-ro-bounces
--- Begin Message ---
*Help with finding tutors for Python, Linux, R, Perl, Octave, MATLAB and/or
Cytoscape for yeast microarray analysis, next generation sequencing and
constructing gene interaction networks*



Hi



I am a visually impaired bioinformatics graduate student using microarray
data for my master’s thesis aimed at deciphering the mechanism by which the
yeast wild type can suppress the rise of free reactive oxygen species (ROS)
induced by caloric restriction (CR) but the Atg15 and Erg6 knockout mutant
cannot.



Since my remaining vision is very limited I need very high magnification.
But that makes my visual field very small.  Therefore I need somebody to
teach me how to use these programming environments, especially for
microarray analysis, next generation sequencing and constructing gene and
pathway interaction networks.  This is very difficult for me to figure out
without assistance because Zoomtext, my magnification and text to speech
software, on which I am depending because I am almost blind, has problems
reading out aloud many programming related websites to me.  And even those
websites it can read, it can only read sequentially from left to right and
then from top to bottom.  Unfortunately, this way of acquiring, finding,
selecting and processing new information and answering questions is too
tiresome, exhausting, ineffective and especially way too time consuming for
graduating with a PhD in bioinformatics before my funding runs out despite
being severely limited by my visual disability.  I would also need help
with writing a good literature review and applying the described techniques
to my own yeast Affimetrix microarray dataset because I cannot see well
enough to find all relevant publications on my own.



Some examples for specific tasks I urgently need help with are:



1.Analyzing and comparing the three publically available microarray
datasets that can be accessed at:

A.http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE41860

B.http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE38635

C.   http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE9217



2.Learning how to use the Affymetrics microarray analysis software for
the Yeast 2 chip, which can be found at
http://www.affymetrix.com/support/technical/libraryfilesmain.affx



3.For Cytoscape I need somebody, who can teach me how to execute the
tutorials at the following links because due to my very limited vision
field I cannot see tutorial and program interface simultaneously.

A.
http://opentutorials.cgl.ucsf.edu/index.php/Tutorial:Introduction_to_Cytoscape_3.1-part2#Importing_and_Exploring_Your_Data

B.
http://opentutorials.cgl.ucsf.edu/index.php/Tutorial:Filtering_and_Editing_in_Cytoscape_3

C.
http://cytoscape.org/manual/Cytoscape2_8Manual.html#Import%20Fixed-Format%20Network%20Files

D.   http://wiki.cytoscape.org/Cytoscape_User_Manual/Network_Formats



4.Learning how to use the TopGo R package to perform statistical
analysis on GO enrichments.



Since I am legally blind the rehab agency is giving me money to pay tutors
for this purpose.  Could you please help me getting in touch regarding this
with anybody, who could potentially be interested in teaching me one on one
thus saving me time for acquiring new information and skills, which I need
to finish my thesis on time, so that I can remain eligible for funding to
continue in my bioinformatics PhD program despite being almost blind?  The
tutoring can be done remotely via TeamViewer 5 and Skype.  Hence, it does
not matter where my tutors are physically located.  Currently I have tutors
in Croatia and UK.  But since they both work full time jobs while working
on their PhD dissertation they only have very limited time to teach me
online.  Could you therefore please forward this request for help to
anybody, who could potentially be interested or, who could connect me to
somebody, who might be, because my graduation and career depend on it?  Who
else would you recommend me to contact regarding this?  Where else could I
post this because I am in urgent need for help?



Could you please contact me directly via email at thomas.f.ha...@gmail.com
and/or Skype at tfh002 because my text to speech software has problems to
read out this website aloud to me?

I thank you very much in advance for your thoughts, ideas, suggestions,
recommendations, time, help, efforts and support.

With very warm regards,



*Thomas Hahn*

1)*Graduate student in the Joint Bioinformatics Program at the
University of Arkansas at Little Rock (UALR) and the University of Arkansas
Medical Sciences (UAMS) &*

2)*Research & Industry Advocate, Founder and Board Member of RADISH
MEDICAL SOLUTIONS, INC. (**http://www.radishmedical.com/thomas-hahn/*
*) *



*Primary email: **thomas.f.ha...@gmail.com* 

*Cell phone: 318 243 3940*

*Office phone: 501 682 1440*

*Office location: EIT 535*

*Skype ID: tfh002*

*Virtual Google Voice pho

Re: list comparison vs integer comparison, which is more efficient?

2015-01-04 Thread austin aigbe
On Sunday, January 4, 2015 8:12:10 AM UTC+1, Terry Reedy wrote:
> On 1/3/2015 6:19 PM, austin aigbe wrote:
> 
> > I am currently implementing the LTE physical layer in Python (ver 2.7.7).
> > For the qpsk, 16qam and 64qam modulation I would like to know which is more 
> > efficient to use, between an integer comparison and a list comparison:
> >
> > Integer comparison: bit_pair as an integer value before comparison
> >
> >  # QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
> >  def mp_qpsk(self):
> >  r = []
> >  for i in range(self.nbits/2):
> >  bit_pair = (self.sbits[i*2] << 1) | self.sbits[i*2+1]
> >  if bit_pair == 0:
> >  r.append(complex(1/math.sqrt(2),1/math.sqrt(2)))
> >  elif bit_pair == 1:
> >  r.append(complex(1/math.sqrt(2),-1/math.sqrt(2)))
> >  elif bit_pair == 2:
> >  r.append(complex(-1/math.sqrt(2),1/math.sqrt(2)))
> >  elif bit_pair == 3:
> >  r.append(complex(-1/math.sqrt(2),-1/math.sqrt(2)))
> >  return r
> >
> > List comparison: bit_pair as a list before comparison
> >
> >  # QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
> >  def mp_qpsk(self):
> >  r = []
> >  for i in range(self.nbits/2):
> >  bit_pair = self.sbits[i*2:i*2+2]
> >  if bit_pair == [0,0]:
> >  r.append()
> >  elif bit_pair == [0,1]:
> >  r.append(complex(1/math.sqrt(2),-1/math.sqrt(2)))
> >  elif bit_pair == [1,0]:
> >  r.append(complex(-1/math.sqrt(2),1/math.sqrt(2)))
> >  elif bit_pair == [1,1]:
> >  r.append(complex(-1/math.sqrt(2),-1/math.sqrt(2)))
> >  return r
> 
> Wrong question.  If you are worried about efficiency, factor out all 
> repeated calculation of constants and eliminate the multiple comparisons.
> 
> sbits = self.sbits
> a = 1.0 / math.sqrt(2)
> b = -a
> points = (complex(a,a), complex(a,b), complex(b,a), complex(b,b))
>  complex(math.sqrt(2),1/math.sqrt(2))
> def mp_qpsk(self):
>  r = [points[sbits[i]*2 + sbits[i+1]]
>  for i in range(0, self.nbits, 2)]
>  return r
> 
> -- 
> Terry Jan Reedy

Cool. Thanks a lot.
-- 
https://mail.python.org/mailman/listinfo/python-list


Help with map python 2

2015-01-04 Thread flebber
In repsonse to this question: Write a program that prints the first 100 members 
of the sequence 2, -3, 4, -5, 6, -7, 8.

This is my solution it works but ugly.

series = range(2,100)
# answer = [(x,(y* -1)) for x, y in series[::2]]
# print(answer)
answer = []
for item in series:
if item % 2 != 0:
answer.append(item * -1)
else:
answer.append(item)

print(answer)

I know I should be better off doing this with map but cannot get it to work. I 
understand also that map returns a generator so this solution should only 
working in python2(correct me please if I am wrong).

In [6]: map?
Type:   builtin_function_or_method
String Form:
Namespace:  Python builtin
Docstring:
map(function, sequence[, sequence, ...]) -> list

Just getting something wrong
list(map((lambda x: x * -1 if (x%2 != 0)), series))
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with map python 2

2015-01-04 Thread Chris Angelico
On Sun, Jan 4, 2015 at 10:34 PM, flebber  wrote:
> Just getting something wrong
> list(map((lambda x: x * -1 if (x%2 != 0)), series))

Okay, and what happens when you run this? Do you get an exception? If
so (and I fully expect you will), copy and paste the entire exception
traceback and message. That's the best way to show what's going wrong.
If you're not getting an exception, what do you get that's wrong?

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


Re: Help with map python 2

2015-01-04 Thread Alec Taylor
map(lambda i: -i if i&1==1 else i, xrange(2, 10))

On Sun, Jan 4, 2015 at 10:34 PM, flebber  wrote:
> In repsonse to this question: Write a program that prints the first 100 
> members of the sequence 2, -3, 4, -5, 6, -7, 8.
>
> This is my solution it works but ugly.
>
> series = range(2,100)
> # answer = [(x,(y* -1)) for x, y in series[::2]]
> # print(answer)
> answer = []
> for item in series:
> if item % 2 != 0:
> answer.append(item * -1)
> else:
> answer.append(item)
>
> print(answer)
>
> I know I should be better off doing this with map but cannot get it to work. 
> I understand also that map returns a generator so this solution should only 
> working in python2(correct me please if I am wrong).
>
> In [6]: map?
> Type:   builtin_function_or_method
> String Form:
> Namespace:  Python builtin
> Docstring:
> map(function, sequence[, sequence, ...]) -> list
>
> Just getting something wrong
> list(map((lambda x: x * -1 if (x%2 != 0)), series))
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with map python 2

2015-01-04 Thread Alec Taylor
^To print the first 8. To print the first 100: map(lambda i: -i if
i&1==1 else i, xrange(2, 102))

On Sun, Jan 4, 2015 at 10:47 PM, Alec Taylor  wrote:
> map(lambda i: -i if i&1==1 else i, xrange(2, 10))
>
> On Sun, Jan 4, 2015 at 10:34 PM, flebber  wrote:
>> In repsonse to this question: Write a program that prints the first 100 
>> members of the sequence 2, -3, 4, -5, 6, -7, 8.
>>
>> This is my solution it works but ugly.
>>
>> series = range(2,100)
>> # answer = [(x,(y* -1)) for x, y in series[::2]]
>> # print(answer)
>> answer = []
>> for item in series:
>> if item % 2 != 0:
>> answer.append(item * -1)
>> else:
>> answer.append(item)
>>
>> print(answer)
>>
>> I know I should be better off doing this with map but cannot get it to work. 
>> I understand also that map returns a generator so this solution should only 
>> working in python2(correct me please if I am wrong).
>>
>> In [6]: map?
>> Type:   builtin_function_or_method
>> String Form:
>> Namespace:  Python builtin
>> Docstring:
>> map(function, sequence[, sequence, ...]) -> list
>>
>> Just getting something wrong
>> list(map((lambda x: x * -1 if (x%2 != 0)), series))
>> --
>> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with map python 2

2015-01-04 Thread Jussi Piitulainen
flebber writes:

> In repsonse to this question: Write a program that prints the first
> 100 members of the sequence 2, -3, 4, -5, 6, -7, 8.
> 
> This is my solution it works but ugly.

Seems respectable to me, except that you are taking fewer than 100
elements. But I'd prefer the expressions that you are looking for.

> series = range(2,100)
> # answer = [(x,(y* -1)) for x, y in series[::2]]

You could do what mathematicians do when they deal with alternating
signs: they raise -1 to the power of the index to get an appropriate
multiplier.

   >>> [ n * (-1) ** n for n in range(10) ]
   [0, -1, 2, -3, 4, -5, 6, -7, 8, -9]
   >>> 

Or you could do here what you attempt to do with map below. See below.

> # print(answer)
> answer = []
> for item in series:
> if item % 2 != 0:
> answer.append(item * -1)
> else:
> answer.append(item)
> 
> print(answer)
> 
> I know I should be better off doing this with map but cannot get it
> to work. I understand also that map returns a generator so this
> solution should only working in python2(correct me please if I am
> wrong).
> 
> In [6]: map?
> Type:   builtin_function_or_method
> String Form:
> Namespace:  Python builtin
> Docstring:
> map(function, sequence[, sequence, ...]) -> list
> 
> Just getting something wrong
> list(map((lambda x: x * -1 if (x%2 != 0)), series))

You are trying to use a binary expression. There are no binary
expressions. Add an else branch to make it ternary:

   lambda x : x if x % 2 == 0 else -x

But never mind the number of branches, the serious point is that you
didn't specify a value for when the condition is not true. It doesn't
make sense without that.

There's nothing wrong with a list comprehension, or the corresponding
generator expression if you want a generator. It's fine. Map's fine.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: list comparison vs integer comparison, which is more efficient?

2015-01-04 Thread austin aigbe
On Sunday, January 4, 2015 12:20:26 PM UTC+1, austin aigbe wrote:
> On Sunday, January 4, 2015 8:12:10 AM UTC+1, Terry Reedy wrote:
> > On 1/3/2015 6:19 PM, austin aigbe wrote:
> > 
> > > I am currently implementing the LTE physical layer in Python (ver 2.7.7).
> > > For the qpsk, 16qam and 64qam modulation I would like to know which is 
> > > more efficient to use, between an integer comparison and a list 
> > > comparison:
> > >
> > > Integer comparison: bit_pair as an integer value before comparison
> > >
> > >  # QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
> > >  def mp_qpsk(self):
> > >  r = []
> > >  for i in range(self.nbits/2):
> > >  bit_pair = (self.sbits[i*2] << 1) | self.sbits[i*2+1]
> > >  if bit_pair == 0:
> > >  r.append(complex(1/math.sqrt(2),1/math.sqrt(2)))
> > >  elif bit_pair == 1:
> > >  r.append(complex(1/math.sqrt(2),-1/math.sqrt(2)))
> > >  elif bit_pair == 2:
> > >  r.append(complex(-1/math.sqrt(2),1/math.sqrt(2)))
> > >  elif bit_pair == 3:
> > >  r.append(complex(-1/math.sqrt(2),-1/math.sqrt(2)))
> > >  return r
> > >
> > > List comparison: bit_pair as a list before comparison
> > >
> > >  # QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
> > >  def mp_qpsk(self):
> > >  r = []
> > >  for i in range(self.nbits/2):
> > >  bit_pair = self.sbits[i*2:i*2+2]
> > >  if bit_pair == [0,0]:
> > >  r.append()
> > >  elif bit_pair == [0,1]:
> > >  r.append(complex(1/math.sqrt(2),-1/math.sqrt(2)))
> > >  elif bit_pair == [1,0]:
> > >  r.append(complex(-1/math.sqrt(2),1/math.sqrt(2)))
> > >  elif bit_pair == [1,1]:
> > >  r.append(complex(-1/math.sqrt(2),-1/math.sqrt(2)))
> > >  return r
> > 
> > Wrong question.  If you are worried about efficiency, factor out all 
> > repeated calculation of constants and eliminate the multiple comparisons.
> > 
> > sbits = self.sbits
> > a = 1.0 / math.sqrt(2)
> > b = -a
> > points = (complex(a,a), complex(a,b), complex(b,a), complex(b,b))
> >  complex(math.sqrt(2),1/math.sqrt(2))
> > def mp_qpsk(self):
> >  r = [points[sbits[i]*2 + sbits[i+1]]
> >  for i in range(0, self.nbits, 2)]
> >  return r
> > 
> > -- 
> > Terry Jan Reedy
> 
> Cool. Thanks a lot.

Hi Terry,

No difference between the int and list comparison in terms of the number of 
calls(24) and time (0.004s). Main part is the repeated call to sqrt().

However, it took a shorter time (0.004s) with 24 function calls than your code 
(0.005s) which took just 13 function calls to execute.

Why is this?

Integer comparison profile result:
>>> p = pstats.Stats('lte_phy_mod.txt')
>>> p.strip_dirs().sort_stats(-1).print_stats()
Sun Jan 04 12:36:32 2015lte_phy_mod.txt

 24 function calls in 0.004 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10.0040.0040.0040.004 lte_phy_layer.py:16()
10.0000.0000.0000.000 lte_phy_layer.py:20(Scrambling)
10.0000.0000.0000.000 lte_phy_layer.py:276(LayerMapping)

10.0000.0000.0000.000 lte_phy_layer.py:278(Precoding)
10.0000.0000.0000.000 
lte_phy_layer.py:280(ResourceElementMapping)
10.0000.0000.0000.000 
lte_phy_layer.py:282(OFDMSignalGenerator)
10.0000.0000.0000.000 lte_phy_layer.py:65(Modulation)
10.0000.0000.0000.000 lte_phy_layer.py:71(__init__)
10.0000.0000.0000.000 lte_phy_layer.py:87(mp_qpsk)
10.0000.0000.0000.000 {len}
80.0000.0000.0000.000 {math.sqrt}
40.0000.0000.0000.000 {method 'append' of 'list' 
objects}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}
10.0000.0000.0000.000 {range}



>>>

List comparison:
>>> import pstats
>>> p = pstats.Stats('lte_phy_mod2.txt')
>>> p.strip_dirs().sort_stats(-1).print_stats()
Sun Jan 04 12:57:24 2015lte_phy_mod2.txt

 24 function calls in 0.004 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10.0040.0040.0040.004 lte_phy_layer.py:16()
10.0000.0000.0000.000 lte_phy_layer.py:20(Scrambling)
10.0000.0000.0000.000 lte_phy_layer.py:276(LayerMapping)

10.0000.0000.0000.000 lte_phy_layer.py:278(Precoding)
10.0000.0000.0000.000 
lte_phy_layer.py:280(ResourceElementMapping)
10.0000.0000.0000.000 
lte_phy_layer.py:282(OFDMSignalGenerator)
1   

Re: list comparison vs integer comparison, which is more efficient?

2015-01-04 Thread Christian Gollwitzer

Am 04.01.15 um 13:17 schrieb austin aigbe:

However, it took a shorter time (0.004s) with 24 function calls than

your code (0.005s) which took just 13 function calls to execute.


Why is this?


These times are way too short for conclusive results. Typically, the OS 
timer operates with a millisecond resolution. You need to run a 
benchmark at least for a second to get reliable information about 
timing. INstead of 24 times, call your function 2 times in loop.


Christian

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


Re: list comparison vs integer comparison, which is more efficient?

2015-01-04 Thread Chris Angelico
On Sun, Jan 4, 2015 at 11:17 PM, austin aigbe  wrote:
> However, it took a shorter time (0.004s) with 24 function calls than your 
> code (0.005s) which took just 13 function calls to execute.
>
> Why is this?

That looks to me like noise in your stats. One ULP in timing stats?
Not something to base *anything* on.

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


Re: list comparison vs integer comparison, which is more efficient?

2015-01-04 Thread Mark Lawrence

On 04/01/2015 12:22, Christian Gollwitzer wrote:

Am 04.01.15 um 13:17 schrieb austin aigbe:

However, it took a shorter time (0.004s) with 24 function calls than

your code (0.005s) which took just 13 function calls to execute.


Why is this?


These times are way too short for conclusive results. Typically, the OS
timer operates with a millisecond resolution. You need to run a
benchmark at least for a second to get reliable information about
timing. INstead of 24 times, call your function 2 times in loop.

 Christian



Maybe using a custom built tool such as 
https://docs.python.org/3/library/timeit.html#module-timeit ?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Simon Evans
Dear Michael Torrie,
Thanks for pointing that out to me re: it not being a syntax problem.
The thing is there is a file called 'EcologicalPyramid.html'. I put it in a 
folder called 'Soup' as the text advised on page 28. For what its worth I also 
shifted the Windows Command Prompt to that folder (re: cd Soup)as instructed on 
page 30, and put a duplicate file of 'EcologicalPyramid.html' in the python 2.8 
directory. 
I therefore am wondering where I ought put this html file where the Python 
console will recognize it ? 
Thank you for your attention,
Yours 
Simon  

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


Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Mark Lawrence

On 04/01/2015 12:49, Simon Evans wrote:

Dear Michael Torrie,
Thanks for pointing that out to me re: it not being a syntax problem.
The thing is there is a file called 'EcologicalPyramid.html'. I put it in a 
folder called 'Soup' as the text advised on page 28. For what its worth I also 
shifted the Windows Command Prompt to that folder (re: cd Soup)as instructed on 
page 30, and put a duplicate file of 'EcologicalPyramid.html' in the python 2.8 
directory.
I therefore am wondering where I ought put this html file where the Python 
console will recognize it ?
Thank you for your attention,
Yours
Simon



You could put your file on the moon provided you give the code a 
complete path to it, something like 
r'c:\the\path\to\your\file\called\EcologicalPyramid.html'


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


OT Vernacular and empire building [was Re: How do I remove/unlink wildcarded files]

2015-01-04 Thread Steven D'Aprano
Dear gods, I know I'm going to regret this... 


Mark Lawrence wrote:

> On 03/01/2015 17:53, Rick Johnson wrote:
>> On Saturday, January 3, 2015 4:39:25 AM UTC-6, Mark Lawrence wrote:
>>
>>> I used to get very confused watching the old westerns.  The child when
>>> talking about "more" and "paw" wasn't referring to possibly an
>>> adjective, noun or adverb and a part of an animal, but what we would
>>> refer to in the UK as "mum" and "dad" :)

Mark, that's not very different from the plethora of terms used for mother
across the British Isles, including "mam".

- "mum" is common in the south of England;
- "mom" is used in the west midlands;
- "mam" is used in the north and Ireland;

http://www.bl.uk/learning/langlit/sounds/text-only/england/danesford/

Mam is usually spelled "mam", but British "mom" is always spelled "mum"
unless the author is deliberately emphasising the pronunciation by using
phonetic spelling.


Rick then said:
>> Early Americans are easy to satirize since most were
>> schooled at home by illiterate parents. I believe the
>> "redneck vernacular" substituted "mother" and "father" for
>> "maw" and "paw" respectively. Which is not surprising since
>> most uneducated folks tend to favor single syllable
>> simplifications of words over their multi-syllable
>> counterparts.

I think that is rather silly. "Uneducated folks" often have very high
linguistic skills, except that they are verbal. Linguistically, the pattern
is that languages tend to become more simpler as literacy spreads, not the
other way around.

Mum/mom and Dad has become the most common terms of address for parents in
most English-speaking countries, except in the most formal situations. I
can't imagine calling my parents "mother and father" directly, although I
will refer to them in the third person as "my mother and father".

Oh, for interest, here's an fascinating discussion on why the baby words for
mother and father are so similar across all languages:

http://languagelog.ldc.upenn.edu/nll/?p=1847

Read the comments as well as the comic.


And Rick again:
>> Widespread centralized free schooling did not exists until
>> almost the 1900's. Heck, looking back at American history,
>> the world *SHOULD* be in awe. To go from a rag-tag
>> illiterate bunch of cowboys, to the worlds most powerful and
>> technically advanced society (in roughly one hundred years!)
>> has to be the most amazing transformation in the history of
>> the human society.

A ridiculous fantasy. The USA wasn't "a rag-tag illiterate bunch of
cowboys", you've been watching too many John Wayne westerns.

The United States as a world power wasn't created by cowboys from the
midwest or farmers from the heartland. It was created by the educated
elites on the east and west coasts, and immigrants from Europe, many of who
were already intelligent, educated and cultured. The rise of the USA as a
world power was World War One: the US started to industrialise to European
standards, while the European powers were slaughtering each other in the
trenches. Had the US only had the low-population midwest states to draw on,
they could never have become a world power. It was the industrialised
high-population states, with their millions of workers, who manned the
factories that allowed the US to become a world power.


Mark replied:
> I suspect that the engineers who pushed the railways across North
> America were hardly "a rag-tag illiterate bunch of cowboys".  I won't
> mention that the transformation involved wiping out 99% of the
> indigenous population.

In fairness, most of the genocide was over before the first English arrived
in North America. Disease inadvertently introduced by the Spanish travelled
north and wiped out probably 90% of the native American population. By the
time the English arrived, the continent was already depopulated, and
defeating and killing the survivors was relatively easy. Without the effect
of disease, I expect that the Americas would be more like the bulk of
Africa and Asia. Despite European technological superiority, apart from a
few special cases, mass European migration would simply never have been
practical.


>> Of course with all success stories, timing and luck had a
>> little to do with it, but it was undoubtedly the rebellious
>> and self reliant nature of Americans that made them so
>> successful. 

Rebellious and self-reliant, it is to laugh.


>> So before you go and spouting off about how dumb 
>> Americans are/were, ask yourself, what greatness has *MY*
>> country achieved in the span of a century?
> 
> I'm not entirely sure how a little bit of gentle teasing about accents
> in fictional films translates into "spouting off about how dumb
> Americans are/were" but there you go.  Hardly a century but I believe
> that the British Empire covered 25% of the land surface on the planet.
> Quite an achievement for a tiny patch of islands sitting off the coast
> of Europe.  However I suspect that a large number of people were glad to
> 

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2015-01-04 Thread Dave Angel

On 01/04/2015 07:49 AM, Simon Evans wrote:

Dear Michael Torrie,
Thanks for pointing that out to me re: it not being a syntax problem.
The thing is there is a file called 'EcologicalPyramid.html'. I put it in a 
folder called 'Soup' as the text advised on page 28.
For what its worth I also shifted the Windows Command Prompt to that folder 
(re: cd Soup)as instructed on page 30,
and put a duplicate file of 'EcologicalPyramid.html' in the python 2.8 
directory.


Never put any user files in the "python 2.8" directory, whatever that is.


I therefore am wondering where I ought put this html file where the Python 
console will recognize it ?


Since your code expects it in the current directory, either change the 
code, or make sure it IS in the current directory.


The only obvious thing I can see is that you didn't spell the name the 
same.  But since Windows makes the error of ignoring case, it ought to 
be close enough.  However, you're typing the name, not pasting it, so 
maybe there's some other subtle difference, like you have more than one 
Soup directory.


Try the following, from the cmd.exe prompt:

myprompt> cd Soup
myprompt> dir *.html
  (something shows here)
myprompt> python
  (something shows here)


>>> from bs4 import BeautifulSoup
>>> with open("ecologicalpyramid.html","r") as ecological_pyramid:
...  soup= next(ecological_pyramid,"lxml")
...  producer_entries = soup.find("ul")
...

and see what happens.  Paste the whole thing into a message if it 
doesn't make sense to you.  And of course don't forget to include the 
traceback.




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


Re: Help with map python 2

2015-01-04 Thread Peter Otten
flebber wrote:

> In repsonse to this question: Write a program that prints the first 100
> members of the sequence 2, -3, 4, -5, 6, -7, 8.
> 
> This is my solution it works but ugly.
> 
> series = range(2,100)
> # answer = [(x,(y* -1)) for x, y in series[::2]]
> # print(answer)
> answer = []
> for item in series:
> if item % 2 != 0:
> answer.append(item * -1)
> else:
> answer.append(item)
> 
> print(answer)

Hm, that's the only first 98 members.

> 
> I know I should be better off doing this with map but cannot get it to
> work. I understand also that map returns a generator so this solution
> should only working in python2(correct me please if I am wrong).
> 
> In [6]: map?
> Type:   builtin_function_or_method
> String Form:
> Namespace:  Python builtin
> Docstring:
> map(function, sequence[, sequence, ...]) -> list
> 
> Just getting something wrong
> list(map((lambda x: x * -1 if (x%2 != 0)), series))

Here's another way to look at the problem -- start with an infinite series 
and then slice it:

>>> from itertools import *
>>> list(islice(count(2), 10))
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

Factor out the slicing to focus on the important stuff:

>>> def first_ten(items):
... return list(islice(items, 10))
... 
>>> first_ten(count(2))

Now add the alternating sign:

>>> first_ten(cycle([1, -1]))
[1, -1, 1, -1, 1, -1, 1, -1, 1, -1]

Combine the two:

>>> from operator import mul
>>> first_ten(imap(mul, cycle([1, -1]), count(2)))
[2, -3, 4, -5, 6, -7, 8, -9, 10, -11]

It is important that you use itertools.imap() in Python 2 because the map() 
builtin would try to build the infinite list...

Finally put the slicing back into the expression if you like:

>>> list(islice(imap(mul, cycle([1, -1]), count(2)), 10))
[2, -3, 4, -5, 6, -7, 8, -9, 10, -11]



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


Probem with fbconsole

2015-01-04 Thread Ole Andreas Gløersen
I want to enter text msg and upload picture (so all friends can see and some 
private pictures) to my Facebook acount.

I'm working with fbconsole (it's important that it is text based command line) 
for setting up cron job on a Raspberry Pi.

My code:

import fbconsole

redirect_uri =  "https://local.fbconsole.com:8080/";
fbconsole.SITE_URL=redirect_uri

fbconsole.APP_ID = 'my_SW_ID'

fbconsole.AUTH_SCOPE = ['read_stream']
fbconsole.automatically_authenticate('my_FB_ID','my_FB_PWD','Security_code',fbconsole.SITE_URL,True)



My result:

pi@raspberrypi ~/facebook $ python f.py 
send: 'GET 
/dialog/oauth?scope=read_stream&state=DeletetDeletet&redirect_uri=https%3A%2F%2Flocal.fbconsole.com%3A8080%2F&client_id=Deletet
 HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: www.facebook.com\r\nConnection: 
close\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) 
Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Pragma: no-cache
header: Facebook-API-Version: v2.2
header: X-Frame-Options: DENY
header: Cache-Control: private, no-cache, no-store, must-revalidate
header: Expires: Sat, 01 Jan 2000 00:00:00 GMT
header: X-XSS-Protection: 0
header: X-Content-Type-Options: nosniff
header: Content-Type: text/html; charset=utf-8
header: X-FB-Debug: Deletet.Deletet
header: Date: Sun, 04 Jan 2015 16:51:31 GMT
header: Connection: close
Traceback (most recent call last):
  File "f.py", line 13, in 

fbconsole.automatically_authenticate('Deletet','Deletet','Deletet',fbconsole.SITE_URL,True)
  File "/usr/local/lib/python2.7/dist-packages/fbconsole.py", line 413, in 
automatically_authenticate
browser.select_form(nr=0)
  File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 
524, in select_form
raise FormNotFoundError("no form matching "+description)
mechanize._mechanize.FormNotFoundError: no form matching nr 0
pi@raspberrypi ~/facebook $ 


Can anyone help me futher on?


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


Re: Probem with fbconsole

2015-01-04 Thread Mark Lawrence

On 04/01/2015 17:03, Ole Andreas Gløersen wrote:

I want to enter text msg and upload picture (so all friends can see and some 
private pictures) to my Facebook acount.

I'm working with fbconsole (it's important that it is text based command line) 
for setting up cron job on a Raspberry Pi.

My code:

import fbconsole

redirect_uri =  "https://local.fbconsole.com:8080/";
fbconsole.SITE_URL=redirect_uri

fbconsole.APP_ID = 'my_SW_ID'

fbconsole.AUTH_SCOPE = ['read_stream']
fbconsole.automatically_authenticate('my_FB_ID','my_FB_PWD','Security_code',fbconsole.SITE_URL,True)



My result:

pi@raspberrypi ~/facebook $ python f.py
send: 'GET 
/dialog/oauth?scope=read_stream&state=DeletetDeletet&redirect_uri=https%3A%2F%2Flocal.fbconsole.com%3A8080%2F&client_id=Deletet
 HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: www.facebook.com\r\nConnection: 
close\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 
Fedora/3.0.1-1.fc9 Firefox/3.0.1\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Pragma: no-cache
header: Facebook-API-Version: v2.2
header: X-Frame-Options: DENY
header: Cache-Control: private, no-cache, no-store, must-revalidate
header: Expires: Sat, 01 Jan 2000 00:00:00 GMT
header: X-XSS-Protection: 0
header: X-Content-Type-Options: nosniff
header: Content-Type: text/html; charset=utf-8
header: X-FB-Debug: Deletet.Deletet
header: Date: Sun, 04 Jan 2015 16:51:31 GMT
header: Connection: close
Traceback (most recent call last):
   File "f.py", line 13, in 
 
fbconsole.automatically_authenticate('Deletet','Deletet','Deletet',fbconsole.SITE_URL,True)
   File "/usr/local/lib/python2.7/dist-packages/fbconsole.py", line 413, in 
automatically_authenticate
 browser.select_form(nr=0)
   File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 
524, in select_form
 raise FormNotFoundError("no form matching "+description)
mechanize._mechanize.FormNotFoundError: no form matching nr 0
pi@raspberrypi ~/facebook $


Can anyone help me futher on?




Maybe 
http://stackoverflow.com/questions/10507169/using-python-requests-to-select-forms 
failing which work your way down the remaining 816 hits on google after 
searching for the entire FormNotFoundError line :)


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Argparse defaults

2015-01-04 Thread Joseph L. Casale
Does a facility exist to add an argument with a default being a function
that leverages the final parsed Namespace?

For example:

group  = parser.add_argument_group(' some_group ')
group.add_argument(
'--some_group',
nargs='*',
type=str
)
group.add_argument(
'-- some_group_def',
default=func
)

args = parser.parse_args()

where func returns a value 'a' if args.some_group or 'b' otherwise?

Obviously I can break that out after but I am curious if the facility exists?

Thanks,
jlc
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help with map python 2

2015-01-04 Thread Dan Stromberg
I'm partial to:

#!/usr/local/cpython-3.4/bin/python

def gen_series(top=None):
'''
Generate the numbers from 2 to top, with alternating signs.
If top is None, generate forever.
If top is an integer, generate from 2 to top.
'''
sign = 1
if top is None:
number = 2
while True:
yield number * sign
number += 1
sign = -sign
else:
for number in range(2, top):
yield number * sign
sign = -sign


def main():
list_ = list(gen_series(100))
print(list_)

main()


It's not the shortest, but it's pretty clear what's going on, and
gen_series() is reusable.


On Sun, Jan 4, 2015 at 3:34 AM, flebber  wrote:
> In repsonse to this question: Write a program that prints the first 100 
> members of the sequence 2, -3, 4, -5, 6, -7, 8.
>
> This is my solution it works but ugly.
>
> series = range(2,100)
> # answer = [(x,(y* -1)) for x, y in series[::2]]
> # print(answer)
> answer = []
> for item in series:
> if item % 2 != 0:
> answer.append(item * -1)
> else:
> answer.append(item)
>
> print(answer)
>
> I know I should be better off doing this with map but cannot get it to work. 
> I understand also that map returns a generator so this solution should only 
> working in python2(correct me please if I am wrong).
>
> In [6]: map?
> Type:   builtin_function_or_method
> String Form:
> Namespace:  Python builtin
> Docstring:
> map(function, sequence[, sequence, ...]) -> list
>
> Just getting something wrong
> list(map((lambda x: x * -1 if (x%2 != 0)), series))
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-04 Thread Jorgen Grahn
On Sat, 2015-01-03, Dan Stromberg wrote:
> On Sat, Jan 3, 2015 at 3:43 AM, pramod gowda  wrote:
...

> data=client_socket.recv(1024)
> print(data)
> client_socket.close()
>
>
> But note that if you send 10 bytes into a socket, it could be received
> as two chunks of 5, or other strangeness. So you should frame your
> data somehow - adding crlf to the end of your send's is one simple
> way.

I like to think of it as "defining the protocol" rather than "framing
your data".  But it ends up as the same thing: making sure each end
knows when it should stop looking for more data and start /acting/ on
it.

And yes, you can't do much with a TCP soocket without setting up these
rules. It's important to see that noone does it /for/ you.

/Jorgen

-- 
  // Jorgen GrahnO  o   .
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Tk Tix GUI documentation & builder overview and tips

2015-01-04 Thread Terry Reedy

On 1/4/2015 3:23 AM, Christian Gollwitzer wrote:


Am 03.01.15 um 22:57 schrieb Terry Reedy:

The current doc is wrong in any case.  I opened
http://bugs.python.org/issue23156



Tix is a compiled extension, so this tix8.4.3.dll is needed as well as a
couple of .tcl file including pkgIndex.tcl, which makes the package
available to the Tcl interpreter. tix*.dll was never part of tk*.dll.

Note that Tix is LEGACY. There are much better options for its widgets
available that are based on ttk. Just to try, I compiled Tix under OSX
for my Tk8.6.3 and ran the widget demos.

Instead of

* Hierarchical Listbox use ttk::treeview, tablelist_tile or tkTreeCtrl,
with increasing order of capabilities and install complexity

* TList: I think tkTreeCtrl can do it, never have used this layout

* CheckList: tablelist can be used with an editable field

* Grid widget: use tkTable

* NoteBook, PanedWindow, ComboBox, LabelFrame -> ttk::notebook,
ttk::panedwindow, ttk::combobox, ttk::labelframe

* Balloon: tcllib::tooltip

Not to mention that the Tix widgets are extremely ugly, while the
widgets from ttk have a near-native look and feel.

Caveat emptor: I've never used Tix, so this is just my impression as an
experienced Tk programmer from running the widget demo


I copied parts of this response with additional comments in a new 
tracker post.


--
Terry Jan Reedy

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


Re: Help with map python 2

2015-01-04 Thread Terry Reedy

On 1/4/2015 6:34 AM, flebber wrote:

In repsonse to this question: Write a program that prints the first 100 members 
of the sequence 2, -3, 4, -5, 6, -7, 8.

This is my solution it works but ugly.

series = range(2,100)
# answer = [(x,(y* -1)) for x, y in series[::2]]
# print(answer)
answer = []
for item in series:
 if item % 2 != 0:
 answer.append(item * -1)
 else:
 answer.append(item)


for item in series:
if item % 2:  # since result is a number, same as != 0
item *= -1
answer.append(item)


print(answer)

I know I should be better off doing this with map but cannot get it to work. I 
understand also that map returns a generator so this solution should only 
working in python2(correct me please if I am wrong).

In [6]: map?
Type:   builtin_function_or_method
String Form:
Namespace:  Python builtin
Docstring:
map(function, sequence[, sequence, ...]) -> list

Just getting something wrong
list(map((lambda x: x * -1 if (x%2 != 0)), series))


In py2, map produces a list already.  In any case, above is syntax error 
without else clause.


map(lambda x: x * -1 if x%2 else x, series)

If you do not have a function already, a list comp is better.

[(-1*k if k%2 else k) for k in range(2, N)]

Change [] to () and you have a generator expression.

--
Terry Jan Reedy

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


Re: Help with map python 2

2015-01-04 Thread Sayth Renshaw
Thank you for those solutions so varied. Am going to have a party with them
to see what works best for me.

Strange is there a way too use lousy comprehension without returning just
the matching odd values?

Sayth

On Mon, 5 Jan 2015 5:06 AM Dan Stromberg  wrote:

> I'm partial to:
>
> #!/usr/local/cpython-3.4/bin/python
>
> def gen_series(top=None):
> '''
> Generate the numbers from 2 to top, with alternating signs.
> If top is None, generate forever.
> If top is an integer, generate from 2 to top.
> '''
> sign = 1
> if top is None:
> number = 2
> while True:
> yield number * sign
> number += 1
> sign = -sign
> else:
> for number in range(2, top):
> yield number * sign
> sign = -sign
>
>
> def main():
> list_ = list(gen_series(100))
> print(list_)
>
> main()
>
>
> It's not the shortest, but it's pretty clear what's going on, and
> gen_series() is reusable.
>
>
> On Sun, Jan 4, 2015 at 3:34 AM, flebber  wrote:
> > In repsonse to this question: Write a program that prints the first 100
> members of the sequence 2, -3, 4, -5, 6, -7, 8.
> >
> > This is my solution it works but ugly.
> >
> > series = range(2,100)
> > # answer = [(x,(y* -1)) for x, y in series[::2]]
> > # print(answer)
> > answer = []
> > for item in series:
> > if item % 2 != 0:
> > answer.append(item * -1)
> > else:
> > answer.append(item)
> >
> > print(answer)
> >
> > I know I should be better off doing this with map but cannot get it to
> work. I understand also that map returns a generator so this solution
> should only working in python2(correct me please if I am wrong).
> >
> > In [6]: map?
> > Type:   builtin_function_or_method
> > String Form:
> > Namespace:  Python builtin
> > Docstring:
> > map(function, sequence[, sequence, ...]) -> list
> >
> > Just getting something wrong
> > list(map((lambda x: x * -1 if (x%2 != 0)), series))
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OT Vernacular and empire building [was Re: How do I remove/unlink wildcarded files]

2015-01-04 Thread Rick Johnson
On Sunday, January 4, 2015 7:19:23 AM UTC-6, Steven D'Aprano wrote:
> Dear gods, I know I'm going to regret this... [...]

Yes, but *NOT* for the reason you think!

With all the intellectual and philosophical *GOLD* i have
dropped into this thread (and others), the only response you
can muster is to re-affirm your hatred for America's
Greatness and your disdain for the classical American
vernacular?

  "Is this it? Is this all you can conjure, Saruman?"

Hmm... yours and Marks responses are leading me to believe
that perpetual bike-shedding is not a unique phenomenon of
python-ideas after all!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: apostrophe not considered with tkinter's wordstart and wordend

2015-01-04 Thread Rick Johnson
On Saturday, January 3, 2015 2:28:18 PM UTC-6, ravas wrote:

> Is it possible that this could be added in an upcoming
> version of Python -- or is this a Tk issue?

A quick look at the Tkinter.Text.get source code will answer
that question for you:

py> import inspect
py> from Tkinter import Text
py> print inspect.getsource(Text.get)
def get(self, index1, index2=None):
"""Return the text from INDEX1 to INDEX2 (not included)."""
return self.tk.call(self._w, 'get', index1, index2)

As you can see, this method is just a dumb wrapper. There is
no "python-side" processing going on here. Which is true for
just about the entire Tkinter module.

I'm not sure if you can edit the pre-defined "word capture
patterns" that exist within TK (never had the need to find
out), but you could implement any pattern matching you want
by binding the correct events and then processing the
"target string" on the Python side. 

However, i would say that not allowing customization of
patterns is a major flaw of the API, and one more reason why
Tkinter is a rusty old "Clostridium tetani infected" anchor
around Python's neck!

   FOR GUIDO'S SAKE, BE SURE YOUR IMMUNIZATIONS ARE UP TO DATE!
-- 
https://mail.python.org/mailman/listinfo/python-list


need some guidance on Python syntax smart editor for use with speech recognition

2015-01-04 Thread Eric S. Johansson
Some of you will recognize me as someone who pops up occasionally asking 
questions as I grope my way to a usable speech driven programming 
environment. My last set of experiments with a technique called 
togglename and speech driven template notation hit a pretty nasty wall 
of usability because of a fundamental incompatibility between GUIs and 
speech recognition and the lack of support Nuance gives to disabled 
users in general.


Before anybody suggests it, yes I know about that guy who gave a talk at 
a python convention and uses what we call the burp, belch, and fart 
school of speech recognition engine abuse. yes that is actually an 
affectionate description. :-) what he did is impressive but it's not 
where I'm going


I think the techniques I was experimenting with are good ones because 
they do make it easier to speak code. the problem comes about because of 
the irreversibility of the transformation making editing code as 
difficult as it was before.


A little background. Today, Python is an amazingly speech recognition 
friendly programming language (especially if you ignore pep-8). Using 
simple macros, you can pretty much noodle along and write code 
relatively easily. A few more specialized pieces and it's almost easy to 
rip, shred, and tear code into new shapes as you realize you went down 
the wrong path but still have lots of good idioms.


However, as easy as it is to noodle along, creating code I find myself 
somewhere around 0.8 as effective as I was with my hands and in editing 
code, I'm around 0.5 or less. My goal is to make speech driven 
programming at least on a parity with someone who has useful hands and 
hopefully 3 to 5 times faster.


a few years ago, a disabled friend of mine pointed out that the hard 
problem was not the creation of code but the editing of code. I took his 
observations to heart and have been working on trying to create a speech 
friendly environment that that can transform from the speech notation to 
the code notation and back again and still remain functionally 
identical. I have some ideas but I need some outside perspective from 
people who know Python better than I do.


The core of the idea is an editor which can present code in two forms. 
The first form is what you guys all know in love but is horrible to 
speak. The second form is something that is easy to speak, and as I said 
above, functionally identical to the code form. An ideal solution would 
give me the ability to toggle back and forth between these two 
representations. An experiment would be to play with is displaying both 
representations at the same time so you can see what you speak in near 
real-time.


The speech environment lends itself to speaking the broad intent and 
then answering questions to fill in the detail to create something 
concrete. For example, in one of my prototypes (shown below), I state 
that I want a class. Then I fill a detail like an initialization 
function, inheriting from a parent, copying in all the arguments etc. 
and I end up with a full class definition much more quickly than I could 
even type it with good hands. This is what I meant above by 3 to 5 times 
faster than hand generated code.


But with every experimental success, there is usually more than one 
problem. In this case is that I lose all the meta-information when I 
create the instance of the intent plus detail. I can't go back to that 
abstract form.


The obvious answer is saving that meta-information in conjunction with 
the code but when working in a team environment, that information is 
going to drive you handies up the wall because it's going to visually 
overwhelm the actual code. Serving the meta-information separately will 
mean it's even harder to recover a speech friendly version of the code 
after it's been touched.


Another thought experiment has been with always generating syntactically 
correct code and basing various code generation and navigation 
constructs around that.


So the questions I have right now are, or

what's a good open editor ( preferably multiplatform) that actually 
decomposes Python code into fundamental components such as class, 
expression, etc. and, lets you operate on those components? this is in 
contrast to editors such as Emacs which give you some fundamental pieces 
you can operate on but it's really character oriented and all of the 
syntax smartness not really available for coupling to speech recognition 
environment. it would be great if it was in Python so I don't have to 
learn yet another fricking language.


What would be the best way to store meta-information necessary to 
re-create the speech friendly presentation of code? I don't know if this 
is possible but I would like to be able to let handy programmers make 
changes that will be propagated automatically into the speech friendly 
code presentation without forcing them to learn the new notation.


An example of this is the definition of the class. In my world, a class 
definition