Re: [Tutor] Testing for commandline args

2005-05-13 Thread Max Noel
e: # do different stuff Also, I hear that optparse is much better than getopt. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect

Re: [Tutor] help: space formatting for multiplication table

2005-05-14 Thread Max Noel
uld you make this work? > You may want to have a look at the string ljust() and rjust() methods. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you c

Re: [Tutor] How to verify all things are equal to one another

2005-05-15 Thread Max Noel
On May 15, 2005, at 06:54, Terry Carroll wrote: > if (a == b & > a == c & > a == d & > a == e & > a == f & > a == g): > do stuff > Well, you can already try this: if a == b == c == d == e == f == g: do stuff -- Max

Re: [Tutor] Directory not empty :: Fast mode

2005-05-16 Thread Max Noel
>>> import os >>> os.listdir("Prog") ['.DS_Store', 'archive', 'C-Cpp', 'docs', 'eclipse', 'gi21', 'Haskell', 'Java', 'matt', 'ObjC', 'Python'] -- Max

Re: [Tutor] Removing lines in string-table

2005-05-17 Thread Max Noel
o this. So, any > comments are really appreciated. Looks like a job for a list comprehension: fileNames = [element for element in fileNames if not element.endswith ("_thumb.jpg")] -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature

Re: [Tutor] Perl equivalent of $#var

2005-05-17 Thread Max Noel
ained with the shortcut var[-1]. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect, immortal machine?" ___

Re: [Tutor] dictionary values in strings

2005-05-19 Thread Max Noel
nd they also have the has_key() method, which can be used to test for the presence of a key in a dict: >>> a.has_key('foo') True >>> a.has_key('baz') False What you are looking for can be achieved like this: >>> dol = {'key1':['li1&

Re: [Tutor] diving into py question

2005-05-19 Thread Max Noel
scores. The line should be changed to: if __name__ == "__main__": Hope that helps, -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through

Re: [Tutor] diving into py question

2005-05-19 Thread Max Noel
e source of the error. Lacking that, could you send us the exact error message, please? Just copy/paste whatever the interpreter throws at you; error messages are very useful to us. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of me

Re: [Tutor] kernel serie

2005-05-19 Thread Max Noel
Also, note that this code will likely cause the program to crash on any system that isn't Linux. On my box (OS X 10.4.1), for example, sys.platform returns 'darwin'. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone

Re: [Tutor] using -i flag with '''if __name__ == "__main__":'''

2005-05-19 Thread Max Noel
rust me, the time you take to write them is by far lower than the time they save you tracking and correcting bugs if you don't. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my co

Re: [Tutor] looking for a pattern in a lot of files

2005-05-22 Thread Max Noel
string and not a regex pattern, you don't have to use regular expressions: if "locale for" in line: print line Works just as well, and is faster. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, pant

Re: [Tutor] Filtering Spreadsheet Data

2005-05-24 Thread Max Noel
ery > working, you could > automate it using VBA or Python. > > Mike If you want to do it in Python, the easiest way is to export the spreadsheet as CSV in Excel, then use the csv module to do your processing. If needed, convert back to XLS afterward. -- Max maxnoel_fr

Re: [Tutor] Python won't play wav file

2005-05-24 Thread Max Noel
filter, whatever) WAV files, not to play them. Playing a sound is a highly OS-specific function; PyGame is a cross-platform library that enables this, among other things. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, pa

[Tutor] Fwd: xml

2005-05-24 Thread Max Noel
(meh, forgot to click "reply-all" again) Begin forwarded message: > From: Max Noel <[EMAIL PROTECTED]> > Date: May 24, 2005 23:01:39 BDT > To: "D. Hartley" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] xml > > > > On May 24, 2005, at 22

Re: [Tutor] quick PIL question

2005-06-02 Thread Max Noel
16.7 million. This is where the palette comes into play. Each 256-color image has a palette, which is basically an array of length 256, where each element is a (24-bit RGB) color. The color data for each pixel in the image is actually an index in this array. Makes sense? -- Max

Re: [Tutor] Detecting my own IP address?

2005-06-06 Thread Max Noel
. The (more-or-less) equivalent command is ipconfig, except that it has no generic names for network interfaces. What that means, is that instead of eth0 (or en0, or whatever), it uses the full name of your NIC -- which effectively means that the output differs from one machine to another. G

Re: [Tutor] repr()

2005-06-07 Thread Max Noel
ment calls the function, then assigns to s the representation of the function's return value. A function that doesn't have a return statement returns None, and repr(None) == 'None'. Which is what you get. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at y

Re: [Tutor] Calling a function

2005-06-09 Thread Max Noel
it, all members of the list seem to be modified as well -- but they're actually one single object that's present 10 times in the list. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting

Re: [Tutor] "Print" behaviour inside a loop?

2005-06-11 Thread Max Noel
ple: #!/usr/bin/env python import time, sys for i in xrange(20): sys.stdout.write(".") sys.stdout.flush() time.sleep(0.2) -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run

Re: [Tutor] can't see emacs timer in action

2005-06-14 Thread Max Noel
me... How do you run it? Do you use a separate terminal window, or do you use some kind of "run with Python" command in emacs? (not sure how it's done, I'm a vim user myself) Did you make sure you import time before that code is run? -- Max maxnoel_fr at yahoo d

Re: [Tutor] can't see emacs timer in action

2005-06-14 Thread Max Noel
On Jun 14, 2005, at 23:17, Pujo Aji wrote: > I just use Ctrl+C Ctrl+C to run the code. > The code wait for 3 second and show all i all together. > > I can't feel every second pass. > > pujo Try running your script from a terminal (outside of emacs, that is). --

Re: [Tutor] max(len(item)) for cols

2005-06-17 Thread Max Noel
On Jun 17, 2005, at 11:58, János Juhász wrote: > > Dear Guys, > > I have a 2D array: > >>>> [['1', '2 ', '3'], ['longer ', 'longer', 'sort']] >>>> > > > How can I get what is

Re: [Tutor] Changing what you've already printed

2005-06-22 Thread Max Noel
ution does not include the curses module (you have to use msvcrt[?] instead). I wonder why, because I'm pretty sure I saw (C) curses-based applications running on Windows (NetHack is one, AFAIK). -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic c

Re: [Tutor] OT self-implementation?

2005-07-01 Thread Max Noel
. The whole process is called "bootstrappping" (from the Adventures of Baron Munchausen, as you mentioned), and exists for all compiled languages (including assembly). In fact, every language except microcode was at some point either bootstrapped or cross- compiled. -- Ma

[Tutor] Initialising attributes with random values

2005-07-05 Thread Max Russell
starts with values of 0. But how can I neatly say, start with a random value from (for example) 1 - 5? thanks Max ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http

Re: [Tutor] Passing Arguments

2005-07-09 Thread Max Noel
' printed out, since it is the result of the function. How can I correct this? You have to call the function: get_Name(prt_Name()) prt_Name is the function itself. prt_Name() (note the parens) calls (executes) the function and allows you to use its return value. -- Max maxnoel_

Re: [Tutor] Storing Data Records in XML File

2005-07-12 Thread Max Noel
store full, etc. ). Any recommendations on a way to do this? i.e. what modules what methods? For all your XML processing needs, you need ElementTree (http:// effbot.org/). -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and

Re: [Tutor] Questions on file.read

2005-07-14 Thread Max Noel
rt sys >>> sys.is_computer_on_fire() True In any cas, you should try to avoid using file.read without a size parameter. If you're processing text files, reading them one line at a time would be a good start (for line in open ('filename.txt'): is an instance of Best Thin

[Tutor] populating a listbox from a list

2005-07-15 Thread Max Russell
do to read a list into a listbox. Should I preformat the list I read from to be one entry per line? I don't know if I want to pickle my data as i need to be able to delete defunct list entries from my little GUI application. thanks Max __

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Max Noel
o be used with lists in addition to dictionaries. While we're on that topic, is there a particular reason why 'in', in a dict context, searches the keys instead of doing the logical thing and searching the values? -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Loo

[Tutor] curses

2007-07-12 Thread max baseman
ok after reading a few tutorials i think i know enough to write my program here it is not commented yet though sorry: import curses from time import sleep scr=vurses.initscr() population=0 seconds=0 try: scr.nodelay(1) scr.leaveok(0) max_y, max_x = scr.getmaxyx()

[Tutor] curses

2007-07-14 Thread max baseman
hello all sorry to bother I'm working on my first curses program ive been wanting to learn curses for a while now and now that a have a lop top with fedora core running in run level 3 ware im trying to program all the tools i'll use but curses will be my only gui ALAN has been helping me wi

[Tutor] reading random line from a file

2007-07-14 Thread max baseman
im writing a quick quote reader that spits out a random quote from a show but cant get it to pick randomly i tried a=randrange(820)+1 text.readline(a) and i would prefer not having to bring evryline into the program then picking like for line in text.readlines(): lines.append(text) .

[Tutor] curses

2007-07-16 Thread max baseman
hello all sorry to bother I'm working on my first curses program ive been wanting to learn curses for a while now and now that a have a lop top with fedora core running in run level 3 ware im trying to program all the tools i'll use but curses will be my only gui ALAN has been helping me wi

[Tutor] web browser

2007-07-21 Thread max baseman
has anyone ever written a web browser with python and Tkinter? if so is there any documentation on it? if not does anyone know if their which tutorials i should read if i wanted to write one for my apple? i don't know vary much Tkinter so i was going to start there then i thought i would be us

[Tutor] the and command

2007-08-23 Thread max baseman
hello im checking if a number is in all 5 of the other lists and when i use the and command it seems to just be checking if it's in a least one of the others, here is the program it's choppy i needed it for a quick calculation so it's not pretty but it's not long: n2=2 n3=3 n4=4 n5=5 n6=6 n

Re: [Tutor] the and command

2007-08-24 Thread max baseman
if a+1 in l7: print a+1 On Aug 24, 2007, at 1:25 AM, Alan Gauld wrote: > > "max baseman" <[EMAIL PROTECTED]> wrote >> im checking if a number is in all 5 of the other lists and when >> i use the and command it seems to just be checking if it's in a >>

[Tutor] clearing a text document

2007-08-29 Thread max baseman
quick question how would i clear a text document? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] clearing a text document

2007-08-29 Thread max baseman
t 4,2,1,4,2,1... now im looking for a a number with a very high amount of numbers till you get to 1 so every time it's finds a new one i would like it to write that to a file and clear the last entry, On Aug 29, 2007, at 5:45 PM, Alan Gauld wrote: > > "max baseman" <

Re: [Tutor] clearing a text document

2007-08-30 Thread max baseman
cool thank you :) On Aug 29, 2007, at 11:02 PM, Luke Paireepinart wrote: > max baseman wrote: >> right it's for a quick math "game" the rules are simple you start >> with any number to get the next number you, a. if it's odd >> multiply by 3 th

Re: [Tutor] clearing a text document

2007-08-30 Thread max baseman
Johnson wrote: > max baseman wrote: >> right it's for a quick math "game" the rules are simple you start >> with any number to get the next number you, a. if it's odd >> multiply by 3 than add 1 or b. if it's even divide by two, the >>

[Tutor] checking if a number is evan or odd

2007-09-03 Thread max baseman
hello just a quick check in, it's about the same program i was asking about before ive let it sit for a few days now and i reached a number to high to convert to a decimal by adding 0.0 here's the program: count=1 numstart=268549802 number=0 high=0 a=0 while 1==1: numstart=numstart+1

Re: [Tutor] checking if a number is evan or odd

2007-09-03 Thread max baseman
h > > if number%2 == 0: >number = number/2 > > Why do you need to convert it to a float? > > Off topic: > Is this a PE problem? I remember doing the same thing. > > max baseman wrote: >> hello just a quick check in, it's about the same program i was >

Re: [Tutor] checking if a number is evan or odd

2007-09-04 Thread max baseman
r=(number-1)/3.0 ... count=count+1 ... print number On Sep 4, 2007, at 3:00 AM, Alan Gauld wrote: > Max, > >> just wondering if theirs a way to check if a larger number is even >> or >> odd > > I notice this is homework so I won't give a direct answe

[Tutor] making math problems mmmm fun

2007-09-10 Thread max baseman
hello all this is a homework in math i dont need to program it but i would like to :) so like any other time pleas dont just give a answer tutorials or a explanation. i dont like to use script something i dont understand :) thanks basically the problem is to find a bunch of ways to put 1,

[Tutor] making math problems mmmm fun

2007-09-10 Thread max baseman
hello all this is a homework in math i dont need to program it but i would like to :) so like any other time pleas dont just give a answer tutorials or a explanation. i dont like to use script something i dont understand :) thanks basically the problem is to find a bunch of ways to put 1,

Re: [Tutor] making math problems mmmm fun

2007-09-10 Thread max baseman
problem was listed in a chapter entitled > "Cruel and Unusual"! > > -Sam > ____ > - Original Message > From: max baseman <[EMAIL PROTECTED]> > To: tutor@python.org > Sent: Monday, September 10, 2007 6:28:23 PM > Sub

Re: [Tutor] making math problems mmmm fun

2007-09-10 Thread max baseman
wow this is a bit over my range of knowledge im impressed :) ill be happy to look at it but i think i will see if i can end up writing my own :) worse case ill do it by hand will not take long hmm wow thanks :) On Sep 10, 2007, at 8:47 PM, John Fouhy wrote: ### import operator bino

Re: [Tutor] making math problems mmmm fun

2007-09-11 Thread max baseman
sentences run together and > difficult to read. :-) Honestly, I just gave up after the first two > lines. > > max baseman wrote: >> haha :) yeah it's the new imp stuff i like parts of the idea but >> other parts i really dislike basically it TRIES to make math &

[Tutor] quick question

2007-09-24 Thread max baseman
hello just a quickie today :) how is python with patters or finding a rule for something ie: in out tables for example how hard would it be to write a program that take's a input of a in out table and finds the rule ex: in out 10 23 5 13 1

[Tutor] Tkinter text

2007-10-03 Thread max baseman
hello im working on my first simple gui using Tkinter i've got two questions, 1st how would you go about creating a hidden text file that trys on a apple and if that does not work tries to do it on a windows computer? the program I'm making is a vary simple text editor for one file all it ne

Re: [Tutor] Tkinter text

2007-10-03 Thread max baseman
27;ve ever read i really like and that was the first place i checked but in the GUI section the text entry bit is for a single line of text On Oct 3, 2007, at 3:58 PM, Alan Gauld wrote: > > "max baseman" <[EMAIL PROTECTED]> wrote > >> i've got two qu

[Tutor] another quickie

2007-10-04 Thread max baseman
hello all, im sorry but i might be asking a lot of Tkinter questions for a bit. im still working on my first GUI, it is very simple all i want it to do is open a text file, write to it, than save it. so far i have a GUI with the ability to right text (nothing amazing), but i don't know how

[Tutor] war cards

2007-12-24 Thread max baseman
hello all, i have been rolling the idea of writing a simple script to play the classic card game war. i thought it would be good for me because their is no skill in the game. while thinking of how to write it i got stuck on one bit, how do i make it so that their is one of each card and i c

[Tutor] locating python scripts

2008-01-06 Thread max baseman
hey i just have a small question, doesn't have much to do with programing but it has to do with python. anyways Im running a apple computer version 10.4 and have been keeping my scripts in the user folder i was wondering where and how i can change the files that python looks in when looking

[Tutor] mamelauncher

2005-09-09 Thread Max Russell
Hi: I've been working on this for ages and am having real problems with getting the wiring for a selected game to launch when I click OK. I haven't added my error handling yet. Can anyone help? I've tried using spawn, system etc etc to no avail. #Mame Launcher #GUI launcher for MAME games #F

Re: [Tutor] mamelauncher

2005-09-10 Thread Max Russell
I was using 2.3 but upgraded to 2.4 last night because I had read about the subprocess module (then Danny also brought tat to my attention.) The wierd spacing is just Yahoo, sorry! I'm probably going to try the same project in WX and then QT, just to get a flavour. thanks Max --- Alan G &l

Re: [Tutor] mamelauncher

2005-09-12 Thread Max Russell
the CMD prompt like it is trying it and not waiting or getting some kind of return. I'm really not sure where I'm going wrong at all! I'll try re-writing using sub-process as I've upped my Python to 2.4. --- Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Fri, 9

Re: [Tutor] mamelauncher (fwd)

2005-09-13 Thread Max Russell
selection) raw_input() mame reports files missing, but I can launch the game manually- I suspect that this is some sort of error that occurs normally but is bypassed on launch and that my one-shot attempt to launch the thing cannot handle. I think I need to have a wee look at subprocess! ta

[Tutor] Non type object?

2006-03-01 Thread Max Russell
.append(diff)    print changes    break        Now, I have a lot of print statements in there for debugging purposes, but I don't understand why when I run it, and it parses through my input directory and comparison directory it returns this Nonecomp

[Tutor] Setting a global variable on class initialisation

2006-04-27 Thread Max Russell
give good examples of this?   thanks   Max RussellSenior Test Engineer BarcoBonnington Bond, 2 Anderson Place, Edinburgh EH6 5NP, UKTel + 44 (0) 131 472 5731 Fax + 44 (0) 131 472 4799www.barco.com[EMAIL PROTECTED]Unless indicated otherwise, the information contained in this message is

[Tutor] Setting a global variable on class initialisation

2006-04-28 Thread Max Russell
formsFile()    global typeCategories    typeCategories = self.GetTypesFile()   The method above is within Directory and updates the two lists with the values I need. (The methods called within GetCategories do the returning of the lists.)   I think I've got a grasp on what was going wr

[Tutor] (no subject)

2007-01-19 Thread Max Jameson
I know this is totally off-the-wall, but what am I doing wrong here? I am using Python 2.5, and I am just learning...please be kind! >>> aList = [2,3] >>> bList = [5,7,9] >>> aList.append(bList) >>> print aList [2, 3, [5, 7, 9]] >>> print aList [1] [2] Traceback (most recent call last): File

[Tutor] powerball

2008-06-11 Thread max baseman
as a fun little project i scripted a powerball program. it seems to have a bug in it that i cant find. from random import randrange wins=0 win=[] count =0 while count !=5: number=randrange(55)+1 win.append(number) count=count+1 powerball=randrange(42)+1 count=0 win.sort() while coun

[Tutor] powerball

2008-06-12 Thread max baseman
hello and thank you everyone for your help. I apologize for my ignorance when it came to knowledge of what the powerball is it is not as wide spread as i had thought it was the powerball is a form of lottery their are 5 numbers between 1 and 55, and then their is the powerball between 1 and

Re: [Tutor] about import statement

2011-01-10 Thread Max Countryman
On Jan 10, 2011, at 7:58 AM, arun kumar wrote: > how to know that we > should import something. How do we know that certain classes are in > particular module? You know to import a module if you need part of that module. Perhaps you need a class or function defined in the module. There are seve

[Tutor] dict['_find']

2011-02-19 Thread Max Niederhofer
TER to quit)", state = raw_input("> ") if not state: break city_found = cities['_find'](cities, state) print city_found My question is - how do I rewrite this using an alternate module given find is deprecated? Grateful for all suggestions or pointers. For ref

Re: [Tutor] dict['_find']

2011-02-20 Thread Max Niederhofer
n the code, the error I got was: max:python max$ python ex40.py State? (ENTER to quit) > CA Traceback (most recent call last): File "ex40.py", line 22, in city_found = cities['_find'](cities, state) File "ex40.py", line 8, in find_city return th

[Tutor] Generic For Loop

2011-10-12 Thread Max S.
I've been doing some research into C++, and I've noticed the for loops. Is there a way to use the C++ version of the loops instead of the Python one? For example, I believe that the Python syntax would be: for a=1, a < 11, a += 1: print(a) print("Loop ended.") if the 'for' keyword did it's f

Re: [Tutor] Generic For Loop

2011-10-12 Thread Max S.
Thanks! On Wed, Oct 12, 2011 at 8:56 PM, bob gailer wrote: > On 10/12/2011 8:41 PM, Max S. wrote: > >> I've been doing some research into C++, and I've noticed the for loops. >> Is there a way to use the C++ version of the loops instead of the Python >> one

[Tutor] 'object' class

2011-10-14 Thread Max S.
I have seen classes created with 'class Class_Name:' and 'class Class_Name(object):'. I'm using the latter, just in case it has some sort of method that could be useful that I don't know about, but *are *there any methods in the 'object' class? And if so, what are they? __

Re: [Tutor] Tutor Digest, Vol 92, Issue 77

2011-10-16 Thread Max S.
On Sun, Oct 16, 2011 at 3:44 PM, wrote: > Send Tutor mailing list submissions to >tutor@python.org > > To subscribe or unsubscribe via the World Wide Web, visit >http://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with subject or body 'help' to >t

Re: [Tutor] Python 2.7 on Ubuntu 11.10 - Do not unintall

2011-11-01 Thread Max gmail
Heh, yeah. It's usually a bad idea to do stuff like that (I know a guy (Windows) who deleted his OS of his system). On Nov 1, 2011, at 7:40 PM, Joel Montes de Oca wrote: > I just discovered that it is a bad idea to complete uninstall Python 2.7 on > Ubuntu 11.10. If you do, expect a lot of thi

[Tutor] Assigning variables with names set by other variables

2011-11-04 Thread Max S.
Is it possible to create a variable with a string held by another variable in Python? For example, >>> var_name = input("Variable name: ") (input: 'var') >>> var_name = 4 >>> print(var) (output: 4) (Yeah, I know that if this gets typed into Python, it won't work. It just pseudocode.) I'm on a

Re: [Tutor] Assigning variables with names set by other variables

2011-11-04 Thread Max gmail
Thanks Steven. On Nov 4, 2011, at 6:45 PM, Steven D'Aprano wrote: > Max S. wrote: >> Is it possible to create a variable with a string held by another variable >> in Python? For example, > > Yes, but you shouldn't do it. Seriously. Don't do this, you will

Re: [Tutor] Assigning variables with names set by other variables

2011-11-04 Thread Max gmail
Thank you, Wayne! This helps a lot. On Nov 4, 2011, at 5:38 PM, Wayne Werner wrote: > On Fri, Nov 4, 2011 at 4:21 PM, Max S. wrote: > Is it possible to create a variable with a string held by another variable in > Python? For example, > > >>> var_name = input(&qu

[Tutor] Accessing methods in same class

2011-11-06 Thread Max S.
Hi. I'm working on a project for my friend, but I'm running into errors. No matter what I do, I can't seem to get one method to execute another method in the same class. Is there a way that I can do this? Thanks. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Accessing methods in same class

2011-11-06 Thread Max S.
Oh. Sorry. It's 500 lines, so I'll just post an example. Windows Vista and Python 3, just because I forgot. class K: def __init__(self): doThis() def doThis(self): print("Hi.") k = K() >From what I understand by your help, the code class K: def __init__(self): self.doThis() def doThis(s

Re: [Tutor] sifting through a long program

2011-11-10 Thread Max S.
Alt+G, or Edit>Go To Line. On Thu, Nov 10, 2011 at 1:58 PM, Nathaniel Trujillo wrote: > How do I get to line 362 of a program without counting each line ? Thanks > for the help. > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change sub

Re: [Tutor] Encoding

2011-11-18 Thread Max S.
Well, I am assuming that by this you mean converting user input into a string, and then extracting the numerals (0-9) from it. Next time, please tell us your version of Python. I'll do my best to help with this. You might try the following: the_input = input("Insert string here: ") # change to

[Tutor] Saving read-only or encoded text files?

2011-11-18 Thread Max S.
Hi. I've been using a lot of text files recently, and I'm starting to worry about a user hacking some element by editing the text files. I know that I can pickle my data instead, creating less easily editable (try saying that five times fast) .dat files, but I'd rather store individual variables

Re: [Tutor] Saving read-only or encoded text files?

2011-11-18 Thread Max gmail
Thank you. This will work perfectly. On Nov 18, 2011, at 11:58 AM, Prasad, Ramit wrote: > Hi. I've been using a lot of text files recently, and I'm starting to worry > about a user hacking some element by editing the text files. I know that I > can pickle my data instead, creating less easil

Re: [Tutor] why doesn't python show error

2011-11-29 Thread Max gmail
In some cases, it is a useful fact that Python only shows error messages when they are encountered. For example, I can test a program while keeping away from an area that still doesn't work, rather than having to make it work flawlessly before my first test. Python *can* generate executables w

Re: [Tutor] beginner here

2011-12-07 Thread Max S.
You are using an 'elif' for your 'coin_rolls == 1:'. The 'elif' keyword means that if the last 'if' statement (and any 'elif's behind it) was *not* true, only then will it be executed. Your code could be written as 'if rolls is NOT less than or equal to 100, only then check to see if it is 1 or 2

Re: [Tutor] Need Explanation...

2011-12-10 Thread Max gmail
On Dec 10, 2011, at 12:04 PM, Alan Gauld wrote: > On 10/12/11 16:46, Steven D'Aprano wrote: > >> ...the alternative would also have caught out everybody at some point. >> Consider a hypothetical Python where mutator methods returned a result: >> >> a = [1, 2, 3] >> b = a.append(4) >> >> Does t

Re: [Tutor] Extremely simple question

2012-01-11 Thread Max S.
I believe that line 3 raises an error. The because you contained the text in single quotes, and then used the same character in 'you're not chris', Python believes that you are trying to type "you" re not chris". You can change the single quotes surrounding your string to double quotes ("you're n

[Tutor] .py vs .pyc

2012-04-19 Thread Max S.
Could anyone tell me why I should use a .pyc file rather than a .py? After doing some research, I have found that a .py file is first precompiled and then run, while a .pyc file is already precompiled and is simply run. But unless I'm mistaken, it seems that a .pyc is no faster or better than a .

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Max S.
Then if I understand correctly, I work with .py files and (should) run them as .pyc files? On Thu, Apr 19, 2012 at 10:55 AM, Russel Winder wrote: > On Thu, 2012-04-19 at 10:47 -0400, Max S. wrote: > > Could anyone tell me why I should use a .pyc file rather than a .py? > After &g

[Tutor] What these Python user-defined functions do?

2016-05-21 Thread Max Jegers
Hi, I started learning Python (v3.5) and was given some code samples to assist in my studies. There are some things I could not figure out using Python documentation or other online sources. I have experience with SQL programming and some procedural programming, but little in terms of OOP. I tr

[Tutor] Newcomer with organizational questions

2016-05-26 Thread Max Jegers
Hi, I am a newcomer who asked a first question here at Tutor. Soon I received a very good answer from a tutor and put an effort to understand it. After that I wrote a reply with a thank you and a follow-up question, only to discover that I don’t see a way to send it. I need to say I did not wri

[Tutor] if statement problems(noob question)

2013-04-08 Thread Max Smith
Hi, everyone whom might read this, im Max and i am really new to coding, been going at it for about two weeks using codeacademy and the book "think python". when i decided to experiment a little with if statements i ran into the following problem: def plus(x,y): if x and y == in

[Tutor] Using tkinter for cross platform application

2013-09-02 Thread Max Bedacht
dows 7(64Bit), Windows XP Python 2.7 and 3.3 64Bit on the Ubuntu box. Python 2.7 and 3.3 32Bit on the Windows boxes Thanks; Max Bedacht ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python Questions

2017-07-18 Thread Max Smith
on for my GCSE's if you could give me some tips. I'd be excited to hear. Thanks very Much, Max. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] closing the window through code

2017-10-01 Thread Max Patient
help me it woild be much appreciated yours sincerely Max Patient Sent from my iPhone ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Memory Allocation -- deep learning

2018-07-30 Thread Max Zettlmeißl via Tutor
On Mon, Jul 30, 2018 at 3:20 PM, Sunil Tech wrote: > Python memory allocation is varying in all these use cases. Please help me > understand. CPython is interning small integers and small strings as a form of optimisation. "The current implementation keeps an array of integer objects for all int

<    1   2   3