Re: [Tutor] Python

2013-08-18 Thread Wayne Werner
On Thu, 15 Aug 2013, Jake Wohldmann wrote: Hello I am a beginner to using any type of programming lanhuage  How long does it take to become fluent at a script? Do you know and good sites to learn python?  I will only be able to practice python on weekends since school is starting.  I was also w

Re: [Tutor] 3to2?

2013-04-22 Thread Wayne Werner
On Sun, 21 Apr 2013, Steven D'Aprano wrote: On 21/04/13 04:32, Jim Mooney wrote: I was looking at google pengine for python and it only supports 2.7. I've installed 3 and would rather not go back (I kept doing Print without the parentheses for awhile and it was really annoying ;') So the quest

Re: [Tutor] design question (Django?)

2013-04-18 Thread Wayne Werner
d rough UI mockps! HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Guidance if possible

2013-04-12 Thread Wayne Werner
requests pretty trivial. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Looks like a judgment bug.

2013-04-11 Thread Wayne Werner
imes it will be, other times it won't. The takeaway is to use `is` when you want to compare identity, and `==` when you want equaltiy. For example, That car is *my* car. The car I'm referring to is one specific car. But if I were to say... My car is a Chevette. That would be mor

Re: [Tutor] Code to open a website

2013-02-09 Thread Wayne Werner
On Sat, 9 Feb 2013, mann kann wrote: Dear Jedi,  I wrote my first program but it doesn't open a website as I intended it to. Please correct my mistake.  Sincerely,  Mann You'll actually want the webbrowser module, which will open the links in your web browser - at least if you want to load s

Re: [Tutor] running multiple versions of python

2013-01-12 Thread Wayne Werner
be able to do: C:\some\path> python2 a_matplot_program.py HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] writing effective unittests

2013-01-09 Thread Wayne Werner
On Thu, 3 Jan 2013, Japhy Bartlett wrote: The general idea is to write tests that use your code in realistic ways and check the results.  So if you have a function that takes an input and returns a result, you write a test that passes that function an input checks the result.  If some inputs s

Re: [Tutor] IronPython any tutors with experience out there?

2013-01-06 Thread Wayne Werner
On Thu, 3 Jan 2013, Bjorn Madsen wrote: Hello PythonTutor- I'm a scientist and very happy with python 2.7. I have been asked to assist a development program where everything is written in dotNET/ C# (visual studio 2012) and luckily Microsoft Visual Studio supports IronPython which is a clean P

Re: [Tutor] Recommended texts for self-study to master software engineering?

2012-12-15 Thread Wayne Werner
of the rest of them. Although, my own personal experience is that contributing to this list has done more to help me really understand the basics of Python and development than anything else. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubs

Re: [Tutor] Tutor Digest, Vol 106, Issue 5

2012-12-04 Thread Wayne Werner
the more I hear about Gmail, the more horrible I discover it to be. Why does anyone use this crappy, anti-social product? Because it didn't use to suck. Also protip: you can use with gmail. Like alpine ;) -Wayne ___ Tutor maillist - Tutor@pytho

Re: [Tutor] I am learning python3 and would like some more python3 modules/programs on my...

2012-10-15 Thread Wayne Werner
at many of the tutorials will be Python 2 oriented, so if they run into problems, they should ask a question here. Plus, there will be no Python 2.8. Sure, people are still developing tools in Python 2.x, but more and more are migrating to 3.x, and *many* of the larger packages are Python 3 compa

Re: [Tutor] Through a glass, darkly: the datetime module

2012-10-07 Thread Wayne Werner
or of typing four characters when two would do. lol. I really did, too! +1 (I think this might apply to COBOL programmers, too.) -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/ma

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-29 Thread Wayne Werner
On Sat, 29 Sep 2012, Wayne Werner wrote: On Sat, 29 Sep 2012, Oscar Benjamin wrote: On Sep 29, 2012 2:25 AM, "Alan Gauld" wrote: > > On 28/09/12 21:32, Jim Apto wrote: > >> I'm relatively new to python, and was asked to program a lotka-volterra >> model (p

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-29 Thread Wayne Werner
responses about variable names? I for one, prefer to get the most value from my question as possible. It shows respect to the people I'm asking, and to everything else that they could possibly be spending their time on, including answering other questions. Respectfully-and-somewhat-to

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-28 Thread Wayne Werner
On Fri, 28 Sep 2012, Jim Apto wrote: Hello folks, I'm relatively new to python, and was asked to program a lotka-volterra model (predator and prey relation) simulator.  The program basically will basically have a menu that takes user input, collect data, and then create a graph.  Currently i'v

Re: [Tutor] OT: Netiquette

2012-09-28 Thread Wayne Werner
On Fri, 28 Sep 2012, Bod Soutar wrote: On Sep 28, 2012 4:47 AM, "Dwight Hutto" wrote: > Yeah, all up in my fucking cranium with nothing but me and God to hold > on  to one another. > > -- > Best Regards, > David Hutto > CEO: http://www.hitwebdevelopment.com Probably not a good idea to advertis

Re: [Tutor] Resources to create a form filler

2012-09-17 Thread Wayne Werner
On Mon, 17 Sep 2012, DM wrote: Hi I've learned a little python via MIT's 6.01SC and would like to gain experience with personal projects. I'd like to make a web form filler for the desktop. I'd appreciate it if someone could suggest what resources I would need to build it. Thanks! Do you mean

Re: [Tutor] [Semi-OT] Yes or no on using a Graphical IDE?

2012-09-15 Thread Wayne Werner
e telling that even with the ViEmu plugin for Visual Studio, I actually prefer programming in Vim (using :make), with ctags, and grep, to using Visual Studio... Of course YMMV. -HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] help me decide

2012-09-05 Thread Wayne Werner
to just get stuff done. I don't have to worry about how I can shoehorn the problem into something that the language can solve - I can just solve it. So I find great joy in writing Python code, and encourage everyone to learn it. My recommendation for

Re: [Tutor] making a shortcut in windows

2012-09-04 Thread Wayne Werner
On Tue, 4 Sep 2012, Garry Willgoose wrote: Oscar, I actually just want the functionality of a shortcut so that I can put an icon on the desktop. symlink allows that in Unix (and a few other capabilities that I'm not that intersted in) and just want something equivalent to the menu item for maki

Re: [Tutor] running more than one python program at the same time

2012-09-04 Thread Wayne Werner
On Mon, 3 Sep 2012, William R. Wing (Bill Wing) wrote: junk = raw_input("Yes Master?") You don't even need the 'junk' bit: raw_input("Yes Master?") Will run just fine. HTH, -Wayne ___ Tutor maillist - Tutor@

Re: [Tutor] using multiprocessing efficiently to process large data file

2012-09-01 Thread Wayne Werner
f is now at the end of the file, calling next on it will raise StopIteration, which will end your loop without actually processing anything on the inside! So, this probably isn't the best way to handle your issue, but maybe it is! HTH, Wayne

Re: [Tutor] Why begin a function name with an underscore

2012-09-01 Thread Wayne Werner
On Thu, 30 Aug 2012, Steven D'Aprano wrote: On 28/08/12 21:24, Wayne Werner wrote: On Mon, 27 Aug 2012, Richard D. Moores wrote: What the best way to test if something's an integer? try: whatever_you_want(supposed_integer) except ValueError: print("Oops, that wa

Re: [Tutor] Why begin a function name with an underscore

2012-08-28 Thread Wayne Werner
ry: whatever_you_want(supposed_integer) except ValueError: print("Oops, that wasn't an integer! Please try again") That's usually the best way... HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Wayne Werner
ine 1, "called" from input(). Anyway, the cure is to use raw_input() everywhere instead. Or alternatively, if you want to write forward-looking code: try: input = raw_input except NameError: pass # since we're using python 3+ -Wayne _

Re: [Tutor] suggestion for an editor

2012-07-20 Thread Wayne Werner
e of IDE integration. -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] suggestion for an editor

2012-07-19 Thread Wayne Werner
into the Timeit module. How long does it take your program to run currently? After all, premature optimisation is the root of all evil... -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pytho

Re: [Tutor] Problem When Iterating Over Large Test Files

2012-07-19 Thread Wayne Werner
Caps_In_Variable_Names are usually discouraged. Class names should be CamelCase (e.g. SimpleHTTPServer), while variable names should be lowercase with underscores if needed, so id_line_1 instead of ID_Line_1. If you're using Python3 or from __future__ import print_function, rather

Re: [Tutor] string to binary and back... Python 3

2012-07-19 Thread Wayne Werner
my head around things and I've found that explaining (or trying to explain) to someone else is often the best way to work out the idea in your own head. If I've gone too far astray I'm sure the other helpful folks here will correct me :) HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] newbie Questions

2012-07-16 Thread Wayne Werner
ised my opinion. I would now tell someone to learn any language besides php. -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] passing global variable as argument.

2012-07-16 Thread Wayne Werner
return new_array And then you would call it like this: REF_F2 = ref(ln) HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] str object is not callable

2012-07-10 Thread Wayne Werner
for a big head. I read a marvelous quote today: "Good code is anything I wrote today. Bad code is anything I wrote more than a week ago." -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://ma

Re: [Tutor] updating step size while in loop

2012-07-09 Thread Wayne Werner
f.cur < self.stop: yield self.cur self.cur += 1 And then you could do the following: In [36]: i = MyIter(1, 10) In [37]: for x in i: : if x % 2: : i.cur += 1 : print(x) : 1 3 5 7 9 -HTH, Wayne On Tue, 10 Jul 2012, Hugo Arts wrote:

Re: [Tutor] Simple Python Address Book (Advice welcome!)

2012-06-17 Thread Wayne Werner
make things a little cleaner. There's also the end parameter which defaults to end='\n' HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] creating a regularly placed fields in a line

2012-04-26 Thread Wayne Werner
On Wed, 25 Apr 2012, Prasad, Ramit wrote: Useful to know both though, since lots of people swear by % substitution. And % formatting is slightly faster - if you end out doing tons of formatting and you find your script isn't fast enough, it's worth taking a look there

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Wayne Werner
On Thu, 19 Apr 2012, Tino Dai wrote: Hi!      I have a question about style. In PEP-8, it says don't exceed 79 characters, but can this rule ever be trumped by  readability? PEP 8 is style guidelines, not hard and fast rules or they wouls be syntax errors. But that would just be annoying, so

Re: [Tutor] regex question

2012-04-08 Thread Wayne Werner
tring with redata.split('::') and then look at every second element in the list and split *that* element on the last '.' in the string. With data as well-formed as this, regex is probably overkill. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] breeds of Python .....

2012-04-03 Thread Wayne Werner
erpowers?) http://python3wos.appspot.com/ HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] New to Python programing

2012-04-03 Thread Wayne Werner
d luck and welcome to Python! -Wayne Werner ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] feedback on writing pipelines in python

2012-03-22 Thread Wayne Werner
On Wed, 21 Mar 2012, Abhishek Pratap wrote: Hi Guys I am  in the process of perl to python transition for good. Welcome! 1. stitch pipelines : I want python to act as a glue allowing me to run various linux shell based programs. If needed wait for a program to finish and then move on, logs if

Re: [Tutor] help writing functions

2012-02-24 Thread Wayne Werner
;re really interested in doing this fire the sake of the exercise you should probably take a look at feedparser it's designed for parsing read and atom feeds. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] (no subject)

2012-01-18 Thread Wayne Werner
st the exact text of the traceback. If the code you used is short enough then it's reasonable to just paste it in your email (make sure HTML formatting is off, though, because it will probably break the formatting). -Wayne ___ Tutor maillist - Tutor

Re: [Tutor] Reg. Expressions Parenthesis

2012-01-17 Thread Wayne Werner
ake much), can someone explain this to me, please?? > > Here's an example to use. It's kinda long, so, if you'd rather provide > your own shorter ex, that'd be fine. Thanks for any help as always. > Here's a quick example: import re data = 'Wayne Werner

Re: [Tutor] Return to my python26.dll & python.dll problems on bootup

2012-01-07 Thread Wayne Watson
have pages that are thick with other $ products advertising. Once you get through several pages of them, you then find the download. On 1/5/2012 10:25 AM, Steven D'Aprano wrote: Wayne Watson wrote: I have two problems upon bootup of my Win7 PC, 64-bit. Wayne, I sympathize with your pro

[Tutor] Return to my python26.dll & python.dll problems on bootup

2012-01-05 Thread Wayne Watson
7;s the problem? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet CE 1955 October 20 07:53:32.6 UT

Re: [Tutor] question about a exercise

2012-01-05 Thread Wayne Werner
an you do this? 3. Generate random text - can you do this? 4. Modify text (or generate slightly less-random text) - can you do this? If you can do those four things then you should be able to easily accomplish this task (that looks an awful lot like homework) HTH, Wayne ___

Re: [Tutor] Which libraries for Python 2.5.2 [SOLVED]

2012-01-01 Thread Wayne Watson
This problem was solved when my wife noticed that there was a second install disk for the 5 year old XP zx6000 PC she had given me, which I will now give to a friend. The problem originally was a missing dll that Python wanted. All is well now. -- Wayne Watson (Watson Adventures

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-26 Thread Wayne Watson
Regardless, the problem is solved. See my [SOLVED] msg I put up this morning (USA). It's in response to Lie Ryan. However, I have no real idea how is was caused. On 12/26/2011 1:28 PM, Alan Gauld wrote: On 26/12/11 18:57, Wayne Watson wrote: IOError: [Errno 13] Permission denie

Re: [Tutor] Which libraries for Python 2.5.2

2011-12-26 Thread Wayne Watson
import affine_transform ImportError: DLL load failed: The specified module could not be found. >>> On 12/26/2011 11:44 AM, Wayne Watson wrote: Yes, that's a reasonable request, and I expected it, but hoped it might be apparent from what I revealed. Why? It's on another PC this

Re: [Tutor] Which libraries for Python 2.5.2

2011-12-26 Thread Wayne Watson
Arts wrote: On Sat, Dec 24, 2011 at 6:37 PM, Wayne Watson wrote: I'm trying to restore Python 2.5.2 on an old PC for a particular application that uses it from 4-5 years ago. According to the latest manual on it, the following should be installed. python-2.5.2.msi PIL-1.1.6.win32-py2.5.

Re: [Tutor] A few Python Mysteries [SOLVED]

2011-12-26 Thread Wayne Watson
Thanks to all who followed this long perplexing thread. On 12/24/2011 8:08 PM, Lie Ryan wrote: On 12/25/2011 06:24 AM, Alan Gauld wrote: On 24/12/11 18:58, Wayne Watson wrote: Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-26 Thread Wayne Watson
On 12/24/2011 11:24 AM, Alan Gauld wrote: On 24/12/11 18:58, Wayne Watson wrote: Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' Can you open it in Notepa

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Wayne Watson
Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' These are for it. Same as before except for Account Unknown, which had "list folder contents". Pe

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Wayne Watson
Permissions as follows: SYSTEM: All. From Full control to write Account Unknown(S-1-5-21...): read, exec, list folder contents, Read Wayne: (normal use) All. From Full control to write Admin: All. From Full control to write WMPNetwork: Read -- Wayne Watson (Watson Adventures, Prop

[Tutor] Which libraries for Python 2.5.2

2011-12-24 Thread Wayne Watson
mport tkMessageBox import tkSimpleDialog from pylab import plot, xlabel, ylabel, title, show, xticks, bar I tried numpy-1.2.0 and matplotlib-0.98.3 and had the same difficulty. What are wiser choices? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 D

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Wayne Watson
ow I might login. On 12/23/2011 11:47 PM, Lie Ryan wrote: On 12/23/2011 03:20 PM, Wayne Watson wrote: Hi, I found it, but not in a place I would expect. It's under my username, Wayne. It is a folder and has three files: breakpoints.lst recent-files.lst ZZrecent-files.lst The last one has

Re: [Tutor] Unable to remove three libs from XP

2011-12-23 Thread Wayne Watson
This is a laugher. The Add/Remove screen was hiding a dialog that wanted to know if I really wanted to remove the program. Argh. On 12/23/2011 4:56 AM, Wayne Watson wrote: I have three py libs and the python program itself, 2.52, installed on an 6 year old HP Laptop. I decided to remove them

[Tutor] Unable to remove three libs from XP

2011-12-23 Thread Wayne Watson
. How do I get around this problem? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet CE 1955 Octo

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-22 Thread Wayne Watson
Hi, I found it, but not in a place I would expect. It's under my username, Wayne. It is a folder and has three files: breakpoints.lst recent-files.lst ZZrecent-files.lst The last one has the odd ZZ, but is empty. breakpoints.lst is empty too. recent-files.lst contains about 21 files li

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-22 Thread Wayne Watson
Lib\idlelib\EditorWindow.py", line 799, in update_recent_files_list rf_file = open(self.recent_files_path, 'w') IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' - Maybe as I poi

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-22 Thread Wayne Watson
More. I did some Googling on IDLE not appearing. My case appears not to be unique. One site offered this as a solution in 2.6, C:\Python27>python.exe \Lib\idlelib\idle.py. It issued a complaint that "no such file or directory exists". It however does. A place to go that may clear this up mi

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-22 Thread Wayne Watson
I just searched the registry for the dll. Nothing. I then searched for python. It found a a Python "folder" with a PythonCore folder. Under it are three folders: 2.5, 2.7 and 3.2. I do recall installing 3.2, but I'm pretty sure I uninstalled it. Under each of the three folders is Module. Look

Re: [Tutor] A few Python Mysteries

2011-12-22 Thread Wayne Watson
On 12/21/2011 4:10 PM, Alan Gauld wrote: On 21/12/11 19:56, Wayne Watson wrote: To clarify: Python on Windows does **not** put itself on the System PATH when installed. So, PythonNN, where NN is the version, should never appear in PATH? Not from a standard Python installation. But other

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-22 Thread Wayne Watson
Hi, Walter. On 12/21/2011 8:20 PM, Walter Prins wrote: Hi Wayne, On 22 December 2011 03:21, Wayne Watson wrote: I uninstalled Uniblue, but as it turns out, it was an incomplete uninstall. I just spent the last 30-45 minutes trying to get it uninstalled. Finally, I sent an e-mail on how to

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-21 Thread Wayne Watson
at. It is in the same idlelib. Is there something that needs to be done here, to get IDLE active? Is this where having Python27 in the path causes a problem with IDLE? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 h

Re: [Tutor] A few Python Mysteries

2011-12-21 Thread Wayne Watson
Hi, On 12/21/2011 10:18 AM, Walter Prins wrote: Hi Wayne, On 21 December 2011 15:15, Wayne Watson wrote: Python is long gone from my system. I presume you mean Python **2.5** is long gone from your system (not Python in general), but in any case, this much has been well understood since

Re: [Tutor] A few Python Mysteries

2011-12-21 Thread Wayne Watson
for this in the system32 directory. To be rid of the startup errors, you need to replace the dll that was removed by the uninstallation of python2.5 - to do this, reinstall python2.5 See my post to Prins above. Bodsda Sent from my BlackBerry® wireless device -Original Message----- From: Wayn

Re: [Tutor] A few Python Mysteries

2011-12-21 Thread Wayne Watson
Howdy, On 12/21/2011 2:08 AM, Walter Prins wrote: Hi Wayne, On 21 December 2011 02:32, Wayne Watson wrote: I changed Python25 to Python27, and rebooted. I got the same two dll msgs again. The PATH issue has nothing to do with your error messages. True, but it should have a lot to do with

Re: [Tutor] A few Python Mysteries

2011-12-21 Thread Wayne Watson
uninstalled it long ago too. On 12/21/2011 2:43 AM, Steven D'Aprano wrote: Wayne Watson wrote: I changed Python25 to Python27, and rebooted. I got the same two dll msgs again. I suggest you find out what applications are trying to run using Python 2.5. This is a Windows problem -- you

Re: [Tutor] A few Python Mysteries

2011-12-20 Thread Wayne Watson
I changed Python25 to Python27, and rebooted. I got the same two dll msgs again. On 12/19/2011 7:33 PM, Wayne Watson wrote: It became apparent during the other part of this thread that I had not uninstalled Python 2.7, as I thought I had. As pointed out in the PATH discussion (James R

Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet CE 1955 October 20 07:53:32.6 UT

Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
The PATH variable for me (user) has c:\Users\Wayne\g95\bin On 12/19/2011 12:25 PM, Prasad, Ramit wrote: James wrote: In windows 7, 1. Go to start 2. Right click on "Computer" 3. Select Properties. This will bring up the "System" menu. 4. Select "Advanced system Settin

Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
On 12/19/2011 3:19 PM, Steven D'Aprano wrote: Wayne Watson wrote: Win 7, 64-bit I had Py 2.5 installed on my PC earlier this year, and it began failing around June. I finally uninstalled it, and tried 2.6. Still had problems that centered around getting to IDLE. Uninstalled 2.6, and

Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
to reboot. 10. To test, open a cmd prompt and and type simply "python". if you get Python 2.7.2 (some more stuff) then python is now on your path. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time

Re: [Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
On 12/19/2011 8:50 AM, James Reynolds wrote: On Mon, Dec 19, 2011 at 11:35 AM, Wayne Watson <sierra_mtnv...@sbcglobal.net> wrote: Win 7, 64-bit I had Py 2.5 installed on my PC earlier this year,

[Tutor] A few Python Mysteries

2011-12-19 Thread Wayne Watson
. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet CE 1955 October 20 07:53:32.6 UT -- &q

Re: [Tutor] 'str' object has no attribute 'description'

2011-12-18 Thread Wayne Werner
class, examine function, > in the first print statement. > > I have added the traceback following a suggestion from Wayne Werner. > That's much more useful. As a slight aside, it probably would have been better to just reply-all to the original thread with the traceback. >

Re: [Tutor] reset password program

2011-12-18 Thread Wayne Werner
ing to go with "EULA.txt"; the reasons should be obvious. +1, because I laughed. -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sqlite3: turning on foreign key support thru python

2011-12-18 Thread Wayne Werner
something like this:: > >rows = conn.execute('pragma foreign_keys') >for r in rows: >print r > If you're mucking about in the interactive prompt, and you just want to see the results quickly you can just turn it into a tuple or a list (list would be less ty

Re: [Tutor] 'str' object has no attribute 'description'

2011-12-18 Thread Wayne Werner
class, examine function, > in the first print statement. > > It's best to give the full traceback, because it provides an awful lot of information. -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

Re: [Tutor] where I am going wrong?

2011-12-14 Thread Wayne Werner
wer as wrong!!. > I used the same method on the example puzzle and it worked. Your email client broke the formatting - you should probably use plain-text or a pastebin. -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscrip

Re: [Tutor] return, why do I need it?

2011-12-11 Thread Wayne Werner
teractive interpreter is what you should use for debugging short code snippets. I always program with two windows open - one with my editor and one with the interpreter. This lets me try out short bits of code without running my whole program. Hth, Wayne > Thanks > Pete > > > __

Re: [Tutor] Python Windows Vista Installation Question

2011-12-09 Thread Wayne Werner
On Fri, Dec 9, 2011 at 12:41 PM, Homme, James wrote: > Hi, > > Can Python easily be installed on a Windows Vista computer without needing > administrative rights to that machine? > > > If you use portable python: http://www.portablepython.com/ that might work

Re: [Tutor] how to use int and split() simultaneously

2011-12-08 Thread Wayne Werner
ve to have *something* or you'll get a syntax error because you can't have an empty block. The keyword `pass` works well in cases like this. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Saved the Day

2011-12-04 Thread Wayne Werner
ta so that should hardly be a surprise ;) (and definitely wouldn't be a surprise for any of my former classmates. I was quite the evangelist... and still am) -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription optio

Re: [Tutor] Prime Factorization Tool

2011-12-01 Thread Wayne Werner
ng up to the sqrt(N). Now you've vastly improved your running time. Now, I'm not sure what the time complexity of these two operations is, but go ahead and put this line in your isprime: if n == 11: print("Checked 11... again") Can you think of a way to compute the primes you need to check only once? HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] is there a better way to organise this code

2011-11-30 Thread Wayne Werner
I highly recommend this set of slides: http://www.dabeaz.com/generators/Generators.pdf HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] plotting in python

2011-11-30 Thread Wayne Werner
need to pad or trim the data so you've got the correct dimensions. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] tkinter message & button questions

2011-11-30 Thread Wayne Werner
g numeric - based on my experience). With that preparation then you should be able to easily search for answers to the problems you encounter. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pass tuples to user defined function(beginner)

2011-11-29 Thread Wayne Werner
a bunch of strings that you want in a tuple you should do something like: data = tuple(f.open('data.txt').readlines()) Which has the added advantage of *just* reading in strings. If you want to convert that data into other types (integer, float, etc.) then you can

Re: [Tutor] list, tuple or dictionary

2011-11-29 Thread Wayne Werner
2.37, > "Eggs" : 1.23, > "Beans" : 0.57} > > how would i go about *adding, *for example tea and eggs to get a subtotal? > Why, you would add tea and eggs, of course! print("Subtotal: ", Stock_list["Tea Bags"] + Stock_lis

Re: [Tutor] list, tuple or dictionary

2011-11-29 Thread Wayne Werner
m: def __init__(self, desc='', price=0.00): self.desc = desc self.price = price def __repr__(self): return str(self) def __str__(self): return "{0} - {1}".format(self.desc, self.price) inventory = [Item('Lumberjack', 5.5), Item

Re: [Tutor] Making a function run every second.

2011-11-29 Thread Wayne Werner
i() ># make tkinter call it again after 1000 milliseconds >root.after(1000, hi_reschedule) > hi_reschedule() # call it manually the first time HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem with msg widget & button

2011-11-29 Thread Wayne Werner
ibuteError: 'dict' object has no attribute 'Robin' They simply made a design choice to allow access to the data via index (in this case "text" is the index), rather than by object attribute. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Writing Game in python

2011-11-27 Thread Wayne Werner
suedocode of your algorithm or the steps you think each piece should need to accomplish. We like to see that you've at least tried to do something. HTH, Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sensing EOF in Python 3.1

2011-11-23 Thread Wayne Werner
;, "303-9876-333", "john.el...@gmai.com", "Mile High Stadium"], "Manning": ["Archie","504-888-1234", "archie.mann...@gmail.com", "Louisiana Superdome"], "Staubach": ["Roger","214-765-8989&q

Re: [Tutor] Python 3 dictionary questions

2011-11-23 Thread Wayne Werner
['Elway', 'Montana', ... ] Then you would do something like: Qb_Dict[keys[0]] (As a slight aside, I'll direct you to PEP 8 which is the Python style guide which contains things like naming conventions. If you want your code to look Pythonic, you should take a look there.)

Re: [Tutor] Saving read-only or encoded text files?

2011-11-18 Thread Wayne Werner
27;t have any issue getting past this (Office files are just archive files). On Ubuntu at least, if you just remove the extension then it will attempt to discover what the filetype, and can usually guess archive types. It's security through obscurity, of course, so it all depends on wh

Re: [Tutor] FW: urgent help!! THANKS EVERYONE!

2011-11-18 Thread Wayne Werner
(minimum $50)? Amount: $")) if amount < 50.0: print 'Please enter an amount greater than $50' return amount_over_50() return amount Then you can just do this: def main(): print 'Your total comes to', exchange(amount_over_50())

  1   2   3   4   5   6   7   8   9   >