[Tutor] S.find()

2010-07-01 Thread Corey Richardson
hat does mean? (5 Bonus Points for answering that). I also tried passing a slice index right into it like gameWord.find('p', [1:4]), but that returned a SyntaxError as well. I have the entirety of my code posted up at http://pastebin.com/k9nMZNMy, I won't edit the code until I

Re: [Tutor] S.find()

2010-07-02 Thread Corey Richardson
Thanks everyone! I got it all working now, and I finished up the program. Your help is much appreciated ;-) ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

[Tutor] GUI Creation Aide

2010-07-14 Thread Corey Richardson
ence for which toolkit I use, wx/Tk/GTK, etc. Thanks, ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Global name not found, though clearly in use

2010-07-14 Thread Corey Richardson
ryBox' is not defined However, not even 30 lines down, (29, to be exact) there is this line: eWordEntryBox = tk.Entry(fWordEntry) Not understanding what is happening here. Same happens when I tack self at the beginning of it, except it says global name self is

Re: [Tutor] Global name not found, though clearly in use

2010-07-14 Thread Corey Richardson
stebin.com/QTNmKYC6 Steven D'Aprano wrote: On Thu, 15 Jul 2010 12:18:58 am Corey Richardson wrote: Hey tutors. Two separate submissions one day, guess I'm getting busy ;) Anyway, I'm re-writing my hangman program to make use of my new-found understanding of OOP, and using a GUI this

Re: [Tutor] Global name not found, though clearly in use

2010-07-14 Thread Corey Richardson
Hmm..If I add a few debugging lines like that into my code, I get this: Starting program In class Hangman done defs in class eWordEntryBox defined Exception in Tkinter callback Traceback (most recent call last):  File "C:\Python31\lib\tkinter\__init__.py", line 1399, in __call__    ret

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

2010-07-21 Thread Corey Richardson
The "SQLite Database locked problem" was yesterday at 12:48 AM, I'm guessing you didn't count that? ;) Alan Gauld wrote: I haven't had any tutor messages in 2 days. Do I have a problem or are things just very quiet suddenly? The archive isn't showing anything either which makes me suspicious.

[Tutor] Making String

2010-08-10 Thread Corey Richardson
Can someone either point me in a different direction, or explain how join() works? Thank you, ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Making String

2010-08-10 Thread Corey Richardson
Joel and Hugo: Thanks a lot! That clears it right up. ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Scripting Blender

2010-08-11 Thread Corey Richardson
Yes. It's called the Python API, it comes with Blender ;) bpy and Blender are the top modules. There are submodules for everything. The reference is here: http://www.blender.org/documentation/249PythonDoc/index.html HTH, ~Corey Richardson aug dawg wrote: Are there any Python modul

[Tutor] Writing to Sound

2010-09-14 Thread Corey Richardson
Greetings tutors. First off, here is what I'm doing. I'm taking pi (3.141592 etc. etc. etc.), taking two values at a time, and then mapping the two values to pitch and length. I'm then using winsound.Beep to beep for x ms, at y frequency. What I want to do, is write that to file. Judging from

[Tutor] Plotting a Linear Equation

2010-09-23 Thread Corey Richardson
Hello tutors. Probably the wrong mailing list, but someone might know. I want to use matplotlib (or similar) to plot an equation in slope-intercept (y=mx+b) or standard form (Ax + By = C). As far as I've read and tested, you can only plot with a series of points. I could make two points out of

[Tutor] Operating in Place

2010-09-28 Thread Corey Richardson
Hello tutors. I hate doing this: string = string.lower() Is there a way to do it without the "string =" part? Thanks. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/li

Re: [Tutor] File transfer

2010-10-30 Thread Corey Richardson
If you can send a list, have the list [name, data] where name is the file name and data is the raw binary of the file, contained in a string. On 10/30/2010 9:11 PM, Chris King wrote: Dear Tutors, How would I send a file from one computer to another. I have modules which can send simple ob

Re: [Tutor] File transfer

2010-10-31 Thread Corey Richardson
On 10/31/2010 12:06 PM, Chris King wrote: On 10/31/2010 12:03 PM, Corey Richardson wrote: On 10/31/2010 11:51 AM, Chris King wrote: On 10/30/2010 10:08 PM, Corey Richardson wrote: If you can send a list, have the list [name, data] where name is the file name and data is the raw binary of

Re: [Tutor] Server

2010-11-05 Thread Corey Richardson
On 11/5/2010 3:18 PM, Chris King wrote: On 11/4/2010 9:46 PM, Corey Richardson wrote: On 11/4/2010 8:43 PM, Chris King wrote: Dear Tutors, May server and client programs aren't working. They basically simplify socket and SocketServer. Run them directly to test them. They do

Re: [Tutor] lists, arrays and saving data

2010-11-21 Thread Corey Richardson
On 11/21/2010 8:12 AM, Chris Begert wrote: Hi Gurus I just wrote my first little python program; so yes I'm very new to all this. The goal in the end is to have a program that shows how the sun moves from the point of view of a given location (i.e. solar paths added to some sort of stereog

[Tutor] Simple Game

2009-09-06 Thread Corey Richardson
So far, I can use tuples/lists/dictionary's, and define some functions, and a bit of other things. Would it be hard for me to make a simple text rpg game? Or is there something else I should know before I try that. ___ Tutor maillist - Tutor@python.o

Re: [Tutor] Tutor Digest, Vol 67, Issue 22

2009-09-06 Thread Corey Richardson
"Corey Richardson" wrote So far, I can use tuples/lists/dictionary's, and define some functions, and a bit of other things. Would it be hard for me to make a simple text rpg game? Or is there something else I should know before I try that. No idea about rpg bec

[Tutor] Simple Program

2009-09-17 Thread Corey Richardson
I'm going to be making a simple program, that is a few books like "A is for...", "B is for...", but it will be many built into one, with a some sort of define(word) command, some sort of a find(word) command, and a few others. Looking for people to contribute, and make this a community thing, m

Re: [Tutor] Tutor Digest, Vol 67, Issue 62

2009-09-18 Thread Corey Richardson
I'm going to be making a simple program, that is a few books like "A is for...", "B is for...", but it will be many built into one, Sorry, I don't understand? *By that, I mean it will be like a childrens book, teaching the letters. You've read them. example "A is for apple, a yummy tre

[Tutor] Calling a dictionary entry inside of a function

2009-09-18 Thread Corey Richardson
I am trying to use a parameter of a function to call a word inside a dictionary. Here is my code wordList = { 'Apple' : ["A delicious snack"], 'Word' : ["This code is not working..."], } def define(word): print wordList['Word'] When I use define('Apple') it returns ['This code is not w

Re: [Tutor] eazy python question involving functions and, parameters

2009-09-20 Thread Corey Richardson
assume that jade2 is a function that expects two int parameters and returns the value of the larger one. Also assume that four variables, population1 , population2 , population3 , and population4 have already been defined and associated with int values. Write an expre

[Tutor] eazy python question involving functions and parameters

2009-09-21 Thread Corey Richardson
another thing from the OP that no one has addressed yet is what *this* means: >/ > Write an expression (not a statement!) / to the veterans, we don't have to think twice, but this may not be obvious to a beginner. basically, an expression is something like 4 * 5, foo(), [x for x in range(5)], et

[Tutor] Unknown reason for error.

2009-09-24 Thread Corey Richardson
Hello, python tutors, its Corey. Anyway, I'm getting a syntax error for an unknown reason. Here is my code...     name = raw_input("What is your name?") print "Hello, ", name wellness = raw_input("How are you?") if wellness != "Good":     if wellness != "Well":     if wellness != "Fine":   

[Tutor] invalid syntax (reply)

2009-09-24 Thread Corey Richardson
Robert, that is my code. The error? "Theres an error in your program : invalid syntax" Closing the parenthesis helped that one, but my else statement is not working...heres the code chunk... if wellness != "Good": elif wellness != "Well": elif wellness != "Fine": print "Oh,

[Tutor] [Reply]need help with conditionals

2009-09-25 Thread Corey Richardson
I have no clue what it is trying to acomplish. What are you doing? Here is a good Tut on conditionals. Boolean is near the top. http://www.freenetpages.co.uk/hp/alan.gauld/tutbranch.htm HTH(If I did), ~Corey <>___ Tutor maillist - Tutor@python.org To

[Tutor] Not workin!

2009-09-29 Thread Corey Richardson
I got suggested to use this format for my code, as it was shorter and prettier. But It dun work! if wellness != ["Well","Fine","Good", "OK", "ok", "Ok", "Great", "Awesome", "Epic"]: print "Oh, I'm sorry you are not feeling well." areYouOk = raw_input("I guessed correct, right?") if areY

[Tutor] Images, and other things.

2009-09-29 Thread Corey Richardson
I haven't looked into this, but could you make a real time image using python? I think it would be most hard Anyway, I am having trouble with int(). I am trying to int(raw_input("some number")), but it returns Traceback (most recent call last): File "C:/Users/Quick-Start/Documents/Python Do

[Tutor] UnboundLocalError and Break

2009-09-30 Thread Corey Richardson
Here is my code that is being used/affected by the block that is erroring. The rest is superfluous, and does not affect it: intel = 10 #Define the abilities. strn = 10 con = 10 dex = 10 wis = 10 exp = 0 cha = 10 playHp = 20 melWep = 1 # A sword rngWep = 1 #A bow

Re: [Tutor] UnboundLocalError and Break

2009-09-30 Thread Corey Richardson
Luke Paireepinart wrote: If your code's more than 10 lines long or so, put it on pastebin.com and send us the link rather than inlining the whole thing. You could also send it as an attachment. Your formatting is all screwed up and I can't read the code at all, but I hav

[Tutor] Switching to other version of Python

2009-10-12 Thread Corey Richardson
My school has python 2.4. I have python 2.6, and I find it perfectly wonderful. However, I am contemplating the switch, and am wondering, what is your personal opinion on why or why not to use 3.x? Thanks for the help in advance, ~Corey <>___ Tutor ma

[Tutor] Running Python on a Calculator

2009-10-19 Thread Corey Richardson
Hey tutors. I have a TI-84 plus, and I am making some math tools, and I don't know the native language of the Ti-84, and was wondering, has anyone worked with a version of Python that can run on that small of a processor? Thanks in advance, ~Corey ___

[Tutor] List Changing Order

2010-11-25 Thread Corey Richardson
Tutors, I recall that the keys of dictionaries have arbitrary order, and may change over time. Is this true of lists? I can't find the answer from a simple Google search. Thank you! ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub

Re: [Tutor] List Changing Order

2010-11-26 Thread Corey Richardson
Steven D'Aprano wrote: Corey Richardson wrote: Tutors, I recall that the keys of dictionaries have arbitrary order, and may change over time. Is this true of lists? I can't find the answer from a simple Google search. Thank you! Only if you re-arrange it yourself.

Re: [Tutor] Temperature Scales

2010-11-28 Thread Corey Richardson
however. HTH, ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] floats

2010-12-03 Thread Corey Richardson
ons: http://mail.python.org/mailman/listinfo/tutor float_b = float(float_b) That takes the string and makes it a float. ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] PHP

2010-12-04 Thread Corey Richardson
erver Pages (PSP) and mod_python enable you to do this on an Apache server. ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Writing to the terminal?

2010-12-10 Thread Corey Richardson
On 12/10/2010 3:14 PM, Modulok wrote: List, Forgive me if I don't describe this well, I'm new to it: Assume I'm working in a command shell on a terminal. Something like tcsh on xterm, for example. I have a program which does *something*. Let's say it counts down from 10. How do I print a valu

Re: [Tutor] Writing to the terminal?

2010-12-10 Thread Corey Richardson
On 12/10/2010 3:34 PM, Wayne Werner wrote: If you just want a single line you can use chr(13) which is a carriage return. If you want a more complex program you'll need a curses type library hth, wayne On 12/10/10, Modulok wrote: List, Forgive me if I don't describe this well, I'm new to it

Re: [Tutor] Tutor Digest, Vol 82, Issue 54

2010-12-12 Thread Corey Richardson
On 12/12/2010 11:43 PM, marupalli charan wrote: dont send me mails again. i want to unsubscript At the bottom of every single message from the list there are the following lines: To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ~Corey Richardson

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Corey Richardson
On 01/01/2011 02:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. Ken On 01/01/2011 12:11 PM, Abhijeet Rastogi wrote: You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete mailto:psmo...@

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Corey Richardson
On 01/02/2011 09:40 AM, Brett Ritter wrote: > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: >> Why avoidCamelCase? I actually prefer it to using_non_camel_case > > The readability is an often argued topic - I myself find the space of > names_in_underscores to be more readable (words are disti

Re: [Tutor] print stack traces not caused by errors

2011-01-04 Thread Corey Richardson
ions: > http://mail.python.org/mailman/listinfo/tutor I've done almost all my debugging via print statements at crucial points. It's a good way to go, IMO. ~Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] wx accelerator table: one keystroke seems skipped

2011-01-05 Thread Corey Richardson
On 01/05/2011 04:41 PM, Alex Hall wrote: > Hello all, > First, this is about a wx accelerator table, so if it is too off-topic > for this list, let me know. > > [snip] I would go ask the wxPython mailing list or similar, just my 2 cents. ~C

Re: [Tutor] Parse MPL files

2011-01-07 Thread Corey Richardson
dvance. > > a+ > A google search yields no results for one. If you know the structure of the MPL file, you can write your own parser. Look through the file with a hex editor like Bless first, if you need to. Most likely the information you want

Re: [Tutor] Parse MPL files

2011-01-07 Thread Corey Richardson
On 01/07/2011 06:29 PM, PyProg PyProg wrote: > 2011/1/7 Corey Richardson : > > Hi, > > Thanks for your response. > >> A google search yields no results for one. If you know the structure of >> the MPL file, you can write your own parser. Look through the file w

Re: [Tutor] Open a text file, read and print pattern matching

2011-01-08 Thread Corey Richardson
2 #+ #Time: 20s -end-paste Your script could look something like: data = [for line in open(filename) if not line.startswith("#") for line in data: line = line.split() if line[3] == pattern: pr

[Tutor] __init__() - is it required?

2011-01-09 Thread Corey Richardson
Do all classes need an __init__() method? I have classes that look much like this one starts out: class GenerateXML(object): """Defines methods to be inherited for StaticXML and AnimationXML""" def __init__(self): pass I would rather not do that. Code without it runs fine, but wil

Re: [Tutor] __init__() - is it required?

2011-01-10 Thread Corey Richardson
On 01/09/2011 04:27 PM, Steven D'Aprano wrote: > Corey Richardson wrote: >> Do all classes need an __init__() method? I have classes that look much >> like this one starts out: >> >> class GenerateXML(object): >> """Defines methods to be i

[Tutor] Sorting a List

2011-01-12 Thread Corey Richardson
search doesn't return anything I could use. I tried just using [image for image in os.listdir(path) if image.endswith('.png')], but that doesn't appear to have any order. Thanks, Corey Richardson ___ Tutor maillist - Tutor@

Re: [Tutor] Sorting a List

2011-01-12 Thread Corey Richardson
On 01/12/2011 09:42 PM, Luke Paireepinart wrote: > Remember the sorted() method takes a key function, have this key > function take in each filename and compare the numbers and you're all set! > > - > Sent from a mobile device. Apologies for brevity and top-posting. > -

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Corey Richardson
On 01/13/2011 08:50 PM, Elwin Estle wrote: > I am going through the book mentioned in the subject line, and I have found a > couple of things that don't seem to work the way the author shows in the > book. So, either I am doing something wrong, or what he is saying isn't > quite right. > > I a

Re: [Tutor] errors in "Python Programming for the Absolute Beginner"??

2011-01-13 Thread Corey Richardson
On 01/13/2011 10:29 PM, Bill Allen wrote: > That is correct about the difference between Python 2 and Python 3 > syntax. However, I am surprised that with 2.7.1 these do not work. I > have found that on my Ubuntu system with Python 2.6.5 these Python 3 > syntax items do seem to work properly.

Re: [Tutor] how to print random number multiply

2011-01-14 Thread Corey Richardson
nce, and not every time you type in x. What you want it is for loop: for number in range(50): print(random.random()) Coming from other languages you might think: cntr = 0 while cntr < 50: print(random.random()) cntr += 1 which is correct, but not pythonic. HTH, ~Corey Richardson __

Re: [Tutor] color of "print" function

2011-01-14 Thread Corey Richardson
On 01/14/2011 07:48 PM, Bill DeBroglie wrote: > Hello all, > > I don't have a problem per se, but have noticed something that I'd > like to figure out... > > Sometimes the "print" function appears orange for me, sometimes it > appears purple. Why does this happen and what's the difference any

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-14 Thread Corey Richardson
On 01/14/2011 08:17 PM, Joel Knoll wrote: > Hello, > > I am new to programming and to Python. I've been using Python with IDLE > on Windows Vista for a few weeks now. > (And I'm loving it!) However, I'm thinking about switching to Ubuntu > 10.10. If I download Ubuntu, will I still be able to u

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Corey Richardson
On 01/15/2011 05:45 PM, walter weston wrote: > I thought creating a Python help hotline would help programmers > exponential! I think they should make a help hotline for every > programming language. and since I havent discovered something similar It > would probably be lucretive! > > > > __

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Corey Richardson
On 01/15/2011 05:45 PM, walter weston wrote: > I thought creating a Python help hotline would help programmers > exponential! I think they should make a help hotline for every > programming language. and since I havent discovered something similar It > would probably be lucretive! > irc.freenode.

Re: [Tutor] Anyone interested in making a Python Help hotline?

2011-01-15 Thread Corey Richardson
On 01/15/2011 06:30 PM, Corey Richardson wrote: > On 01/15/2011 05:45 PM, walter weston wrote: >> I thought creating a Python help hotline would help programmers >> exponential! I think they should make a help hotline for every >> programming language. and since I havent

Re: [Tutor] question about manipulate images!

2011-01-17 Thread Corey Richardson
On 01/17/2011 10:34 AM, zhengqing gan wrote: > Hi, >Thanks for the reply. >But I found that there are some website which can convert images > into iphone icon style images, there should be an kind of algorithm to > manipulate. >Thanks! > > >From playing with http://wizardtoolkit.com/

Re: [Tutor] Is it possible to tell, from which class an method was inherited from

2011-01-19 Thread Corey Richardson
On 01/19/2011 03:55 AM, Jojo Mwebaze wrote: > Is it possible to tell, from which class an method was inherited from. > take an example below > > |class A: > >def foo(): > pass > class B(A): > >def boo(A): > pass > > class C(B): >def coo() > > pass > class D(C): > >

Re: [Tutor] Exercise suggestions

2011-01-22 Thread Corey Richardson
On 01/22/2011 11:56 AM, michael scott wrote: I am new to programming, I intend to get an entry level job programming next year (or a little bit longer). I am switching fields and not going to college, but kinda "self teaching" myself through various methods. I currently understand concepts in pro

Re: [Tutor] Exercise suggestions

2011-01-22 Thread Corey Richardson
On 01/22/2011 03:09 PM, David Hutto wrote: When I felt I was ready to start doing some work, I got involved in an open source project. It's definitely an experience! Try going through http://freshmeat.net/ Isn't that for those that aren't given real apprenticeship?:) Programming is my hobby,

Re: [Tutor] The trap of the year

2011-01-25 Thread Corey Richardson
On 01/25/2011 04:28 PM, Karim wrote: > > Hello Bob, > > I know this fact for function but in this case this is not a function > but a constructor method of a class. To be pedantic, a method _is_ a function, just under the umbrella of a class, with it's parent object being passed to it. ~Corey >

Re: [Tutor] placing widgets

2011-01-25 Thread Corey Richardson
On 01/25/2011 04:31 PM, W S wrote: > hi, i have written some Tk/Python code to do a few simple tasks, and am > having > trouble with my combobox placement on the frame. is there a way to more > explicitly place it other than: This method does not give a lot of control > xx=apply(OptionMenu,(se

Re: [Tutor] extracting text from word files (.doc, .docx) and pdf

2011-01-25 Thread Corey Richardson
On 01/25/2011 04:52 PM, Juan Jose Del Toro wrote: > Dear List; > > I am looking for a way to extract parts of a text from word (.doc,.docx) > files as well as pdf; the idea is to walk through the whole directory tree > and populate a csv file with an excerpt from each file. > For PDF I found PyPdf

Re: [Tutor] class question

2011-01-25 Thread Corey Richardson
On 01/25/2011 06:26 PM, Elwin Estle wrote: > Is it better to have one large sort of "do it all" class, or break the larger > class up into smaller classes? Seems to me like the one large class would be > clearer in some ways. I have something I am trying to do that have somewhere > in the neig

Re: [Tutor] class question

2011-01-25 Thread Corey Richardson
On 01/25/2011 08:50 PM, Steven D'Aprano wrote: > Corey Richardson wrote: >> On 01/25/2011 06:26 PM, Elwin Estle wrote: >>> Is it better to have one large sort of "do it all" class, or break >>> the larger class up into smaller classes? > >> If y

Re: [Tutor] The trap of the year

2011-01-25 Thread Corey Richardson
On 01/25/2011 06:49 PM, Steven D'Aprano wrote: > Corey Richardson wrote: > >> To be pedantic, a method _is_ a function, just under the umbrella of a >> class, with it's parent object being passed to it. > > To be even more pedantic, a method object is a wr

Re: [Tutor] Composing lists from both items and other lists

2011-02-01 Thread Corey Richardson
On 02/01/2011 03:40 PM, John Simon wrote: > I'm looking for a way to flatten lists inside a list literal, kind of like > this: > start = '(' end = ')' items = ['abc', '+', 'def'] [start, *items, end] > ['(', 'abc', '+', 'def', ')'] > > Of course, the star doesn't work there. I

Re: [Tutor] Composing lists from both items and other lists

2011-02-01 Thread Corey Richardson
On 02/01/2011 06:23 PM, Andre Engels wrote: > On Tue, Feb 1, 2011 at 9:40 PM, John Simon wrote: >> I'm looking for a way to flatten lists inside a list literal, kind of like >> this: >> > start = '(' > end = ')' > items = ['abc', '+', 'def'] > [start, *items, end] >> ['(', 'abc', '

Re: [Tutor] print "Hello, World!"

2011-02-02 Thread Corey Richardson
On 2/2/2011 9:00 PM, Doug Marvel wrote: > [snip] > > I am hoping for a link to a somewhat comprehensive online resource > that explains from the beginning in English, plain English, as this is > the only language I speak. Something to get my foot in the door would > be awesome. > > > Cheers, > Doug

[Tutor] P2PU Python Challenges

2011-02-05 Thread Corey Richardson
In my journeys across the face of the Internet, I found this: http://p2pu.org/general/python-challenges Not sure what it's really going to be, but any new programmers/people looking for something to do might be interested. I'm not quite sure how a class can be organised around a web riddle, but it

Re: [Tutor] python packaging systems

2011-02-10 Thread Corey Richardson
On 02/09/2011 11:17 PM, Bill Allen wrote: > I have found there are a few systems available to package Python programs as > standalone programs for distribution. Do the folks here have any > recommendation or comment on any of these? > > Thanks, > --Bill > I found cx_Freeze to be the most usefu

[Tutor] Python + Sound

2011-02-11 Thread Corey Richardson
Hello Tutors, I'm working on a small script that compresses a file, sends it through the telephone, and then receives and decompresses the file on the other end. The compression is the easy part. The transmission is the hard part. If anyone has worked with sound before, what do you recommend? I've

Re: [Tutor] Python + Sound

2011-02-11 Thread Corey Richardson
On 02/12/2011 01:10 AM, David Hutto wrote: > for some reason, if you're on linux, I wanna say use python's > subprocess, and man pppd. also look into proc and a thread in the > archives I did a while back. The point is to specifically transmit the data as sound, and then turn the sound back into t

Re: [Tutor] Python + Sound

2011-02-11 Thread Corey Richardson
On 02/12/2011 01:26 AM, David Hutto wrote: > On Sat, Feb 12, 2011 at 1:24 AM, David Hutto wrote: >>> The point is to specifically transmit the data as sound, and then turn >>> the sound back into the gzipped file. If I were doing this for anything >>> other than my own entertainment and education,

Re: [Tutor] Python + Sound

2011-02-11 Thread Corey Richardson
On 02/12/2011 02:27 AM, Steven D'Aprano wrote: > Corey Richardson wrote: >> Hello Tutors, >> >> I'm working on a small script that compresses a file, sends it through >> the telephone, and then receives and decompresses the file on the other >>

Re: [Tutor] Backpropagation Learning in Python

2011-02-13 Thread Corey Richardson
> http://lmgtfy.com/?q=neural+networking+in+python http://lmgtfy.com/?q=backpropagation+in+python -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Having Troubles with For Loops

2011-02-19 Thread Corey Richardson
2's raw_input(), so it's hard to tell which you are using. I'm assuming Python 2 because you didn't report the raw_input() failing. If that's the case, you don't need the ()'s around the text you are printing. I also suggest you look into lists and list index

Re: [Tutor] how to connect to Django's irc

2011-02-20 Thread Corey Richardson
de.net/. #django You'll have better luck with django-specific questions on the django mailing list. -- Corey Richardson I've never known any trouble which an hour's reading didn't assuage. -Charles De Secondat ___ Tutor maill

Re: [Tutor] comparing strings

2011-02-23 Thread Corey Richardson
s the value of the ord()'s. >>>ord('a') 97 >>>ord('3') 51 This is their number in the ASCII system. You can also do this: >>>chr(97) 'a' >>>chr(51) '3' -- Corey Richardson _

Re: [Tutor] Dictionnaries in object

2011-02-24 Thread Corey Richardson
t le feu bruler", "Froid devorant": "Gele lenemi sur place"} Have it implicit that the key is the name and the value is the description. That's how I would do it, at least. -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] comparing strings

2011-02-25 Thread Corey Richardson
unicode. Check out http://qcpages.qc.cuny.edu/~nixon/links/asciiUnicode.html -- Corey Richardson ___ 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-25 Thread Corey Richardson
a > different disk. > > > Being difficult just for the sake of it-ly y'rs, And at that point, the all-encompassing "etc." steps in ;-) -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running Existing Python

2011-02-25 Thread Corey Richardson
o.py from the IDLE interpreter? You need to run "python hello.py" in a terminal window, not from the Python interpreter. If you are using IDLE, you can File > Open hello.py and hit F5 to run it... I don't know if that advice applies to Mac, might be different key strokes. -- Co

Re: [Tutor] scripts search

2011-02-25 Thread Corey Richardson
haven't programmed before, and if you have, try this: http://docs.python.org/tutorial/ -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Cross-Module Interaction

2011-02-25 Thread Corey Richardson
put it off for the future after I'm more comfortable with C/C++) -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cross-Module Interaction

2011-02-25 Thread Corey Richardson
hich I didn't know worked because I didn't test it like you showed it, but to be safe I definitely need to persist that data every once in a while. I'm slightly concerned about performance when it comes to reading/writing to disk a lot when doing things like that, since if

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Corey Richardson
On 02/26/2011 06:02 AM, Walter Prins wrote: > On 26 February 2011 05:33, Corey Richardson wrote: > >> Aha, that explains why I didn't get any results. Each file got its own >> interpreter instance. >> > > Not wanting to nit pick, but no: It's not that ea

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Corey Richardson
I would like it to be sensible and now waste time dawdling. (And the full quote is "We should forget about *small* efficiencies, say about 97% of the time: premature optimization is the root of all evil." (emphasis added)) -- Corey Richardson __

Re: [Tutor] Running Existing Python

2011-02-26 Thread Corey Richardson
in your file browser? That's most curious. -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running Existing Python

2011-02-26 Thread Corey Richardson
nell/bin/Python\2.7/Extras/Demo/tkinter/guido/hello.py > $ cd /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py > Alas, you still do it wrong. You don't just replace the space with a backslash, you put a slash _before_ the space. Or like Steven (I think it was) sugg

Re: [Tutor] python module to search a website

2011-02-26 Thread Corey Richardson
s and opening websites respectively. http://docs.python.org/library/urlparse.html http://docs.python.org/library/urllib2.html If that isn't what you're looking for, you'll need to be a bit more descriptive. If you are going to be parsing the HTML and then searching for specific elements

Re: [Tutor] Generator expressions...

2011-02-27 Thread Corey Richardson
On 02/27/2011 04:34 PM, Modulok wrote: > > import hashlib > > fd = open('/dev/urandom', 'rb') > gen = (hashlib.sha256(i).hexdigest() for i in fd.read(4096)) > I think the problem is that you're only reading 4096 bits (bytes? No idea), and iterating

Re: [Tutor] Timer with exe command

2011-02-28 Thread Corey Richardson
#reading-and-writing-files Should be everything you need. -- Corey Richardson ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Timer with exe command

2011-02-28 Thread Corey Richardson
On 02/28/2011 03:30 PM, Corey Richardson wrote: > On 02/27/2011 10:02 PM, Kaden McLaws wrote: >> I would like to set up the following using python: A timer that is activated >> when a user logs on to our computer, then shuts the computer down when the >> timer runs out (n

[Tutor] Homework Problem Flaming (was: Help!)

2011-03-03 Thread Corey Richardson
work. With homework problems, instead of saying "Hey, replace lines 42-48 with foo", saying "Look into the bar module, it bazifies the proper value for you". Teaching people to learn better for themselves instead of hand-feeding them the answers. This list does a rea

Re: [Tutor] multiple if and or statement

2011-03-14 Thread Corey Richardson
;: if i == 'test1' or i == 'test2' >print 'true' > I know I am missing something, but in reality it should only print > true once correct? You are missing something. Before, you're simply testing the existence of 'test2'. And since 

  1   2   >