[Tutor] Question about a python finction

2018-05-11 Thread kevin hulshof
Hello, Is there a function that allows you to grab the numbers between two numbers? Eg. If you input the numbers 1 and 4 To make a list like this [1,2,3,4] Thank you for you’re time Sent from my iPhone ___ Tutor maillist - Tutor@python.org To unsub

Re: [Tutor] The game of nim in python

2016-04-22 Thread Henderson, Kevin (GE Aviation, US)
Python to Jython. Can you help me with a Jython code for the Nim game? Removing 1-4 sticks out of 13, last player who picks up the last stick wins Player 1 vs player2(Computer) player1=str(input("Enter your name. ")) player2="Computer" howMany=0 gameover=False strawsNumber=random.randint(10,20)

Re: [Tutor] Tutor Digest, Vol 123, Issue 27

2014-05-08 Thread Kevin Johnson
you stated for yor example a guess of 60 would be closer than the guess of 25. As I said I really am a beginner and I apologise if my questions are frustrating but I do appreciate any help offered. Thanks again. Kevin On Thu, May 8, 2014 at 2:02 PM, wrote: > Send Tutor mailing list s

[Tutor] (no subject)

2014-05-08 Thread Kevin Johnson
ember the previously closest highest and lowest guesses, not sure if you have all read Micheal Dawsons book but I've not covered a whole lot by chapter 3 and so any hints/solutions need to be pretty basic as I don't want to get ahead of myself. Thanks, Kevin #numbers game again but... #u

[Tutor] cx_freeze windows 7 python 3.3

2014-02-18 Thread KEVIN ROBINSON
I am new to this site so please forgive me if I am forwarding this question to the wrong person.   I am trying to use cx_freeze on windows 7 with python 3.3.   I can create a build folder and a dist folder using the command line without any problems.   When I click on the created .exe file I rece

[Tutor] Please help with beautifulsoup and web scraping

2013-09-23 Thread Kevin Ndung'u
http://stackoverflow.com/q/18974172/2390312 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to make a python script run on startup

2013-04-09 Thread Kevin Ndung'u
anybody know how to do this on linux? On 4/9/13, eryksun wrote: > On Tue, Apr 9, 2013 at 5:54 AM, Alexander Mark > wrote: >> There is a startup folder, usually on the start menu, you can add the >> script >> to. > > current user: > "%USERPROFILE%\Start Menu\Programs\Startup" > > all users: > "%A

[Tutor] Matplotlib Slider Widget and changing colorbar threshold

2013-03-12 Thread Kevin Khan
I am currently trying to work on a program that will allow the user to display their dataset in the form of a colormap and through the use of sliders, it will also allow the user to adjust the threshold of the colormap and thus update the colormap accordingly. The best to describe this would be th

[Tutor] help, complete beginner please!

2010-08-27 Thread kevin hayes
l like you have to correct my code...please just create your own example of code structure to get me on the right track. Here is the start of my game: """FirstGame.py First try at creating a text-based adventure game. Trying to learn the basics of creating functions and using if and lo

Re: [Tutor] Running .py files in shell

2010-07-28 Thread Kevin Rapley
mmand line shell? I have my files in /Users/Kevin/python-exercises/ and am opening python in shell from that directory There are numerous ways, especially in MacOS. The simplest way is to put a "shebang" line at the top of your script and then make them executable: $ cat> myscript.py W

[Tutor] Running .py files in shell

2010-07-27 Thread Kevin Rapley
ing Python 2.6.1 I have a couple of questions: 1. How do I execute .py files in the command line shell? I have my files in /Users/Kevin/python-exercises/ and am opening python in shell from that directory 2. How do I install GASP which is referenced in chapter 4? The instructions in this bo

Re: [Tutor] Any

2010-04-29 Thread Kevin Kirton
Alan Gauld wrote: > But if thats not enough try both sourceforge and the PyGame web sites. > On sourceforge search for projects using python... DIA is one that springs > to mind(a Visio type drawing program) > > PyGame has lots of Python games you can download, several with source. PyGame looks p

Re: [Tutor] Any

2010-04-29 Thread Kevin Kirton
Christian Witts wrote: > Maybe look through projects at Freshmeat [1]. > > [1] http://freshmeat.net/tags/python That's exactly what I was looking for. I've already selected a few small programs and now I plan on installing them, seeing how they operate from a user's perspective, then I'll take a

[Tutor] Any

2010-04-29 Thread Kevin Kirton
ot; I mean something that people actually use, hopefully something that comes with it's own installer and GUI. I'd like to try out using the program as an ordinary user and then I want to look at the source code to see how it's been achieved. Any ideas or suggestions

[Tutor] automatic output file naming scheme

2010-03-28 Thread kevin parks
okay. I got the subprocess bit to work and i have os walk doing its walk. But now for something i did not think about until i started to think about how to fit these two bits to work together. os walk is going to traverse my dirs from some given starting point and process files that it finds th

Re: [Tutor] subprocess

2010-03-27 Thread kevin parks
Thanks David. Those are excellent short clear examples. I will look those over. Super! Thanks for that. -kp On Mar 27, 2010, at 5:30 PM, David Abbott wrote: > On Sat, 2010-03-27 at 16:55 +0900, kevin parks wrote: > > Here is an example using subprocess.call > http://dwabbott.com

[Tutor] subprocess

2010-03-27 Thread kevin parks
I tried readings some toots and tried reading alan's thing. I just still can't grok how to use subprocess. I am trying to call sox (fun fact: an early contributer to sox was none other than Guido van Rossum) In the old days you would just use os i guess, like: import os os.system('sox -V3 -D -

Re: [Tutor] Self-intro and two short newbie questions

2010-03-18 Thread Kevin Kirton
Thanks very much for the responses. I feel encouraged now to try to create the guitar tuner program by myself first, and then the simple turtle art program after that. It's kind of both exhilarating and daunting that I don't know exactly where to start at the moment, but that's the fun of learning

[Tutor] Self-intro and two short newbie questions

2010-03-18 Thread Kevin Kirton
27;m thinking of starting something from scratch. It's the easy localization I'm interested in. Hope these questions are appropriate. I'm grateful to be able to ask them here. Kevin (in Australia) ___ Tutor maillist - Tutor@python.

Re: [Tutor] Bowing out

2010-03-03 Thread kevin parks
. Wish there was some way to give a standing ovation over the internet. Glad to see though that the list has been handed off to 2 fantastic folks but still sad to see you go. Wish Danny Yoo was still here too. Thank you Kent. Thank you very much~ -kevin-- On Mar 3, 2010, at 10:17 PM, Kent

[Tutor] batch file processing w/ python using cmd line executable?

2010-02-12 Thread kevin parks
ay to do this in python, by just pointing it to a whole dir of files and say "do it" to all of these? cheers, kevin ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread kevin parks
On Oct 12, 2009, at 8:02 PM, Dave Angel wrote: Often, when a combination of existing stdlib collection types gets too confusing, it's time to consider classes and objects. Not necessarily to make the program "object oriented," but to make the program data structure understandable. That

Re: [Tutor] Automaton/transitional grammar query

2009-10-12 Thread kevin parks
l this around in my pea sized brain and see if i can put this suggestion to work. Thanks Kent! Hopefully I will get this going and my psudo-markov thingy happening too. These things are fun for making patterns. I like these powerful little pea shooters. -kevin __

[Tutor] Automaton/transitional grammar query

2009-10-12 Thread kevin parks
I posted about this a couple weeks back, but then got horribly ill and dropped the ball so i was hoping to revisit. I am not sure if this is and example of Finite Automaton or a Finite State Machine or perhaps it is related to a transition table or markov process. I think some one here told

Re: [Tutor] need help with conditionals

2009-09-26 Thread kevin parks
On Sep 26, 2009, at 11:42 PM, Alan Gauld wrote: "Kent Johnson" wrote It appears to be http://openbookproject.net/thinkCSpy/ch04.html So it is, Thats a shame CSpy is one of my favourite "competitors" :-) Pity it's apparently encouraging the use of eval like this with no caveat. But to

Re: [Tutor] What is this an example of (and how can i use it?)

2009-09-22 Thread kevin parks
h. Well iterators aren't maybe, but generator do look tricky. So interators iterate over lists, tuples, strings, dictionaries and any data type that is iterable, and generators are ways to make new iterables? Anyway, i will brew some coffee and hit those links. Thanks, -kevin _

Re: [Tutor] What is this an example of (and how can i use it?)

2009-09-20 Thread kevin parks
On Sep 21, 2009, at 1:32 AM, Alan Gauld wrote: kevin parks wrote: called, and what it is an example of. I guess there are generators and iterators now and it seems this might be an example of one of those new This is a generator expression. That's unfortunate news for me. It is

[Tutor] What is this an example of (and how can i use it?)

2009-09-20 Thread kevin parks
I am afraid that in the long layoff in python has meant some new constructs have passed me by. In googling around I found some nice little code I want to use, but i don't quite understand it, how it is called, and what it is an example of. I guess there are generators and iterators now and

Re: [Tutor] working with multiple sets

2009-09-09 Thread kevin parks
Are any of these methods better than another for some reason? On Sep 9, 2009, at 10:12 PM, Lie Ryan wrote: kevin parks wrote: This discussion is making my brain melt. It is also showing how clever Bob was to do it the way he did... I found a solution that i think works, and think has not

Re: [Tutor] mapping/filtering a sequence

2009-09-09 Thread kevin parks
Prolly good to post final solutions for future goog'lerz (like when i forget) or anyone who was following along. Here's where i ended up with this... shows both ways. -- #!/usr/bin/env python my_map = { 38:34, 40:39, 45:44, 47:46, 52:51, 59:58, 55:56 } def filter_item(item): retu

Re: [Tutor] working with multiple sets

2009-09-09 Thread kevin parks
This discussion is making my brain melt. It is also showing how clever Bob was to do it the way he did... I found a solution that i think works, and think has not yet been suggested. I quarantined Bob's code into a black box ... and then cast the output as a plain old fashioned python built

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
I guess what i honestly want to asks, but am hesitant to since it makes me look like a dork is: What would this look like if i want to use a straight up built-in dictionary type and not the collections.defaultdict. import collections def foo(): lookup = collections.defaultdict(l

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
or educational purposes. I am somewhat nervous about using something other than a built in type as i am not familiar with collections and it isn't well covered in beginner books or the docs. On Sep 9, 2009, at 12:44 AM, Kent Johnson wrote: On Tue, Sep 8, 2009 at 10:07 AM, kevin parks

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
d it in all the wrong places. 0 ['x'] 1 ['x'] 2 ['x'] 3 ['x'] 4 ['x'] 5 ['y', 'x'] 6 ['y', 'x'] 7 ['y', 'x'] 8 ['y', 'x', 'z'] 9 ['y',

Re: [Tutor] working with multiple sets

2009-09-08 Thread kevin parks
I am looking at this and wondering: Why does this use collections.defaultdict ? In fact i guess since collections.defaultdict is new to me i am not even sure why it exists and why someone would use this as opposed to using Python's built-in dictionary? and why was it used in this instance

Re: [Tutor] mapping/filtering a sequence

2009-09-06 Thread kevin parks
I actually find the map biz easier to get my head around than the list comp. I guess this makes it another good reason for me to be happy that map is apparently staying in after nearly being depreciated. I generally prefer list comp in every instance, but the idea of an if else construct wi

Re: [Tutor] Help deciding between python and ruby

2009-09-06 Thread kevin parks
ore than one way of doing something). You mean people actually like ruby's syntax? I think Python's the prettiest language I've worked with syntactically. I wouldn't call having multiple ways to do something "flexible". I agree more with Python's philosophy,

Re: [Tutor] mapping/filtering a sequence

2009-09-05 Thread kevin parks
Yeah the list seems flaky at the moment. Additionally, my query is an incredibly stupid one. But what you have works and represents an improvement over the unreadable kludge I was doing. Thanks to all who responded. cheers, k On Sep 6, 2009, at 12:26 AM, Douglas Philips wrote: On or ab

Re: [Tutor] mapping/filtering a sequence

2009-09-05 Thread kevin parks
list just now. On Sep 5, 2009, at 11:47 PM, Wayne wrote: On Fri, Sep 4, 2009 at 12:31 PM, kevin parks wrote: I am doing some data massage, minor mapping and filtering really and i find that i have a lot of this kind of kludgy code: To do some basic jiggering of some out of range off gri

Re: [Tutor] Help deciding between python and ruby

2009-09-05 Thread kevin parks
p; co. If you think i am just being a jerk, at least take my initial advice. The ora books BOTH have great overviews of each language. A cup of coffee and reading the first 20 pages of each will tell you great overviews of Python v Ruby. -kevin On Sep 4, 2009, at 11:46 PM, Dan King wrote

[Tutor] working with multiple sets

2009-09-05 Thread kevin parks
I am doing some simple things with sets and so far have had a lot of success with python's built-in sets, which is such a great new(ish) "batteries included" type python data type. [snip] [snip] -- [snip] [snip] -- #!/usr/bin/env python def test(

[Tutor] mapping/filtering a sequence

2009-09-05 Thread kevin parks
I am doing some data massage, minor mapping and filtering really and i find that i have a lot of this kind of kludgy code: # -- - def filt_seq(inseq): out_list = [] for item in inseq: # 38 needs to be mapped on to 34 as we don't have a 38

Re: [Tutor] packing a list of lists

2009-08-28 Thread kevin parks
On Aug 29, 2009, at 12:23 AM, Michael M Mason wrote: i wrote: def pack(in_seq): out_list=[] x = 1 ll=[1, 1] for each in in_seq: ll[0] = x ll[1] = each out_list.append(ll) #print ll x

Re: [Tutor] packing a list of lists

2009-08-28 Thread kevin parks
Interestingly changing: out_list.append(ll) to out_list.append(list(ll)) seems to work. The part of my brain that understood why that is must have sleeping. -k On Aug 28, 2009, at 11:05 PM, i wrote: Back to python after a long long layoff. So i am running

Re: [Tutor] packing a list of lists

2009-08-28 Thread kevin parks
I think this is b/c I am running 2.5. I also have 2.6 but i am using 2.5 for gnupoly and an older audio lib i have. I ran the listcom below on 2.6 and it worked, so i just have to figure out how that can be written for 2.5. I guess 2.6 has an update to enumerate. -k On Aug 29, 2009, at 2:2

Re: [Tutor] packing a list of lists

2009-08-28 Thread kevin parks
Thanks for the replies. Though the list comprehension does not work: TypeError: enumerate() takes exactly 1 argument (2 given) On Aug 29, 2009, at 12:20 AM, vince spicer wrote: #print foohough I didn't test your code, I think what you are trying to accomplish can be done using enu

[Tutor] packing a list of lists

2009-08-28 Thread kevin parks
Back to python after a long long layoff. So i am running into some beginner's confusion... I am trying to plot a list of numbers in gnuplot.py. To do that I am trying to pack the list with an index by iterating over the list so i can get something like: foo = [12, 11, 9, 6, 2, 9, 3, 8, 12

[Tutor] Checking Syntax

2009-06-18 Thread Kevin Pearson
tWorkspace + "/" + GP.ValidateTableName(fc,outWorkspace) I have checked the tutorial and I can't see what is wrong. I can't get past this until it is corrected. I have attached the script. Any advice would be greatly appreciated. Thanks, Kevin #Import standard library modules #imports system,

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Kevin Cameron
Stephen McInerney wrote: > My friend said the runtime efficiency of Doxygen on his build was much > worse on the Python code than the C++ code, i.e. it took ages to parse > the Python code. It's not the efficiency of doxygen that's the question. The problem is that you can add fields to objects as

[Tutor] Module imports

2007-07-11 Thread kevin parks
rlapping imports are not a big deal in python, you are worrying about nothing, and making a problem where there is none! Get on with your life." haha best, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] time(duration) formats & basic time math query

2006-07-05 Thread kevin parks
labyrinthian datetime module in the docs (i am guessing that this is what i should use). I wonder if anyone could give me a hand and point me in the right direction. cheers, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org

Re: [Tutor] how to *really* copy a list

2006-04-29 Thread kevin parks
x27;gotcha' that i remember reading about often but, now that it has bit me a few times hehe so much to know... -kevin-- On Apr 29, 2006, at 6:00 AM, [EMAIL PROTECTED] wrote: >> >> Hi Kevin, >> >> Your problem is this line: >> seq.extend(foo) >

Re: [Tutor] how to *really* copy a list

2006-04-29 Thread kevin parks
John, Thanks. Your message was very helpful. I will tattoo it to my forehead. hehe... i notice that the "learning python" book also explains so of this and i shall study that as well cheers, kevin On Apr 27, 2006, at 10:14 PM, [EMAIL PROTECTED] wrote: > > On 28/04/06, kev

Re: [Tutor] cycle w/ shuffle

2006-04-29 Thread kevin parks
Thanks Kent. That is what i did the first time around but it didn't work ... but that was do to something else that was not working in the script hehe of course, this just shuffles the saved copy of the list which is egg-zactly what i needed "duh" ... sorry... gosh... -

Re: [Tutor] how to *really* copy a list

2006-04-27 Thread kevin parks
I know there is an answer to this somewhere. it is prolly the biggest stumbling block to all python n00bs, but it hasn't been an issue for me in a while. Suddenly i am getting bit by it and can't for the life of me keep straight the two way of opperating on lists. In most case you are fine

[Tutor] cycle w/ shuffle

2006-04-26 Thread kevin parks
I am trying to write a loop that iterates over a sequence and do something x number of times. But sometimes i will need more events (larger number x) than i have have items in the sequence, so if i need more events that i have stuff in my sequence i would like to have the loop reload and shuffl

Re: [Tutor] cycle w/ shuffle

2006-04-26 Thread kevin parks
I am trying to write a loop that iterates over a sequence and do something x number of times. But sometimes i will need more events (larger number x) than i have have items in the sequence, so if i need more events that i have stuff in my sequence i would like to have the loop reload and shuffl

Re: [Tutor] seq looping

2006-04-26 Thread kevin parks
print "[bang]" # debug return start then in the master bedroom i just call it: startime = foo.make_rest(event, 1, upperbound, startime, rest_percent) cheers, kevin On Apr 25, 2006, at 11:27 PM, Bob Gailer wrote: > How about separating the body into 2 fun

[Tutor] seq looping

2006-04-25 Thread kevin parks
l_01: item_1 item_2 rest item_3 rest item_4 item_5 item_6 rest item_7 (but we don't want any rest here ever! cause we might want our next loop to start w/o any pause) gosh.. i hope this is clear anyway that's my query .. hehe ... cheers, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Alternating patterns

2006-03-28 Thread kevin parks
e: text/plain; charset=ISO-8859-1; format=flowed > > kevin parks wrote: >> I have a set that i iterate over... but each time through it i would >> like to alternate between the original set and a variation of the set >> that has one of the members of the set altered (

[Tutor] Alternating patterns

2006-03-28 Thread kevin parks
I have a set that i iterate over... but each time through it i would like to alternate between the original set and a variation of the set that has one of the members of the set altered (by + or - 1) So if my original set is: [0, 2, 4, 5, 7, 9, 11] I would use that the first pass but on the se

Re: [Tutor] scaling values

2006-03-14 Thread kevin parks
Thanks to Kent Johnson, & David Heiser and everyone else. Looks like i was most of the way there...hehe... David Heiser gets special bonus points for actually understanding my initial mysterious query. ___ Tutor maillist - Tutor@python.org http://mai

Re: [Tutor] scaling values

2006-03-14 Thread kevin parks
hi, Seems my post added much confusion. Sorry... I was hoping not to have to post my code since it is really wrong and slightly embarrassing.. what i am trying to do is map an input range of values to output range. I was hoping to make it a bit of an all purpose utility that would map pretty m

[Tutor] scaling values

2006-03-14 Thread kevin parks
i have various functions (that i didn't write) that put out data in lists of various types. But some functions (which i didn't write) that expect the data to be scaled, sometimes 0-1 sometimes 1-2, sometimes 0-127..., sometimes 0 - 32768... gosh you name it. In other words i have a bunch of bla

Re: [Tutor] weighted choices from among many lists

2006-03-11 Thread kevin parks
is in your print statement... grrr of course the another way i would be a use a dictionary and us the list name as a key... the list as a value... Thanks, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] weighted choices from among many lists

2006-03-11 Thread kevin parks
D]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > kevin parks wrote: >> I have several lists... and i would like to some times chose from one >> list and for a while choose from a different list, etc. > > You don't say what isn't workin

[Tutor] activestate

2006-03-10 Thread kevin parks
I noticed a couple days ago that the active state archive seems to have ceased. Is it going away? cheers, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] weighted choices from among many lists

2006-03-10 Thread kevin parks
thingy check to make sure my wieghets added up to 100% or scaled them to be. ) ... meanwhile, as you can see i am 90% of the way there, can anyone figure out what i got wrong or suggest improvements to the code... best, -kevin-- #!/usr/bin/env python import random def windex(lst

Re: [Tutor] module imports

2006-03-08 Thread kevin parks
On Mar 8, 2006, at 7:09 PM, Bob Gailer wrote: > kevin parks wrote: >> i have a module called foo.py >> >> foo.py imports random >> >> kp.py imports foo.py ... but in kp.py i also need to use stuff from >> random... >> >> so kp.py also impo

[Tutor] module imports

2006-03-08 Thread kevin parks
i have a module called foo.py foo.py imports random kp.py imports foo.py ... but in kp.py i also need to use stuff from random... so kp.py also imports random but i prolly shouldn't do that right? Cause now, haven't i needlessly copied the same names/attributes/methods/functions to 2 nam

Re: [Tutor] list packing

2006-02-27 Thread kevin parks
... Exactly the type of tedious thing i want Python to do for me *^-^* cheers, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] list packing

2006-02-26 Thread kevin parks
oblem sometimes i need just the filenames and that is fine, but more often i need to feed the full path to my other functions yet i don't see *any* documentation on os.listdir() at all. I don't know how to give me the full path ... snd = [f for f in os.listdir('/Users/kevin/snd/&#

[Tutor] soundfile picker & rating system

2006-02-08 Thread kevin parks
sure i want to have to go through what will be hundreds of sound files and scale their ratings by hand so that they all add up to 100%. I just want to have a long list that i can add too whenever i want, and assign it a grade/rating according to my whims! cheers, kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Gaussian integer values

2006-02-08 Thread kevin parks
afely pick from a list of say 15 elements with a large bias towards the center values without over or under-running the bounds of your list? cheers, kevin ps. what would be the opposite of the Gaussian distro the scoop like one, the one where the outer elements are favored. Is that in th

Re: [Tutor] printing the random seed?

2006-02-01 Thread kevin parks
Danny (hope you are good!) & co, I see that biz about random.seed()... but in the absence of setting that ... does it just grab a value from the system clock? Is there a way to just let it generate it's usual, known seed... but then observe what that is in case you get an especially good run of

[Tutor] printing the random seed?

2006-02-01 Thread kevin parks
set the seed for a subsequent run to get the same (initially) random results? cheers, kevin (Hi Danny, if you are still here!) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] help

2005-11-27 Thread Kevin Gall
how do i use python, do i download it? how do i use it . kevin.Don't just Search. Find! The new MSN Search: Fast. Clear. Easy. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Reversing

2005-07-20 Thread Kevin Bixler
I was asked to make a program that reverses the text that a user would input. I have tried what I thought would work which is phrase.reverse(). phrase = the raw_input. Help! Thank you, Kevin Bixler ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Single Underscore

2005-07-10 Thread Kevin Reeder
Thanks for the info. I'll look into the links provided. > http://jaynes.colorado.edu/PythonGuidelines.html > http://www.python.org/peps/pep-0008.html Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Single Underscore

2005-07-10 Thread Kevin Reeder
What's the significance of naming a variable with a single underscore as its first character? For example, I'm looking at find.py in the standard library and it has variables named _debug and _prune. Kevin ___ Tutor maillist - Tutor@pytho

Re: [Tutor] fileinput problem

2005-06-25 Thread Kevin Reeder
er reading that somewhere before. Lesson learnt. Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] fileinput problem

2005-06-24 Thread Kevin Reeder
t has no attribute 'input' --- I'm stumped. Any ideas? Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Calling a function

2005-06-09 Thread Kevin Reeder
Ewald & John, thanks for the help. i'll work on it some more with your ideas in mind (after getting some sleep). Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Calling a function

2005-06-08 Thread Kevin Reeder
y(func) TypeError: 'tuple' object is not callable BTW, the code is taken straight out of Learning Python, but I've been banging my head on it for awhile. Any ideas?? Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] re: IDLE

2005-04-09 Thread Kevin
Is there a way to get line numbers to show in python IDLE? I looked at all the preferances but nothing? Thanks Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Re: Help with classes

2005-04-08 Thread Kevin
wich is >>>: When a player type is "get sword" it will add a sword to there inventory. Wich I'm not sure if I am going about this the right way. thanks Kevin On Apr 8, 2005 3:01 AM, Andrei <[EMAIL PROTECTED]> wrote: > Bob Gailer alum.rpi.edu> writes: >

[Tutor] Help with classes

2005-04-07 Thread Kevin
understand that command?\n" I want to beable to type in a command from the list at the prompt and have it call one of the functions from the class. I was looking for a shorter way to write it but the only way I can think of is with an if statment for each command. Is there a better way or shorter way to do this? Thanks Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Operator Overloading

2005-04-04 Thread Kevin Reeder
7;__coerce__'). Everything's working fine now. > pdb is useful :-) Thanks, Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Operator Overloading

2005-04-04 Thread Kevin Reeder
On Mon, 04 Apr 2005 21:14:21 +1200 John Fouhy <[EMAIL PROTECTED]> wrote: > Are you sure you've giving us all the code? No, I was trying to keep it simple. Anyway, here it is, class MyList: def __init__(self, start): self.wrapped = [ ] for x in start: self.wrapped.append(x)

[Tutor] Operator Overloading

2005-04-03 Thread Kevin Reeder
methods. Here's an example, >>> A = MyListSub([1, 2, 3]) >>> A.stats() (0, 0) >>> len(A) 3 >>> A.stats() (1, 1) >>> A + [4, 5, 6] [1, 2, 3, 4, 5, 6] >>> A.stats() (3, 3) I'm stumped and and would appreciate any help. Kevin

Re: [Tutor] Class and methods?

2005-03-30 Thread Kevin
? Thanks Kevin On Wed, 30 Mar 2005 21:46:36 +0100, Alan Gauld <[EMAIL PROTECTED]> wrote: > > > In a class is every def called a method > > Strictly speaking only those that have a 'self' parameter(or > equivalent) > The others are "unbound functions" an

[Tutor] A simple question about creating a program

2005-03-30 Thread Kevin
I was wondering, can you make a program the uses alot of classes do the exact same thing with out useing classes? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class and methods?

2005-03-30 Thread Kevin
etail? Thanks Kevin ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] A very simple socket server question

2005-03-29 Thread Kevin
le 1: conn, addr = s.accept() data = conn.recv(1024) if not data: break else: conn.send(data) How can I make it so that when a client sends the word hello the server will write back hello, how are you?. Thanks Kevin __

Re: [Tutor] An attribute error problem

2005-03-29 Thread Kevin
Well I think I am going to learn how to create small little server the will just send and recive a message from a client. I just want to know is it easier to use twistedmatrix or just plain socket to create servers? Thanks Kevin On Tue, 29 Mar 2005 06:11:46 -0500, Kent Johnson <[EMAIL PROTEC

Re: [Tutor] An attribute error problem

2005-03-28 Thread Kevin
now. I only wanted to look at how it ran under a linux box and windows to see how a mud server would run. Thanks for the help Kevin On Mon, 28 Mar 2005 20:25:38 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > Kevin wrote: > > Here is the entire error message: > > > >

Re: [Tutor] An attribute error problem

2005-03-28 Thread Kevin
Here is the entire error message: Traceback (most recent call last): File "C:\Documents and Settings\Kevin\Desktop\New Folder\mudmaker\mmaker.py", line 55, in ? server.checkConnections(0.1) File "C:\Documents and Settings\Kevin\Desktop\New Folder\mudmaker\sServer.p

Re: [Tutor] An attribute error problem

2005-03-28 Thread Kevin
Nope it will still give the same Attribute error. On Mon, 28 Mar 2005 13:50:07 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > Kevin wrote: > > Hi, > > > > I fond this game on the internet I was able to fix most of the errors > > that it was giving and it will

[Tutor] Re: An attribute error problem

2005-03-28 Thread Kevin
Sorry http://www.lotheria.com/mudmaker.zip On Mon, 28 Mar 2005 13:35:20 -0500, Kevin <[EMAIL PROTECTED]> wrote: > Hi, > > I fond this game on the internet I was able to fix most of the errors > that it was giving and it will > now start up ok. However when you try to ent

[Tutor] An attribute error problem

2005-03-28 Thread Kevin
) AttributeError: 'tuple' object has no attribute '_fd' How would I go about fixing this. I have uploaded to entire game to http://lotheria.com/mudmaker.zp if anyone would care to take a look at it. Thanks Kevin ___ Tutor maillist - T

  1   2   >