[Tutor] jumping from function to function

2009-01-30 Thread David
all function def f(whatever):, whose new value, 3, gets printed. Is this what is going on? I find it difficult to get my head around this one. Also: does Python go back to the function call main()'s position after step 3)? How does that work? Agai

[Tutor] methods split and join in sequence

2009-01-31 Thread David
anage. Thanks for your ideas! David ''' convert text with whitespace, supplied by the user, into a string joined by underscores. ''' seq = raw_input("Please write some words: ") print "You wrote the following words: ", seq print "The progr

[Tutor] confusion about cloning (graphics)

2009-02-01 Thread David
t: In [10]: x = 5 In [11]: y = x In [12]: y + 2 Out[12]: 7 In [13]: x Out[13]: 5 So here is my question: what have I failed to grasp? Are those different issues? If so, why? I'd appreciate it if you could give me a short comment, this one bothers me ;-) David

Re: [Tutor] confusion about cloning (graphics)

2009-02-01 Thread David
nough depth. David ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Alarm Clock (suggestions please)

2009-02-02 Thread David
Hi All, As I am getting a little older, I sometimes take small naps to recharge my batteries:) Is this while loop OK? What kind of error checking should I use? thanks -david #!/usr/bin/python import time import subprocess import sys doit = 1 alarmhour = int(raw_input("Please ente

[Tutor] reading file, adding to each line, writing file

2009-02-04 Thread David
uld like to append the string " -d" to each line. But how, where? I can't append to strings (which the lines gained with infile.readline() seem be), and my trial and error approach has brought me nothing but a headache. Thanks for your help! David ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading file, adding to each line, writing file

2009-02-04 Thread David
g line2 to disk. The question that arises however is, what should be done with a line like "bla bla \n" Do you want "bla bla -d\n" or do you want "bla bla -d\n" here? I want "bla bla" -d\n ;-) Let me try your suggestions

Re: [Tutor] reading file, adding to each line, writing file

2009-02-04 Thread David
and once inside it. Finally: changing the line "for i in line:" for "while line:" will freeze the machine, filling my hard disk. Any ideas? David ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] UPDATED: Question on how to open other programs and files

2009-02-08 Thread David
Hi wrote: Re: Question on how to open other programs and files Here is one way; #!/usr/bin/python import subprocess print "Starting Adobe Reader " def startReader(): myreader = "acroread" fname = "test.pdf" print "Loading ", fname subprocess.call([myreader, fn

[Tutor] Beginning Python and other resources (was Re: Slicing Tuples)

2010-12-11 Thread David
On 12 December 2010 03:25, John Russell wrote: > Last night I started working through a book (Beginning Python: Using Python > 2.6 and Python 3.1) I bought to learn Python, and there is an example in it > that doesn't make sense to me. I have that book too, and several others thankfully. I'm jus

Re: [Tutor] Dictionaries - Using 1 Key:Value to find another

2010-12-11 Thread David
On 12 December 2010 11:10, Al Stern wrote: > > I thought father got defined in the > > father == pairs[grandfather] > line. I have tried it a couple different ways but always get the father is > not defined error once I enter the name. I only glanced at your code, but maybe you have some typos t

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread David
On 5 January 2011 08:50, Patty wrote: > Hi David - I was looking for the book you recomended below - "Python 3 > Object Oriented Programming" by Dusty Phillips - and found it on Amazon for > $43 new on up and $70 for used but maybe that was hardback?  Do you happen > to kno

Re: [Tutor] accessing another system's environment

2011-02-26 Thread David
mation about this software provider. So do not use it without conducting your own investigation into any security risks that might affect your situation. David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] accessing another system's environment

2011-02-26 Thread David
On 26 February 2011 22:42, Walter Prins wrote: > > On 26 February 2011 04:26, Bill Allen wrote: >> >> I administrate the workstations in our engineering environment and some of >> the major pieces of software we use are configured via the Windows system >> environment variables. Being able to re

[Tutor] A class that instantiates conditionally ?

2011-02-28 Thread David
I have an idea that might clean up my code slightly, if I can make one of my classes clever enough to refuse to instantiate itself if a necessary condition is not met. Below I propose some example code that seems to achieve this, and I am asking here for feedback on it, because I have not written

Re: [Tutor] A class that instantiates conditionally ?

2011-03-02 Thread David
Another classic case of trying something not the best way, due to inexperience. But it has been a good process: I learned something new from setting myself the initial puzzle and then finding a solution,and then learned more from the great tutoring here. Thanks very much for all the replies. On 2

[Tutor] a function I fail to understand

2011-03-21 Thread David
etters are converted back to lower again!?? The point is that, to my understanding, the logic follows from the first block to letter = letter.lower(). Isn't that true? Thanks for helping me out, David def rotate13_letter(letter): """ Return the 13-char rotation of a letter

Re: [Tutor] a function I fail to understand

2011-03-22 Thread David
Hey guys, thanks for all this help, I now got a clearer picture. Given the confusion as to the CHAR_MAP I am attaching the entire file. It comes, btw, out of Jeff McNeil's "Python 2.6 Text Processing" book (Packt), p. 11. Happy hacking, David On 03/22/2011 06:45 AM, Dave An

[Tutor] What's the logic behind parameters and arguments?

2011-03-29 Thread David
is here is obviously not the same. I am curious... Thanks, David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] calculation in string operations

2011-08-03 Thread David
expression after the (final) operator and then having it inserted into the string. So I guess my question is this: what is the path that Python follows in its string formatting operations? Thanks for your insights, David [code] my_weight = 80 # kg # 1 kg equals 2.20462262 pounds print &qu

[Tutor] joining selected items in list

2012-06-24 Thread David
for a hint or two. Thank you! David Original list: [['Intervall-', 'Anzahl', 'Rufzeit', 'Rufzeit', 'Rufzeit', 'Rufzeit', '>', 'Mittlere', 'Anzahl', 'Unzul\xe4ssiger', '\xdcberlauf'

[Tutor] How to use introspection to discover parameters?

2012-07-26 Thread David
Please help me understand the following (I have python 2.6.2) ... Because I want to write nice docstrings, I read PEP257 where it says: "The one-line docstring should NOT be a "signature" reiterating the function/method parameters (which can be obtained by introspection)." I am understanding this

Re: [Tutor] How to use introspection to discover parameters?

2012-07-26 Thread David
On 27/07/2012, Jerry Hill wrote: ... inspect.getargspec(logging.log) > ArgSpec(args=['level', 'msg'], varargs='args', keywords='kwargs', > defaults=None) ... > Also, the help object itself is written in python. You can look at > the source in pydoc.py On 27/07/2012, Steven D'Aprano wrote:

Re: [Tutor] Error message...

2012-08-24 Thread David
On 24/08/2012, Victoria Homsy wrote: > > However, this does not work - I get another error message. > Could somebody advise what I'm doing wrong here? Thank you. 1) You are not carefully reading the entire error message. 2) You are not allowing us to do it either. Some other things too, probably

[Tutor] [newbie] import error after restart (virtualenv)

2015-09-19 Thread David
t was not there beforehand: (Percival_TDD)david@lubuntu:~/PycharmProjects/Percival_TDD/superlists/lists$ python tests.py Traceback (most recent call last): File "tests.py", line 5, in from lists.views import home_page ImportError: No module named 'lists' I neither un

Re: [Tutor] [newbie] import error after restart (virtualenv)

2015-09-19 Thread David
Hello Peter, this was indeed the problem -- I didn't go through manage.py! Weird I didn't have that on the radar anymore. Putting lists/ onto the Python path did not solve the problem. Thanks for your help! David On 19/09/15 16:07, Peter Otten wrote: > David wrote: >

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread David
On 5 February 2017 at 09:02, boB Stepp wrote: > py3: a > ['Mary', 'had', 'a', 'little', 'lamb', 'break'] > py3: for w in a: > ... print(w) > ... print('Huh?') > File "", line 3 > print('Huh?') > ^ > SyntaxError: invalid syntax > > I don't understand why this throws a SyntaxError.

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread David
On 5 February 2017 at 09:56, boB Stepp wrote: > On Sat, Feb 4, 2017 at 4:40 PM, David wrote: >>> >>> I don't understand why this throws a SyntaxError. If I wrap >>> essentially the same code into a function it works: >> >> From [1]: "When a

Re: [Tutor] why can you swap an immutable tuple?

2013-05-25 Thread David
On 26/05/2013, Jim Mooney wrote: > I thought tuples were immutable but it seems you can swap them, so I'm > confused: > > a,b = 5,8 I think your confusion might arise from not understanding that the meaning of the comma differs depending on whether it is on the left or the right side of an equals

Re: [Tutor] when is a generator "smart?"

2013-06-01 Thread David
On 02/06/2013, Jim Mooney wrote: > On 1 June 2013 21:20, Steven D'Aprano wrote: >> On 02/06/13 13:58, Jim Mooney wrote: >>> >>> It's a little unclear to me where generators are more efficient. >> >> >> When there are a lot of items, and you access the items one at a time, >> not >> all at once. I

Re: [Tutor] HELP I need help with Python Setup or to reach Marilyn Davis

2013-10-03 Thread David
On 3 October 2013 20:51, Walter Prins wrote: > Hi Carolynn, > > On 3 October 2013 03:01, carolynn fryer wrote: >> >> I am at the point where I am just spinning my wheels. I tried to get help >> with logging on but so far I am just getting frustrated. > > Please note that you've sent an email reg

Re: [Tutor] Assigning a variable to an FTP directory listing

2013-12-11 Thread David
On 12 December 2013 10:55, Pat Martin wrote: > Hello, > > I am writing a program that needs to pull all of the files from a > specific directory. I have a few lines written that give me the list > of files but when I try to assign it to a variable the variable ends > up equaling "226 Directory sen

Re: [Tutor] Understanding Classes

2014-01-20 Thread David
On 20 January 2014 20:33, Alan Gauld wrote: > On 20/01/14 00:55, Christian Alexander wrote: >> >> I would first like to state two things, those being that I am a horrible >> writer as well as explaining things, but Ill try my absolute best. >> Everything python is an object. Strings, integers,

Re: [Tutor] downloading Python

2014-01-23 Thread David
On 23 January 2014 11:27, Mackenzi Jackson wrote: > Hi there, I'm new to computers in general but I'd like to start programming > asap. I'm having trouble getting Python to run on my computer. Is this the > right place to seek help? If so, my mac is OS x 10.6.8 and I was trying to > run Mac Python

Re: [Tutor] os.symlink can't find target

2014-02-26 Thread David
On 26 February 2014 16:31, Cameron Simpson wrote: > > You need to know that ENOENT is errno 2 "No such file or directory", > but it helps. In case it helps anyone, there is information in the python documentation of the errno module that associates system error numbers with their corresponding me

Re: [Tutor] This is driving my crazy! My file hasn't been corrupted

2014-08-31 Thread David
On 1 September 2014 02:31, Richard Dillon wrote: > > except IOError: > print('An error occured trying to read the file.') > > except ValueError: > print('Non-numeric data found in the file.') > > except: > print('An error occured.') Your other respondents have

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread David
On Tue, 22 Jan 2019 at 20:30, Matthew Polack wrote: > > Hi All, > > In our growing school we're teaching Python programming for the first time > as an elective subject with Year 9 and 10 students. (Had a dabble at this > last year with 3 students in Year 11) Hi Matthew and other readers, I wonde

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread David
On Tue, 5 Feb 2019 at 15:03, David wrote: > > 1) The given title is misleading, in my opinion its subtitle would be much > more > representative: "Enabling students [by] example-driven teaching". Hi again, Sorry for replying to myself, but I want to correct something wr

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-20 Thread David
On Thu, 21 Feb 2019 at 14:35, Matthew Polack wrote: > > Just wanted to update this thread regarding a resource for beginning > students. We are now 4 weeks into the course and have found ... Hi Matthew, Thanks for sharing your progress here! I'm very pleased to hear you are finding classroom re

Re: [Tutor] When you think to setup the __class__ of a module object to a subclass of ModuleType

2019-04-27 Thread David
On Sat, 27 Apr 2019 at 02:14, Alan Gauld via Tutor wrote: > On 26/04/2019 13:48, Arup Rakshit wrote: > > > BTW, one thing I would like to know about this list is that, everytime I > > send an email I see it the in list after 2 hours approx. Is this for me > > or everybody? I am just curious. > > J

Re: [Tutor] When you think to setup the __class__ of a module object to a subclass of ModuleType

2019-04-28 Thread David
On Sun, 28 Apr 2019 at 02:57, Alan Gauld via Tutor wrote: > On 27/04/2019 01:22, David wrote: > > > It's no big deal, but I wonder why you wouldn't approve an address > > the first time you see that it is being used for legitimate discussion. > > Time... >

Re: [Tutor] Fw: [docs] Python Embedding PyImport_ImportModule

2019-07-08 Thread David
On Tue, 9 Jul 2019 at 03:13, Alan Gauld via Tutor wrote: > On 08/07/2019 15:14, Ibarra, Jesse wrote: > > > > I cannot seem to figure this potential bug out. > > Neither can we since we cannot see any code. I'm guessing this might be the original post: https://mail.python.org/pipermail/docs/2019-J

[Tutor] Create a binary for a python game

2004-12-03 Thread David Holland
I have created a simple python game and I would like to convert it into a binary executable that can be used to play it in Linux without needing the various libraries (pygame etc). Is this possible ? ___ Win a castle for

[Tutor] How to get input from Tkinter app ?

2004-12-10 Thread David Holland
Here is an example create a function eg createwidgets(self) with code like     self.question_ent = Entry(self)    self.question_ent.grid(row=0, column = 4, columnspan = 2, sticky = W) Then in another function eg getinfo(self) which is fired off by a button or something write code like :-

[Tutor] (Self resolved) os.spawn behavior issue

2004-12-10 Thread David Broadwell
/Iexplore.exe", 'www.yahoo.com']) # os.spawnv(os.P_NOWAIT,"C:/Program Files/Internet Explorer/Iexplore.exe", [r"C:/Program Files/Internet Explorer/Iexplore.exe", 'www.yahoo.com']) # Yields Browser with 'http://explorer/Iexplore.exe%2

[Tutor] Pygame problems

2004-12-11 Thread David Holland
I am not sure if this is the right place, apologies if not. Anyway in a game I wrote using pygame, I would like to increase the initial message so it is over several lines. This is the code in the example game if pygame.font: font = pygame.font.Font(None, 36) text = font.render

Re: [Tutor] Nifty

2004-12-17 Thread David Broadwell
ving running 'projects' for the tutor list to do. That way it's driven a bit less by homework problems. -- Programmer's mantra; Observe, Brainstorm, Prototype, Repeat David Broadwell ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

[Tutor] (Self resolved) os.spawn behaviorism issue

2004-12-10 Thread David Broadwell
# os.spawnv(os.P_NOWAIT,"C:/Program Files/Internet Explorer/Iexplore.exe", ["C:/Progra~1/Internet Explorer/Iexplore.exe", 'www.yahoo.com']) # Finally! Yields browser with www.yahoo.com in it, but took 8.3 format in the list. os.sp

[Tutor] The magic parentheses

2010-01-23 Thread David Hutto
writing the 'Variable 1' and '2', as well as the 'is greater than' within the y, and z local variables in the def return_difference_of12, and got the same result as when I listed the portions of the printed result's senten

Re: [Tutor] The magic parentheses

2010-01-24 Thread David Hutto
Thanks for the solutions and the quick responses. I just removed the variable and used print, I thought they would be considered the same whether as  a variable, or as a direct line, guess not. Thanks again, David ___ Tutor maillist - Tutor

Re: [Tutor] The magic parentheses

2010-01-24 Thread David Hutto
Re: [Tutor] The magic parentheses Sunday, January 24, 2010 9:28 PM From: "David Hutto" Add sender to Contacts To: "Alan Gauld" --- On Sun, 1/24/10, Alan Gauld wrote: > From: Alan Gauld > Subject: Re: [Tutor] The magic parentheses > To: tutor@python.org > Date

[Tutor] [OT] Python Study Group

2010-01-29 Thread David Abbott
no deadline. If you would like to join please email me off list or just sign up at the wiki; http://asterisklinks.com/wiki/doku.php?id=core:start#members thanks, david -- David Abbott ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] [OT] Python Study Group

2010-01-29 Thread David Abbott
On Fri, 2010-01-29 at 15:26 -0500, Serdar Tumgoren wrote: > Sounds like a cool idea David. Is this an online study group or do the > folks who signed up live near each other geographically as well? Its all online, we have people from India to Germany as an example. -- David

Re: [Tutor] kudos to alan

2010-01-31 Thread David Hutto
--- On Sun, 1/31/10, Woodwerks wrote: From: Woodwerks Subject: [Tutor] kudos to alan To: tutor@python.org Date: Sunday, January 31, 2010, 2:33 PM Message: 4 Date: Sun, 31 Jan 2010 11:01:19 -0500 From: "R. Alan Monroe" To:tutor@python.org Subject: Re: [Tutor] can any one help Message-ID:<46810

Re: [Tutor] kudos to alan

2010-01-31 Thread David Abbott
On Sun, 2010-01-31 at 11:58 -0800, David Hutto wrote: > > > --- On Sun, 1/31/10, Woodwerks wrote: > > > > > I think the way you give hints and ideas about how to > accomplish something in Python is excellent. I sometimes w

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Григор wrote: From: Григор Subject: [Tutor] Question about importing To: "Python Tutor" Date: Tuesday, February 2, 2010, 12:07 PM Hi all. How can I import a module which is located in the upper directory. I think the following might be what you're looking for: http://d

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Grigor Kolev wrote: From: Grigor Kolev Subject: Re: [Tutor] Question about importing To: "David Hutto" Cc: "Python Tutor" Date: Tuesday, February 2, 2010, 2:28 PM В 10:33 -0800 на 02.02.2010 (вт), David Hutto написа: > > > ---

Re: [Tutor] Question about importing

2010-02-02 Thread David Hutto
--- On Tue, 2/2/10, Grigor Kolev wrote: From: Grigor Kolev Subject: Re: [Tutor] Question about importing To: "David Hutto" Cc: "Python Tutor" Date: Tuesday, February 2, 2010, 2:54 PM В 11:47 -0800 на 02.02.2010 (вт), David Hutto написа: > > > ---

Re: [Tutor] python function to know the path of the program in execution

2010-02-05 Thread David Hutto
cribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor I think this is what you want: >>> import sys >>> sys.argv[0] 'C:\\Python26\\testingscripts\\lowdir.py' >>> David

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread David Hutto
ir\lowerdir.py >>> As long as you have sys imported at somepoint, then all you have to do is print sys.argv[0], and that should be the exact name and location of the current running script, David --- On Fri, 2/5/10, Daniel Sarmiento wrote: From: Daniel Sarmiento Subject: Re: [Tu

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread David Hutto
scripts\lowerdir\lowerdir.py >>> As long as you have sys imported at somepoint, then all you have to do is print sys.argv[0], and that should be the exact name and location of the current running script, David --- On Fri, 2/5/10, Daniel Sarmiento wrote: From: Daniel Sarmiento Su

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread David Hutto
--- On Fri, 2/12/10, Hansen, Mike wrote: From: Hansen, Mike Subject: Re: [Tutor] Tutor list as pair progamming plush toy To: tutor@python.org Date: Friday, February 12, 2010, 11:55 AM > -Original Message- > From: tutor-bounces+mike.hansen=atmel@python.org > [mailto:tutor-bounc

tutor@python.org

2010-02-13 Thread David Abbott
t between 0 and %d inclusive" % MAX_IP return '%d.%d.%d.%d' % (l>>24 & 255, l>>16 & 255, l>>8 & 255, l & 255) result = int2ip(ip) print result I don't understand the l>>24 & 255. from the docs; Right Shift

tutor@python.org

2010-02-13 Thread David Abbott
On Sat, 2010-02-13 at 11:32 -0800, Steve Willoughby wrote: On Sat, 2010-02-13 at 13:45 -0600, Wayne Werner wrote: Thanks Steve and Wayne your explanations; HAL (helps a lot) -- David Abbott ___ Tutor maillist - Tutor@python.org To unsubscribe or

[Tutor] datetime, time zones, and ISO time

2010-02-17 Thread David Perlman
I have been really scratching my head over this, it seems like there *should* be a nice easy way to do what I want but I can't find it for the life of me. What I would like to do would be something like this: >>> datetime.datetime.now().isoformat() '2010-02-17T12:13:17.913260-06:00' But wha

Re: [Tutor] datetime, time zones, and ISO time

2010-02-17 Thread David Perlman
ithout subclassing tzinfo. This makes me feel like I MUST be missing something obvious, because it shouldn't require so much coding just to find out what the current local time and timezone is! On Feb 17, 2010, at 1:42 PM, William Witteman wrote: On Wed, Feb 17, 2010 at 12:44:02PM -0600

Re: [Tutor] datetime, time zones, and ISO time

2010-02-17 Thread David Perlman
ion already; it doesn't require any kind of fancy calculations about global politics or anything. On Feb 17, 2010, at 3:12 PM, Kent Johnson wrote: On Wed, Feb 17, 2010 at 3:48 PM, David Perlman wrote: Surely there is a way to simply print out the local time, date and time zone with

Re: [Tutor] datetime, time zones, and ISO time

2010-02-17 Thread David Perlman
*(t[4]-u[4]) + (t[5]-u[5]) return datetime.timedelta(seconds=osec) As far as I can tell, this should always work. So wouldn't it be nice if there were a less convoluted way to get this?? On Feb 17, 2010, at 3:12 PM, Kent Johnson wrote: On Wed, Feb 17, 2010 at 3:48 PM, David Perlman wrote: Surel

Re: [Tutor] datetime, time zones, and ISO time

2010-02-17 Thread David Perlman
On Feb 17, 2010, at 4:17 PM, Sander Sweers wrote: On 17 February 2010 22:37, David Perlman wrote: As far as I can tell, this should always work. So wouldn't it be nice if there were a less convoluted way to get this?? There is pytz [1] which should provide a simpler way to m

Re: [Tutor] How to use pydoc

2010-02-26 Thread David Hutto
--- On Fri, 2/26/10, Ricardo Aráoz wrote: From: Ricardo Aráoz Subject: [Tutor] How to use pydoc To: tutor@python.org Date: Friday, February 26, 2010, 8:31 AM Checked the manuals on pydoc and wanted to try it. Must certainly be doing something wrong but I can't figure what. Here's my session :

[Tutor] Script Building

2010-03-03 Thread David Hutto
iliar with it, I'm thinking of using the blender game engine(just to combine the learning process of both), but the overall code is python, so I'm pretty sure I'm posting this to the right list. Any suggestions, or critiques, are welcome. Thanks, David _

Re: [Tutor] Bowing out

2010-03-03 Thread David Hutto
--- On Wed, 3/3/10, Sander Sweers wrote: From: Sander Sweers Subject: Re: [Tutor] Bowing out To: "Kent Johnson" Cc: Tutor@python.org Date: Wednesday, March 3, 2010, 11:06 AM On 3 March 2010 14:17, Kent Johnson wrote: > After six years of tutor posts my interest and energy have waned and > I

Re: [Tutor] Understanding (Complex) Modules

2010-03-03 Thread David Hutto
--- On Wed, 3/3/10, Wayne Watson wrote: From: Wayne Watson Subject: [Tutor] Understanding (Complex) Modules To: tutor@python.org Date: Wednesday, March 3, 2010, 8:24 PM First a little preamble before my questions. Most of my work in Python has required modifying a program that uses modules

[Tutor] Feedparser and Google News feeds

2010-03-10 Thread David Kim
I have been working through some of the examples in the Programming Collective Intelligence book by Toby Segaran. I highly recommend it, btw. Anyway, some of the exercises use feedparser to pull in RSS/Atom feeds from different sources (before doing more interesting things). The algorithm stuff I

[Tutor] Feedparser and google news/google reader

2010-03-10 Thread David Kim
I have been working through some of the examples in the Programming Collective Intelligence book by Toby Segaran. I highly recommend it, btw. Anyway, one of the simple exercises required is using feedparser to pull in RSS/Atom feeds from different sources (before doing more interesting things). Th

Re: [Tutor] Visual Python programming and decompilers?

2010-03-12 Thread David Hutto
ecause I'm hoping I can implement this in > Python 3.1. > > > > So any input or suggestion would be greatly > appreciated. > > Don't understand why you work at the bytecode level. > > > Kind Regards, > > > > -- > > Ludolph Neethling > > > Denis > __

[Tutor] Command not issued until after escape from loop

2010-03-14 Thread David Hutto
return # don't redraw if nothing changed Draw.Redraw(1) TIA, David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Command not issued until after escape from loop

2010-03-15 Thread David Hutto
--- On Mon, 3/15/10, David Hutto wrote: > From: David Hutto > Subject: Command not issued until after escape from loop > To: tutor@python.org > Date: Monday, March 15, 2010, 2:15 AM > In the following code, the portion > I'm having a problem with is outlined in stars,

Re: [Tutor] Command not issued until after escape from loop

2010-03-15 Thread David Hutto
On Mon, Mar 15, 2010 at 4:53 AM, Alan Gauld wrote: > > "David Hutto" wrote > > Caveat: I know zero about Blender... but... > I *thought* that since the code was in Python it might be the way I was executing it. I think now it might be how the other windows are up

Re: [Tutor] subprocess

2010-03-27 Thread David Abbott
all http://dwabbott.com/code/index8.html and some more here with subprocess.Popen http://asterisklinks.com/wiki/doku.php?id=wiki:subprocess HTH David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class Inheritance

2010-04-22 Thread David Hutto
le import * line from Tkinter which resolved the problem(the example I was using didn't have a canvas, and I'm pretty sure Tkinter was defaulting to the ScrolledCanvas). TIA, David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class Inheritance, Beat it into the Ground

2010-04-23 Thread David Hutto
In previous post I asked about turtle module importing from tkinter. But what I don't understand is why does Tkinter default it's casnvas to ScrolledCanvas in turtle.py, and then as a 'metaclass' for ScrolledCanvas in turtle it calls TK.Frame, which could have been set as a default within Tkinter

[Tutor] Is there a better way to use scientific notation in an equation?

2010-05-02 Thread David Hutto
insert the scientific notation if not this way. I know there is probably a module, but this is for my own practice. TIA David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] An interesting situation befalls me

2010-05-09 Thread David Abbott
- Kirk Bailey, > Largo Florida > > Here are a few; Learning to Program by none other than Alan Gauld http://www.freenetpages.co.uk/hp/alan.gauld/ Essential Python Reading list http://wordaligned.org/articles/essential-python-reading-list Daves Page http://www.rexx

Re: [Tutor] Recent Documents

2010-05-27 Thread David Abbott
_icon('document-open-recent'), "name": _("Recent Documents"), "description": _("Retrieve your recently accessed files and locations"), "version": VERSION} [1] http://download.gnome.org/sour

[Tutor] list of dicts <-> dict of lists?

2010-05-27 Thread David Perlman
Using the csv.DictReader and csv.DictWriter lets you read and write lists of dictionaries from files containing tabular data. I have a system that naturally generates tabular data in the form of a dictionary of lists: the dictionary key is the name of the column, and then the value is a li

Re: [Tutor] list of dicts <-> dict of lists?

2010-05-28 Thread David Perlman
Aha, now this is the clever solution that I didn't find "outside the box". :) On May 28, 2010, at 2:33 AM, Peter Otten wrote: I think it's simpler and therefore more appropriate to use a normal csv.writer here: import csv import sys data = {'a': [1, 2, 3], 'c': [7, 8, 9], 'b': [4, 5, 6]} w

Re: [Tutor] list of dicts <-> dict of lists?

2010-05-28 Thread David Perlman
Oh, except one problem: the csv.DictWriter lets you tell it what order you want the columns output in. With your version, they just show up in whatever order Python wants them. On May 28, 2010, at 2:33 AM, Peter Otten wrote: I think it's simpler and therefore more appropriate to use a norm

Re: [Tutor] Question

2010-06-19 Thread David Hutto
On Sat, Jun 19, 2010 at 7:24 AM, ALAN GAULD wrote: > > >> belt, then go ahead and learn anything else you like. But even then, if you >> have >> to learn two new ones at the same time, I'd recommend they be very unlike. >> So you could learn Lisp or Forth at the same time as you were learning Rub

Re: [Tutor] Question

2010-06-19 Thread David Hutto
On Sat, Jun 19, 2010 at 4:56 AM, Steven D'Aprano wrote: > On Sat, 19 Jun 2010 01:55:05 pm Independent Learner wrote: > >> ~I was wondering if I should try to learn 2 programming languages at >> once, Python and C++. > > I don't know. That depends on you. > > How much time do you have to spend on l

Re: [Tutor] Running external commands from Python

2010-06-25 Thread David Hutto
On Fri, Jun 25, 2010 at 8:16 PM, Steven D'Aprano wrote: > On Sat, 26 Jun 2010 08:46:17 am Randy Kao wrote: >> Hi all, >> >> I'm a newbie to Python (switching from Perl) and had a question about >> the best way to run external commands in Python. > [...] >> through: os.popen, os.popen2, os.popen3,

Re: [Tutor] Running external commands from Python

2010-06-25 Thread David Hutto
On Fri, Jun 25, 2010 at 9:37 PM, Randy Kao wrote: > Thanks for the great and quick feedback from everyone! > That definitely clears things up. > -Randy > On Fri, Jun 25, 2010 at 5:16 PM, Steven D'Aprano > wrote: >> >> On Sat, 26 Jun 2010 08:46:17 am Randy Kao wrote: >> > Hi all, >> > >> > I'm a n

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-28 Thread David Hutto
On Mon, Jun 28, 2010 at 8:32 PM, Steven D'Aprano wrote: > On Mon, 28 Jun 2010 10:52:03 am Richard D. Moores wrote: >> On Sun, Jun 27, 2010 at 16:25, Steven D'Aprano > wrote: >> > On Mon, 28 Jun 2010 03:07:47 am Richard D. Moores wrote: >> >> A "feature" very important to me >> >> is that with Gma

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-29 Thread David Hutto
On Tue, Jun 29, 2010 at 3:48 AM, Alan Gauld wrote: > > "David Hutto" wrote > >> > fundamentally different from "downloading", and those who know > that >> > the >> > only difference is that with streaming, the browser deletes the > vi

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-29 Thread David Hutto
On Tue, Jun 29, 2010 at 11:11 AM, Alan Gauld wrote: > "David Hutto" wrote > >> > Or if the network is shared with other users or other applications >> >> So, the bandwidth supplied(better question for my own ISP) is like a >> drop cord, even with al

Re: [Tutor] OT: need computer advice from wise Tutors

2010-06-30 Thread David Hutto
On Wed, Jun 30, 2010 at 3:06 AM, ALAN GAULD wrote: > > >> > If its a typical ADSL line it will be conneced to a DSLAM at >> > the centeral office(by the telco) and  that will be shareed. >> >> > ADSL also loses bandwidth the further you are from the office > >> process has to be diversified for ea

[Tutor] Reading a file

2010-07-02 Thread David Hutto
ginally supposed to be an int for the line number being read''' print readcont Thanks, David ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Reading a file

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 11:31 AM, Steven D'Aprano wrote: > On Fri, 2 Jul 2010 11:16:02 pm David Hutto wrote: >> In the code below, I'm trying to read from a file, and print out the >> lines. > > f = open("filename.txt") > for line in f: >    print lin

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 8:56 PM, Jeff Johnson wrote: > On 07/02/2010 05:35 PM, Chris C. wrote: > > Hi Jeff, thank for your reply!  I’m aware of Dabo and was pretty much sold > on using it until the last couple of days.  I was trying to install it so I > could start connecting to my tables when I ra

Re: [Tutor] Help with choices for new database program

2010-07-02 Thread David Hutto
On Fri, Jul 2, 2010 at 9:27 PM, Jeff Johnson wrote: > On 07/02/2010 06:14 PM, David Hutto wrote: >> >> Stick to the main python libraries(python with sqllite, and for the >> standalone exe know it's somewhere, and I've seen it in the past few >> days, but d

<    1   2   3   4   5   6   7   8   9   10   >