At 04:14 PM 9/6/2005, Mike Cheponis wrote:
>On Tue, 6 Sep 2005, Danny Yoo wrote:[snip]
>
>How can I actively help fix these Python bugs?
I am concerned when you use the term "bugs". The behaviors you describe are
part of the design of Python, and they work as designed. To me a bug is a
failure o
1972, maintained
the APL interpreter in 1975 and devised and helped implement my first
language in 1976. My BSEE from RPI predates any CS departments.
Bob Gailer
phone 510 978 4454
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
At 04:34 PM 9/8/2005, [EMAIL PROTECTED] wrote:
I
would like to construct a table for my program but it does not seem to be
coming out evenly. Could someone please let me know what to do so that
everything will work out correctly?
def main():
print "This program shows a table of Celsius
tempe
At 10:12 AM 9/15/2005, Christopher Arndt wrote:
>Hi,
>
>I wonder if there is a shorter form of the following idiom:
>
>list1 = []
>list2 = []
>for item in original_list:
> if condition(item):
> list1.append(item)
> else:
> list2.append(item)
Consider (5 lines instead of 7):
At 09:30 PM 9/16/2005, Nathan Pinno wrote:
>Hey all,
>
>It looks like I started another running debate, the last time I did this, it
>went forever it seemed.
>
>Any hints or help on that original question?
>
>For clarity, I'll ask it again:
>
>Why won't it enter the quiz? Here is the code again:
>
At 10:30 AM 9/18/2005, Kent Johnson wrote:
>Marcin Komorowski wrote:
> > I know that one of the ways to iterate over sorted dictionary keys is:
> > keylist = dictionary.keys()
> > keylist.sort()
> > for key in keylist:
> > ...
> >
> > Is there a way to do this in a single line.
At 06:42 PM 9/22/2005, Nathan Pinno wrote:
The URL is
http://zoffee.tripod.com/purchasecomprogs.htm
[snip]
At your invitation I visited the site. I personally would not purchase
anything listed there due to insufficient information. I don't know what
I'm getting!
I suggest you dedicate a page to
At 03:46 PM 9/22/2005, [EMAIL PROTECTED] wrote:
>I am coming to Python from Perl. Does Python have anything like the diamond
>operator found in Perl?
Some of us (who don't know Perl) might help you if you tell us what the
diamond operator does. How could we get to first base with it? What are its
At 04:37 AM 9/23/2005, [EMAIL PROTECTED] wrote:
>[snip]
>In perl I can write this:
>
>@array = <>;
>print @array;
>
>If I save that and call it from the command line, I can include the name of a
>file after the script name. It will read in the file, putting each line
>into an
>element of the array
At 01:11 AM 9/24/2005, Shitiz Bansal wrote:
>Hi,
>I want to update a textfile using the r+ file mode.
>contents of file:
>
>abcd
>efgh
>ijkl
>mnop
>qrst
>uvwx
>yx12
>
>my scripts is:
>
>file1=open("aa.txt",'r+')
Instead of readline, use skip to position the file to where you want to
overwrite it.
At 08:11 AM 9/24/2005, Luke Jordan wrote:
>Hi All,
>
>I have spent an embarrassingly large amount of time trying to solve what
>on its face seems like a simple problem.
>
>I have a list of intergers, and I want to assign the sum of the intergers
>in the list to a variable. There are only interger
At 03:29 PM 9/24/2005, [EMAIL PROTECTED] wrote:
Hello
How would I get the following program to accept inputs of exam scores
from 0-100 with A being 100-90, B being 89-80, C being 79-70, D being
69-60, and F being everything less than 60?
Many solutions are available. One could use an if stateme
At 10:34 AM 9/26/2005, Nathan Pinno wrote:
Bob,
I did what you suggested. Take
another look, and tell me if you were a potential customer, would you
purchase something?
I tried
http://zoffee.tripod.com/purchasecomprogs.htm
I got "Sorry but the page ... is not here."
Sorry, but t
At 10:56 AM 9/26/2005, Nathan Pinno wrote:
The actual URL is
http://zoffee.tripod.com/purchasecompprogs.htm
I did what you suggested. Take another look, and tell me if you were a potential customer, would you purchase something?
No. For one thing I can (if I didn't already have one) buy a "re
At 12:08 PM 9/27/2005, Bernard Lebel wrote:
>Hello,
>
>Let say I have a string. The value of the string might be 'False',
>'True', '3', '1.394', or whatever else. Is there a quick way to
>convert this string into the appropriate data type other than with
>try/except?
eval()?
At 04:29 PM 9/28/2005, DS wrote:
>What I'm hoping to avoid is an
>explicit reference to any of the called functions within the program.
>By doing it that way, it would avoid a maintenance problem of having to
>remember to put a reference for every new function in the calling program.
Try this - a
At 08:23 AM 9/29/2005, DS wrote:
>bob wrote:
>
> > At 04:29 PM 9/28/2005, DS wrote:
> >
> >> What I'm hoping to avoid is an
> >> explicit reference to any of the called functions within the program.
> >> By doing it that way, it would avoid a maint
I am moving this to the python-win32 list where we can better handle it.
Please send further replies there.
At 03:41 AM 10/3/2005, Pepe Pena wrote:
>I am attempting to load a pdf file programatically within Adobe Reader
>using the Adobe Acrobat 7.0 Browser Control Type Library. If I run this
>c
At 07:20 PM 10/3/2005, Craig MacFarlane wrote:
>Hello,
>
>Is there a way to make line continuation work with
>the readlines function?
>
>i.e.
Do you mean e.g.?
> this is \
> one line.
I assume the above is a 2 line file you wish to read using a file object's
readlines method. There is not
At 09:10 PM 10/9/2005, Bill Burns wrote:
>I'm looking to get the size (width, length) of a PDF file. Every pdf
>file has a 'tag' (in the file) that looks similar to this
>
>Example #1
>MediaBox [0 0 612 792]
>
>or this
>
>Example #2
>MediaBox [ 0 0 612 792 ]
>
>I figured a regex might be a good way
At 06:04 PM 10/12/2005, [EMAIL PROTECTED] wrote:
>hello
>
>below is my code and everytime I input a value of 16 or more it keeps
>returning sophomore. could anyone help me figure out what to change so
>that it won't return sophmore for things greater than or equal to 16?
>
>def getcredits(num):
>
At 04:09 PM 10/13/2005, Marc Buehler wrote:
>hi.
>
>i want to pass an argument (a number) to a python
>script when running it:
> > python script.py
>
>i want to be able to use within script.py
>as a parameter.
>
>how do i set this up?
In the sys module there is a property argv. The docs say: "Th
At 03:50 PM 10/14/2005, Marc Buehler wrote:
>hi.
>
>i have a ton of html files from which i want to
>extract the plain english words, and then write
>those words into a single text file.
http://www.crummy.com/software/BeautifulSoup/ will read the html, let you
step from tag to tag and extract the
At 08:11 AM 10/16/2005, Norman Silverstone wrote:
>I am an elderly person somewhat physically handicapped with some
>experience programming in basic and pascal, many years ago. In order to
>keep myself mentally active I decided to have a look once again at
>programming and chose python as a good l
At 02:12 PM 10/19/2005, CPIM Ronin wrote:
>I know that one should use IDLE or a choosen editor for any substantial
>Python coding! However, if one happens to have written some interesting
>doodlings on the regular command line interface (under Windows XP in my
>case), is there an easy way to save
At 04:16 PM 10/19/2005, Jonas Melian wrote:
>def _pre_save(self):
> for field in [self.name, self.native_name]:
> if not field.istitle():
> #print field.title()
> field = field.title()
>
>The change I try to do there (field = field.title()) is not being applied
At 04:16 PM 10/19/2005, Jonas Melian wrote:
>def _pre_save(self):
> for field in [self.name, self.native_name]:
> if not field.istitle():
> #print field.title()
> field = field.title()
And FWIW there is no benefit in using "if not field.istitle():" since it
cal
At 12:32 AM 10/20/2005, Jonas Melian wrote:
>bob wrote:
>
> > At 04:16 PM 10/19/2005, Jonas Melian wrote:
> >
> >> def _pre_save(self):
> >> for field in [self.name, self.native_name]:
> >> if not field.istitle():
> >>
At 10:53 PM 10/25/2005, Nick Eberle wrote:
Content-class:
urn:content-classes:message
Content-Type: multipart/alternative;
boundary="_=_NextPart_001_01C5D9F1.A836CF4F"
Sorry for potential double post, error with first send
--
Thank you for posting your code. That really helps us see where you are
and therefore how to help.
I encourage you to "desk check" your code: pretend you are the
computer: write down the values of variables and expressions as things
change. Evaluate each statement to see what it does.
Example:
he
At 12:18 PM 10/27/2005, Mike Haft wrote:
>Apologies for not making things clearer last time.
>
>My specific problems are:
>
>why can I not get the readline() or readlines() functions to work, I'm
>told they are not defined whenever I try.
Mike * Oh * Mike ... and all others ...
Please Post The Co
At 01:42 PM 10/27/2005, Adam wrote:
> >if line[:1] == "1":
>
>This line won't work because you're getting the first 2 characters from
>the line
Oh? Did you test that? When I do that I get 1 character. Why? Because
slicing goes UP TO the 2nd argument.
>>> 'abc'[:1]
'a'
At 07:07 PM 10/27/2005, Nathan Pinno wrote:
>Hey all,
>I am trying to create a program that draws 6 numbers between 1 and 49 at
>random for creating lottery tickets. I want to have a better chance when I
>play.
Define "better chance". Lottery odds are how many tickets you buy relative
to how ma
Please in future provide meaningful subject lines. It makes it a lot easier
to track the threads.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
At 08:06 PM 10/27/2005, Jason Massey wrote:
>All you need is the line continuation character, '\':
>
>if (condition 123 and \
>condition 456) :
Did you test that (or even read it)? That is a syntax error line
continuation or not! Also recall that the parentheses obviate the need for
the \.
At 09:42 PM 10/27/2005, Nathan Pinno wrote:
>If I create a program that randomly draws 6 numbers, its like the lottery.
>According to an article I read in Reader's Digest, if you get a Quick Pick
>- which is six numbers at random - you increase your odds of winning.
Odds are how many tickets yo
At 09:50 PM 10/27/2005, Johan Meskens CS3 jmcs3 approximated:
>what is Python's equivalent of 'last' in perl?
>
>if flag == 1:
> break
Yes. If flag is either 1 or 0 you may code it thus:
if flag:
break
That's not the whole truth. Most types have a value that is seen as false
in b
At 07:28 AM 10/28/2005, Smith, Jeff wrote:
Aren't the odds just based on
how many tickets you buy? The odds aren't
affected by different people buying more tickets. If only one
person
buys a ticket in the entire lottery system, his odds of winning are
the
same as if two people play, and the sam
tails is 1. The odds therefore are the same. If you
flip 2 coins then the odds of both being heads is 1/3, ditto both tails.
Odds of being different is 1/2.
Jeff
-Original Message-
From: bob
[mailto:[EMAIL PROTECTED]]
Sent: Friday, October 28, 2005 10:52 AM
To: Smith, Jeff; Tutor@pyt
At 08:03 AM 10/28/2005, Nathan Pinno wrote:
>Hey,
>I created it. Want to see the code?
>Here it is:
>[code]
>import random
>numbers = []
Move this inside the loop following if q == 1 and get rid of the occurrence
of this statement following print numbers. Less code, easier to read, more
to the p
At 08:52 PM 10/31/2005, Steve Bergman wrote:
>Say I have a function:
>def f(self, **kwargs) :
FWIW you don't have a function at this point. You have a def statement
which must be followed by at least one indented statement, which in turn
must be executed. Then you have a function.
>and I want t
At 02:36 PM 11/1/2005, Zameer Manji wrote:
>Ok after looking at everyones replies my program looks like this:
>
>#Coin Toss Game
>#Zameer Manji
>import random
>
>print "This game will simulate 100 coin tosses and then tell you the
>number of head's and tails"
>
>tosses = 0
>heads = 0
>tails = 0
>
>
At 11:31 AM 11/3/2005, Johan Geldenhuys wrote:
>Hi all,
>Just a quick question;
>
>How do I code this output:
>"""
>files dirs
>==
>"""
>
>I want to print something a few space away from the left side or in the
>middle of the line.
In the Python Library Reference look up 2.3.6.2 S
At 11:31 AM 11/3/2005, Johan Geldenhuys wrote:
>Hi all,
>Just a quick question;
FWIW saying that does not help. It takes time to read it, and I can judge
the question length by reading the question. The real concern is what does
it take to construct an answer.
_
At 01:34 PM 11/3/2005, Michael Haft wrote:
>Hello,
> I tried the following code:
>
>def readSOMNETM(inputName):
> input = open(inputName, "r")
> result = []
> for line in input:
> fields = line.split()
# add this; it will show you what line(s) have less than 8 f
[snip] Colin: your replies to 2 e-mails indicate that you have either not
read the e-mails or the prior responses. Please consider the work others
put into replying before replying.
Example: I suggested % formatting in a reply. You replied to that by saying
the same thing.
At 10:02 PM 11/3/2005, Johan Geldenhuys wrote:
Found it. This is what I was
looking for:
"""
>>> print ('file'+'dir'.center(20))+('\n'+'='*15)
file dir
===
>>>
"""
I am glad you found what you wanted. I'm sad that you did not tell us
more precisely what you wanted, as we cou
At 05:47 PM 11/4/2005, Carroll, Barry wrote:
>I have a function that makes use of several global variables:
>
>##
>Include struct
Did you mean "import"?
>ABC = 1
>DEF = 2
>xyz = 0
>def do_stuff(in_str):
> hdr = struct.pack('@2BH',ABC|DEF,xyz,len(in_str))
> newstr = hdr+in_str
Wor
At 01:57 PM 11/5/2005, Shi Mu wrote:
>when I clicked 'quit' button,
>there is no response. I want to close the interface by clicking 'x',
>the interface could not be closed.
>i had to close PYTHONWIN to get out of the program.
That is a known problem running Tkinter stuff under PythonWin. Others m
At 03:39 PM 11/5/2005, Shi Mu wrote:
>It is very hard for me to understand why we need the following line?
>if __name__ == "__main__":
We don't need it. Often we code a module for importing into another module.
But sometimes we also want to run the module independently as a Python
program, perha
At 08:19 AM 11/8/2005, Matt Williams wrote:
>Dear List,
>
>Does anyone know of any python semweb tools? I'm especially interested
>in tools to build and handle ontologies. I've come across CWM (built by
>Tim BL) but not that much else. I'd be really interested in anything
>that can interface with a
At 08:52 PM 11/20/2005, ->Terry<- wrote:
-BEGIN PGP SIGNED
MESSAGE-
Hash: SHA1
Ok, I've got my peg game roughed out and I'm having
problems.
The error is:
Traceback (most recent call last):
File "pypeg.py", line 113, in ?
main()
File "pypeg.py", line 107, in main
x.draw_b
At 08:38 PM 11/21/2005, Vincent Wan wrote:
>I'm trying to write a tree data structure as part of my first
>object oriented program
>
>I have an error "can't assign to function call" caused by this line:
>Tree.nodeList(self.name) = self
Tree.nodeList[self.name] = self
>however, nodeList is a dicti
At 09:04 PM 11/21/2005, Vincent Wan wrote:
>Thank you bob. I fixed the errors where I tried to index a dictionary
>with name()
>so so that they say name[]
>
>>>Beyond the error I'm still not sure I understand how to make and
>>>use a tree data structure using
At 12:20 PM 11/22/2005, Liam Clarke-Hutchinson wrote:
Hi
Eric,
Either -
add this line to the end of your scripts
-
discard = raw_input("Press enter to finish.")
Or -
Click on Start > Run... type cmd.exe and
use DOS to move to the directory where your scripts are stored and run
them via
At 02:41 PM 11/22/2005, mike donato wrote:
>Greetings, I am new student to programming and am experimenting with PYTHON.
> >From what I have read, seems to be a very versatile language. In the
>following excercise I am getting an error
>
>class String(str, Object):
try -> class String(str, object)
At 09:55 AM 11/23/2005, lmac wrote:
>i have a list with the dirs/files from the current path. When i use
>sort() to sort the list alphabetically the list is still unsorted.
When you say "unsorted" - are the list members in the same order as
before the sort?
>dirs_files = os.listdir(os.getcwd())
At 06:31 PM 11/23/2005, Diego Galho Prestes wrote:
>Hi! I'm using a program that I want to know if I'm running the program
>in Linux or Windows. How can I do this? I want this because I created
>all my program in Linux but if someone runs it in Windows I have to do
>some things to make it work well
At 11:58 AM 11/29/2005, [EMAIL PROTECTED] wrote:
>Hi,
>
>I have written a script which reads a Microsoft Excel file and moves
>the data inside onto a database. The script uses the PyWin32 module
>written by Mark Hammond, but I was wondering if anyone knew of a way
>to extract the data without usin
At 01:45 PM 11/29/2005, John Fouhy wrote:
>On 30/11/05, bob <[EMAIL PROTECTED]> wrote:
> > Interesting you ask at the same time I'm researching this question. I found
> > http://sourceforge.net/projects/pyexcelerator
> > Somewhere I thought I saw a reference to its
At 09:57 PM 12/5/2005, Gregorius Gede Wiranarada wrote:
>hello,
>how can i connect python to read data from ms access or ms foxpro?
foxpro:
Install (if you have not) Mark Hammond's pywin32 to get the odbc module
http://sourceforge.net/project/showfiles.php?group_id=78018
Create a Data Source (if
At 06:57 AM 12/6/2005, Joseph Quigley wrote:
>I'd like to make a 30 minute timer. How an I do that? With time?
import time
time.sleep(30)
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
At 07:18 PM 12/6/2005, Liam Clarke-Hutchinson wrote:
>Hi,
>
>time.sleep() takes an argument as seconds.
Oh yeah I know that but forgot.Sigh. Thanks for the correction.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tuto
At 04:15 PM 12/11/2005, Brian van den Broek wrote:
>Hi all,
>
>I have a case like this toy code:
>
>import random
>list1 = [1,2,3]
>list2 = ['a', 'b', 'c']
>item = random.choice(list1 +list2)
>if item in list1:
> others = list2
>else:
> others = list1
>
>
>Another way occurred to me, but
At 11:13 AM 12/14/2005, Carroll, Barry wrote:
>Greetings:
>
>I am implementing a (crude but useful) debug facility in my test
>system client software. Basically, I test the value of a global
>Boolean. It True, I write pertinent data to a text file. I want to
>do this in multiple functions in a
At 02:14 AM 12/14/2005, Liam Clarke wrote:
>Hi all,
>
>Just contemplating.
>
>If in Python I were organising a data index along the lines of -
>
>j = {
>
>"k_word1" : ["rec1","rec2","rec3","rec4"],
>...
>"k_wordn" :["recX","rec4"]
>
>}
>
>and I was going to find records that matched by seeing what
At 10:15 AM 12/23/2005, Panagiotis Atmatzidis wrote:
>Hello,
>
>Can someone provide me with an error checking example about an x
>variable that needs to be number only? I used something like:
>
> def useridf():
> print ""
> print "WARNING: If you don't understand why this must be unique,
At 11:16 AM 12/23/2005, Panagiotis Atmatzidis wrote:
>Hello there,
>
>Thank you for the prompt response.
>
>On 12/23/05, bob <[EMAIL PROTECTED]> wrote:
>[snip]
> > print input("x ; ")
> > and enter "Hello world"
>
> >>> x = in
At 11:28 AM 12/23/2005, Panagiotis Atmatzidis wrote:
>On 12/23/05, Panagiotis Atmatzidis <[EMAIL PROTECTED]> wrote:
> > Hello Dany :-)
> >
> > On 12/23/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
>[...]
> > >
> > >
> > > Hello Bob a
At 05:20 AM 12/24/2005, Panagiotis Atmatzidis wrote:
>Hello,
>
>I am writing a function in order to check if a directory exists. If
>exists the functions must do nothing, otherwise must check the users
>permissions and if it's possible create the dir. Looking at pydoc's
>httpd I found the module "o
At 04:30 AM 12/25/2005, linda.s wrote:
>is there any tool like "run line or selection" in Pythonwin?
Shades of Visual FoxPro?
Create a script (I call it testbed.py). Open it in a script window,
paste the selection there, hit F5. Since this executes in the main
namespace the results will persist
At 08:52 AM 12/26/2005, John Corry wrote:
>Thanks for the prompt reply. This is exactly what I am looking for.
>However, I have tried the code on the page and I can't get it to work.
>
>import tempfile
>import win32api
>
>filename = tempfile.mktemp (".txt")
>open (filename, "w").write ("This is a
At 01:26 PM 12/28/2005, [EMAIL PROTECTED] wrote:
>[snip]
>I`m trying to make a python script for extracting certain data from HTML
>filesSay for example the HTML file has the following format:
>Category:Category1
>[...]
>Name:Filename.exe
>[...]
>Description:Description1.
>
>Taking in to accoun
At 02:41 AM 1/5/2006, Intercodes wrote:
Hello everyone,
Iam new to this mailing list as well as
python(uptime-3 weeks).Today I learnt about RE from
http://www.amk.ca/python/howto/regex/.This one was really helpful. I
started working out with few examples on my own. The first one was to
colle
At 12:40 PM 1/5/2006, Boyan R. wrote:
>I need program to convert my string in integer.
>I remember in BASIC I used val(string) command
>Is there a Python equivalent ?
>
>Here is how it should work:
>val(7) = 7
>val(bbab7) = 7
>val(aa7aa) = 7
>val( 7) = 7
>
>This last is most important, currently
At 05:48 AM 1/8/2006, John Corry wrote:
>Hi,
>
>My text file is printing out in portrait. Is there any instruction that I
>can use so that notepad prints it in landscape?
I doubt that you can do this with notepad. Certainly not with
ShelleExecute. You could do some fancy footwork with opening no
At 02:59 PM 1/11/2006, Burge Kurt wrote:
>Hi,
>
>What is the usage of div_t in python?
>
>I have some unsigned integer variables and want to use ;
>
>div_t div_T;
>div_t div_N;
>div_t div_B;
Your question is meaningless to me! Please clarify.
div_t is not a Python constant or built_in.
div_t div
At 08:31 PM 1/11/2006, Steve Haley wrote:
>Hello everyone,
>
>I need to do something very simple but I'm having trouble finding
>the way to do it - at least easily. I have created a tuple and now
>need to find the position of individual members of that
>tuple. Specifically, the tuple is someth
At 10:52 PM 1/11/2006, Brian van den Broek wrote:
>[snip]
>
>I assume Bob meant that tuples have no index or find method.
No, Bob is sick and not thinking clearly.
At 11:04 PM 1/11/2006, Terry Carroll wrote:
>Does it have to be a tuple? If you make it a list, you can use index():
At 12:12 PM 1/16/2006, Christopher Spears wrote:
>I understand that you can use __getitem__ as a hook to
>modify indexing behavoir in a class. That's why
>__getitem__ not only affects [] but also for loops,
>map calls, list comprehension, etc. For loops, etc.
>work by indexing a sequences from z
At 09:23 AM 1/17/2006, Paul Kraus wrote:
>On Tuesday 17 January 2006 12:11 pm, andy senoaji wrote:
> > I am starting to pull my hair here. There were some postings in the past,
> > similar to my problem, but the response was not clear enough. Sorry if you
> > thingk I am reposting this.
> >
> > I a
At 02:25 PM 1/18/2006, Christopher Spears wrote:
Let's say I have two
classes:
>>> class super:
... def hello(self):
... self.data1 =
'spam'
...
>>> class sub(super):
... def hola(self):
... self.data2 =
'eggs'
...
Now let's look in the classes' namespaces using
__dict__:
At 03:46 PM 1/22/2006, Vincent Zee wrote:
>Why will this little program crash when you enter the enter key?
Thank you for including the "traceback" message in your 2nd post.
Index error means you tried to reference an element of a sequence
that is not there. a is the empty string when you just h
At 10:24 PM 1/22/2006, Shalini R wrote:
>Hi sir,
> I'm new to python & postgres as I've created a form in html & a
>table in postgres. There is a field in form which will take multiple
>value
My guess is that each checkbox needs its own name, rather than all of
them using arrFacility. Give that
u get something other than a command
not found kind of error then we can do something. Let us know.
Bob Gailer
[EMAIL PROTECTED]
303 442 2625 home
720 938 2625 cell
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
list's
append() and pop() methods).
For grins I just wrote one that takes '1 2.3 - 3 4 5 + * /' as input and
prints -0.0481481 8 lines of Python. That indeed is less than 100. Took
about 7 minutes to code and test.
Bob Gailer
[EMAIL PROTEC
At 03:36 AM 12/5/2004, you wrote:
Hi Bob,
That is what I am looking for! A simple RPN calculator program!
Can I see what you have please?
That depends. Are you are working on a homework assignment? I ask because
when we see several posts of a similar question we suspect it is an
assignment given
At 02:06 PM 12/5/2004, Just Incase wrote:
Hi Bob,
Yea, it is a homework and I would also like to do something on it to get
familiar with the program, so all I am asking for is if there are the
pionters to help me. Like I said I am new to python/programming but I have
limited time to turn-in the
ele1 in x:
for ele2 in seq:
if match:
print ele2
match = False
if ele1 in ele2:
print ele2
match = True
OR
for ele1 in x:
for index, ele2 in enumerate(seq):
if ele1 in ele2:
print ele2, seq[index+1]
[snip]
B
s:
DO function WITH parameters (FoxPro, similar in COBOL)
function parameter or parameter1 function parameter2 (APL)
Bob Gailer
[EMAIL PROTECTED]
303 442 2625 home
720 938 2625 cell
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/li
At 12:39 PM 12/8/2004, Bob Gailer wrote:
At 11:27 AM 12/8/2004, Dick Moores wrote:
My thanks to both Max and Kent. So Python tries, and fails, to see 2() as
a function!
I also got some help from <http://www.pcwebopedia.com/TERM/c/call.html>
Note that SOME languages use () for call. The
nts of a spot_int element to
match a spot_cor element.
Then (for the subset of data you've provided):
>>> for ele1 in spot_cor:
... for ele2 in spot_int:
... if ele1 == ele2[:2]:
... print "%8s %8s %8s" % ele2
...
10
At 06:05 AM 12/6/2004, you wrote:
Bob Gailer wrote:
> For grins I just wrote one that takes '1 2.3 - 3 4 5 + * /' as input
> and prints -0.0481481 8 lines of Python. That indeed is less than
> 100. Took about 7 minutes to code and test.
I'm quite interested in seeing
you don't seem to benefit from some of our suggestions.
Bob Gailer
[EMAIL PROTECTED]
303 442 2625 home
720 938 2625 cell
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
don't they just read the book?" That's how I
learned almost everything I know about programming. So it can be hard for
me to understand your struggle.
Nuf said for now...
[snip]
Bob Gailer
[EMAIL PROTECTED]
303 442 2625 home
720 938 2625 cell
_
hich it should
instead of 0x03039
and print "0x%05X" % 12345 displays 0x03039
The Python docs state
The conversion will be zero padded for numeric values, when a 0 is used as
a flag between the % and the conversion type.
If you continue in the documentation right after 3 Conversion flags comes
e, and then writing
if e == True:
instead of
if e:
For some reason, that's extremely common in code written by newcomers
to Pascal.
Not to mention coding examples provided by Microsoft in some help topics!
[snip]
Bob Gailer
[EMAIL PROTECTED]
303 442 2625 home
720 938 2625 cell
_
t a new reference
to the original attribute. Example
>>> import sys
>>> from sys import modules
>>> sys.modules is modules
True
>>> m = dict(sys.modules) # create a copy
>>> m is modules
False
--
Bob Gailer
Chapel Hill NC
919-636-4239
terseness:
terms = [random.randint(1, 99) for i in 'ab']
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
swers. Good
idea?
Yes indeed. That is what I did before reading your comment! Great minds
think alike.
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
1 - 100 of 2074 matches
Mail list logo