Re: [Tutor] help

2012-12-28 Thread Evans Anyokwu
On Thu, Dec 27, 2012 at 12:07 PM, Randy WhiteWolf wrote: > I am an older newbie teaching myself Python programming. I copied the code > # Emonstrates escape sequences. This exercise is on page 22 of the Phthon > Programming for the Absolute Beginner by Michael Dawson. I have copied the > code verb

Re: [Tutor] help

2012-12-27 Thread Alan Gauld
On 27/12/12 12:07, Randy WhiteWolf wrote: Phthon Programming for the Absolute Beginner by Michael Dawson. I have copied the code verbatim below. # Sound the system bell print "\a" > ... raw_input ("\n\nPress the enter key to exit.") My problem is I hear no system bell; the enter doesn't respon

Re: [Tutor] help

2012-12-27 Thread Steven D'Aprano
On 27/12/12 23:07, Randy WhiteWolf wrote: # Sound the system bell print "\a" That comment is misleading. \a does not necessarily sound the system bell. Whether it does or not depends on the terminal you are using. For example, under Linux I am using the "Konsole" terminal, and I have four sett

Re: [Tutor] Help please!

2012-12-14 Thread Steven D'Aprano
On 02/12/12 12:37, Jack Little wrote: Hi Tutor, I'm getting this error Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined Names need to be defined before they are used. Code needs to be indented to b

Re: [Tutor] Help please!

2012-12-14 Thread Kwpolska
On Sun, Dec 2, 2012 at 2:37 AM, Jack Little wrote: > Hi Tutor, > I'm getting this error > > Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", > line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined > > With the attached file > > Please get back to me > Than

Re: [Tutor] Help with web.py error

2012-12-05 Thread eryksun
On Wed, Dec 5, 2012 at 2:13 AM, Erik Martinson wrote: > > File "/usr/lib/python2.7/sqlite3/dbapi2.py", line 63, in convert_date > return datetime.date(*map(int, val.split("-"))) > > ValueError: invalid literal for int() with base 10: '21 01:47:43' > 127.0.0.1:59850 - - [04/Dec/2012 22:47:35] "HTT

Re: [Tutor] Help with writing a program

2012-12-03 Thread Steven D'Aprano
On 03/12/12 14:59, rajesh mullings wrote: Hello, I am trying to write a program which takes two lines of input, one called "a", and one called "b", which are both strings, then outputs the number of times a is a substring of b. If you could give me an algorithm/pseudo code of what I should do to

Re: [Tutor] Help with writing a program

2012-12-02 Thread Luke Paireepinart
There is an equivalent page in the documentation for Python 3 as well, regarding strings. This sounds a lot like a homework problem so you are unlikely to get a lot of help. You certainly won't get exact code. What have you tried so far? Where are you getting stuck? We're not here to write cod

Re: [Tutor] Help with writing a program

2012-12-02 Thread fantasticrm
The Python version, is Python 3. On Sun, Dec 2, 2012 at 10:59 PM, rajesh mullings wrote: > Hello, I am trying to write a program which takes two lines of input, one > called "a", and one called "b", which are both strings, then outputs the > number of times a is a substring of b. If you could giv

Re: [Tutor] Help with writing a program

2012-12-02 Thread Mark Lawrence
On 03/12/2012 03:59, rajesh mullings wrote: Hello, I am trying to write a program which takes two lines of input, one called "a", and one called "b", which are both strings, then outputs the number of times a is a substring of b. If you could give me an algorithm/pseudo code of what I should do t

Re: [Tutor] help

2012-11-20 Thread Matthew Ngaha
> Traceback (most recent call last): > File "Match finder GUI.py", line 87, in ? > app = Application(root) > File "\Match finder GUI.py", line 23, in __init__ > self.create_widgets() > File "Match finder GUI.py", line 61, in create_widgets > self.submit_bttn = Button(self, text =

Re: [Tutor] help

2012-11-19 Thread Steven D'Aprano
On 20/11/12 11:33, Mark Lawrence wrote: On 19/11/2012 23:28, Matthew Ngaha wrote: It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. I believe that to be complete nonsense, there was very l

Re: [Tutor] help

2012-11-19 Thread Mark Lawrence
On 19/11/2012 23:28, Matthew Ngaha wrote: It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. I believe that to be complete nonsense, there was very little code to parse. What was missi

Re: [Tutor] help

2012-11-19 Thread Mark Lawrence
On 19/11/2012 18:07, Isaac Parkes wrote: First of all giving a meaningful subject helps everybody, how about "tkinter problems"? hi, I'm quite new to python and have just made a program that makes a GUI but when i open it it says there are some errors. I can't find any :( if you find any pro

Re: [Tutor] help

2012-11-19 Thread Matthew Ngaha
It's asking a lot if you want people to read your whole code to try and spot the errors. Try to run it from the console and paste what the errors are here. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

Re: [Tutor] Help with a SQL Statement

2012-11-18 Thread Alan Gauld
On 18/11/12 11:29, Khalid Al-Ghamdi wrote: The SQL statement below doesn't return anything.. and I don't know why... I've used the parans but still no luck. Any Suggestions? I'll restructure it to how I think you want it... cur.execute(""" select badge, name, stage, tc, major, package

Re: [Tutor] Help with a SQL Statement

2012-11-18 Thread Bod Soutar
On Nov 18, 2012 11:30 AM, "Khalid Al-Ghamdi" wrote: > > Hi, I found one typo in 'Workshop&' which should be 'Workshop%' but it still gives results containing majors with 'Customer%' and 'Warehouse%' in them... > > > On Sun, Nov 18, 2012 at 2:21 PM, Khalid Al-Ghamdi wrote: >> >> Hi All, >> >> The

Re: [Tutor] Help with a SQL Statement

2012-11-18 Thread Khalid Al-Ghamdi
Hi, I found one typo in 'Workshop&' which should be 'Workshop%' but it still gives results containing majors with 'Customer%' and 'Warehouse%' in them... On Sun, Nov 18, 2012 at 2:21 PM, Khalid Al-Ghamdi wrote: > Hi All, > > The SQL statement below doesn't return anything.. and I don't know why.

Re: [Tutor] Help with class example

2012-11-06 Thread Prasad, Ramit
Ramit Prasad wrote: > You would be better off trying to run this from the command > line. I just wanted to clarify on this. The reason you will have a better results running this from the command line is that Python will normally give you very good error traceback. An IDE might hide or obscure t

Re: [Tutor] help on dic creation

2012-11-06 Thread Mark Lawrence
On 06/11/2012 14:16, Dave Angel wrote: On 11/06/2012 09:01 AM, Mark Lawrence wrote: On 31/10/2012 01:01, Brayden Zhao wrote: def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=linelist[0]

Re: [Tutor] help on dic creation

2012-11-06 Thread Dave Angel
On 11/06/2012 09:01 AM, Mark Lawrence wrote: > On 31/10/2012 01:01, Brayden Zhao wrote: > >> def fieldict(filename): >>D={} >>with open(filename) as FileObject: >> for lines in FileObject: >>linelist=lines.split('\t') >>Key=linelist[0] >>ValCity=(linelist[12]).s

Re: [Tutor] help on dic creation

2012-11-06 Thread Mark Lawrence
On 31/10/2012 01:01, Brayden Zhao wrote: def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=linelist[0] ValCity=(linelist[12]).strip() ValState=linelist[13] ValOne=linelist[2]

Re: [Tutor] help on dic creation

2012-11-05 Thread Alan Gauld
On 31/10/12 01:01, Brayden Zhao wrote: Here is my code and I dont know why my code is only reading the 500th line of the file. Thanks for your help! def fieldict(filename): D={} with open(filename) as FileObject: for lines in FileObject: linelist=lines.split('\t') Key=l

Re: [Tutor] Help with class example

2012-11-05 Thread Dave Angel
On 11/05/2012 06:07 PM, Prasad, Ramit wrote: > Frank Pontius wrote: >> Sent: Saturday, October 27, 2012 12:27 PM >> To: d...@davea.name; bgai...@gmail.com >> Cc: tutor@python.org >> Subject: Re: [Tutor] Help with class example >> >> Here ya go! >> Can

Re: [Tutor] Help with OOP!

2012-11-05 Thread Steven D'Aprano
On 30/10/12 17:56, Pete wrote: I'm taking this class on python at UCSC. They said this list could help. I don't' understand OOP and I'm having a hard time understanding the "scope" and why the def inside class are not like function But they are like functions. Can you explain in more detail wha

Re: [Tutor] Help with OOP!

2012-11-05 Thread Oscar Benjamin
On 30 October 2012 06:56, Pete wrote: > I’m taking this class on python at UCSC. They said this list could help. I > don’t’ understand OOP and I’m having a hard time understanding the “scope” > and why the def inside class are not like function –plus I can’t get my > c-brain around the implicit ty

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
FYI - Gmail's new "compose" feature makes it WAY too easy to miss trimming the quotes. :( On Mon, Nov 5, 2012 at 3:37 PM, Brett Ritter wrote: (way too much) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
> Here is my code and I dont know why my code is only reading the 500th line of > the file. Thanks for your help! Let me offer you some hints: This sounds like only the last line is getting saved into the dict. Yet your loop is clearly going over each line. Ergo, the problem is probably in the

Re: [Tutor] Help with class example

2012-11-05 Thread Prasad, Ramit
Frank Pontius wrote: > Sent: Saturday, October 27, 2012 12:27 PM > To: d...@davea.name; bgai...@gmail.com > Cc: tutor@python.org > Subject: Re: [Tutor] Help with class example > > Here ya go! > Can't do what you want as this is a programmatic error from interrupter. 

Re: [Tutor] Help Passing Variables

2012-10-29 Thread Prasad, Ramit
David Hutto wrote: > #A little more complex in terms of params: > > def SwapCaseAndCenter(*kwargs): > > if upper_or_lower == "upper": > print a_string.center(center_num).upper() > > if upper_or_lower == "lower": > print a_string.center(center_num).lower()

Re: [Tutor] help with homework

2012-10-29 Thread Asokan Pichai
On Mon, Oct 29, 2012 at 2:28 PM, Alan Gauld wrote: > On 29/10/12 08:37, Asokan Pichai wrote: > >>> teachers put stupid artificial constraints on your code, >> >> >>> >>> such as banning the use of len(). >> >> >> There may be legitim

Re: [Tutor] help with homework

2012-10-29 Thread Alan Gauld
On 29/10/12 08:37, Asokan Pichai wrote: teachers put stupid artificial constraints on your code, such as banning the use of len(). There may be legitimate learning outcomes for a teacher to specify such conditions. In that ca

Re: [Tutor] help with homework

2012-10-29 Thread Asokan Pichai
[SNIPPED] > > Always use a while loop in this situation, This is excellent advice. Use a for loop in two situations: 1. Iterating a fixed(known) number of times 2. Iterating through the contents of any container Use a while loop to iterate as long as a condition applies. > regardless of wheth

Re: [Tutor] help with homework

2012-10-28 Thread Mark Lawrence
On 29/10/2012 01:40, Matthew Ngaha wrote: In your original getNames do something like this. Initialise a counter to zero. Every time you get a valid name increment the count. If the count is three you're finished. hey i was looking at the question as im learning also. With the counter, would

Re: [Tutor] help with homework

2012-10-28 Thread Matthew Ngaha
> > In your original getNames do something like this. >> Initialise a counter to zero. >> Every time you get a valid name increment the count. >> If the count is three you're finished. >> > hey i was looking at the question as im learning also. With the counter, would you use a while loop instead o

Re: [Tutor] help with homework

2012-10-28 Thread Alan Gauld
On 28/10/12 21:37, Sandra Beleza wrote: def GetNames(): names=[] while len(names)<3: name=raw_input("Name: ") if name in names: print name, "is already in the data. Try again." if name not in names: names.append(name) names.sort

Re: [Tutor] help with homework

2012-10-28 Thread Mark Lawrence
On 28/10/2012 21:37, Sandra Beleza wrote: Hi, I have to write a script that asks the user for names one at a time, and accept the name only if the user did not gave it before. The script has to do this until it gets 3 unique names. So far I have this: def GetNames(): names=[] while le

Re: [Tutor] Help with class example

2012-10-27 Thread bob gailer
On 10/27/2012 4:51 PM, Frank Pontius wrote: But, this is an if. When replying please put your response after the text it applies to, and delete all irrelevant text. In other words avoid "top-posting". Sorry I really messed up my reply! The offending line is: coin = random.randragge(0,2): get

Re: [Tutor] Help with class example

2012-10-26 Thread Dave Angel
On 10/18/2012 07:59 PM, Frank Pontius wrote: > Hello, > I'm taking a beginners course on Python. > > Have class example which is to be used in H/W, which I can't get to work. > Thus I figure the example is wrong. But I need this to get H/W done. > > Using 'import random' and random.randrange in fu

Re: [Tutor] Help with class example

2012-10-26 Thread bob gailer
On 10/18/2012 7:59 PM, Frank Pontius wrote: Help with class example Hello, Hi - this just showed up in my mailbox. Perhaps there was a delay getting it posted. The "" around tails and heads are not ascii quote characters. They are what some word processors change ascii quotes into to meet t

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
#Apologies, this is the actual code: def SwapCaseAndCenter(a_string, upper_or_lower = None, center_num = None): if upper_or_lower == "upper": print a_string.center(center_num).upper() if upper_or_lower == "lower": print a_string.center(center_num)

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
#A little more complex in terms of params: def SwapCaseAndCenter(*kwargs): if upper_or_lower == "upper": print a_string.center(center_num).upper() if upper_or_lower == "lower": print a_string.center(center_num).lower() a_string = raw_input("Give m

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
#This is the actual code: def SwapCaseAndCenter(a_string, upper_or_lower = None): if upper_or_lower == "upper": print a_string.center(center_num).upper() if upper_or_lower == "lower": print a_string.center(center_num).lower() a_string = raw_input(

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
Algorithm it, and look at the instance below the function first where variables are drawn in as raw input, and comments with # are just comments, not part of the code: def SwapCaseAndCenter(a_string, upper_or_lower = None): #find if it's upper, and print if upper_or_lower == "upper":

Re: [Tutor] Help on Remote File Copy & Exection

2012-10-25 Thread Prasad, Ramit
Arumugam N wrote: > Hi All, > > First of the big thanks and congrats for managing such a brilliant online > community. I am new to Python and have > started getting the taste of python on my day to day work. > > I have a requirement and i am trying to solve it using python. > > I am from QA. He

Re: [Tutor] Help on Remote File Copy & Exection

2012-10-25 Thread Alan Gauld
On 25/10/12 10:26, Arumugam N wrote: 1. Revert the snapshot of a VM used for testing. - i have automated using pysphere 2. Copy the build from share location to the VM - here i can have a python script run from the VM but is it possible to run it remotely? for example. if i run the script from M

Re: [Tutor] Help on Remote File Copy & Exection

2012-10-25 Thread Oscar Benjamin
On 25 October 2012 10:26, Arumugam N wrote: > Hi All, > > First of the big thanks and congrats for managing such a brilliant online > community. I am new to Python and have started getting the taste of python > on my day to day work. > > I have a requirement and i am trying to solve it using pytho

Re: [Tutor] Help - Using Sort and Join

2012-10-22 Thread Oscar Benjamin
On 22 October 2012 20:57, Daniel Gulko wrote: > Hi Python Tutor, Hi Daniel, > I have an issue trying to figure out how to print out final answers using > sort and join functions. Do you know how to use sort and join to print a list of strings in alphabetical order? > > Assignment Specification

Re: [Tutor] Help - Using Sort and Join

2012-10-22 Thread Dave Angel
On 10/22/2012 03:57 PM, Daniel Gulko wrote: > Hi Python Tutor, > > I have an issue trying to figure out how to print out final answers using > sort and join functions. > > Assignment Specification: > make a function that is a magic eight ball emulator. emulator will be a > function that returns o

Re: [Tutor] Help Passing Variables

2012-10-19 Thread Dave Angel
y not after the things they follow? There is a long-standing convention in this forum, and many others, and why let Microsoft ruin it for all of us? >> Date: Thu, 18 Oct 2012 04:44:55 -0400 >> Subject: Re: [Tutor] Help Passing Variables >> From: dwightdhu...@gmail.com >> To

Re: [Tutor] Help Passing Variables

2012-10-19 Thread Daniel Gulko
Thanks David. This has been helpful in understanding a bit more on how parameters are passed through. > Date: Thu, 18 Oct 2012 04:44:55 -0400 > Subject: Re: [Tutor] Help Passing Variables > From: dwightdhu...@gmail.com > To: dangu...@hotmail.com > CC: tutor@python.org >

Re: [Tutor] Help Passing Variables

2012-10-18 Thread Dave Angel
On 10/18/2012 03:08 AM, Daniel Gulko wrote: > > > > Hi Python Tutor, I have a write a simple function named > "SwapCaseAndCenter(a_string, width). So why did you define it with only one formal parameter? > The idea is to use the function swapcase and center so that when the > userenters a stri

Re: [Tutor] Help Passing Variables

2012-10-18 Thread Alan Gauld
On 18/10/12 08:08, Daniel Gulko wrote: The function calls for passing in two variables "a_string, width" but I am still confused on this concept. You just provide the list of input parameters when you define the function: >>> def add(x,y): ... return x+y ... >>> add(4,5) 9 I define add to t

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-03 Thread Cecilia Chavana-Bryant
Got it, many thanks for your help. On Tue, Oct 2, 2012 at 7:59 PM, Oscar Benjamin wrote: > Hi Cecilia, I'm sending this again as the first message was sent only > to you (I hadn't realised that your own message was sent only to me as > well). If you want to reply please reply-all to this message.

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-02 Thread Oscar Benjamin
Hi Cecilia, I'm sending this again as the first message was sent only to you (I hadn't realised that your own message was sent only to me as well). If you want to reply please reply-all to this message. On 1 October 2012 17:42, Cecilia Chavana-Bryant wrote: > On Mon, Oct 1, 2012 at 11:02 AM, Osca

Re: [Tutor] HELP!

2012-10-01 Thread Brian van den Broek
On 1 Oct 2012 19:58, "Mark Rourke" wrote: > > hello, I am a college student in my first year of computer programming, I was > wondering if you could look at my code to see whats wrong with it. > > # Mark Rourke > # Sept 29, 2012 > # Write a program to calculate the sales tax at the rate of 4% and

Re: [Tutor] HELP!

2012-10-01 Thread c smith
Is the only problem that your code is giving unexpected results, or that it doesnt run or what? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-01 Thread Cecilia Chavana-Bryant
On Mon, Oct 1, 2012 at 1:16 AM, Dave Angel wrote: > On 09/30/2012 06:07 PM, Cecilia Chavana-Bryant wrote: > > Hola again Python Tutor! > > > > With a friend's help I have the following code to extract reflectance > data > > from an ASCII data file, do a bit of data manipulation to calibrate the >

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-01 Thread Cecilia Chavana-Bryant
On Mon, Oct 1, 2012 at 12:33 AM, Alan Gauld wrote: > On 30/09/12 23:07, Cecilia Chavana-Bryant wrote: > >> Hola again Python Tutor! >> >> With a friend's help I have the following code to extract reflectance >> data from an ASCII data file, do a bit of data manipulation to calibrate >> the data an

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-01 Thread Oscar Benjamin
On Sep 30, 2012 11:10 PM, "Cecilia Chavana-Bryant" wrote: > > Hola again Python Tutor! Hi Cecilia > > With a friend's help I have the following code to extract reflectance data > from an ASCII data file, do a bit of data manipulation to calibrate the data > and then write the calibrated file i

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-09-30 Thread Dave Angel
On 09/30/2012 06:07 PM, Cecilia Chavana-Bryant wrote: > Hola again Python Tutor! > > With a friend's help I have the following code to extract reflectance data > from an ASCII data file, do a bit of data manipulation to calibrate the > data and then write the calibrated file into an out file. > > i

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-09-30 Thread Alan Gauld
On 30/09/12 23:07, Cecilia Chavana-Bryant wrote: Hola again Python Tutor! With a friend's help I have the following code to extract reflectance data from an ASCII data file, do a bit of data manipulation to calibrate the data and then write the calibrated file into an out file. I have succ

Re: [Tutor] Help

2012-09-23 Thread Alan Gauld
On 21/09/12 15:33, Prasad, Ramit wrote: Steven D'Aprano wrote: On 21/09/12 08:54, Prasad, Ramit wrote: People on this list are not all receiving this via email. They're not? How else can you receive this? Unlike the main python-list, this isn't (as far as I know) mirrored on Usenet. I wonder

Re: [Tutor] Help

2012-09-22 Thread eryksun
On Sat, Sep 22, 2012 at 5:13 AM, Dwight Hutto wrote: > > I'd say youtube, but you couldn't copy and paste from the video, just > look at the errors outputed, and a good long video of the code. OK, but please don't make a video and basically grunt like Animal from the Muppet Show: see code! see co

Re: [Tutor] Help

2012-09-22 Thread Dwight Hutto
>> It's tricky. >> >> Ideally, you need to take your large code base, and reduce it into a >> short piece of sample code that is runnable and reproduces your issue. > > > +1 on this. > > There is no good answer. Speaking for myself, I would prefer that you > attach the file to your email. But

Re: [Tutor] Help

2012-09-21 Thread eryksun
On Fri, Sep 21, 2012 at 2:46 PM, Brett Dailey wrote: > > It just needs to be scaled to fit into each tile. You can just use one of your > choice as a place holder for now and I'll just put my own in later. I wrote up a version last night. Here's an image of the output: http://i.imgur.com/h4Wcd.p

Re: [Tutor] Help

2012-09-21 Thread Steven D'Aprano
On 22/09/12 01:18, Jerry Hill wrote: On Fri, Sep 21, 2012 at 10:33 AM, Prasad, Ramit wrote: Ironically, that describes me. So what is the preference for large code samples? Just always include it? What about for the main list? It's tricky. Ideally, you need to take your large code base, and

Re: [Tutor] Help

2012-09-21 Thread Jerry Hill
On Fri, Sep 21, 2012 at 10:33 AM, Prasad, Ramit wrote: > Ironically, that describes me. So what is the preference for large > code samples? Just always include it? What about for the main list? It's tricky. Ideally, you need to take your large code base, and reduce it into a short piece of sampl

Re: [Tutor] Help

2012-09-21 Thread Prasad, Ramit
Steven D'Aprano wrote: > On 21/09/12 08:54, Prasad, Ramit wrote: > > People on this list are not all receiving this via email. > > > They're not? How else can you receive this? Unlike the main python-list, > this isn't (as far as I know) mirrored on Usenet. > > I wonder under what circumstances

Re: [Tutor] Help

2012-09-20 Thread Steven D'Aprano
On 21/09/12 08:54, Prasad, Ramit wrote: People on this list are not all receiving this via email. They're not? How else can you receive this? Unlike the main python-list, this isn't (as far as I know) mirrored on Usenet. I wonder under what circumstances people could read this email without s

Re: [Tutor] Help

2012-09-20 Thread eryksun
On Thu, Sep 20, 2012 at 6:31 PM, Brett Dailey wrote: > > From this, create a checkboard pattern which evenly fills the window. On > approximately 10% of the squares (chosen at random) draw an image which is > sized to just fit inside a checkboard square (use the smallest dimension). > Keep the pro

Re: [Tutor] Help

2012-09-20 Thread Prasad, Ramit
People on this list are not all receiving this via email. It is recommended that you post 1. plain text (instead of Rich Text or HTML) 2. Just include the code directly in the email if it is short (which this is) or post to a website like pastebin for large samples. I have included the code below

Re: [Tutor] Help - My First Program Fails

2012-09-10 Thread Steven D'Aprano
On 10/09/12 19:40, tayo rotimi wrote: Hi Steven. Thank you for your answer below. The program now runs, using print("Game Over"). I use Python 3..; but the book - python for absolute beginner - that I have is an old (2003) edition. I don't know how this combination may affect my learning, goin

Re: [Tutor] Help - My First Program Fails

2012-09-10 Thread tayo rotimi
Hi Steven. Thank you for your answer below. The program now runs, using print("Game Over"). I use Python 3..; but the book - python for absolute beginner - that I have is an old (2003) edition. I don't know how this combination may affect my learning, going forward. Could you please suggest

Re: [Tutor] Help - My First Program Fails

2012-09-09 Thread Steven D'Aprano
Please, please, PLEASE do not reply to a digest without deleting the irrelevant text from your email! We don't need to read HUNDREDS of lines of text we've already seen before. When you want to start a *new* question, ALWAYS start a fresh, blank email, set the "To" address to tutor@python.org,

Re: [Tutor] Help with class in class

2012-09-09 Thread Dave Angel
On 09/09/2012 04:56 PM, leam hall wrote: > self.blue = Button(root, text="Blue", > command=self.change_text_color("blue")) > self.blue.pack(side=LEFT) > self.green = Button(root, text="Green", > command=self.change_text_color("green")) > self.green.pack(side=LEFT) > > To follow up,

Re: [Tutor] Help with class in class

2012-09-09 Thread leam hall
self.blue = Button(root, text="Blue", command=self.change_text_color("blue")) self.blue.pack(side=LEFT) self.green = Button(root, text="Green", command=self.change_text_color("green")) self.green.pack(side=LEFT) To follow up, I've added a second button. Of course, it doesn't work,

Re: [Tutor] Help with class in class

2012-09-09 Thread leam hall
On Sun, Sep 9, 2012 at 12:12 PM, Peter Otten <__pete...@web.de> wrote: > the above will no longer complain about a missing attribute. > > > root = Tk() > > project = ch8_Project(master=root) > > project.mainloop() > > > Another problem that caught my attention: > > > self.green = Button(root,

Re: [Tutor] Help with class in class

2012-09-09 Thread Peter Otten
leam hall wrote: > I'm in the O'Reilly Python 2 class, so pointers to learning would be > better than just answers, please. My brain is a bit slow but needs to go > forward. > > Line 16 calls line 31. Rather, it is supposed to. I'm trying to figure out > why I get > > File "./ch8_project.py",

Re: [Tutor] Help with class in class

2012-09-09 Thread Kwpolska
On Sun, Sep 9, 2012 at 5:43 PM, leam hall wrote: > Of course, showing the code might help... > > http://bpaste.net/show/44593/ > > Thanks! > > Leam > > > On Sun, Sep 9, 2012 at 10:42 AM, leam hall wrote: >> >> I'm in the O'Reilly Python 2 class, so pointers to learning would be >> better than ju

Re: [Tutor] Help with class in class

2012-09-09 Thread leam hall
Of course, showing the code might help... http://bpaste.net/show/44593/ Thanks! Leam On Sun, Sep 9, 2012 at 10:42 AM, leam hall wrote: > I'm in the O'Reilly Python 2 class, so pointers to learning would be > better than just answers, please. My brain is a bit slow but needs to go > forward.

Re: [Tutor] Help

2012-09-06 Thread Mark Lawrence
On 03/09/2012 15:39, Jack Little wrote: Ok, I am somewhat new to python, and I am making a text-based RPG. I get a weird error with this code: [snip] Thanks, Jack Little Further to the sound advice you've already been given a rather more informative subject line would have been helpfu

Re: [Tutor] Help

2012-09-06 Thread Walter Prins
Hi Ian, On 4 September 2012 20:36, Ian o donovan wrote: > Hey, I am writing this to you because I want to know could you help. > My school is doing enterprise and I want to enter. What do you mean your school is "doing enterprise"? Is it some competition or something? > I really want to > make

Re: [Tutor] Help

2012-09-06 Thread Alan Gauld
On 06/09/12 09:35, Ray Jones wrote: #A Python text-RPG #A Jak Production #APOC global ammo You use global inside a function not outside. All variables declared at the module level are global by definition. ammo=55 This sets the global ammo value def part1(): if answer == "SHOW" or

Re: [Tutor] help me decide

2012-09-06 Thread Matthew Ngaha
hey guys i just like to thank everyone for their input. Its really helped me in deciding a lot of things. also @ Alan i think? as ive started writing this mail it won;t let me look up previous senders but thanks for your input. Also your field of work sounds very interesting indeed. I can't dare to

Re: [Tutor] Help

2012-09-06 Thread Dave Angel
On 09/03/2012 10:39 AM, Jack Little wrote: >> Ok, I am somewhat new to python, and I am making a text-based RPG. I get a >> weird error with this code: >> >> >> #A Python text-RPG >> #A Jak Production >> #APOC >> global ammo >> global health >> global lives >> global exp >> global food >> ammo=55 >

Re: [Tutor] Help

2012-09-06 Thread Ray Jones
On 09/03/2012 07:39 AM, Jack Little wrote: > > Ok, I am somewhat new to python, and I am making a text-based RPG. I get a > > weird error with this code: > > > > > > #A Python text-RPG > > #A Jak Production > > #APOC > > global ammo > > global health > > global lives > > global exp > > global food

Re: [Tutor] help me decide

2012-09-05 Thread Wayne Werner
On Tue, 4 Sep 2012, Matthew Ngaha wrote: a) IF you happen to have used both, which one fills you with joy and is more fun for you to program with, GUI programming, or web related / Framework programming? Honestly - both. It's really a highly subjective question and depends what you want to do

Re: [Tutor] help me decide

2012-09-05 Thread Dwight Hutto
No matter what the kit used for GUI, make sure it's well documented, and has plenty of tuts/docs. I used tkinter, and wxpython, and like the widget set/cross OS usages in wxpython better. However, with more experience, now I'm moving toward the Blender Game Engine to give more feel, and a 3-d pop

Re: [Tutor] help me decide

2012-09-05 Thread Steve Willoughby
On 05-Sep-12 10:40, Alan Gauld wrote: On 05/09/12 11:04, Matthew Ngaha wrote: also please could you tell me why you suggest wxPython over GTK? Support, there are probably more beginner friendly resources for wxPython than for GTk, although that is changing. Yeah, and wxPython is a large, co

Re: [Tutor] help me decide

2012-09-05 Thread Alan Gauld
On 05/09/12 11:04, Matthew Ngaha wrote: also please could you tell me why you suggest wxPython over GTK? Support, there are probably more beginner friendly resources for wxPython than for GTk, although that is changing. that wxPython is the easiet to pick up yet a lot more complete than Tk

Re: [Tutor] help me decide

2012-09-05 Thread Prasad, Ramit
From: Matthew Ngaha [snip] > i feel confident using Python now but im still not > sure which direction i want to go in. I would at some point like to > learn how to use GUIs and a web Framework(Django). But i don't know > which of the 2 to start out with. > > a) IF you happen to have used both, wh

Re: [Tutor] help me decide

2012-09-05 Thread Matthew Ngaha
Hi Alan thanks so much for your helpful answers. > probably wxPython or GTk > But if you want to get serious about GUIs I'd probably suggest wxPython > instead - it ultimately is more powerful and complete and if you are only > just starting will be easy to learn whereas learning Tkinter and conv

Re: [Tutor] help me decide

2012-09-04 Thread Matthew Ngaha
hey you didnt read my question:( i dont enjoy either because i have no experience with them. so im asking questions about peoples personal experiences with the 2 areas which can give me further information to research on. ___ Tutor maillist - Tutor@pyth

Re: [Tutor] help me decide

2012-09-04 Thread Matthew Ngaha
sorry wrong i didnt send mail right. hey i didnt explain it properly, i wasn't asking what language to use or learn. I am only going to be using Python. I meant whic area to study on 1st, GUI programing e.g Tkinter or Programming with a web framwork e.g Django. _

Re: [Tutor] help me decide

2012-09-04 Thread leam hall
Matthew, Program what is fun for you. I prefer PHP for web work but I'm learning Python for my day job. Python provides a wider range of abilities but PHP is more "fun" for me. If Python GUIs are fun, then do that. The more you enjoy the topic the more reason you will have to learn more and more.

Re: [Tutor] Help : File formatting

2012-08-23 Thread Alan Gauld
On 23/08/12 07:12, rahool shelke wrote: I want to take the list of files present in packages. On AIX we get the files list present in packges using command "lslpp -f ". Can you provide a short example of the output format from lslpp? Now i want to format output of above command such that onl

Re: [Tutor] help--- opening csv in different functions

2012-08-10 Thread Alan Gauld
On 10/08/12 11:02, leon zaat wrote: I am trying to fill a file. I assume you mean create a file? Or overwrite an existing one? Or append to an existing one. There isn't really a concept of filling a file, they just keep getting bigger until you ruin out of space. (There are some filesystems th

Re: [Tutor] help--- opening csv in different functions

2012-08-10 Thread Dave Angel
On 08/10/2012 06:02 AM, leon zaat wrote: > I am trying to fill a file. > When i am start the leading fuction the file schould be overwriting the , > probarly, existing csv file. > Accoording from keys from different keys in my sql files, information is > collected and written in a other function

Re: [Tutor] help -Global name xxxxxxxx is not definied.

2012-08-09 Thread Alan Gauld
On 09/08/12 13:20, leon zaat wrote: When i run the program i got the following message: NameError: global name 'schrijfExportRecord' is not found What I am doing wrong and how can i fix it? Looks like you found the problem in this case but for future reference... Please, always post the enti

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