Re: [Tutor] Modifying Source Code while Program is Running

2005-11-27 Thread Alan Gauld
> However, I'm still slightly uncomfortable with it.  It smells to me a
> bit like the "as long as it works, its fine" school of thought.

FRom the client point of view thats true, but from the class designers
point of view its very important that the internals be we well designed.
And that includes how the internal objects and ultimately data are
represented, but its a much smaller (and therefore easier) problem
than trying to solve the total data picture. In this regard objects are
an abstraction layer on top of the data, we focus on the entities
and let the fields take care of themselves (or let the entity designers
do it for us!)...

> defined, as at the end of the day it's the data that matters

Only at one level. You are right that the inputs and outputs of a
program will be expressed in terms of data, but the program itself
is an expression of behaviour. If I feed this in you transform it to
that out. You can feed the data in as one big tuple ands feed it
out in the same way, what happens to it in between is not important
so long as the output is correctly matched to the input.

> data is given to me by other people and can rarely be gotten back).

The trick is not to change the inpuit data but to generate new output
from the input. This is standard functional programming practice and
good to apply in procedural, OOP or functional programming styles.

>> Whereas in OOP you simply say
>
>> obj.doThing()
>>
> But writing a different doThing() for each object can be a huge waste
> of time.  You want to be able to write one doThing() that is going to
> work on each object (of a particular type).  This requires either
> knowing that all your objects are going to be similar in some respect,
> or writing a huge if..elseif as you mentioned.

On the contrary its nearly alwys more efficient to write a separate
function that gets called polymorphically than have long if/else chains.
Not least because:
a) you wind up with lots of if/else chains - one for every invocation
of the polymorphic method
b) the if/elif chains become a big maintenance headache requiring a
revisit to each one every time you introduce a new type
c) the invoking function becomes vulnerable to changes in the internals
of the called objects, introducing high levels of coupling which is "a bad 
thing"

Avoiding these kinds of chained if/else structures is one of the primary
goals of good OO design, and one of the biggest improvements in reliability
and readability brough about by OOP. But it does require a wee bit of faith
initially to trust it! :-)

However the many functions are not as bad as they sound because
you don't have to write the whole function out again, only the differences.
For example:

class C:
 # some data bits here...
def doit(self)
  # process the data bits
  pass

class D(C):
# some new data bits here
def doit(self):
 C.doit(self)# get C to do its bits first
 # process my data bits
 pass

class E(D):
# data
def doit(self):
 D.doit(self)
 # do my data bits
pass

So each subclass only has to process its own data and
call the superclass method. The superclass call can be at the start,
end or in the middle of the method - in Lisp terms this is called
BEFORE, AFTER and AROUND methods...

And if you think about it the data all has to be handled anyway
so the extra lines of code is actually very few, much fewer than
the accumulation of multiple if/else chains, and much easier to
maintain because each object is responsible for its own data
and nobody elses!

> Even just saying every object has a doThing() is starting
> to create a data structure.

No its creating a behaviour structure, the two things are very
different. Data structures are by definition static, behavour
stuctures are dynamic. It is the difference between static
data structures and dynamic behaviour structures that gives
OOP its power. Every time you rely on a static data structure
within an object you are limiting its ability to be reused.

>> But that's behaviour of the Page, just let it create its own form
>> and do its own searches, not your problem. Create the right
>> kind of Page and it will do the work for you...
>
> But then I've got to create lots of different behaviours instead of
> one simple generalised behaviour.

Correct, thats what OOP is all about, lots of very short simple,
(and thus reliable) methods. But you can parameterise them
but often thats doine by passing other objects with their own
behaviour. Thus

class C:
def meth(self, startObj, endObj)
startObj.doit()
doSomeOtherStuff()
endObj.finish()

So by passing in different objects we can completely change
the behaviour of meth, but not by relying on data just passing
in the objects we are working with andletting them do whatever
it is they do...

> > So maybe attributes are objects too? Maybe you page needs
>> to know how to handle attributes and you can create pages by

>Th

Re: [Tutor] Scientific Notation + 18 digit precision

2005-11-27 Thread Alan Gauld
> Is there an easy  way to convert these large numbers to the scientific 
> notation format?

The numbers are, of course, stored in binary so the real question is:
can we *display* them in scientific format?

The answer is yes using string format operators.

Try playing with the %e and %g options:

>>> val = 123456789453286432976.5309764
>>> print "%e" % val
>>> print "%g" % val
>>> print "%E" % val
>>> print "%G" % val

You can also control how many decimal places are displayed too

>>> print "%.4" % val

And the total number of digits, and the justification. Well worth
browsing the documentation on string formatting.

There are also ways of getting engineering notation (ie the powers
are multiples of 3, but I've forgotten for now how that's done!)

HTH

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Object-oriented design process

2005-11-27 Thread Alan Gauld
> I think you work at a much larger scale (of program size) than I do

That's probably true.
My day job is as a systems architect/designer, most of the real coding
is done by development teams scattered across the country. I use
Python to prove the concepts of my design before converting it into
Java speak for the real work

An average project for me involves about 3 months of architecture/design
generating maybe 5 or 6 workpackages given to different teams, each of
which will comprise between 10 and 50 programmers, so total team size
will be around 200-400 developers/testers and produce around 2 million
line of Java code over a year or so. I used to think that was normal but
I've discovered that in fact most folks are working on a much smaller scale.

[My current project is the biggest yet - it will have around 2000 engineers
working over 5 years and I've no idea how many millions of lines we will
produce! Even the design team is over 50 people and the requirements team
has over 30... The project office hasonlybeen set up but already has about
a dozen planners etc It's a bit scary, but thankfully the senior archiects 
have
worked on similar sized jobs in the past - and succeeded!...]

> ave ever worked on a project I would really call large.

The smallest real project I've ever worked on was 7 developers for 4
months - around 50,000 lines of C++ - it was my first C++ program and my
first Unix project!

>> individual classes get tested at the >>> prompt before veing tried in the 
>> framework - one of the great joys of Python is interactive testing at the 
>>  >>>.
>
> I do very little of this. For me the problem with testing at the >>> 
> prompt is that the tests aren't captured.

True, but I rely on my formal testing for that, but I do like being able to
just instantiate a class and fire stuff into it to get instant feedback. [ 
Maybe
it comes from being brought up in an environment wher we had to send
our programmes down the wire and get printouts back 3 days later 
the joy of instant feedback is too much to ignore! :-) ]

Alan G. 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] lil help Booky.py - updated (Chris or Leslie Smith)

2005-11-27 Thread Alan
Smile
Thanks 

#I am sorry I had bad cold
#I am back
I totally agree with you, I am sorry I was engrossed with the 150 lines
of code 

Now I am attempting to address this booky.py script with your all help
to clean the text


Input Filename1.txt :

1|H A quote this is a cool python coders (some of them know Java and
c++) lucky them thereby they united the universe
|F dollar sore book of the year |R nice

7|H C qoute this is a cool Java group coders, they live San Jose at
sun car parking lot
all what they afraid of is the sun network (this is a dog outside
|S Title I love the Canyon
the door) in sun main building |F Santa Fe Flea Market book of the year
|R very nice


5|H B qoute this is a cool COBOL group of coders, they are loved by
IBM
some of them are trying to learn visual COBOL
|F Good morning America book of the year
|R bad


Expected output Filename2.txt

|H1 A quote this is a cool python coders lucky them thereby they
united the universe
|F1 dollar sore book of the year
|R1 nice (some of them know Java and c++)

|H2 C qoute this is a cool Java group coders, they live San Jose at
sun car parking lot all what they afraid of is the sun network in sun
main building
|F2 Santa Fe Flea Market book of the year
|R2 very nice (this is a dog outside the door)

|H3 B qoute this is a cool COBOL group of coders, they are loved by
IBM some of them are trying to learn visual COBOL
|F3 Good morning America book of the year
|R3 bad

#!c:\python42

# script Name: Booky
# Date: 11/05
# Author: Python's good fellows
#
# requirements:
# read Filename1.txt and produce filename2.txt and perhaps finemame3.txt
as small test having accomplised the following:
# 1. sorted by H statement
# 2. numbereing |H |F |R
# 3. () relocated from |H to after |R
# 4. each statement united is only one line]
# 5. disregard any "|" following by other than |H |F |R such as |S Title
I love the Canyon
#
#
# Abstract:
# 1. consider remove all line feed, enter, etc from the whole file
# 2. split by | to generate one line per |
# 4. disregard (kill) any line having | which is not followed by H, F or
R 
# 3. constuct regular expression to find between |H and next | any
(words)
# even if it is in multi line layout
# 4. replace the (words) by one space and relocate (words) to the end of
|R just before next |H
# 5. sort each set (H F R) by |H statement
# 6. renamber all sets (H F R)
# done
# match, search, findall or findliter

import re
import sys

filename1 = "filename1.txt"
filename2 = "filename2.txt"
filename3 = "filetest1.txt"


f1= open(filename1, "r")
f2= open(filename2, "w")
f3= open(filetest3, "w") # small test file to check the output
f3= open(filename1, "r+w")


reg1=re.compile('\(.*' , re.IGNORECASE)
reg2=re.compile('.*\)' , re.IGNORECASE)

#or:
leftq=re.compile('\(\d+\s+\w+' , re.IGNORECASE)
rightq=re.compile('\d+\s+\w+\)' , re.IGNORECASE)


for searchstring in f1.readlines():

# which one is best

 match1 = reg1.match(searchstring)
 match2 = reg2.match(searchstring)

 search1 = reg1.search(searchstring)
 search2 = reg2.search(searchstring)

 findall1 = reg1.findall(searchstring)
 findall2 = reg2.findall(searchstring)

 finditer1=reg1.finditer(searchstring)
 finditer2=reg2.finditer(searchstring)

 if match1:
  print "Match 1 leftq:\t" , match1.group()

 if match2:
  print "Match 2 rightq:\t" , match2.group()
 else:
   print "No match"
 if search1:
  print "Match 3 leftq:\t" , search1.group()
 else:
   print "No match"

 if search2:
  print "Match 4 rightq:\t" , search2.group()
 else:
   print "No match"

 if findall1:
  print "Match 5 leftq:\t" , findall1.group()
 else:
   print "No match"

 if findall2:
  print "Match 6 rightq:\t" , findall2.group()
 else:
   print "No match"

 if finditer1:
  for i in finditer1:
   print i.group()
 else:
  print "no finditer match"

 if finditer2:
  for i in finditer1:
   print i.group()
 else:
  print "no finditer match"


# use sub to remove ()  from |H
# whole = (leftq + rightq)
# whole = sub("whole", ' ')


# Unlite () and relocate

# Use Smile's multilines post tomake one line of whole

# for searchstring in f1.readlines():
#  line1 = reg1
#  line2 = reg2
#  multinines
# sub (multilines, (reg1 + reg2)
# use the test file to check the output
# f3.writelines(searchstrings) # small test file to check the output
# if the output is Ok then we write to f2 or f1 r+w
# f2.writelines(searchstrings) # how do we write original file + changes

# in progress


Message: 8
Date: Fri, 25 Nov 2005 21:53:28 -0600
From: "Chris or Leslie Smith" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] lil help please - updated (fwd)
To: 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;   charset="iso-8859-1"

| The logic is so good so far. However, How do we move the (...) in |H 
| to end of |R and before next |H

Maybe you are thinking too literally about the moving of the
parenthetical item from the |H to the end of the |R.  Let's say you have
the 3 chunks of information in 

Re: [Tutor] Object-oriented design process

2005-11-27 Thread Kent Johnson
Alan Gauld wrote:
>> I think you work at a much larger scale (of program size) than I do
> 
> That's probably true.
> 
> An average project for me involves about 3 months of architecture/design
> generating maybe 5 or 6 workpackages given to different teams, each of
> which will comprise between 10 and 50 programmers, so total team size
> will be around 200-400 developers/testers and produce around 2 million
> line of Java code over a year or so. I used to think that was normal but
> I've discovered that in fact most folks are working on a much smaller 
> scale.

Yes, that's definitely larger than what I do! I can see why you need to think 
through the architecture more than I do.

> The smallest real project I've ever worked on was 7 developers for 4
> months - around 50,000 lines of C++ - it was my first C++ program and my
> first Unix project!

Most of my projects are completed by 1-4 programmers in 3-6 months. The 
smallest real project I can think of took me about 2-4 weeks working by myself 
:-)

Kent
-- 
http://www.kentsjohnson.com

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Refactoring

2005-11-27 Thread Kent Johnson
Alan Gauld wrote:

> Picking up Kent's message about refactoring, my approach tends to
> mean I more often refactor by combining classes into a higher level one,
> or reverting a class to a native data type than I do by breaking a class
> into smaller pieces. Most folks tend to mean the opposite direction
> when they say refactor - breaking a class or method out into two.

Hmm, refactoring is so much more than that. Common refactorings for me are 
extracting common code to a new function or method, moving an attribute or 
method from one class to another, changing a functional interface to an 
object-based one, changing the signature of a method, extracting a base class 
(OK, I do use base classes sometimes ;)

There is a catalog of refactorings here:
http://www.refactoring.com/catalog/index.html
and I recommend Martin Fowler's book to anyone who hasn't read it:
http://martinfowler.com/books.html#refactoring

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Scientific Notation + 18 Digit Precision

2005-11-27 Thread Hubert Fitch



Thanks to all of you (Alan, Chris, Kent) for your 
responses!
 
Before I try to follow up on these suggestions, it might be 
good to examine the display function module, and provide a few lines from a 
.py module that needs display.
 
Typical lines in a defintion module, that need a formatted 
display : 
(All referenced symbols in this module are previously defined 
in another module)
 
# 
---#   
VARIABLE  NAME, DATA ,   
ASSIGNMENT FORMULA,  COMMENT# 
---##   
INDUCTANCEL0 = pi*mu0*r0    #  Classical 
Inductance#   
CAPACITANCE  c0 = 4*pi*ep0*r0  # Classical 
Cpacitance
 
n = 2    # Quantum 
Number#   RADIUSr3 = 
(r0*(n/a)**2    ) # Bohr radius
#   ORBIT VELOCITYv3 = 
Q0**2/(2*h*ep0*n) # Bohr Orbit Velocityv = a*C/n  
#    Bohr Orbit 
Velocityv3 = 
v  
#  Bohr Orbit Velocityg3 = (1-v3**2/C**2)**-0.5 #  
Gamma
#   FREQUENCYf3  = 
g3*m0*v3**2/h  #  Bohr Orbit deBroglie frequency
-
 
 

Most of the formatted results are already provided in the 
correct form. 
What should be changed in this display function 
module? 
-
Display Function Module: 
(Written by Dr. Steve Spiklemire, Physics Dept Head Universtiy 
of indianapolis)
-
 
def DisplayPyFile(fname, context=None):
 
    if context is 
None:    context = 
globals()    f = open(fname)    lines = 
f.readlines()    f.close()
 
    for line in 
lines:    line = 
line.strip()    if not 
line:    
continue    leftAndRight = 
line.split('#',2)    comment = 
''    if 
len(leftAndRight)>1:    
comment = leftAndRight[1]
 
    assignment = 
leftAndRight[0]    leftAndRight = 
assignment.split('=')    if 
len(leftAndRight) == 
2:    name = 
leftAndRight[0].strip()    
exec(assignment, 
context)    
if context.get(name,None) is not 
None:    
value = 
context.get(name,'???')    
print "%10s  =  %18.15e (%s)\t[%s]" % (name, value, assignment, 
comment)    
else:    
print "%s not defined. %s" % (name, 
assignment)    
else:    
print 
line  -
 
Hubert    

 
 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Is it a good idea to use TKInter to change my password program into a GUI?

2005-11-27 Thread Nathan Pinno



Hey all,
 
Is it a good idea to use TKInter to change my password program into a GUI? 
I know it needs improvements, and I've noted them below:
 
[code]
#This is for a password protected program to store passwords.import 
getpasspassword = "hello" # This should instead load a file with the 
password in it.sitelist = {}
 
def load_file(pw):    import os    
filename = 'passcard.txt' # Weak, because any text file 
editor can read the usernames 
and passwords!    if 
os.path.exists(filename):   store = 
open(filename,'r')   for line in 
store:  site = 
line.strip()  ID = 
store.next().strip()  
pw[site] = ID     
else:    store = open(filename,'w') # 
create new empty file    store.close()
 
def save_file(pw):    store = 
open('passcard.txt',"w")    for site,ID in 
sitelist.items():    store.write(site 
+ '\n')    store.write(ID + 
'\n')    store.close()
 
def main_menu():    print "1) Add a login info 
card"    print "2) Lookup a login info 
card"    print "3) Remove a login info 
card"    print "4) Print Login info 
list"    print "9) Save and Exit"
 
def add_site():    print "Add a login info 
card"    site = raw_input("Site: ")    ID 
= raw_input("User ID and passcard, seperated by a space: ") # seperated should 
be spelt separated.    sitelist[site] = ID
 
def lookup_site():    print "Lookup a login info 
card"    site = raw_input("Site: ")    if 
sitelist.has_key(site):    print 
site,sitelist[site]    
else:    print site," was not 
found."
 
def remove_site(): print "Remove a login info 
card" site = raw_input("Site: 
") if 
sitelist.has_key(site): del 
sitelist[site] 
else: print site," was not 
found."
 
def print_login_info():    print "Login 
Info"    for site in 
sitelist.keys():    print "Site: 
",site," \tID Passcard: ",sitelist[site]+"\n"
# There should be a way to change the password, or add it for first 
time users.
print "The Password Program"print "By Nathan 
Pinno"printload_file(sitelist)answer = getpass.getpass("What is the 
password? ")while password != answer:    print "The 
password is incorrect."    answer = getpass.getpass("What is 
the password? ")
 
print "Welcome to the second half of the program."while 
1:    main_menu()    menu_choice = 
int(raw_input("Choose an option (1-4, or 9: "))    if 
menu_choice == 1:    
add_site()    elif menu_choice == 
2:    
lookup_site()    elif menu_choice == 
3:    
remove_site()    elif menu_choice == 
4:    
print_login_info()    elif menu_choice == 
9:    break    
else:    print "That's not an 
option!"save_file(sitelist)print "Have a nice day!"[/code]
 
Is it possible to salvage it?
 
Give me your honest advice.
Nathan Pinno
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Scientific Notation + 18 Digit Precision

2005-11-27 Thread Danny Yoo


On Sun, 27 Nov 2005, Hubert Fitch wrote:

> Thanks to all of you (Alan, Chris, Kent) for your responses!
>
> Before I try to follow up on these suggestions, it might be good to
> examine the display function module, and provide a few lines from a .py
> module that needs display.

[warning: long message.  It's hard to show how to refactor code without
actually doing it.  *grin*]

Hi Hubert,

The code that you've shown is a bit unusual since the heart of it is
'exec'.  I'll ignore that issue for the moment since it's so core to what
the program intends.  But instead, I'll concentrate on the overall
structure of the program, and try to give some constructive criticism.

(I'll try to condemn the use of exec at the end of this message.  *grin*)

The DisplayPyFile function feels too big: its inner workings obscures the
main idea of the function: to execute every functional definition in the
input file and display each result value.  Let's see if we can refactor
the program a bit to make that logic clearer.


There's a whole block of code here that does the parsing of each
definition:

> line = line.strip()
> if not line:
> continue
> leftAndRight = line.split('#',2)
> comment = ''
> if len(leftAndRight)>1:
> comment = leftAndRight[1]
> assignment = leftAndRight[0]
> leftAndRight = assignment.split('=')
> if len(leftAndRight) == 2:
> name = leftAndRight[0].strip()

Conceptually, the "input" into this block is a line from the file, and the
"output" is either an equation or not.  Let's informally say that an
equation is a 3-tuple (name, assignment, comment).

We can take the block above and turn it into a function:

##
def extractEquation(line):
"""Either returns a 3-tuple (name, assignment, comment) from the line,
or None if we can't extract a definition from the line."""
line = line.strip()
if not line:
return None
leftAndRight = line.split('#',2)
comment = ''
if len(leftAndRight) > 1:
comment = leftAndRight[1]
assignment = leftAndRight[0]
leftAndRight = assignment.split('=')
if len(leftAndRight) == 2:
name = leftAndRight[0].strip()
return (name, assignment, comment)
return None
##


This function is a bit messy, but we can clean that up in a moment.  But
let's see how this might work:

##
>>> extractEquation("")
>>>
>>> extractEquation("x = 42")
('x', 'x = 42', '')
>>> extractEquation("x = 42  # this is a test comment")
('x', 'x = 42  ', ' this is a test comment')
##

So this appears to work, although it's a bit rough.


If we have this extractEquation, then the logic in the original
DisplayPyFile()  simplifies to:

##
def DisplayPyFile(fname, context=None):
if context is None:
context = globals()
f = open(fname)
lines = f.readlines()
f.close()

for line in lines:
equation = extractEquation(line)
if equation:
name, assignment, comment = equation
exec(assignment, context)
if context.get(name,None) is not None:
value = context.get(name,'???')
print "%10s  =  %18.15e (%s)\t[%s]" % (name, value,
   assignment,
   comment)
else:
print "%s not defined. %s" % (name, assignment)
else:
print line
##


We can chip at DisplayPyFile() a bit more: there's a promising block here:

##
name, assignment, comment = equation
exec(assignment, context)
if context.get(name,None) is not None:
value = context.get(name,'???')
##

This block tries to evaluate the equation and get its value.  Actually, on
further inspection, some of the logic is redundant: if we get into that
'if' block, context.get(name) has to work --- the default clause in
"context.get(name, '???') is useless.  We can simplify the block to:

##
name, assignment, comment = equation
exec(assignment, context)
if context.get(name,None) is not None:
value = context.get(name)
##


Let's turn that equation-evaluating block into a real function:

##
def evaluateEquation(equation, context):
"""Evaluates the equation in a given context.  If we can't get a
value, returns None."""
assert equation != None
name, assignment, comment = equation
exec(assignment, context)
return context.get(name, None)
##


Let's do a quick pass to see if this

[Tutor] Scientific Notation + 18 Digit Precision

2005-11-27 Thread Hubert Fitch



Thank you Danny for your comments!
 
I have now printed out four responses, and perhaps I might 
even learn some Python! 
It will take me some time to analyze all comments!  

 
I had never heard of Python until I audited two Physics 
classes. "Math Methods for Physics,"  and "Quantum Mechanics." (I am 73 
years old, a retired Electronics Engineer).
 
In my first definition module "pythondef.py" I enter physical 
constants and formulas that define these constants, but there can be many 
entirely different formulas that will calculate the same physical 
parameter.
 
(I have quit trying to keep track of how many assignment 
formulas I have now, but it is over three hundred.)
 
The main reason for all these different formulas is for 
checking my theories. If one or more formulas that calculate the same parameter 
do not give the correct precision data value or result, then I know that I have 
made a wrong assumption (misake). 
 
I need these defintions to be global, but changeable. That is, 
I want to be able to overwrite the parameter when the same assignment (or 
another assignment that calculates the same parameter) is executed again. This 
can be dangerous, so I must be careful.
 
I may have 20 to 50 or more assignment satements in a .py 
module that must be in the correct computation order ( to be sure that all 
variables in each following assignment are all defined before execution). When 
these lines are processed by my run module, (or display module), they are not in 
a good order for including in a book. What is needed is to separate the 
equations into groups, and sometimes alphabetical order.
 
This can be done after all definition modules 
have run once, to get all global variables defined. Then I rearrange the 
order of all of the 20 to 50 assignments, to make inspection of results easy, no 
longer needing to have a certain execution order to avoid an undefined 
variable error.
 
So, typically I do the assignments twice. Once to get the 
variable entered globally, and the second time for presentation purposes. (This 
requires careful checking to be sure that all equations are in both lists, 
without any errors.)
 
I have needed to frequently modify the defintition modules. 
And, they are not really suitable for compiled .pyc modules. However, 
my display function and run module function are 
compiled modules. 
 
--
I had thought not to introduce my theory into this 
discussion, but to help understand what the programs are supposed to do, I will 
tell you a little bit about it.
 
My theory says that photons can be converted into electrons, 
to give the newly created electron intrinsic properties. The photon continues to 
exist, and to continue to travel at light speed! 
 
After the at-rest electron "structure" is understood, then we 
may extend this model to include electrons in motion. Physicists use Quantum 
Mechanics (QM) and Shrodinger's Equation to explain the in-motion electron, its 
momentum and energy states, using probabilities and wave functions, but 
ignore any electron intrinsic structure. Quantum Electro Dynamics (QED) and the 
Dirac Equation further explain electron properites, but likewise ignore any 
intrinsic electron structure.
 
So, why is another electron model needed? ( At another time, 
perhaps we can say more. )
 
We need some notation, which could be explained more fully 
later, but here is a short description:
 
Photon Parameters, Electron Classical Parameters, Electron 
Compton Parameters (2 sets), Atomic orbit Parameters, and Arbitrary Motion (not 
in any orbit) Parameters.
 
Photon parameters use the subscript 1. 
Classical parameters use subscript 0. 
Compton Parameters use subscript 10, and 11.
Orbiting Electron parameters use the subscripts 2, and 3, for 
the first two Hydrogen orbits.
deBroglie Wave Parameters use a letter subscript 
(sometimes upper case, and somtimes lower case).
 
For Example: (Seven Parameter groups)
Photon Energy = E1, Electron Classical Energy = E0, Electron 
Compton Energy = E10, and E11.
First Orbit Energy = E2, Second Orbit Energy = E3, deBroglie 
Energy = Ed
 
And so on for: Current, Voltage, Period, Frequency, 
Inductance, Capacitance, Moments, Electric field, Magnetic Field, Flux Density, 
etc. etc.
 
***
So, we have seven groups of variable names, with 
precision data, assignment formulas, and comments arranged in four 
vertically aligned columns.  
(I use Landscape mode, legal size paper for printing .rtf 
files to maintain the 4 column formatting.)
***
 
So, if I displayed only 20 parameters for each of the seven 
groups, I would need additional room for the many redundant(?) calculations of 
each para

[Tutor] help

2005-11-27 Thread Kevin Gall

how do i use python, do i download it? how do i use it . kevin.Don't just Search. Find! The new MSN Search:  Fast. Clear. Easy.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] help

2005-11-27 Thread Danny Yoo


On Sun, 27 Nov 2005, Kevin Gall wrote:

> how do i use python, do i download it? how do i use it . kevin.

Hi Kevin,

Out of curiosity, what do you know about Python or programming already?
We want to avoid rehashing things that you already know, so if you can
give any background on previous experience with computers and programming,
that'll help us target our explanations to suit you better.


There are resources on the web that should help you get started.  For
example:

http://wiki.python.org/moin/BeginnersGuide

The page there explains how to get started: how to download Python, what
to expect, and how to find tutorials.


I really can't get a sense of what you know already, so I'm defaulting to
assuming that you're coming from a non-programmer background.  In that
case, I think you'll find the tutorials on:

http://wiki.python.org/moin/BeginnersGuide/NonProgrammers

approachable.  Pick a tutorial.  When you have questions on something that
doesn't make sense, send a question over to Tutor, and the tutors here
will try to make sense of it.  *grin*

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] running a program

2005-11-27 Thread David Jimenez
Hello everybody,I have a very simple question: how can I run a script that uses module Tkinter without using IDLE? Thank you,David  
		 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor