[Tutor] Recommended Resurce or strategy for beginning students, (Matthew Polack)

2019-01-22 Thread Scott Larsen
27;ve only listened to one episode but it sounds as though she's a teacher and he's a programmer and they're working together to do something similar to what you're taking on. https://itunes.apple.com/us/podcast/teaching-python/id144580

Re: [Tutor] counter not working in Quick Sort script

2015-10-30 Thread Patti Scott via Tutor
not working in Quick Sort script To: tutor@python.org Date: Thursday, October 29, 2015, 9:12 PM On 29/10/15 19:11, Patti Scott via Tutor wrote: Caveat: I didn't check the algorithms for correctness, I'll just take your word for that. > My accumulator variable to cou

[Tutor] counter not working in Quick Sort script

2015-10-29 Thread Patti Scott via Tutor
Mac OS 10.10 Python 3.4.3 I self-study Python and am using it for a Coursera algorithm class. Hi! My script sorts correctly on all my test arrays. My accumulator variable to count the number of comparisons returns nonsense. I'm counting the (length - one) of each sublist that will be sorted in

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-29 Thread Patti Scott
Could someone clarify "Modularize code rather than copying and pasting?" thanks On Fri, 11/14/14, Albert-Jan Roskam wrote: Subject: [Tutor] [OT] Best Practices for Scientific Computing To: "Python Mailing List" Date: Friday, November 14, 2014, 12:

Re: [Tutor] Installing twisted

2014-11-27 Thread Scott W Dunning
Hey guys I was hoping someone could tell me how to opted out of this list? I have it going to two email addresses for some reason and I unsubscribed but nothing happened. Any help is greatly appreciated! Thanks, Scott ___ Tutor maillist

Re: [Tutor] Final review

2014-05-07 Thread Scott W Dunning
On May 5, 2014, at 10:13 PM, meenu ravi wrote: > Likewise, the index of d, which is the last word in the word "Hello world" is > 10. > > So, the maximum index you can access in the word "Hello world" is 10. But > when you try to give the command, > > >>> greeting [len(greeting)] > > It is t

Re: [Tutor] Final review

2014-05-06 Thread Scott Dunning
On May 1, 2014, at 5:30 AM, Steven D'Aprano wrote: > Awesome, thanks everyone! I understand lists a lot better now. I have another question. I don’t understand why below would give an error? >>> greeting = 'Hello World' >>> greeting [len(greeting)] __

Re: [Tutor] Final review

2014-05-05 Thread Scott W Dunning
On May 1, 2014, at 5:30 AM, Steven D'Aprano wrote: Awesome, thanks everyone! I understand lists a lot better now. I have another question. I don’t understand why below would give an error? >>> greeting = 'Hello World’ >>> greeting [len(greeting)] _

[Tutor] Final review

2014-05-01 Thread Scott W Dunning
l for now while compile my other questions you guys can hopefully help to shed light on. Thanks for any help!! Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] methods of sorting

2014-04-23 Thread Patti Scott
This makes sense.  Thanks.  No question on the specific code, I was just thinking I should show I'd done any experimenting with the methods Hi Patti, My answers below, interleaved between your questions. On Tue, Apr 22, 2014 at 04:18:38PM -0700, Patti Scott wrote: > I'm pr

[Tutor] methods of sorting

2014-04-22 Thread Patti Scott
I'm practicing with lists.  I was looking for documentation on sorting with cmp() because it isn't immediately clear to me how comparing items two at a time can sort the entire list.  Identify max or min values, yes, but not sort the whole list.  So, the Sorting HOW TO (Dalke, Hettinger)  posted

Re: [Tutor] conditional execution

2014-04-02 Thread Patti Scott
, Zachary Ware wrote: > Hi Patti, > > On Tue, Apr 1, 2014 at 11:07 AM, Patti Scott wrote: >> I've been cheating:  comment out the conditional statement and adjust the >> indents. But, how do I make my program run with if __name__ == 'main': >> main() at the en

[Tutor] conditional execution

2014-04-01 Thread Patti Scott
I've been cheating:  comment out the conditional statement and adjust the indents. But, how do I make my program run with if __name__ == 'main': main() at the end?  I thought I understood the idea to run a module called directly but not a module imported.  My program isn't running, though. Belo

Re: [Tutor] while loop

2014-04-01 Thread Scott Dunning
On Mar 31, 2014, at 5:15 AM, Dave Angel wrote: > > Do you know how to define and initialize a second local variable? > Create one called i, with a value zero. > > You test expression will not have a literal, but compare the two > locals. And the statement that increments will change i, not

Re: [Tutor] exercise (while loop)

2014-03-31 Thread Scott W Dunning
On Mar 31, 2014, at 7:10 PM, Danny Yoo wrote: Thanks for the info Danny! I’ll try that and I should be able to figure it out with your help! The book I was referring to is greentreepress. ___ Tutor maillist - Tutor@python.org To unsubscribe or c

[Tutor] exercise (while loop)

2014-03-31 Thread Scott W Dunning
I’m working on a few exercises and I’m a little stuck on this one. This is what the book has but it just gives me an endless loop. def square_root(a, eps=1e-6): while True: print x y = (x + a/x) / 2 if abs(y-x) < epsilon:

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 31, 2014, at 1:39 AM, Mark Lawrence wrote: > > They say that the truth hurts, so if that's the best you can come up with, I > suggest you give up programming :( You’re in the TUTOR section. People in here are new to programming. I’ve only been doing this for a couple months and I just

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 31, 2014, at 2:01 AM, Alan Gauld wrote: > > Incidentally, your assignment does not appear to require > a while loop, just iteration? If thats the case you could > use a for loop instead and it would actually be more > suitable. Have you covered for loops yet? > No, we haven’t got to fo

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
On Mar 30, 2014, at 4:29 AM, Dave Angel wrote: > > You're getting closer. Remember that the assignment shows your > function being called with 10, not zero. So you should have a > separate local variable, probably called I, which starts at > zero, and gets incremented each time. > > The te

Re: [Tutor] while loop

2014-03-31 Thread Scott Dunning
n. You should not have a literal 10 in > the function. Without out a break or placing that 10 in there I can’t think of a way to have the while loop stop once it reaches (n). Any hints? SCott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] while loop

2014-03-30 Thread Scott Dunning
On Mar 29, 2014, at 12:47 AM, Dave Angel wrote: > > So did your code print the string 10 times? When asking for help, > it's useful to show what you tried, and what was expected, and > what actually resulted. > > You use * to replicate the string, but that wasn't what the > assignment aske

Re: [Tutor] while loop

2014-03-30 Thread Scott Dunning
On Mar 29, 2014, at 12:47 AM, Dave Angel wrote: > > What are you uncertain about, assert or isinstance? Such > statements are frequently used to make sure the function > arguments are of the right type. I’m not sure exactly what it’s doing. I guess I need to read up on it again. > >> >> >

Re: [Tutor] while loop

2014-03-30 Thread Scott Dunning
On Mar 28, 2014, at 10:36 PM, Ben Finney wrote: > > A good programming exercise will show an example input and the expected > output, to give an unambiguous test case. Does the homework have that? This is what the exercise has as examples… """Print the string `s`, `n` times. Parameter

[Tutor] while loop

2014-03-28 Thread Scott W Dunning
t the string `s`, `n` times. This is also in the exercises and I’m not sure what it means and why it’s there. assert isinstance(s, str) assert isinstance(n, int) Any help is greatly appreciated! Scott ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] while loop

2014-03-28 Thread Scott W Dunning
On Mar 28, 2014, at 9:54 PM, Scott W Dunning wrote: > Hello, I’m working on some practice exercises from my homework and I’m having > some issues figuring out what is wanted. > > We’re working with the while loop and this is what the question states; > > Write a fun

[Tutor] Project suggestions

2014-03-12 Thread Scott W Dunning
!!! Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with Guess the number script

2014-03-12 Thread Scott Dunning
On Mar 10, 2014, at 11:18 PM, Dave Angel wrote: > if guess < secret - 10 or guess > secret - 10: > > Think about that line. You might even want to put in a separate > function to test what it does. > HINT: it's wrong. > Got it! I realized what I was doing wrong. I needed that plus sign f

Re: [Tutor] Help with Guess the number script

2014-03-12 Thread Scott Dunning
On Mar 11, 2014, at 1:57 AM, Alan Gauld wrote: > OK so far, you don't need all the print statements > but that's just a style issue. (You could just > insert '\n' characters instead.) You’re right, I’m actually not sure why I did it that way. > >> if guess < secret - 10 or guess > secret -

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 11, 2014, at 7:50 PM, William Ray Wing wrote: > > Simple. In Mail Preferences -> Composing -> Message Format -> Plain Text > (Your setting is probably currently Rich Text.) > Got it, hopefully that helps. ___ Tutor maillist - Tutor@python

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 11, 2014, at 1:49 AM, Alan Gauld wrote: > > Not from the tutor list though. It only has a few > mails normally - less than 50 most days. > Actually now that you say that most of the emails are coming through the reg python-lists, not the tutor section. I guess I should just unsubscribe

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 10, 2014, at 11:18 PM, Dave Angel wrote: Where are you guys using the forum? Through google? I was using that at first but someone complained about something that google does and told me to get it through my email. That’s what I’m doing now and I get bombarded with about 500 emails

Re: [Tutor] Help with Guess the number script

2014-03-11 Thread Scott W Dunning
On Mar 10, 2014, at 11:18 PM, Dave Angel wrote: > Scott W Dunning Wrote in message: >> > > Would you please stop posting in html? I don’t know what you mean? I just use the text for my email provider. It’s not html? I types up the code I ha

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 8, 2014, at 11:50 AM, Scott dunning wrote: >>> >>> And now that you have the right set of tests you can >>> half the number of lines by combining your if >>> conditions again, like you had in the original >>> post. ie. Bring your hot/cold/warm

Re: [Tutor] Python implementations (was: Help with Guess the number script)

2014-03-10 Thread Scott W Dunning
On Mar 10, 2014, at 8:52 PM, Ben Finney wrote: > > What does the Python interactive prompt display when you first launch an > interactive Python shell? Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or

Re: [Tutor] Python implementations (was: Help with Guess the number script)

2014-03-10 Thread Scott W Dunning
On Mar 10, 2014, at 8:52 PM, Ben Finney wrote: > > What does the Python interactive prompt display when you first launch an > interactive Python shell? Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
>> On Mar 8, 2014, at 3:57 AM, spir wrote: >>> >>> Well done. >>> And now that you have the right set of tests you can >>> half the number of lines by combining your if >>> conditions again, like you had in the original >>> post. ie. Bring your hot/cold/warm tests together. So below is what I fi

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 10, 2014, at 4:15 AM, eryksun wrote: > > Different strokes for different folks. I like to tinker with and > disassemble things as I'm learning about them. I would have been > ecstatic about open source as a kid. I learn simultaneously from the > top down and bottom up -- outside to inside

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 8, 2014, at 7:35 AM, Mark Lawrence wrote: > > I have no interest in the efficiency, only what is easiest for me to read, > which in this case is the chained comparison. As a rule of thumb I'd also > prefer it to be logically correct :) > What exactly is ment by a chained comparison?

Re: [Tutor] Help with Guess the number script

2014-03-10 Thread Scott W Dunning
On Mar 8, 2014, at 7:29 AM, eryksun wrote: > i.e. > >guess < 1 or guess > 100 > > becomes > >not not (guess < 1 or guess > 100) Why a not not? Wouldn’t that just be saying do this because the second not is undoing the first? > > distribute over the disjunction > >not (not (gue

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott dunning
> On Mar 8, 2014, at 3:57 AM, spir wrote: > >> On 03/08/2014 10:13 AM, Alan Gauld wrote: >>> On 08/03/14 01:23, Scott W Dunning wrote: >>> >>> On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote: >>> >>> GOT IT!! Finally! Thanks for al

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott dunning
> On Mar 8, 2014, at 6:26 AM, Mark Lawrence wrote: > >> On 08/03/2014 01:23, Scott W Dunning wrote: >> >> On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote: >> >> GOT IT!! Finally! Thanks for all of your help!! > > If at first you don't succeed.

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott dunning
> On Mar 8, 2014, at 6:36 AM, Dave Angel wrote: > > Mark Lawrence Wrote in message: >>> On 08/03/2014 01:23, Scott W Dunning wrote: >>> >>> >>> def print_hints(secret, guess): >>> if guess < 1 or guess > 100: >> >>

Re: [Tutor] Help with Guess the number script

2014-03-08 Thread Scott W Dunning
On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote: GOT IT!! Finally! Thanks for all of your help!! This is what I got, not sure if it’s correct but it’s working! def print_hints(secret, guess): if guess < 1 or guess > 100: print print "Out of range!" print if gues

[Tutor] Help with Guess the number script

2014-03-07 Thread Scott W Dunning
print "Too high!" print elif guess < (secret - 10) or guess > (secret - 10): print "You are cold!" print elif guess < (secret - 5)or guess > (secret - 5): print "You are warmer!" print print "Plea

Re: [Tutor] Help with "Guess the number" script

2014-03-04 Thread Scott W Dunning
ax error about the indenting for this elif being wrong? Any suggestions? elif: print "You're on fire!!" Thanks again!! Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with "Guess the number" script

2014-03-04 Thread Scott W Dunning
On Mar 3, 2014, at 3:27 AM, spir wrote: > > There are 2 user guesses here, and only 1 variable, thus 1 name. The name > should say what (idea) the variable represents in the program; this should be > said by the name's *meaning*. It is one of the greatest difficulties in > programming. How wo

Re: [Tutor] Help with "Guess the number" script

2014-03-04 Thread Scott W Dunning
On Mar 3, 2014, at 1:51 AM, Ben Finney wrote: > "Bold” assumes that markup of text will survive; that's not reliable, > since this is a text-only medium and only the plain text will reliably > survive to all readers. Sorry, I didn’t realize. I’m still new to this. > > You're creating a prompt s

Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread Scott W Dunning
This is what Im having trouble with now. Here are the directions I’m stuck on and what I have so far, I’ll bold the part that’s dealing with the instructions if anyone could help me figure out where I’m going wrong. Thanks! from random import randrange randrange(1, 101) from random import s

Re: [Tutor] Help with "Guess the number" script

2014-03-03 Thread Scott W Dunning
On Mar 2, 2014, at 12:43 AM, Ben Finney wrote: > > No, that's the opposite direction :-) Inside the ‘get_guess’ function > you should use as many names as you need for the different purposes. > > So, you have one name ‘guess_number’ bound to the function's parameter. > Don't bind anything else

Re: [Tutor] Help with "Guess the number" script

2014-03-01 Thread Scott W Dunning
On Mar 1, 2014, at 6:53 AM, spir wrote: > > I find directions very confusing. Also, they completely control you while > explaining about nothing, like a user manual saying "press this, turn that". > This is inappropriate for programming (and anything else): you need to > understand! You need

Re: [Tutor] Help with "Guess the Number" script

2014-03-01 Thread Scott W Dunning
On Mar 1, 2014, at 8:57 AM, Mark Lawrence wrote: > On 01/03/2014 06:05, Scott Dunning wrote: > > In addition to the answers you've already had, I suggest that you learn to > run code at the interactive prompt, it's a great way of seeing precisely what > snippets o

Re: [Tutor] Help with "Guess the number" script

2014-03-01 Thread Scott W Dunning
On Mar 1, 2014, at 12:47 AM, Ben Finney wrote: > You've bound the name ‘current_guess’ to the user's input, but then do > nothing with it for the rest of the function; it will be discarded > without being used. Hmm, I’m not quite sure I understand. I got somewhat confused because the direction

[Tutor] Help with "Guess the Number" script

2014-02-28 Thread Scott Dunning
Hello, i am working on a project for learning python and I’m stuck. The directions are confusing me. Please keep in mind I’m very new to this. The directions are long so I’ll just add the paragraphs I’m confused about and my code if someone could help me out I’d greatly appreciate it! Also,

[Tutor] Help with "Guess the number" script

2014-02-28 Thread Scott W Dunning
Hello, i am working on a project for learning python and I’m stuck. The directions are confusing me. Please keep in mind I’m very ne to this. The directions are long so I’ll just add the paragraphs I’m confused about and my code if someone could help me out I’d greatly appreciate it! Also, w

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote: > which still shows a repetetive pattern and thus you can simplify it with > another loop. You should be able to find a way to write that loop with two > star_row() calls on a single iteration, but can you do it with a single call

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 2:26 AM, Peter Otten <__pete...@web.de> wrote: > If you want to make rows with more or less stars, or stars in other colors > you could add parameters: > > def star_row(numstars, starcolor): >for i in range(numstars): >fillstar(starcolor) >space(25) > > Y

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
nd corner? Thanks again! Scott from turtle import * from math import sin, sqrt, radians def star(width): R = (width)/(2*sin(radians(72))) A = (2*width)/(3+sqrt(5)) penup() left(18) penup() forward(R) pendown() left(162) forward(A) right(72) f

Re: [Tutor] Function help

2014-02-24 Thread Scott W Dunning
On Feb 23, 2014, at 5:31 AM, Dave Angel wrote: > > Welcome to the tutor forum also, Scott. You'll find it works very > similarly to python-list, and has many of the same people on it. > I'm not sure how you tried to attach source, but please be aware > that this

Re: [Tutor] Function help

2014-02-23 Thread Scott W Dunning
On Feb 23, 2014, at 1:12 AM, Scott W Dunning wrote: > I am VERY new to python (programming too). I had a question regarding > functions. Is there a way to call a function multiple times without > recalling it over and over. Meaning is there a way I can call a function and > th

[Tutor] Function help

2014-02-23 Thread Scott W Dunning
using turtle for class so I’ll post the code I have so far below. As you can see towards the bottom I recall the functions to draw the stars, fill in color and give it spacing. I was wondering if there was a way to cut down on all that some how? Thanks for any help! Scott

Re: [Tutor] most useful ide

2014-02-02 Thread scurvy scott
Hi Are there any recommendations for python ide's currently I am using idle, which seems pretty decent but am open to any suggestions cheers I personally prefer the Linux interpreter. Since you're asking. Scott On Sun, Feb 2, 2014 at 10:43 AM, Asokan Pichai wrote: > > &

Re: [Tutor] Code runs in interpreter but won't output to stdout

2014-02-01 Thread scurvy scott
is it? There is no explanation as to what it does or what I'd do with it! --dogehouse.org is a dogecoin mining pool that allows users to pool CPU/GPU resources to make mining cryptocurrency more efficient. Scurvy Scott: There's nothing really special about printing stuff, so there'

[Tutor] Code runs in interpreter but won't output to stdout

2014-01-29 Thread scurvy scott
ction with the username/password stuff hardcoded to see if the rest of the scraper would run, it still never output to stdout. Any help would be appreciated. Also, as an aside, is there a terminal/command line parsing library someone could recommend? I've been looking at optparse but mayb

[Tutor] Can't figure out why I'm getting no output??

2014-01-28 Thread scurvy scott
t balance from my mining pool in my terminal. I've tested the code in the regular python interpreter and it all executes the way it should. But when I attempt to run it using "python whatever.py" it doesn't give me any output. Any tips would be appreciated. Thanks. scott _

Re: [Tutor] Depth First Search Listing all possible combinations

2013-11-25 Thread Randolph Scott-McLaughlin II
I solved the question thanks to Alan's suggestions. Attached is the .py file I ran to solve my question. Thanks guys. On Sat, Nov 23, 2013 at 8:41 PM, Randolph Scott-McLaughlin II < randolph.michael...@gmail.com> wrote: > So I cleaned up the code to make it readable. I'm n

Re: [Tutor] Depth First Search Listing all possible combinations

2013-11-24 Thread Randolph Scott-McLaughlin II
newpath = find_path(graph, node, end, path) if newpath: return newpath return None def find_all_paths(graph, start, end, path=[]): path = path + [start] if start == end: return [path] if not graph.has_key(start): return []

[Tutor] Unit testing individual modules

2013-11-19 Thread Patti Scott
Python 2.4 self-study with Python Programming: An Introduction to Computer Science by Zelle   I am trying to import a program that has a conditional execution statement at the end so I can troubleshoot individual modules in the main() program.   Below is the textbook example program.  When I try t

[Tutor] Generate word list from specified letters

2013-06-30 Thread Scurvy Scott
idance would be helpful. I'm running Debian and Python 2.7 Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Guidance if possible

2013-04-11 Thread Scurvy Scott
blacklisted text file and never messed with again. This might be a bit convoluted as well and any pointers are appreciated. Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
argv[1] infile = sys.argv[2] outfile = sys.argv[3] main(mystring, infile, outfile) Look right to you? Looks okay to me, except maybe the three ORs in the information line, is there a more pythonic way to accomplish that task? Scott On Fri, Feb 1, 2013 at 8:31 PM, Scurvy Scott wrote: &g

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
it didn't make sense until I saw it in my own code if that makes any sense. Also appreciate the help on the "instructional" side of things. One question related to the instruction aspect- does this make sense to you? If len(sys.argv) == 0: print "usage: etc etc etc" N

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
rgv[3] ETC ETC CODE HERE Is this correct/pythonic? Is there a more recommended way? Am I retarded? Thanks again in advance, Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/lis

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
template to improve upon. As always, thank you guys a lot, it usually only takes a couple of emails from y'all to get my brain working correctly. Be safe, Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: h

[Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
s on A)My stated goal of also writing the 15-20 characters before and after myString to the new file and B)finding the line number and writing that to the file as well. Any information you can give me or pointers would be awesome, thanks in advance. I'm on Ubuntu 12.10 running LXDE an

Re: [Tutor] String formatting expression "g" conversion type case.

2013-01-24 Thread Barnaby Scott
On 24/01/2013 13:29, Krupkina Lesya Olegovna wrote: Hello! I’m newcomer to Python and I’m on documentation reading stage and trying some of examples. I’m using Win7 x64 OS and Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]. I try to understand how string format expres

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-19 Thread Scurvy Scott
this mailing list exists, thanks again. Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
>> So here I extract out of your code (untested!) a generator which produces >> an infinite series of Fibonacci numbers, one at a time: >> >> def fib(): >> >> a, b = 0, 1 >> while True: >> yield b >> >> a, b = b, a+b >> >> >> This is untested, I may have got it wrong. >> >>

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
On Tue, Jan 15, 2013 at 4:01 PM, Steven D'Aprano wrote: > On 16/01/13 10:40, Scurvy Scott wrote: > [...] > >> Anyways, the problem I'm having is I'm not really sure how to search a >> list >> for multiple elements and remove just those elements. Below i

[Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
Hello guys, I'm using Ubuntu 12.10 and Python 2.7 right now. I'm working on code using the Mingus module but this question isn't specific to this module, per se. What I'm trying to do is to generate the fibonacci numbers up to a given N and then do modulo 12 on each number in order to create a lis

Re: [Tutor] Input handling?

2012-09-18 Thread Scott Yamamoto
Thanks for everything. I'll keep this in mind as I continue coding.___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Input handling?

2012-09-18 Thread Scott Yamamoto
0) using mobile yahoo mail 1) expect: raw_input to assign the variable to "" 2)No output to stderr; has a loading symbol after hitting enter without input (tried both input and raw_input) Doesn't affect active interpreter. Only affects the screen with the run option. 3) def simulation():   import

Re: [Tutor] Input handling?

2012-09-17 Thread Scott Yamamoto
2.7.2 on python for ios(platform is darwin) problem reoccured Script: import random username = "" def playername(): global username Mlist = ["name1","name2","name3"] Flist = ["name4","name5", "name6"] Llist = ["Lname1","Lname2","Lname3"] username = raw_input("input your desired username:

Re: [Tutor] Input handling?

2012-09-17 Thread Scott Yamamoto
Didnt show up at first. Result was an eof error (using input not raw_input) Found with interactive interpreter___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Input handling?

2012-09-17 Thread Scott Yamamoto
I've been trying to find possible erros with input(such as NameError or SyntaxError) to handle them with an except clause. however, I've found that hitting enter/return while prompted without inputting creates some kind of problem. >>>username = raw_input("Input a username: ") Input a username:

Re: [Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
Wow, thanks Dave, et al., for explaining things the way they did. I'm not trying to and apologize for top posting, gmail wasn't giving me the option of replying to all. I definitely understand what was going on and why when you all were explaining the code portions to me. _

Re: [Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
On Sun, Sep 16, 2012 at 5:23 PM, Dave Angel wrote: > On 09/16/2012 07:56 PM, Scurvy Scott wrote: > > scratch that, new code is below for your perusal: > > > > from Crypto.PublicKey import RSA > > import hashlib > > > > def repeat_a_lot(): > > co

Re: [Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
7;.onion' count += 1 repeat_a_lot() Thanks again, Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
Hello all, I'm just wondering how to run this block of code X amount of times (a lot) and then store the ouput to a .txt file. The code I've written is below. from Crypto.PublicKey import RSA import hashlib m = RSA.generate(1024) b = hashlib.sha1() b.update(str(m)) a = b.hexdigest() print a[:16]

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
every possible combination of the characters in the variable possible, ideally coming up with a string that resembles the TOR hidden network strings that look like this: "kpvz7ki2v5agwt35.onion" Scott ___ Tutor maillist - Tutor@python.org To un

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
DOC page. I'm not sure if that changes anything as far as the impossible size of my dataset. Again, any input is useful. Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
ash = re.sub(r'[^a-z2-7]', "", hash) return alnum_hash[:16] Keeping in mind that although I understand this code, I did not write it, I got it from stackoverflow. Again any help would be great. Feel free to ask if you must know exactly what I'm trying to do. I&

[Tutor] List all possible 10digit number

2012-08-31 Thread Scurvy Scott
atenate the results but also to no avail. Again, any shoves in the right direction would be greatly appreciated. Scott ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Lambda?? Whaaaaat?

2012-08-30 Thread Scurvy Scott
I'm fairly new to python having recently completed LPTHW. While randomly reading stack overflow I've run into "lambda" but haven't seen an explanation of what that is, how it works, etc. Would anyone care to point me in the right direction?

[Tutor] Resource question?

2012-08-14 Thread Scurvy Scott
Hello, I'm totally new to this list. I've been learning python through codecademy.com which has een helping a lot with it's step by step approach. I'm wondering if there are any others like it? I've been looking at some other places that attempt to teach python (google python course, code kata or

Re: [Tutor] how to print a string in desired colour

2012-02-12 Thread Scott Nelson
On Sun, Feb 12, 2012 at 6:47 AM, Debashish Saha wrote: > suppose i want to print 'hello world' in color blue.so what to do? > > There was a similar thread awhile ago. Unfortunately the answer isn't an easy one. It depends on what operating system you use. Here's a link to the old thread: http:

Re: [Tutor] What's the keyword for the Python creed?

2011-09-15 Thread Scott Nelson
On Thu, Sep 15, 2011 at 1:19 PM, Richard D. Moores wrote: > You know, at the interactive prompt you enter some Monty Python word > that I can't remember, and you get a small list of pithy pythonic > advice such as "explicit is better than implicit", etc. > import this You can also do... import

Re: [Tutor] Class methods

2011-06-22 Thread michael scott
Just to add a little to Alexandre's answer.  You can keep most of the code the same just add in        farmlet[0].eat()     farmlet[1].eat() and it will be okay... kinda. Or you could rewrite it and  do it another way...  I'm guessing that you are using python 3 by your print sta

Re: [Tutor] Non programmer wanting to become programmer

2011-05-26 Thread michael scott
I am a beginner so I can relate with you, although python is my first programming language, it sounds as if you are coming from another language. Either way, here are some sites I'll collected that have tutorials and are free. Alan's tutorial (alan is a very active member here) http://www.freene

[Tutor] Python and the web

2011-05-22 Thread michael scott
I want to start getting into web site development. I already know basic html and css, which will create a basic webpage. But my question is what exactly does python bring to the web? Are forums, blogs, flash sites, etc the results of web programming or can they all be achieved with standard ht

Re: [Tutor] Making a script part of the terminal

2011-05-20 Thread michael scott
Thank you gentlemen so much, I believe I have all that I need to do what I wish. What is it about you... that intrigues me so?___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/list

  1   2   3   >