[Tutor] Is it pythonesque

2010-01-24 Thread Robert Berman
ngerous or 'wrong' to use. Comments and other renditions are most welcome. Thank you, Robert Berman ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is it pythonesque

2010-01-24 Thread Robert Berman
pythonesque "Robert Berman" wrote > def getuserinput(): >while True: >s1 = raw_input('Enter fraction as N,D or 0,0 to exit>>') >delim = s1.find(',') >if delim < 0: >print 'invalid user input&#x

Re: [Tutor] can any one help

2010-01-31 Thread Robert Berman
Grigor Kolev From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of invincible patriot Sent: Sunday, January 31, 2010 5:03 AM To: rabidpoob...@gmail.com; grigor.ko...@gmail.com Cc: tutor@python.org Subject: Re: [Tutor] can any one hel

Re: [Tutor] Future Appointments...

2010-01-31 Thread Robert Berman
-Original Message- From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Ken G. Sent: Sunday, January 31, 2010 10:41 AM To: tutor@python.org Subject: [Tutor] Future Appointments... Below is a program to determine when my nex

Re: [Tutor] rstrip in list?

2010-02-09 Thread Robert Berman
-Original Message- From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Ken G. Sent: Tuesday, February 09, 2010 10:29 AM To: tutor@python.org Subject: [Tutor] rstrip in list? I printed out some random numbers to a list and

Re: [Tutor] Wrestling with the Py2exe Install, Win7[XP!], Py2.5

2010-02-17 Thread Robert Berman
e tell you what I use because it takes a lot of the drudgery out of the process. Go to http://code.google.com/p/gui2exe/ and download gui2exe. It will automate much of the process and it seems to do a great job of finding all the necessary files including the DLL's hidden from py2exe. I hope

Re: [Tutor] Wrestling with the Py2exe Install, Win7[XP!], Py2.5

2010-02-18 Thread Robert Berman
> -Original Message- > From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor- > bounces+bermanrl=cfl.rr@python.org] On Behalf Of Wayne Watson > Sent: Wednesday, February 17, 2010 10:07 PM > To: tutor@python.org > Subject: Re: [Tutor] Wrestling with the Py2exe Install, Win7[XP

Re: [Tutor] Wrestling with the Py2exe Install, Win7[XP!], Py2.5

2010-02-19 Thread Robert Berman
detailed explanation I sent you. Robert Berman > -Original Message- > From: Wayne Watson [mailto:sierra_mtnv...@sbcglobal.net] > Sent: Thursday, February 18, 2010 11:10 PM > To: Robert Berman > Cc: tutor@python.org > Subject: Re: [Tutor] Wrestling with the Py2ex

Re: [Tutor] The Disappearing Program (py2exe)

2010-02-19 Thread Robert Berman
sage- > From: Wayne Watson [mailto:sierra_mtnv...@sbcglobal.net] > Sent: Friday, February 19, 2010 12:11 PM > To: Robert Berman > Subject: Re: [Tutor] The Disappearing Program (py2exe) > > I'm sure you are right. I'm not sure what you mean about view > params.

Re: [Tutor] Why is the max size so low in this mail list?

2010-03-01 Thread Robert Berman
Alan G > > It encouraged me to use pastebin when it was necessary to post code a tad longer than the casual fifteen line snippet. Robert Berman The opposite of love is not hate, it's indifference. The opposite of art is not ugliness, it's indifference. The opposite of faith

[Tutor] Binary search question

2010-04-23 Thread Robert Berman
type statement is in list1? What I am really trying to ascertain is how expensive or how efficient is 'is in list1'. Thanks for your input Robert Berman What you don't see with your eyes, don't invent with your mouth. ___ Tuto

Re: [Tutor] Binary search question

2010-04-23 Thread Robert Berman
Thank you all for your ideas and suggestions. The detailed explanations were most useful. Robert Berman What you don't see with your eyes, don't invent with your mouth. ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] Binary search question

2010-04-23 Thread Robert Berman
n occasional 7 second search time for the general ease of using in list. Knowing of course that eventually a programmer who is concerned with that potential 7 second lag time will opt for either a dictionary lookup or a bisected search. Robert Berman What you don't see with your eyes, don

Re: [Tutor] Binary search question

2010-04-23 Thread Robert Berman
use ‘in’ just based on what I have been reading from those who took the time to answer my post. Just my $0.02 worth. Robert Berman What you don't see with your eyes, don't invent with your mouth. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Binary search question

2010-04-24 Thread Robert Berman
tive to me! > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ Now that is most impressive. Robert Berman What you don't see with your eyes, don't invent with your mouth. ___ Tutor maillist

Re: [Tutor] has it gone quiet or is it just me?

2010-07-21 Thread Robert Berman
Same. Robert > -Original Message- > From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor- > bounces+bermanrl=cfl.rr@python.org] On Behalf Of Luke > Paireepinart > Sent: Wednesday, July 21, 2010 2:05 PM > To: Alan Gauld > Cc: tutor@python.org > Subject: Re: [Tutor] has it g

Re: [Tutor] prime test problem

2010-08-21 Thread Robert Berman
Googling 'computing prime numbers' produced about 64,100,000 results . That should certainly get you started. Robert From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Roelof Wobben Sent: Saturday, August 21, 2010 9:36 AM To

Re: [Tutor] data question

2010-10-02 Thread Robert Berman
> -Original Message- > From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor- > bounces+bermanrl=cfl.rr@python.org] On Behalf Of Roelof Wobben > Sent: Saturday, October 02, 2010 4:35 AM > To: tutor@python.org > Subject: [Tutor] data question > > > > Hello, > Now my que

Re: [Tutor] connect through the ip sharers

2010-10-25 Thread Robert Berman
Hi, Since your post appears to be discussing a networking problem rather than a problem with the Python language you might have far better results posting to a group more attuned to network problems. Good luck, Robert From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tu

Re: [Tutor] connect through the ip sharers

2010-10-25 Thread Robert Berman
, 2010 12:07 PM To: Robert Berman Subject: Re: [Tutor] connect through the ip sharers could you tell me what group or mailing list is more attuned to network problems? 2010/10/26 Robert Berman Hi, Since your post appears to be discussing a networking problem rather than a problem with the

Re: [Tutor] Summing up numbers in a file

2010-10-26 Thread Robert Berman
This certainly looks like a classroom assignment. Please make an attempt to solve the problem on your own. If the program fails, please copy the code you have written and the error messages from the traceback and someone here will be more than happy to help you work your way through the problem.

Re: [Tutor] if statement

2010-11-02 Thread Robert Berman
e: ") >Entries[change]=str(input("Please enter a nem name: ") > else: > #do nothing Whoops. Why are you trying to make the variable "confirmed" an integer rather than a simple 'y/n' as you are asking for? Robert Berman -- I am using the free ve

Re: [Tutor] Advantages or disadvantages on Platform?

2010-11-04 Thread Robert Berman
> -Original Message- > From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor- > bounces+bermanrl=cfl.rr@python.org] On Behalf Of Jorge Biquez > Sent: Thursday, November 04, 2010 3:44 PM > To: tutor@python.org > Subject: [Tutor] Advantages or disadvantages on Platform? > >

Re: [Tutor] While Loops: Coin Flip Game

2010-11-14 Thread Robert Berman
From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Dawn Samson Sent: Sunday, November 14, 2010 5:17 PM To: tutor@python.org Subject: [Tutor] While Loops: Coin Flip Game Greetings, I'm a Python beginner and working my way throu

Re: [Tutor] Reply All Dilemma of This List

2009-02-10 Thread Robert Berman
Mozilla Thunderbird  version 2.0.0.19 (20090105) running under Ubuntu Linux 8.10 does not have  "Reply to Group". Even if it did, out of habit I would be hitting the "Reply All" button. Old preferences die hard. Robert spir wrote: Le Tue, 10 Feb 2009 12:20:51 -0500, Brian Mathis a écrit :

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-19 Thread Robert Berman
for a  very high powered python developing environment and yes of course the open arrow works in that environment also. Consider, at the least, using iPython. Good luck, Robert Berman Eric Dorsey wrote: Still doesnt work.. I just get this when I hit the up arrow: >>> ^[[A

Re: [Tutor] String to list conversion

2009-02-24 Thread Robert Berman
Or, you could do: In [1]: print list(raw_input('name please...')) name please...John ['J', 'o', 'h', 'n'] Robert Berman Kent Johnson wrote: On Tue, Feb 24, 2009 at 10:16 AM, Taylan Karaman wrote: Hello, I am a beginner.

Re: [Tutor] Linear Algebra weirdness

2009-02-26 Thread Robert Berman
named LinearAlgebra In [3]: I am running Ubuntu Linux. What OS are yiou running and what version of Python? Robert Berman Mr Gerard Kelly wrote: I am getting some very strange behaviour from the Linear Algebra module. Look at this code: from LinearAlgebra import * a=5 print a And look at the o

[Tutor] Gtk time control and Glade

2009-03-17 Thread Robert Berman
it is something I would rather not have to do. Have any of you heard of such an available time control specifically for Gtk and available or capable of being used by Glade. Thank you for any insights and suggestions. Robert Berman ___ Tutor maillist -

Re: [Tutor] Gtk time control and Glade

2009-03-17 Thread Robert Berman
w.append_text('%02d'%(i,)) self.pack_start(w, False, False, 0) w.show() def get(self): return '%02d:%02d' % (self.hr.get_active(),self.min.get_active()) Cheers On Tuesday 17 March 2009 09:25, Robert Berman wrote: I am writing a Blood

Re: [Tutor] Executing a C Program from RH Linux in Python for Win

2009-03-18 Thread Robert Berman
under the auspices of VM and you are off and running. Hope this is of some help. Robert Berman Wayne Watson wrote: The Subject contains the interest here. Can it be done? I think it this case it requires executing the program command line with parameters then executing it? How dependent upon

Re: [Tutor] Posting to Tkinter NG in new.gmane.org

2009-03-26 Thread Robert Berman
r (NNTP). Your email server(usually POP) will not work. Robert Berman Alan Gauld wrote: "Wayne Watson" wrote My e-mail address is valid. Any ideas? I've compacted related Trash folders, etc It should be news.gmane.org... Or is that just a typo? In that case you probably

[Tutor] PDF to text conversion

2009-04-21 Thread Robert Berman
? Hopefully, they have reasonable documentation. My development environment is: Python Linux Ubuntu version 8.10 Thanks for any help you might be able to offer. Robert Berman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] PDF to text conversion

2009-04-21 Thread Robert Berman
. The program doesn't care if there are 8 test results or 80,000 test results. That is why i am looking for a python module. Thanks again, Robert Berman bob gailer wrote: Robert Berman wrote: Hi, I must convert a history file in PDF format that goes from May of 1988 to current date. Rea

Re: [Tutor] PDF to text conversion

2009-04-21 Thread Robert Berman
to my attention. Thanks, Robert Berman Emad Nawfal (عماد نوفل) wrote: On Tue, Apr 21, 2009 at 12:54 PM, bob gailer <mailto:bgai...@gmail.com>> wrote: Robert Berman wrote: Hi, I must convert a history file in PDF format that goes from May of 1988 t

Re: [Tutor] PDF to text conversion

2009-04-21 Thread Robert Berman
it to a SQLLITE database. I am thrilled both with the number of suggestions I have received from this group and the quality of the suggestions. Thanks again, Robert Berman Norman Khine wrote: the itools library from hforge.org has a PDF2TEXT implementation itools.pdf http

Re: [Tutor] PDF to text conversion

2009-04-22 Thread Robert Berman
inesh Message: 4 Date: Tue, 21 Apr 2009 18:37:39 -0400 From: Robert Berman mailto:berma...@cfl.rr.com>> Subject: Re: [Tutor] PDF to text conversion To: tutor@python.org <mailto:tutor@python.org> Message-ID: <49ee4ab3.4040...@cfl.rr.com <mailto:49ee4ab3.4040...@cfl.rr.co

Re: [Tutor] Number cruncher

2009-04-22 Thread Robert Berman
y, while this is certainly not 'the' answer it will get you started. Robert Berman John Jenkinson wrote: I need to write code that determines a students final grade based on the number of each type of assignment turned in with its corresponding weighted percentage. There will be 15-20

Re: [Tutor] Python help

2009-04-22 Thread Robert Berman
Yes. Show us your solution and perhaps we can help you make it a tad more efficient. Robert Berman IT_ForMe wrote: Anyone know how to program this using Python Add up the prices for items in a shopping cart. Some items are taxable and some items are not. You may assume a 7% tax rate for

Re: [Tutor] Lists in a file

2009-04-26 Thread Robert Berman
this helps. Robert Berman David Holland wrote: Hi, I am trying to create a program where I open a file full of lists and process them. However when the program does not recognize the lists as lists. Here is the relevant code :- def open_filedef(): text_file =open ("voteinp.tx

[Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate construct having found a similar construct discusse

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Thank you, Emile. That is the exact answer I needed. Robert On Wed, 2009-05-20 at 07:48 -0700, Emile van Sebille wrote: > On 5/20/2009 7:25 AM Robert Berman said... > > Hi, > > > > Given a list of options: option_1...option_n. For each option I have > > a cor

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Thank you, Christian. This solution was one I was not expecting and am glad to receive it. It is one I will explore in greater detail later. Robert On Wed, 2009-05-20 at 16:44 +0200, Christian Witts wrote: > Robert Berman wrote: > > Hi, > > > > Given a list of options: op

[Tutor] Iterating through a function list

2009-05-20 Thread Robert Berman
Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate construct having found a similar construct discusse

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
kesman for 'correct and proper' coding in the Python community and I take your opinions and commentaries seriously. Again, how efficient is this method and is it truly the 'most pythonesque' oriented code. Thanks again, Robert On Wed, 2009-05-20 at 16:07 +0100, Alan Gauld

Re: [Tutor] Need help solving this problem

2009-06-10 Thread Robert Berman
What you are looking at is a simulation whereby a coin having 2 outcomes (heads or tails) is flipped exactly 100 times. You need to tell how many times the coin falls heads up and how many times the coin falls tails up. First become familiar with the random module. Assign a value of 1 for heads a

Re: [Tutor] Help Needed

2009-06-16 Thread Robert Berman
You are putting far too much work into the solution. Look up slicing on the python web page. Then, as an example, In [1]: s1 = 'hello world' In [2]: s1[::-1] Out[2]: 'dlrow olleh' Hope this helps, Robert On Tue, 2009-06-16 at 14:25 -0700, Raj Medhekar wrote: > I had previously emailed y'all r

[Tutor] List Splicing

2009-06-17 Thread Robert Berman
Greetings, I am working on a 'simple' algorithm to solve the problem called PRIME1 explained at http://www.spoj.pl/problems/PRIME1/. I do have an algorithm based on the Sieve of Eratosthenes and it does work as I am failing the project not because of a computational error but because of the drea

Re: [Tutor] List Splicing

2009-06-17 Thread Robert Berman
involves the methodology I use to find primes well over one million. However, for the time being, can you perhaps share some suggestions on list splicing? Thank you for your assistance. Robert On Wed, 2009-06-17 at 15:25 -0700, Emile van Sebille wrote: > On 6/17/2009 3:03 PM Robert Berman s

Re: [Tutor] List Splicing

2009-06-17 Thread Robert Berman
r help. Robert On Wed, 2009-06-17 at 17:01 -0700, Emile van Sebille wrote: > On 6/17/2009 4:48 PM Robert Berman said... > > Emile, > > > > Thank your for your comments. I do have a list running from 0-101. > > Yes, it is true, I only needed 0 - 10 and yes I wi

Re: [Tutor] List Splicing

2009-06-17 Thread Robert Berman
Wayne, Thank you for the suggestion. I will let you know how well this plays out. Robert On Wed, 2009-06-17 at 19:26 -0500, Wayne wrote: > On Wed, Jun 17, 2009 at 7:11 PM, Robert Berman > wrote: > Emille, > > Thank you for the example of list splicin

Re: [Tutor] List Splicing

2009-06-17 Thread Robert Berman
rimearray is/does. If you look at or print all non zero numbers you have the primes between 2 and 20. Robert On Wed, 2009-06-17 at 17:30 -0700, Emile van Sebille wrote: > On 6/17/2009 5:11 PM Robert Berman said... > > Emille, > > > > Thank you for the example of list

Re: [Tutor] Eliminating consecutive duplicates in a list

2009-06-18 Thread Robert Berman
This might help: http://code.activestate.com/recipes/52560/ Robert On Thu, 2009-06-18 at 15:15 +0200, karma wrote: > I was playing around with eliminating duplicates in a list not using > groupby. From the two solutions below, which is more "pythonic". > Alternative solutions would be welcome. >

Re: [Tutor] Eliminating consecutive duplicates in a list

2009-06-18 Thread Robert Berman
pologies for that. > > x=[1,1,1,3,2,2,2,4,4,2,2] > > [1 ,3 ,2 ,4 ,2 ] > > > 2009/6/18 Robert Berman : > > This might help: http://code.activestate.com/recipes/52560/ > > > > Robert > > > > > > On Thu, 2009-06-18 at 15:15 +0200, karma wrote: > >>

Re: [Tutor] Python Programming exercise

2009-07-01 Thread Robert Berman
d: ") guess = str(guess) if guess != password: print "Access Denied" count = count + 1 else: print "Password Confirmed" break Robert Berman On Tue, 2009-06-30 at 19:53 -0700, D

Re: [Tutor] When are strings interned?

2009-07-01 Thread Robert Berman
On Wed, 2009-07-01 at 16:44 +0100, Angus Rodgers wrote: > Hello, world! > > This is my first post to the Tutor list (although I've already > posted to comp.lang.python a couple of times). > > I'm currently reading Chapter 4 of Wesley Chun's book, "Core > Python Programming" (2nd ed.). > > I f

Re: [Tutor] append question

2009-07-05 Thread Robert Berman
In [1]: test=[[1,2,3],[4,5,6],[7,8,9]] In [3]: testvar2 = [] In [16]: for i in range(len(test)): : testvar2.append(test[i][1]) : : In [17]: testvar2 Out[17]: [2, 5, 8] Robert On Sun, 2009-07-05 at 15:57 -0700, Steven Buck wrote: > Hi Python Tutors: > > I ha

Re: [Tutor] Python Tutorials: How to create useful programs after learning the syntax?

2009-07-06 Thread Robert Berman
I have programmed since I was 21. Since I am now retired; that gives me a tad of experience in some aspects of coding. I have only been using Python for two years and I enjoy it for two reasons; the first and most important is it is fun. if you don't enjoy the language, find another one you do enjo

Re: [Tutor] thesaurus

2009-07-08 Thread Robert Berman
http://pywordnet.sourceforge.net/ This will get you started. This is a tad easier to play with than its newer implementation. Read and experiment. it may meet most of your needs in this arena. Good Luck, Robert On Wed, 2009-07-08 at 18:28 -0400, Pete Froslie wrote: > okay.. I'm getting the ha

Re: [Tutor] Python Tutorials: How to create useful programs after learning the syntax?

2009-07-08 Thread Robert Berman
While it is not a sales pitch, the book is excellent. It and the Python Cookbook sit on top of my desk. Both are fantastic and pragmatic reference sources. Robert On Wed, 2009-07-08 at 16:10 -0700, wesley chun wrote: > On Sun, Jul 5, 2009 at 11:48 PM, Luis Galvan wrote: > > Hello all, this is m

Re: [Tutor] Searching backwards from end of string

2009-07-10 Thread Robert Berman
I think you are looking for a complex solution. How about the following example: In [31]: s1='abcdeefghijkl' #find last 'e' In [32]: s2=s1[::-1]#reverses s1 In [33]: j=s2.find('e') #finds first 'e' in reversed string In [36]: ind=len(s1)-j-1 #index into s1 where last occurrence of 'e' i

Re: [Tutor] Searching backwards from end of string

2009-07-10 Thread Robert Berman
On Fri, 2009-07-10 at 20:55 +0100, Angus Rodgers wrote: > On Fri, 10 Jul 2009 11:57:21 -0400, Robert Berman > wrote: > > >I think you are looking for a complex solution. > > Hardly. In my opinion your code w was overly complex for what you were attempting to d

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Robert Berman
On Thu, 2009-08-06 at 03:44 -0400, Joshua Harper wrote: > Ok, so I am trying to learn python, and I am reading many tutorial > type things and I am kind of stuck with implementing some of the > code... so for example the tutorial says "To get the examples working > properly, write the programs i

Re: [Tutor] Help deciding between python and ruby

2009-09-04 Thread Robert Berman
I think you will get at the least a slight bias toward Python. However, I think you should do your own research and reach your own conclusions. Simply to get you started I put the following into Google: 'Python or Ruby: Which to learn' and got more than 1M hits. Best of luck. Robert On Fri, 200

Re: [Tutor] New guy question...

2009-09-14 Thread Robert Berman
work with Version 3. Robert Berman On Mon, 2009-09-14 at 15:30 -0400, Warren wrote: > Hey all, > > I'm just getting started with Python and I'm working my way through my > first "Learn Python" book on my Mac. I ran into a weird issue > though.

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Robert Berman
Is there a significant difference in speed, style, or any pythonesque reasoning between Alan's solution and print message[::-1] Thanks for any information, Robert On Wed, 2009-09-23 at 18:51 +0100, Alan Gauld wrote: > "Ali Sina" wrote > > #Message backward printer > message=input('Enter you

Re: [Tutor] how to print a message backwards

2009-09-23 Thread Robert Berman
Thank you for the clear explanation. Robert On Wed, 2009-09-23 at 23:40 +, ALAN GAULD wrote: > > Is there a significant difference in speed, style, or any pythonesque > > reasoning between Alan's solution and > > print message[::-1] > > > Yes, the for loop doing one character at a time

Re: [Tutor] Unknown reason for error.

2009-09-24 Thread Robert Berman
Cory, It would be helpful for us to see the code and the exact error message(s). Would you copy your code and the errors directly to either your post or your code to one of the posting pages such as www.pastebin.org so we can see your code exactly how you have written it. Robert On Thu, 2009

Re: [Tutor] Using IDLE v2.6

2009-10-24 Thread Robert Berman
Ken, Two recommendations. 1) Komodo Edit 5. Free edition available from Activestate. www.activestate,com 2) Wing IDE 101 Free Edition from www.wingware.com my favorite of the freely available IDE's. Good luck, Robert On Sat, 2009-10-24 at 13:57 -0400, Ken G. wrote: > I ju

[Tutor] Sorting points on a 2D plane

2009-10-28 Thread Robert Berman
Hi, I am working on a practice problem called 'POINTS' on the CodeChef site:http://www.codechef.com/problems/POINTS/. This simply wants the sum of the distances between a number of points on a 2 dimensional plane. Looking at the problem, the algorithm to define the sum of the distances between all

Re: [Tutor] Sorting points on a 2D plane

2009-10-29 Thread Robert Berman
Kent and Alan, Thank you both for providing me with tools I can use to develop the sort portion of my algorithm. They are invaluable. I really appreciate Luke's willingness to examine and advise on the full algorithm and once it is written (only the function that determines distance between two p

Re: [Tutor] Sorting points on a 2D plane

2009-10-30 Thread Robert Berman
: > The problem belongs to 'Convex Hull' superset. > look into : http://en.wikipedia.org/wiki/Convex_hull_algorithms > > > > On Thu, Oct 29, 2009 at 6:05 PM, Robert Berman > wrote: > > > Kent and Alan, > > Thank you

[Tutor] Being beaten up by a tuple that's an integer thats a tuple that may be an unknown 'thing'.

2009-11-03 Thread Robert Berman
In [69]: l1=[(0,0)] * 4 In [70]: l1 Out[70]: [(0, 0), (0, 0), (0, 0), (0, 0)] In [71]: l1[2][0] Out[71]: 0 In [72]: l1[2][0] = 3 --- TypeError Traceback (most recent call last) /home/bermanr

Re: [Tutor] Being beaten up by a tuple that's an integer thats a tuple that may be an unknown 'thing'.

2009-11-03 Thread Robert Berman
Thank you for your explanations and especially your clear examples of a phenomenon(when list elements are tuples) which takes a few moments of study to truly grasp. Robert On Tue, 2009-11-03 at 09:53 -0600, Wayne Werner wrote: > On Tue, Nov 3, 2009 at 9:20 AM, Robert Berman >

[Tutor] Stolen thread: Bottom folk vs. toppers was trouble using 2to3.py

2009-11-03 Thread Robert Berman
lways been incredibly well constructed and concisely and clearly presented. I almost never notice their placement within the post. If there are going to be arguments pertaining to the posts, let them be over content and not placement. Thanks to all who participate in this group. Robert Berman On Tu

[Tutor] working with bit arrays

2009-12-02 Thread Robert Berman
Hi, I am trying to represent a number as a list of bits: for example the bit representation of the integer 8. I did find a number of articles pertaining to a module called bitarray but I was unable to download/install that package. I am using Linux on Ubuntu 9.10; Python 2.6.2. I am almost certa

Re: [Tutor] working with bit arrays

2009-12-02 Thread Robert Berman
Wayne, Thank you very much. Robert On Wed, 2009-12-02 at 12:48 -0600, Wayne Werner wrote: > On Wed, Dec 2, 2009 at 12:08 PM, Robert Berman > wrote: > > Hi, > > I am trying to represent a number as a list of bits: for > example the bit

Re: [Tutor] working with bit arrays

2009-12-02 Thread Robert Berman
Emille, I do think he meant bit 20 to 32 rather than 20 to 40. Unless, of course, he's dealing with a 64 bit word. I am delighted with all the help I have received on this topic and I am gleefully learning anding and oring, but not too much on the EOR side. Thanks again for all the assistance.

[Tutor] Finding a repeating sequence of digits

2010-01-01 Thread Robert Berman
know I should use a relatively large precision as repeating values may constitute a rather long sequence. I did see, on Google, a suggestion to use a precision of 1000. Thank you for any and all ideas and suggestions. Robert Berman ___ Tutor

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Robert Berman
almost always elucidating and extremely helpful. A number of people have suggested I am attempting a Euler problem. This problem is from the Rosecode series problem 8; http://javaist.com/rosecode/show.php?no=8 Again, thank you for all the suggestions and ideas. Robert Berman

[Tutor] New to Python

2008-07-07 Thread Robert Berman
u will get from this group as long as you are willing to show what you have accomplished. Best of luck. Robert Berman W W wrote: A quick google search for "Python tutorial" will yeild several results. I recommend "Think Python" - http://greenteapress.com/thinkpython/ HT

Re: [Tutor] something is fundamentally wrong...

2008-08-10 Thread Robert Berman
No. Not so. Observe, please: Python 2.5.2 (r252:60911, May  7 2008, 15:19:09) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "copyright", "credits" or "license()" for more information.         Personal firewall software may

Re: [Tutor] Reformatting phone number

2008-08-20 Thread Robert Berman
Perhaps because preNumber is a character and not an integer? Robert Dotan Cohen wrote: I was missing the quotes in the if statement. Changing if preNumber[0] == 0: to if preNumber[0] == "0": fixed the problem. Why did I need those quotes? The 0 is numerical, so it should not need the quot

Re: [Tutor] Reformatting phone number

2008-08-20 Thread Robert Berman
, etc. Hope this helps a bit. Robert Dotan Cohen wrote: 2008/8/21 Robert Berman <[EMAIL PROTECTED]>: Perhaps because preNumber is a character and not an integer? Perhaps. In php the distinction was made by the fact that there were no non-numerical characters in a string. I

Re: [Tutor] pass argument into running program *outside* of program

2008-08-22 Thread Robert Berman
Excellent idea. Its simplicity makes it both doable with ease and very reliable. Thanks for this suggestion. Robert Alan Gauld wrote: "Alan Gauld" <[EMAIL PROTECTED]> wrote $ program.py addMe create the server with a socket that listens for clients on a port

Re: [Tutor] test

2008-08-25 Thread Robert Berman
Nope. Kirk Bailey wrote: is my posting getting through? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Need help with Factorial algorithm using Python

2008-09-04 Thread Robert Berman
it found the correct integer. Any and all suggestions as well as more efficient ways to code the algorithm will be most appreciated. Please see attached source code. Robert Berman #!/usr/bin/env python #It can easily be seen that 6! = 720 and has exactly one trailing zero. #What is the lowest i

Re: [Tutor] Need help with Factorial algorithm using Python

2008-09-04 Thread Robert Berman
Luke Paireepinart wrote: On Thu, Sep 4, 2008 at 8:59 AM, Robert Berman <[EMAIL PROTECTED]> wrote: I am using both the THINK PYTHON text and the Challenge-You website to learn Python. I am doing reasonably well and certainly enjoy the available challenges. I am cur

Re: [Tutor] Need help with Factorial algorithm using Python

2008-09-04 Thread Robert Berman
Chris, Thank you very much for this. It is very helpful. I will check my answer against yours in the morning. Robert Chris Fuller wrote: I spent the day mulling over this problem, and then implemented my solution when I got home. This is for the easier problem of 7**8 zeros: On my linux

Re: [Tutor] Need help with Factorial algorithm using Python

2008-09-05 Thread Robert Berman
logic paths. I am learning by leaps and bounds, and knowing the value of such a collective group willing to share ideas and information is even a greater inducement. Robert Terry Carroll wrote: On Thu, 4 Sep 2008, Robert Berman wrote: "It can easily be seen that 6! = 720 and has e

Re: [Tutor] Exhaustive Enumeration

2008-09-21 Thread Robert Berman
A very interesting problem.  Given this is homework, I am not sure what it is you want. Do you want the solution coded and tested? Do you want this to include two or three algorithms optimized for speed as well as accuracy? I think the problem is well enough defined so that you do not need an

Re: [Tutor] Exhaustive Enumeration

2008-09-21 Thread Robert Berman
and recursion is a new concept to me as well. Thanks! Quoting Robert Berman <[EMAIL PROTECTED]>:   A very interesting problem.  Given this is homework, I am not sure what it is you want. Do you want the solution coded and tested? Do you want th

Re: [Tutor] Exhaustive Enumeration

2008-09-21 Thread Robert Berman
That it is. Jaggo wrote: Lol. And here I said to myself only, "What a nice challenge". On Sun, Sep 21, 2008 at 10:28 PM, Robert Berman <[EMAIL PROTECTED]> wrote: A very interesting problem.  Given this is homework, I am not sure what it is you want.

Re: [Tutor] Sorting Dictionary of Dictionary by certain Value

2008-09-23 Thread Robert Berman
This might help you. http://blog.modp.com/2008/09/sorting-python-dictionary-by-value-take.html Robert Joe Python wrote: Hi Pythonistas, I have a large dictionary of dictionary (50,000+ keys) which has a structure as follows: DoD = {     'flintstones' : {     'husband'   : "fre

Re: [Tutor] How trustworthy are pseudo-random numbers?

2008-10-03 Thread Robert Berman
Andre Engels wrote: On Fri, Oct 3, 2008 at 5:25 PM, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Is your math correct? That's ridiculously large. 1 year equals 3600 * 24 * 365 makes about 3*10^8 seconds. The universe is about 15.000.000.000 years old, that's about 5*1

[Tutor] More Pythonesque or a more efficient method

2008-10-05 Thread Robert Berman
Hi, The below script which prints anagrams available for any word available within a given database. It does work, but it is not very fast. I am relatively certain there are more Python friendly coding techniques but I am more concerned with a faster algorithm. The database item consists of

Re: [Tutor] More Pythonesque or a more efficient method

2008-10-05 Thread Robert Berman
Kent, Thank you for two excellent suggestions. I will implement your  suggestion of indexing by the sorted letters in the word. Robert Kent Johnson wrote: On Sun, Oct 5, 2008 at 1:52 PM, Robert Berman <[EMAIL PROTECTED]> wrote: The database item consists of the key; the

Re: [Tutor] More Pythonesque or a more efficient method

2008-10-07 Thread Robert Berman
Yet another approach to experiment with. Thank you all very much, Robert Kent Johnson wrote: On Tue, Oct 7, 2008 at 1:15 PM, Richard Lovely <[EMAIL PROTECTED]> wrote: In a slightly related matter, Is is possible to use all() with a list comprehension to check if a word contains a

Re: [Tutor] Creating a single .exe file without py2exe and pyinstaller

2008-10-19 Thread Robert Berman
If you want a real exe rewrite it in C or C++. Python is an interpretive language; my apologies to those who say it is 'semi-compilable'. Robert Berman Abah Joseph wrote: I have written a small application of about 40-45 lines which is about 4KB, so I want to create a single

[Tutor] A tutorial for Python and QT4

2008-11-12 Thread Robert Berman
Hi, I am looking for a tutorial teaching how to use QT4 Designer with Python. There are a number of very good tutorials for QT3, but I do not want to drop back from QT4.I have no problem designing the form(s) using QT4 designer; including signals and slots; but..I am not even certain why t

  1   2   >