[Tutor] Writing for loop output to csv

2018-09-06 Thread Brandon Creech
Hi, I am working to forecast the temperatures for the next 5 days using an API and a for loop. I would like write the output of this loop to a csv in this format:: Columns: City, min1, max1, min2, max2,min3,max3,min4,max4,min5,max5 data: Athens,Greece 25.4,26.7etc. Nan

Re: [Tutor] Python3 Help

2017-07-24 Thread Brandon Anderson
Success! Thank you, Danny! Mission accomplished. -Brandon Sent from my iPhone On Jul 23, 2017, at 5:44 PM, Danny Yoo wrote: >> 2. I’m trying to locate the directory path to where Python3 is located on >> my system, but when I enter >>the following command: &

[Tutor] Python3 Help

2017-07-23 Thread Brandon Anderson
on3. I need the location in order to setup my Text Editor to execute Python3 commands. Thank you in advance. Brandon Anderson (510) 468-0154 brandonander...@icloud.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] inserting path to open a file from a variable

2015-05-29 Thread Brandon McCaig
ace('rdfile:',"",1) > wrt1 = wrt.replace('wrtfile:',"",1) import os.path import sys for x in [(rd1, 'Source file', 'rdfile'), (wrt1, 'Destination file', 'wrtfile')]: if not os.path.isabs(x[0]): print

Re: [Tutor] key detection

2015-05-22 Thread Brandon McCaig
ks, but if you take a few minutes to configure it then it sucks considerably less. Add clink to make it suck a bit less still. HTH. Regards, -- Brandon McCaig Castopulence Software <https://www.castopulence.org/> Blog <http://www.bambams.ca/> perl -E '$_=q{V zrna gur orfg jvgu

Re: [Tutor] Object references and garbage collection confusion

2015-05-07 Thread Brandon D
> > This is what was also confusing as well. I assumed that python stored > objects rather than simply assigning them. > On Tue, May 5, 2015 at 4:48 AM, Alan Gauld wrote: > On 05/05/15 05:29, Brandon D wrote: > >> Hello tutors, >> >> I'm having trou

Re: [Tutor] Object references and garbage collection confusion

2015-05-07 Thread Brandon D
Thanks Steven. I was just confused on the execution of when Python destroys objects that are no long bound or referenced. On Tue, May 5, 2015 at 2:00 PM, Steven D'Aprano wrote: > On Tue, May 05, 2015 at 12:29:59AM -0400, Brandon D wrote: > > Hello tutors, > > &g

[Tutor] Object references and garbage collection confusion

2015-05-05 Thread Brandon D
Hello tutors, I'm having trouble understanding, as well as visualizing, how object references work in the following situation. For demonstration purposes I will keep it at the most rudimentary level: x = 10 x = x ** x If my knowledge serves me correctly, Python destroys the value once reassign

Re: [Tutor] multiple objects with one assignment?

2015-01-02 Thread Brandon Dorsey
On Fri, Jan 2, 2015 at 6:08 AM, Ben Finney wrote: > Does it help you to understand if I clarify that a tuple is one value? > That a list is one value? That a dict is one value? > Well I knew that those data structures represent one value that can hold "x" amount of objects, but what I didn't rea

Re: [Tutor] multiple objects with one assignment?

2015-01-02 Thread Brandon Dorsey
On Fri, Jan 2, 2015 at 6:27 AM, Dave Angel wrote: Ben's description is very good. But I think the main thing you're missing > is that a tuple is created by the comma, not by parentheses. In some > contexts, parentheses need to be added to make it non-ambiguous, since > comma is overloaded. Th

Re: [Tutor] multiple objects with one assignment?

2015-01-02 Thread Brandon Dorsey
On Fri, Jan 2, 2015 at 6:34 AM, Steven D'Aprano wrote: > The thing to remember is that *commas*, not parentheses, are used for > making tuples. The round brackets are just for grouping. > That's what I was confused about. I didn't realize commas defined tuples, not parentheses. Is this the cas

[Tutor] multiple objects with one assignment?

2015-01-02 Thread Brandon Dorsey
I know there is are easier ways to assign multiple objects to a variable, but why, does the following code work? Why does it return a tuple versus a list? I know it has something to do with the semi-colon, but I didn't know it wouldn't raise an error. greetings = "hello,", "what's", "your", "na

Re: [Tutor] Learning to program, not code.

2014-12-21 Thread Brandon Dorsey
a tendency to over analyze everything, and with > programming - as we all know - there are a million ways to accomplish the > same task. > On Fri, Dec 19, 2014 at 8:06 AM, Dave Angel wrote: > On 12/18/2014 09:09 PM, Brandon Dorsey wrote: > >> Hello All, >> >> Pro

[Tutor] Learning to program, not code.

2014-12-19 Thread Brandon Dorsey
Hello All, Programming has always been a passion of mine, however, I'm frequently frustrated at simple fact that I've been learning python for 8 months, and I have yet to start, and finish, a simple project. I find difficult to not only visualize the execution, but to figure out when and where

[Tutor] Are These Resources Good Enough To Learn Python 3?

2014-06-18 Thread Brandon Price
Hi, I'm new to programming and I've tried to learn in the past but I gave up easily. I tried learning Java but I feel that Python would be the best route to take since it's easier to learn and then I'll move on to learning Java. I want to learn Python 3.x not Python 2. My goal(s) are: Learn Python

Re: [Tutor] how run it on python 3 (S Tareq)

2014-01-20 Thread Brandon Gardell
he mailing list information and rules. Brandon ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help

2013-02-01 Thread Brandon
You get the error because you call path1pt1() before it is defined. Define your path1pt1() method at the top of your code before simpstart(). Brandon On Fri, Feb 1, 2013 at 5:47 PM, Jack Little wrote: > I get this error > > Traceback (most recent call last): > File "C:\U

Re: [Tutor] Tutor Digest, Vol 106, Issue 74

2013-01-01 Thread Brandon Merritt
s I am really trying hard to become a passable Python programmer. I've been working at it for 6 month now, and I don't know any other languages: http://www.cse.msu.edu/~cse231/PracticeOfComputingUsingPython/02_Control/LatinSquares/Project03.pdf Thank you, Brandon On Mon, Dec 31, 20

[Tutor] another for loop question - latin square

2012-12-30 Thread Brandon Merritt
loop work by doing something like this: for i in firstrow: print i, i+2 but that obviously is not a solution either. Any ideas? Thanks, Brandon ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail

[Tutor] still confused about for loops

2012-12-18 Thread Brandon Merritt
Sorry, I am just so confused and aggravated as to why this won't work - why doesn't it print out the whole list? : number = raw_input('Enter a 7-unit number: ') for i in number: count = [] count.append(i) print count >>> Enter a 7-unit number: 7895329

[Tutor] need help with python for counter

2012-12-18 Thread Brandon Merritt
t += 1 else: count = 0 print count Thanks, Brandon -- *Brandon Merritt** (707) 481-1744* * * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Questions about classes

2012-11-12 Thread brandon w
written like this?: class HumanBeing: def makeName(self, name): * name = self.name* * * 2. Why use a class in the first place? What is the purpose of constructing a class instead of just writing a program with a bunch of functions? Thanks, Brandon

Re: [Tutor] Python using RXVT vs Konsole?

2012-03-10 Thread brandon w
to remove characters from the current line. http://pytut.infogami.com/node4.html konsole somehow disabled command line editing. On Fri, Mar 9, 2012 at 3:49 AM, Alan Gauld wrote: > On 09/03/12 02:07, brandon w wrote: > > I am able to up-arrow to get the last typed command using rxvt bu

Re: [Tutor] Python using RXVT vs Konsole?

2012-03-08 Thread brandon w
I am using fluxbox an a window manager not KDE. That may have something to do with it. I will ask in another forum. Running: >>> import readline in both terminals succeded. Thank you for your help. Brandon On Thu, Mar 8, 2012 at 9:58 PM, Steven D'Aprano wrote: > On Thu, M

[Tutor] Python using RXVT vs Konsole?

2012-03-08 Thread brandon w
the up-arrow in all terminals so I don't have to type as much. Python os: 2.6.6 OS: Slackware 13.37 Brandon ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to hide cursor in Terminal?

2012-02-17 Thread brandon w
help! Now I'll have to see if I can get the same thing working on a Windows machine. Brandon On Fri, Feb 17, 2012 at 2:00 PM, Alan Gauld wrote: > On 17/02/12 11:38, brandon w wrote: > >> I made a timer that counts down from five minutes. This code runs fine >> but

[Tutor] How to hide cursor in Terminal?

2012-02-17 Thread brandon w
seconds = 59 five_minutes += 1 time.sleep(1) countd() Brandon ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to Capture a key being pressed?

2012-01-04 Thread brandon w
How do I capture a key like the bar or the key? Is there anything that comes in the default Python2.6.6 installation? I have found something called "termios" doing a search. Should I just use Pygame? I would like it to go cross platform if possible

Re: [Tutor] My code works but it is a little bit broken.

2011-09-27 Thread brandon w
That was my problem. I had the "insert" function. I don't know why I did not see that before or why I even put that in there. Thank you for your help once again. On Tue, Sep 27, 2011 at 6:43 AM, Alan Gauld wrote: > On 27/09/11 02:32, brandon w wrote: > >> The fields

Re: [Tutor] My code works but it is a little bit broken.

2011-09-26 Thread brandon w
at 4:03 AM, Alan Gauld wrote: > On 26/09/11 03:25, brandon w wrote: > >> This code calculates money. The problem is that in the first field after >> the mouse enters a second time updates itself with the value from the >> last field. I don't want it to do that. >>

[Tutor] My code works but it is a little bit broken.

2011-09-25 Thread brandon w
This code calculates money. The problem is that in the first field after the mouse enters a second time updates itself with the value from the last field. I don't want it to do that. I think that the problem is in the "callback" method. #!/usr/bin/python from Tkinter import * root = Tk() root.t

Re: [Tutor] Tkinter Entry field text

2011-09-10 Thread brandon w
On 09/10/2011 10:16 AM, Wayne Werner wrote: On Thu, Sep 8, 2011 at 9:31 PM, brandon w <mailto:thisisonlyat...@gmx.com>> wrote: How do you display text in a Entry field and have it disappear when a person clicks in it? To get text into this box the person must first de

[Tutor] Tkinter Entry field text

2011-09-08 Thread brandon w
How do you display text in a Entry field and have it disappear when a person clicks in it? This is what I have so far: from Tkinter import * root = Tk() root.title("Password Changer") root.geometry("300x300+600+250") label1 = Label(root, text="Enter you password: ") label1.grid(sticky=W, row

Re: [Tutor] Tkinter: Deleting text when clicking in field.

2011-08-20 Thread brandon w
On 08/20/2011 07:11 PM, Alan Gauld wrote: On 20/08/11 20:12, brandon w wrote: I worked on this for a long time. I did many searches to fix the many error messages I was getting and I finally got this to work. I would now just like to have the text disappear when a person clicks in the box to

[Tutor] Tkinter: Deleting text when clicking in field.

2011-08-20 Thread brandon w
I worked on this for a long time. I did many searches to fix the many error messages I was getting and I finally got this to work. I would now just like to have the text disappear when a person clicks in the box to type something. How can I do that? (This is just a sample of the whole program.

Re: [Tutor] Printing in the same place

2011-08-17 Thread brandon w
On 08/17/2011 04:02 AM, Alan Gauld wrote: On 17/08/11 04:05, brandon w wrote: I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This is not a tkinter program so its completely irrelevant to your stated aim. In tkinter

[Tutor] Printing in the same place

2011-08-16 Thread brandon w
I am trying to print in the same place to make a clock in a tkinter window. I will loop the following code to update the time. This seems to work but it is not printing in the same place: #!/usr/bin/python #Python 2.6.6 import time for t in range(5): digits = time.strftime('%H:%M:%S')

Re: [Tutor] Tkinter: no module named messagebox (brandon w)

2011-08-16 Thread brandon w
On 08/14/2011 11:14 AM, Alan Gauld wrote: On 14/08/11 14:07, Wayne Werner wrote: Of course I personally I usually do import Tkinter as tk Which means I only have to type 3 extra characters, but it removes any ambiguity - tk.Something had to come from Tkinter Thats exactly what I tend to do n

Re: [Tutor] Tkinter: no module named messagebox (brandon w)

2011-08-16 Thread brandon w
On 08/14/2011 03:10 AM, Robert Sjoblom wrote: I have tried to follow the tutorial I found here: Python 2.7 Tutorial http://www.youtube.com/watch?v=uh6AdDX7K7U This is what I have done so far: #!/usr/bin/python from Tkinter import * import Tkinter.MessageBox I figured I might as well, g

Re: [Tutor] Tkinter: no module named messagebox

2011-08-16 Thread brandon w
On 08/14/2011 02:29 AM, Peter Otten wrote: brandon w wrote: On 08/13/2011 04:49 PM, Peter Otten wrote: How do I find the modules in Tkinter? The simplest approach is probably to explore your file system: Step 1: where's Tkinter? $ python -c 'import T

Re: [Tutor] python

2011-08-14 Thread brandon w
On 08/14/2011 09:04 AM, je.rees e-mail wrote: I have made a small program but I would like to know how to write or. There is multiple choice answer. Good=raw_input("Good to hear") ok=raw_input("Good good") Bad=raw_input("Oh dear") I would only like the person using the program to be able to pick

[Tutor] tkinter.TclError

2011-08-13 Thread brandon w
Here is the code: #!/usr/bin/python from Tkinter import * from tkMessageBox import * def iClicked(): radioValue = relStatus.get() tkMessageBox.showinfo("You clicked", radioValue) return def chLabel(): name = "Thank you for clicking me. " + your_name.get() labelText.set(name

Re: [Tutor] Tkinter: no module named messagebox

2011-08-13 Thread brandon w
On 08/13/2011 04:49 PM, Peter Otten wrote: brandon w wrote: I have tried to follow the tutorial I found here: Python 2.7 Tutorial http://www.youtube.com/watch?v=uh6AdDX7K7U This is what I have done so far: #!/usr/bin/python from Tkinter import * import Tkinter.MessageBox myapp = Tk

Re: [Tutor] Python

2011-08-13 Thread brandon w
On 08/13/2011 05:56 PM, Jon wrote: Could you link me to some beginners tutorials/idle codes thank you. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor Check out so

Re: [Tutor] Tkinter: no module named messagebox

2011-08-13 Thread brandon w
On 08/13/2011 04:49 PM, Peter Otten wrote: `python -c 'import Tkinter, os; print os.path.dirname(Tkinter.__file__)'` Thanks dude. That is some really useful information. That will help me for future coding. I found that I needed to use "from tkMessageBox import *" to get it to work. ___

[Tutor] Tkinter: no module named messagebox

2011-08-13 Thread brandon w
I have tried to follow the tutorial I found here: Python 2.7 Tutorial http://www.youtube.com/watch?v=uh6AdDX7K7U This is what I have done so far: #!/usr/bin/python from Tkinter import * import Tkinter.MessageBox myapp = Tk() myapp.title("This is the gui title") myapp.geometry("500x500+600+600

Re: [Tutor] When to use def __init__ when making a class?

2011-08-03 Thread brandon w
On 08/02/2011 09:25 PM, Steven D'Aprano wrote: brandon w wrote: I have two questions: 1) When should I use "def __init__(self):" when I create a class? Whenever you need something to happen when you create an instance. 2) Would these two classes have the same effect?

Re: [Tutor] When to use def __init__ when making a class?

2011-08-03 Thread brandon w
On 08/02/2011 09:09 PM, Brett Ritter wrote: On Tue, Aug 2, 2011 at 8:47 PM, brandon w wrote: 1) When should I use "def __init__(self):" when I create a class? When you have any initialization to do. (in other words, when you want class instantiation to do more than simpl

[Tutor] When to use def __init__ when making a class?

2011-08-02 Thread brandon w
I have two questions: 1) When should I use "def __init__(self):" when I create a class? 2) Would these two classes have the same effect? class Name: def __init__(self): man = Marcus woman = Jasmine return self.man, self.woman class Na

Re: [Tutor] Running Python in script vs. Idle

2011-07-24 Thread brandon w
On 07/24/2011 07:59 PM, Steven D'Aprano wrote: brandon w wrote: Thank you. I understand that this ( x = 1+2 ) assigns a variable to "x" and will not print in Idle, but how would I get the 'class' that I created to run from the script like it does in Idle? Will I

[Tutor] Running Python in script vs. Idle

2011-07-24 Thread brandon w
utput. I have to add print. to get any output like this: #!/usr/bin/python class ExClass: eyes = "brown" age = 99 height = '5\'11' def thisMethod(self): return 'This method works.' x = ExClass() x.eyes x.age x.height x.thisMethod()

[Tutor] NameError: is defined

2011-07-19 Thread brandon w
Hi I am running Linux with Python 2.6.6. I have done lists, tuples, dictionaries, etc. Now I want to move on to creating a "class". I keep getting an error for everything I try. Here is the error: * NameError: name 'MyClass' is not defined* I had originally tried to create my own class by wat

[Tutor] Dividing 1 by another number ?

2005-01-30 Thread Brandon
I'm trying to write a program they may involve needing to divide 1 by another number. In the program below when I use 4 for the diameter of the bore, and 1 for the diameter of the rod, and 60 for the PSI, the  force should be 706.8 . However the program keeps giving me 0 for "rodarea". If I