[Tutor] help, thanks very much.

2008-01-15 Thread bill.wu
i am new guy. i ask a easy question. why the first one have"x",the second one doesn't have "x". what is different? when write "x",when don't write "x". in my point,the second one don't def variable. (1) def func(x): print 'x is', x x = 2 print 'Changed local x to', x x = 50 func

[Tutor] help beginner in python.

2008-02-24 Thread Krystle Scott
i need to write an algorithm for computing square roots. so far I have import math def main (): print " This program computes approximate square roots using Newton's method: " print input = (" Enter whose square root you wish to compute (a) : ") input = (" Enter the number

Re: [Tutor] help with slice

2008-03-04 Thread Andreas Kostyrka
What you probably want is: [elem_list[2] for elem_list in List] If you are not sure that the list have at least three elements, you can use something like this: [(elem_list + [None, None, None])[2] for elem_list in List] Which will use None as a default value. Andreas Am Dienstag, den 04.03.2

Re: [Tutor] help with slice

2008-03-04 Thread Ole Henning Jensen
> Could someone please explain 'slices' also for dictionaries? > > basically, I'd like to know how you would call every 3rd element in a list > of lists... > > My logic says: ThirdElems=List[:][2] > What this does is, just assign the 3 value of List to the variable. look at this way, step by st

Re: [Tutor] help with slice

2008-03-04 Thread bob gailer
washakie wrote: > Could someone please explain 'slices' also for dictionaries? > > basically, I'd like to know how you would call every 3rd element in a list > of lists... > > My logic says: ThirdElems=List[:][2] > > Which to me reads, for every item in List (which are lists), return the > third i

Re: [Tutor] help with slice

2008-03-04 Thread bob gailer
bob gailer wrote: > washakie wrote: > >> Could someone please explain 'slices' also for dictionaries? >> >> basically, I'd like to know how you would call every 3rd element in a list >> of lists... >> Call? Do you mean that these elements are callable objects (e.g. functions) which you wa

Re: [Tutor] help with slice

2008-03-04 Thread Alan Gauld
"washakie" <[EMAIL PROTECTED]> wrote > Could someone please explain 'slices' also for dictionaries? So far as I know slices don;t work for dictionaries directly - dictionaries don't have the concept of order. However you could get a list of keys and apply a slice to that, although I'm not sure

Re: [Tutor] help with slice

2008-03-04 Thread Alan Gauld
"Ole Henning Jensen" <[EMAIL PROTECTED]> wrote > What you need to do is loop all the way through your list and then > only > do something to every third element in the list That's not quite what the OP asked for, he wanted the third element from every sublist in the master list > This is an exa

[Tutor] Help with a loop

2008-03-18 Thread PyProg PyProg
Hello, I have a little problem, I have two lists: >>> a=[1, 2, 3, 4, 5, 6] >>> b=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] ... and I want to obtain: >>> [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 1), ('h', 2), ('i', 3), ('j', 4)] I want to obtain that with a co

Re: [Tutor] Help this newbie

2008-03-20 Thread tiger12506
;import filename" at the top of a script which is supposed to use your module. - Original Message - From: Elliot Silvers To: tutor@python.org Sent: Thursday, March 20, 2008 9:21 PM Subject: [Tutor] Help this newbie I am as new as you can get to Python. I have just learned h

Re: [Tutor] Help this newbie

2008-03-21 Thread Alan Gauld
"Elliot Silvers" <[EMAIL PROTECTED]> wrote > I am as new as you can get to Python. I have just learned > how to save my work (very simple work of course). > I created a folder on C:\ (in this case C:\Elliot) for my work. > I am able to use the cmd prompt to run it Congratulations. You should

[Tutor] Help with input/output

2008-03-25 Thread Olexander
Hello, please could you help me with input processing for olympiad problems. For example, what would be the code for input and output of this problem: Input The input file contains several test cases. The first line of each test case contains two integers A and D separated by a single space ind

Re: [Tutor] help with slice

2008-04-02 Thread John
Thanks all for the posts, I guess I'm thinking in 'matrices' and in a matlab syntax. So I was trying to get the third element of a list of lists, or lists in a dictionay in syntax like matlab (yes, I should be using numpy or scipy). Anyway, Alan's final suggestion (and everyone else's) has helped

[Tutor] Help with tutor@python.org

2008-04-16 Thread bob gailer
I just changed my email address. Now when I post to tutor@python.org the posts do not show up. I have checked the mailman settings; they look OK. Have you any guidance? Did this post show up on the list? -- Bob Gailer 919-636-4239 Chapel Hill, NC __

[Tutor] Help with Recurring Function

2008-04-25 Thread Sanhita Mallick
Hi. I am struggling with a simple recurring function, but can't understand why this is happening. Please help. Here is the script. T(i) are trees (as in graphs). The program operates great, until the step where norm_ted is calculated. Mysteriously norm_ted becomes 0, even though "mag" value is ca

[Tutor] Help with class.self variables

2008-05-14 Thread Mark
im trying to create a class user so that i can do r=User(1) r._user.keys() ['rating', 'last_name', 'pageviews', 'ip', 'number_polls', 'site', 'myrand', 'hotmail', 'number_activities', 'skype', 'id', 'city', 'rawpassword', 'number_useraudios', 'zip', 'number_votes', 'last_login', 'number_u

[Tutor] help for building tui?

2008-07-03 Thread Dong Li
Hi, everyone If I want to create a text user interface for my application, is there any existed module to facilitate such building? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] help with sorted()

2008-08-17 Thread Kent Johnson
On 8/17/08, Rick Pasotto <[EMAIL PROTECTED]> wrote: > I have a dictionary that looks like: d = {k:[v1,[v2,v3,v4]]} > > v1,v2,v3,v4 are integers. > > I want to print the dictionary sorted by v1, high to low. Do you want just the keys, or the key/value pairs, or what? > sorted(d,operator.itemgetter

Re: [Tutor] help with sorted()

2008-08-19 Thread Emile van Sebille
Rick Pasotto wrote: I have a dictionary that looks like: d = {k:[v1,[v2,v3,v4]]} v1,v2,v3,v4 are integers. I want to print the dictionary sorted by v1, high to low. sorted(d,operator.itemgetter(0),reverse=True) You need to pass a compare function in... try for ii in sorted(d,lambda ii,jj: c

[Tutor] Help Python String Search

2008-10-06 Thread Deitemeyer, Adam R
Hello, I'm a beginner Python user and I have simple python issue I can't seem to solve. I want to do a truth test on a string to see if a another string is contained within it. I found that typically the re module has the methods to accomplish this. However, every string I'm searching begins w

Re: [Tutor] Help with recursion

2016-03-22 Thread Steven D'Aprano
On Tue, Mar 22, 2016 at 09:12:18AM +, Lucas Cavalcante wrote: > Hello, I'm new to both Python and such a mailling list. > I'm not sure how it works (if it does). > I would really appreciate if anyone could help me with a small piece of > code I'm implementing in order to learn some recursion.

Re: [Tutor] Help with recursion

2016-03-22 Thread Joel Goldstick
On Tue, Mar 22, 2016 at 8:27 AM, Steven D'Aprano wrote: > On Tue, Mar 22, 2016 at 09:12:18AM +, Lucas Cavalcante wrote: > > Hello, I'm new to both Python and such a mailling list. > > I'm not sure how it works (if it does). > > I would really appreciate if anyone could help me with a small pi

Re: [Tutor] Help with recursion

2016-03-22 Thread Martin A. Brown
Greetings and welcome Lucas (Beterraba), >Hello, I'm new to both Python and such a mailling list. >I'm not sure how it works (if it does). First, welcome to Python! We hope you like Python and are happy to help you figure out how to get started. The mailing list etiquette is like most mailing

Re: [Tutor] Help with python

2016-04-19 Thread Alan Gauld
On 19/04/16 02:20, Bereke via Tutor wrote: > Hello there: > > i am facing some problem with my python programming language which is > already installed in My laptop lenovo, 8.1 OS. I'm assuming that means Windows 8.1? > The existing language says "python 27 ". when i click on it, > it turns

Re: [Tutor] Help with python

2016-04-19 Thread Tim Golden
On 19/04/2016 10:03, Alan Gauld wrote: However, for now, you probably want to use IDLE which should come with Python. (It is sometimes called Python GUI on Windows too.) You should find it under Python in your All Programs view. In any recent version of Windows (ie Vista & later) the most comm

Re: [Tutor] Help with python

2016-04-19 Thread Alan Gauld
On 19/04/16 10:13, Tim Golden wrote: > In any recent version of Windows (ie Vista & later) the most common way > to find a program is to press the "Start" button or the "Windows" key > and just start typing its name Interesting, I've been using Windows 10 since it came out and didn't know about

[Tutor] Help me out please

2016-07-19 Thread Marc Sànchez Quibus
Hi, First of all I'm gonan introduce myself. My name is Marc and I'm a student and also a python's programmer begginer. I've been studying/learning python and now I need some help to finish my project. I have two scripts, one of them in python (the main script) and the other one written in html. We

Re: [Tutor] Help on Assginments

2016-07-30 Thread Alan Gauld via Tutor
On 30/07/16 05:31, Justin Korn via Tutor wrote: > ...I need someone to help me to develop programs for the following > assignments: That's not really how tutor list works. We will answer your questions and give you hints when you get stuck. But it is the whole list membership helping you, not a d

Re: [Tutor] Help with NameError

2016-09-01 Thread Alan Gauld via Tutor
On 01/09/16 02:29, Bryan Callow wrote: > Could someone help me with a NameError that I can't seem to figure out. It is hard for us to figure out without seeing the error message. It should tell you which name is in error and where. Please repost with the full error message included. -- Alan G A

Re: [Tutor] Help with NameError

2016-09-01 Thread Peter Otten
Bryan Callow wrote: > Could someone help me with a NameError that I can't seem to figure out. > The program asks for an input and then runs two DC motors. It worked for > a while and then when I reopened the program today I keep getting this > error. Thank you. -Bryan [...] > print('Which dire

Re: [Tutor] help with Numpy

2016-09-21 Thread eryk sun
On Wed, Sep 21, 2016 at 2:53 PM, Paul Dentinger wrote: > > I need Numpy and Scipy and may need matplotlib. So I tried to call Numpy and > it > can't be found. So I go online and find Numpy and download it. Read the following docs on Python packaging and pip: https://pip.pypa.io https://packag

Re: [Tutor] help with Numpy

2016-09-21 Thread Alan Gauld via Tutor
On 21/09/16 15:53, Paul Dentinger wrote: > Hello, > Sorry for such a basic question, but I am trying to get Numpy to work. I > have python 3.5 and working in IDLE. I need Numpy and Scipy and may need > matplotlib. To be honest while you can install all the bits separately I normally recommend j

Re: [Tutor] help with Numpy

2016-09-21 Thread Oscar Benjamin
On 21 Sep 2016 22:29, "Alan Gauld via Tutor" wrote: > > On 21/09/16 15:53, Paul Dentinger wrote: > > Hello, > > Sorry for such a basic question, but I am trying to get Numpy to work. I > > have python 3.5 and working in IDLE. I need Numpy and Scipy and may need > > matplotlib. > > To be honest wh

Re: [Tutor] help with Numpy

2016-09-21 Thread eryk sun
On Wed, Sep 21, 2016 at 10:35 PM, Oscar Benjamin wrote: > I would have given the same advice a year or so ago. It's worth noting > though that the situation with pip, wheel etc has improved significantly > recently. It's now straightforward to pip install Numpy, scipy, matplotlib > and many others

Re: [Tutor] help with Numpy

2016-09-22 Thread Oscar Benjamin
On 22 September 2016 at 04:47, eryk sun wrote: > On Wed, Sep 21, 2016 at 10:35 PM, Oscar Benjamin > wrote: >> I would have given the same advice a year or so ago. It's worth noting >> though that the situation with pip, wheel etc has improved significantly >> recently. It's now straightforward to

[Tutor] Help regarding reg exp.

2016-10-05 Thread rakesh sharma
Hi all I have a string of pattern ({A,BC},{(A,B),(B,C)(C,A)}. I want to extract the inner brackets {A,B,C} etc. Please help. I have tried various methods of re to no avail. Get Outlook for Android ___ Tutor maillist - Tutor@p

[Tutor] Help with Python Queue

2016-11-26 Thread anish singh
I was just writing to read a file using popen and wanted to use queue along with it. I have below code but it is giving this error: AttributeError: Queue instance has no attribute 'taskdone' import threading from Queue import Queue def worker(q): while True: dataset = q.get() prin

Re: [Tutor] help :making window

2016-12-31 Thread Joel Goldstick
On Sat, Dec 31, 2016 at 11:05 AM, syafiqah amir via Tutor wrote: > > > On Saturday, December 31, 2016 3:55 PM, syafiqah amir > wrote: > > > Hello,Im trying to execute the code but the window does not come out.(script > from Maya python for games and film)I'm not sure what I did wrong > im

Re: [Tutor] help :making window

2016-12-31 Thread Alex Kleider
On 2016-12-31 09:35, Joel Goldstick wrote: Semicolon (;) isn't used in python as a statement separator alex@X301n3:/mnt$ python3 Python 3.4.3 (default, Nov 17 2016, 01:11:57) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. gee = "really"; print(gee)

Re: [Tutor] help :making window

2016-12-31 Thread Alan Gauld via Tutor
On 31/12/16 16:05, syafiqah amir via Tutor wrote: > Hello,Im trying to execute the code but the window does not come out. Please always post python code in plain text, otherwise the html gets wrapped and it becomes illegible. > (script from Maya python for games and film) This group is for cor

[Tutor] Help with a Conversion

2017-01-05 Thread S. P. Molnar
I have just started attempting programming in Python and am using Spyder with Python 3.5.2 on a Linux platform. (I first started programing in Fortran II using punched paper tape. Yes, am a rather elderly . . .). I have bumbled through, what I foolishly thought was a simple problem, a short

[Tutor] Help Please on python

2017-02-07 Thread Laura Garcia
I need to create a python code that should simulate throwing darts by random landing between (a random x and a random y)0 and 1. and the program should print out number of darts that land within a rectangle. ___ Tutor maillist - Tutor@python.org To un

[Tutor] Help with this work

2017-02-07 Thread Sasiliyu Adetunji
Hi, I have been working on yhis assignment Create a class called ShoppingCart Create a constructor that takes no arguments and sets the total attribute to zero, and initializes an empty dict attribute named items. Create a method add_item that requires item_name, quantity and price arguments. Th

Re: [Tutor] Help on shoppingcart

2017-02-08 Thread Alan Gauld via Tutor
On 08/02/17 10:04, Sasiliyu Adetunji wrote: > Pls help me on this shoppingcart assignment Sure. You have a very specific set of tasks. Which bit are you stuck on? What have you tried? Show us your code and we can help get it working. > Create a class called ShoppingCart > Create a constructo

[Tutor] Help on this assignment

2017-02-09 Thread Sasiliyu Adetunji
Please can you assist me in this assignment Write a function called remove_duplicates which will take one argument called string. This string input will only have characters between a-z. The function should remove all repeated characters in the string and return a tuple with two values: A new s

[Tutor] Help with this question

2017-02-27 Thread Johnny Hh
write a python function called find_most_freq() that returns the element of a given list that occurs the most frequently. If there are ties, take the number found first. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] help with and

2017-03-01 Thread Alan Gauld via Tutor
On 01/03/17 06:21, darrickbled...@gmail.com wrote: > wage = eval(input("Enter in the employees hourly wage: ")) #get wage > hours_worked = eval(input("Enter in the number of hours worked: ")) Don't use eval() like this it is a security risk and is a very bad habit to get into. Instead use an expl

Re: [Tutor] help with and

2017-03-01 Thread Peter Otten
darrickbled...@gmail.com wrote: > For some reason I am getting a syntax error when I try and write my second > If statement. I cannot find anything wrong with the statement because it > is set up the same as all the others I see online. Perhaps someone can > inform me why I am getting this. Thanks

Re: [Tutor] help with and

2017-03-01 Thread Steven D'Aprano
On Wed, Mar 01, 2017 at 09:29:04AM +, Alan Gauld via Tutor wrote: > You need to be explicit: > >if hours_worked > 40 and hours_worked < 60: > > You can also write what you intend in a slightly > different form: > >if (40 < hours_worked < 60): > > Note: > The second form an unusual

[Tutor] Help with function scoping

2017-03-22 Thread Richard Mcewan
Hi I wonder if you can help. I'm confused about how functions should work. Below is some code I write to check my understanding. I'm expecting two functions to be defined. Then called. One returns a random number. The other user input (guessing the number). I expect the return values to ac

[Tutor] Help with function scoping

2017-03-23 Thread Richard Mcewan
Hi Thanks Mats, Joel and Alan for helpful advice. This code (below) behaves as I wanted now. And think I see where I was going wrong with functions. Thank you very much. Richard Ps I'll reflect on appropriate variable names also. # coding: utf-8 import random #guess number game #compute

[Tutor] Help writing a function

2017-05-17 Thread Grace Sanford
I need suggestions/help for writing the following function: import turtle import time import random # This list represents the board. It's a list # of nine strings, each of which is either # "X", "O", "_", representing, respectively, # a position occupied by an X, by an O, and # an unoccupied pos

[Tutor] Help finishing a function

2017-05-17 Thread Grace Sanford
I am wondering if someone can help/advise me on finishing the code for this function: import turtle import time import random # This list represents the board. It's a list # of nine strings, each of which is either # "X", "O", "_", representing, respectively, # a position occupied by an X, by an

[Tutor] help with subprocess module

2017-08-19 Thread kay Cee
I made a python script that will update a Ubuntu Server every second and writes asuccess message and date to a log file, but for some reason the file is not being written to. Here is the Script: #!/usr/bin/python3 import subprocess import time import datetime class UpdateError(Exception)

[Tutor] Help With Python Tasks

2017-09-05 Thread Ruth Hardy
Dear Sir or Madam I was wondering if you can help me please with these computer science tasks as I don’t know where to start: First Task Write code do the following things involving strings. Wherever possible, you should try to incorporate functions/procedures, although they are not appropr

[Tutor] Help with python 2.7

2017-10-30 Thread Alchemy
Hello, I am in the midst of a career change from renovations to computers. I’m used to working conceptually and understand coding is that. I am taking an online opencourseare classfrom MIT “Introduction to computer science and programming”. The class uses python 2.7, has video lectures and homewo

[Tutor] Help regarding creating tags

2017-11-01 Thread Hemant Sain
i want to tag categories to its menuname. i have a csv containing menu item name and in other csv i have a column containing some strings, i want to pick that strings from categories and look into menu items if any menu item containing that string i want to create a new column next to menu item na

Re: [Tutor] help with code

2018-03-11 Thread Joel Goldstick
On Sat, Mar 10, 2018 at 11:20 PM, Leslie SimondeMontfort via Tutor < tutor@python.org> wrote: > Hi, I wondered if there is someone that can help me with this code. Thank > you, Leslie > > ## Text menu in Python > > def print_menu(): ## Your menu design here > print 30 * "-" , "MENU" , 3

Re: [Tutor] help with code

2018-03-11 Thread Alan Gauld via Tutor
On 11/03/18 04:20, Leslie SimondeMontfort via Tutor wrote: > Hi, I wondered if there is someone that can help me with this code. I'll try but theres a lot to comment on. See below... > def print_menu(): ## Your menu design here > print 30 * "-" , "MENU" , 30 * "-" > print "1. Menu

Re: [Tutor] help with code

2018-03-11 Thread Cameron Simpson
On 10Mar2018 23:20, Leslie SimondeMontfort wrote: Hi, I wondered if there is someone that can help me with this code. Thank you, Leslie Generally we like to know what you think is wrong with it. For example, what you expected it to do, and a little transcript of what it actually did (cut/p

Re: [Tutor] help with code

2018-03-11 Thread Bob Gailer
On Mar 11, 2018 6:25 AM, "Leslie SimondeMontfort via Tutor" < tutor@python.org> wrote: > > Hi, I wondered if there is someone that can help me with this code. I have to assume that you are very new to python. Have you written a Python program that runs the way you want it to? It is often useful t

Re: [Tutor] help with code

2018-03-11 Thread Abdur-Rahmaan Janhangeer
print 30 * "-" , "MENU" , 30 * "-" # just tested in py3 you can do # 'MENU'.center(67, '-') On Sun, Mar 11, 2018 at 8:20 AM, Leslie SimondeMontfort via Tutor < tutor@python.org> wrote: > Hi, I wondered if there is someone that can help me with this code. Thank > you, Leslie > > ## Text menu in

[Tutor] Help with a task

2018-04-12 Thread Aditya Mukherjee
Hello, I'm relatively new to python and have been given a task for university, and would greatly appreciate if anyone could help me basically just get started because as of now I am completely clueless and have no idea what to do. I don't really know who to ask, but anything would be of assistance.

Re: [Tutor] Help with loops

2018-04-30 Thread Alan Gauld via Tutor
On 30/04/18 14:35, Shannon Evans via Tutor wrote: > Hi, is there any way that i can add a loop or iteration or something so > that i dont have to write out every person who has fruit. Yes that's what loops are for. You have two options in Python: a 'for' loop or a 'while' loop In your case I sus

Re: [Tutor] Help with loops

2018-05-01 Thread Isaac Tetteh
else: print("Could not give {} to {}".format(i[1],i[0])) Let us know if you have any other questions. Isaac, Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 From: Tutor on behalf of Shannon Evans vi

Re: [Tutor] help with Pandas

2018-05-22 Thread Alan Gauld via Tutor
On 22/05/18 18:13, Glenn Schultz wrote: Cavbeat: I'm no dataframe expert so I'm going on general principles here... > I am trying to apply the function to the data frame as follows: > > df['loanage'].apply(myfunction(x = 2, y = 10, z = 10, df['loanage]), axis = 0) This looks wrong on several

[Tutor] Help understanding base64 decoding

2018-09-12 Thread Ryan Smith
Hello All, I am currently working on a small utility that finds any base64 encoded strings in files and decodes them. I am having issue understanding how the Base64 module actually works. The regular expression that I am using correctly matches on the encoded strings. I simply want to be able to c

Re: [Tutor] Help with code

2019-03-28 Thread Alan Gauld via Tutor
On 28/03/2019 21:12, lucasbreault2...@gmail.com wrote: > I’m trying to make a password that must contain a number in it. I assume you mean you want to check whether a password has a number in it? Does it need to be a single digit or can there be multiple? > Which method do I use for that? There

Re: [Tutor] help with colormode

2019-04-25 Thread Peter Otten
Mark Alderson wrote: > hi > > Ihave a very small program. I want to cycle colours. I cant set the > colormode from 1 to 255 > > tried screen.colormode(255) > > tells me screen is not defined. the program works without the colormode, > but i want to use it. > > I just change the a and b vari

Re: [Tutor] help with colormode

2019-04-25 Thread Alan Gauld via Tutor
On 25/04/2019 11:54, Mark Alderson wrote: > tried screen.colormode(255) Peter has shown you how to make that work but there is a wee issue below I need to point out. > -code- > from turtle import Turtle > t = Turtle() > t.speed(0) > > b = 180

[Tutor] help with regexps/filename parsing

2005-01-31 Thread Scott W
Hey all. I've got an issue that's been driving me a bit nuts. I'm sure it _can_ be done with a regexp, although I'm missing a piece needed to tie it together to work for all cases. I need to parse out a list of RPMs in this case, but it seems the RPM naming convention has changed, as there are

[Tutor] help with .get in Tkinter

2005-02-20 Thread Mark Kels
Hi all. First, here is the code I have a problem with (I got same problem in my project) : from Tkinter import * def go(): e.get() print e main=Tk() e=Entry(main) e.pack() b=Button(main,text='OK',command=go()).pack() main.mainloop() For some reason the function is called before I click th

[Tutor] Help debuging a small program

2005-02-21 Thread Mark Kels
Hi list ! Here is a small port scanner I made to practice sockets and GUI programming ( WARNING: the program crash when scan button is clicked): #--Imports-- from Tkinter import * import socket #--The result GUI window function- def result(): global result_t #I

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread Max Noel
On Mar 8, 2005, at 22:10, Shidai Liu wrote: Hi all, I'll sum up a question as following: def int5(): '''return 5''' return 5 class my_int(int): def __init__(self): self.id = int5() int.__init__(self, self.id) # FIXME: this line doesn't work I'm not absolutely confident

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread jfouhy
Quoting Max Noel <[EMAIL PROTECTED]>: > I'm not absolutely confident with inheritance in Python (nearly all of > my serious OO work has been in Java), but shouldn't the call to the > superclass's constructor be the very first statement of the subclass's > constructor? No ... Or, well, ma

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread Terry Carroll
On Tue, 8 Mar 2005, Shidai Liu wrote: > I'll sum up a question as following: > > def int5(): > '''return 5''' > return 5 > > class my_int(int): > def __init__(self): > self.id = int5() > int.__init__(self, self.id) # FIXME: this line doesn't work > > the above code

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread Shidai Liu
On Tue, 8 Mar 2005 17:15:00 -0800 (PST), Terry Carroll <[EMAIL PROTECTED]> wrote: > On Tue, 8 Mar 2005, Shidai Liu wrote: > > > I'll sum up a question as following: > > > > def int5(): > > '''return 5''' > > return 5 > > > > class my_int(int): > > def __init__(self): > > self.

Re: [Tutor] HELP: subclass of int

2005-03-08 Thread Kent Johnson
Shidai Liu wrote: Hi all, I'll sum up a question as following: def int5(): '''return 5''' return 5 class my_int(int): def __init__(self): self.id = int5() int.__init__(self, self.id) # FIXME: this line doesn't work the above code act like this: I = my_int() I 0 I want i

Re: [Tutor] Help with this script

2005-04-23 Thread Kent Johnson
John Carmona wrote: I have decided to merge the 2 scripts. First I should have a menu asking me if I want to compute areas or volumes. Then depending on the choice it should display the relevant menu. My first menu comes on but if I select "b" or "c" the script does not run. The error message po

Re: [Tutor] Help with this script

2005-04-23 Thread Alan Gauld
> should display the relevant menu. My first menu comes on but if I select "b" > or "c" the script does not run. The error message points out that > "print_options()" or "print_options_2()" are not defined. Could somebody > point me into the right direction, thanks. Thats because you define them a

[Tutor] help with tabs and Tkinter

2005-05-12 Thread Zenten
Ok, I'm writing a program using tkinter, that has a bit of data entry in it. It would be useful to have a window with various tabs to select between different "pages" in my entry. However, I can't figure out how to do this part, after looking through documentation. Can anyone help? Joshua _

[Tutor] Help with Challenge number 5

2005-05-12 Thread Jacob S.
Is there anyone on the list right now who knows what to do with yes! pickle! on challenge number 5 -- Any hints appreciated. I've tried the most common combinations of yes and pickle in the url path, but to no avail. By the way, this means I solved challenge 4. TIA, Jacob __

[Tutor] help: threading + cron in python?

2005-05-12 Thread Aaron
Lets say you have a threaded program. Is there any way to make it so that an operation occurs at a certain time every hour (eg) like the cron daemon? I'm afraid I don't really understanding threading enought to make this work.. ___ Tutor maillist - Tu

Re: [Tutor] Help with time module

2005-05-13 Thread Kent Johnson
Alberto Troiano wrote: > I have two strings like this > > hour1="14:30" > hour2="15:30" > > I want to compare them like this: > > if local_time between hour1 and hour2: > print True > else > print False > > Can anyone tell me how to make that comparison to work??? (I don't know > h

Re: [Tutor] Help with time module

2005-05-13 Thread Alberto Troiano
Thank you so much Kent That's exactly what I was lookin for Regards Alberto http://graphics.hotmail.com/emvamp.gif"; width=12> Gaucho >From: Kent Johnson <[EMAIL PROTECTED]> >CC: tutor@python.org >Subject: Re: [Tutor] Help with time module >Date:

[Tutor] help with my python app

2005-05-16 Thread james middendorff
Hello, I would like to be able to use the arrow keys to control a remote control car, which I can do but only one key at a time. I would like to press the up key, then while it is moving forward, press the left or right key to turn while it is moving forward? I am sure there are probably better way

[Tutor] help me on python + snack

2005-05-17 Thread Mahmad Sadique Hannure
Hello friends, I m currently working on sound stuff. I have installed all stuff related to Snack. My code for playing mp3 song is like this #!/usr/bin/python2.3 from Tkinter import * import tkSnack def main(): root = Tk() tkSnack.initializeSnack(root) mysound = tkSnack.So

[Tutor] [HELP]win32 shutdown, restart, logoff

2005-05-22 Thread Shidai Liu
Hi all, Any one know how to make a shutdown, restart, logoff call in windows os like 98, 2000 and xp? Implemented in python, can use python win32 extensions. But not os.system('rundll/shutodwn ...'). Thanks for your help.-- With best wishes!Shidai ___ T

[Tutor] Help with file I/O.

2005-07-30 Thread Nathan Pinno
If anyone will help me learn file I/O, it would be appreciated. I went through Josh Cogliani's Non-Programmer's Tutorial for Python, and I still can't understand it.   Thanks in advance, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mai

Re: [Tutor] help regarding game code

2013-05-12 Thread Matthew Ngaha
>> bWater.clicked.connect( water_clicked ) AttributeError: 'int use a paste site like http://bpaste.net/+python to show us the code. i am no expert @ programming myself but that error is telling you you used an int and tried to access an int method called connect somewhere in your code. ints do n

Re: [Tutor] help regarding game code

2013-05-12 Thread Mark Lawrence
On 12/05/2013 22:44, Matthew Ngaha wrote: bWater.clicked.connect( water_clicked ) AttributeError: 'int use a paste site like http://bpaste.net/+python to show us the code. No, please put the code inline. If the original is too long cut it down as requested here http://www.sscce.org/ -- I

Re: [Tutor] help regarding game code

2013-05-12 Thread Dave Angel
On 05/12/2013 03:40 PM, Alex Norton wrote: im new to python and im in the middle of making a RPS game for a college unit. You sent this message 20 minutes after posting a similar one, with a DIFFERENT title, on python-list. You really ought to pick a target and pull the trigger once. Only i

[Tutor] help with postgreSQL and .csv

2013-09-02 Thread Ismar Sehic
hello. i wrote the following code, to insert some values from a csv file to my postgres table : *** *import psycopg2* *conn = psycopg2.connect("host = ***.***.***.*** user=*** dbname = ** ")* *cur = conn.cursor()* *import csv* *with open('HotelImages.csv', 'rb') as f: * *

[Tutor] Help merge files using python

2013-11-13 Thread jarod...@libero.it
Hi I want to merge many files like this: #file1 A 10 B 20 C 30 #file2 B 45 Z 10 #file1 A 60 B 70 C 10 I want to obtain A 10 0 60 B 20 45 70 C 30 0 10 Z 0 10 0 I try to do like this: f = os.listdir(".") for i in f: T =open(i,"r") for r in t.readli

[Tutor] Help needed with Python programming

2014-04-22 Thread Suhana Vidyarthi
My knowledge of coding is fairly limited and I am having a hard time writing a Python code which might be pretty simple for you :-) Here is what I am doing and I need help with: I have a python code that shows a set of shortest paths between nodes A and B. Now I have to select the least risky pat

Re: [Tutor] Help With an Assignment

2014-04-25 Thread Alan Gauld
On 25/04/14 20:52, jordan smallwood wrote: Hello, I am new to Python. I mean completely new and we're working on this problem set where they give us specs and we have to build something based off these specs. I have no idea what they're asking. Its pretty clear. They want you to build a module

Re: [Tutor] Help With an Assignment

2014-04-25 Thread Dave Angel
jordan smallwood Wrote in message: Do you know what a module is? Can you use a text editor to create one? Do you know what a function looks like? Try writing the first one they asked. Post it here, along with some test code showing it works, or describe what goes wrong. And while you're

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Benno Lang
On Thu, Jan 7, 2010 at 10:51 PM, Garry Bettle wrote: > I have a list that I output in the following order: > > 2010-01-07 1103 Sund A7 450m > 2010-01-07 Sheff A7 500m > 2010-01-07 1119 Sund A6 450m > 2010-01-07 1128 Sheff A6 500m > 2010-01-07 1134 Sund A5 450m > 2010-01-07 1142 Sheff A7 500m

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Garry Bettle
On Thu, Jan 7, 2010 at 15:26, Garry Bettle wrote: > > Howdy all, > > I hope this message finds you all well. > > I have a list that I output in the following order: > > 2010-01-07 1103 Sund A7 450m > 2010-01-07 Sheff A7 500m > 2010-01-07 1119 Sund A6 450m > 2010-01-07 1128 Sheff A6 500m > 201

Re: [Tutor] Help with a Dictionary

2010-01-07 Thread Alan Gauld
"Garry Bettle" wrote What I'd like to do, is output a transposed-like summary of just the Fixture + RaceTime. Sund 1103 1119 1134 1148 1204 1218 1232 1247 1304 1319 1333 1351 Sheff 1128 1142 1157 1212 1227 1242 1258 1312 1327 1344 1403 As the races are output, I build a dictionary of k

<    4   5   6   7   8   9   10   11   12   13   >