[Tutor] Windows Memory Basics

2017-10-16 Thread Michael C
Hi all: I don't understand this part about the memory: if I used VirtualQueryEx to find out if a region of memory is ok to scan, and it says it's ok, are the values in the region arranged like this: short,int,double,long,char, double, short in as in, random? I am asking this because, if it's

Re: [Tutor] Windows Memory Basics

2017-10-17 Thread Michael C
ah, i am bummed completely haha. Is there a way to tell which parts a variables so I can scan it? Maybe you could point me to some reading materials? thanks :) On Mon, Oct 16, 2017 at 4:48 PM, Alan Gauld via Tutor wrote: > On 16/10/17 21:04, Michael C wrote: > > > I don't und

Re: [Tutor] Windows Memory Basics

2017-10-17 Thread Michael C
ncrement by one' approach, actually luck out and get that value in it's actual position? On Mon, Oct 16, 2017 at 4:53 PM, Michael C wrote: > ah, i am bummed completely haha. > > Is there a way to tell which parts a variables so I can scan it? > Maybe you could point me

[Tutor] I found something nice!

2017-10-20 Thread Michael C
Hi all! My project needs to use MEMORY_BASIC_INFORMATION() and SYSTEM_INFO() structures, and previously I thought there wasn't a way (thanks to ErykSun, who wrote it for me, which I have been using) Now I found out someone actually wrote a long time ago, so all I have to do is to download and ins

Re: [Tutor] Windows Memory Basics

2017-10-21 Thread Michael C
cool stuff! On Tue, Oct 17, 2017 at 2:17 AM, Alan Gauld via Tutor wrote: > On 17/10/17 01:02, Michael C wrote: > > > that is, one number, can be truncated and exist in multiple locations > like > > this > > > > double = 12345678 > > > > 123 is

Re: [Tutor] Windows Memory Basics

2017-10-21 Thread Michael C
ff > 08 [0xf4f5fc01] = ff > 09 [0xf4f5fc02] = ff > 10 [0xf4f5fc03] = ff > 11 [0xf4f5fc04] = ff > 12 [0xf4f5fc05] = ff > 13 [0xf4f5fc06] = cc > 14 [0xf4f5fc07] = cc > 15 [0xf4f5fc08] = cc > > > In other words, even if you have the source code for the program you w

[Tutor] Counting iterations of a function

2017-11-30 Thread Michael Dowell
x27;1' for each question, for each question asked. Is there a way to count how many times a give line of code is executed? For instance, every time the oracle() function is run, a counter goes up. Thanks for any help. Program: #Michael Dowell #11-26-27 #Capstone: Magic 8-ball #import modules

[Tutor] I'm attempting to code the barbershop problem in OS except with 3 barbers instead of one. Can anyone help rewrite my Barber1 and Barber2 classes so it just uses the functions already defined i

2018-04-25 Thread Michael Solan
class Barber: barberWorkingEvent = Event() def sleep(self): self.barberWorkingEvent.wait() def wakeUp(self): self.barberWorkingEvent.set() def cutHair(self, customer): #Set barber as busy self.barberWorkingEvent.clear() print '{0} is having a haircut from barber\n'.format(customer.name) HairCutting

Re: [Tutor] Python C extension - which method?

2018-05-07 Thread Michael C
Sorry I don't understand your suggestion. Use "ctypes.CDLL" and "ctypes.WinDLL" this works, mydll = cdll.LoadLibrary('test.dll') print(mydll.sum(3,2)) and this doens't mydll = cdll('test.dll') print(mydll.sum(3,2)) What's the syntax of what you suggested? Thanks On Mon, May 7, 2018 at 3:15 AM

[Tutor] Hi This is Michael Munn and I’m interested of the Python programming language.

2018-08-26 Thread Michael Munn
Hi All, This is Michael and I have a question about resources on starting to code python. I’m using Python 3.6 and I heard a friend of mine told me that He write his code using a word processer called Note pad plus some thing like that to code. Any idea where to get this word Processer? Please

[Tutor] help please

2018-10-10 Thread Michael Schmitt
the following error for rivers in rivers.values(): AttributeError: 'str' object has no attribute 'values' Thanks for the help. Sincerely, Michael S. Schmitt [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.a

[Tutor] graphics library for teaching Python

2018-12-21 Thread Michael Mossey
I'm a computer science tutor and I'm asking advice about a graphics or game library that can be used with Python effectively for teaching purposes. I've found that having my student pick a long-term project is a good way for them to learn coding, and graphics or games make great projects that both

Re: [Tutor] graphics library for teaching Python

2018-12-21 Thread Michael Mossey
On Fri, Dec 21, 2018 at 9:15 AM Mike Barnett wrote: > >There are two sub-topics I'm interested in - (1) graphics, as in drawing > interesting pictures or art, or using diagrams for data visualization. (2) > Simple games, with the use of sprites. > > Can you post some images of similar programs /

[Tutor] learning python from scratch

2019-02-06 Thread Michael Munn
dear fellow programmeers, this is michael. I have a question for Python. I'm a beginner Pythonist. I havee been learning the history and it's use for past years. My main focus this year is to learn it's code and begin coding. Where can I find resource for this? All comment are gre

Re: [Tutor] "Sounding" Off, IDLE (Win7)

2010-02-17 Thread Michael M Mason
e. But anyway, the sound is probably the same sound you get if you type CTRL-G at a command prompt in a DOS box, in which case it isn't one of the sounds you set in Control Panel. You can disable it using Device Manager. It's called 'System Speaker' and it's under 'System

Re: [Tutor] Cannot open SQLite database

2010-02-25 Thread Michael M Mason
older Read-Only, and if you close and re-open the Properties dialog after ticking the checkbox you'll find the coloured square will reappear. -- Michael ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] I don't understand this code

2010-07-14 Thread Michael M Mason
Word(morestuff) You can think of "getRandomWord(wordList)" as a convenient shorthand for:- wordList = words getRandomWord(wordList) Hope this helps -- Michael ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Challenge supporting custom deepcopy with inheritance

2009-05-31 Thread Michael H . Goldwasser
al post at http://mail.python.org/pipermail/python-list/2009-May/714866.html and ask for responses to be sent there. With regard, Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Michael H . Goldwasser
epcopy__). Then I would always have a means for simulating a call to deepcopy(self) based upon the super.__deepcopy__ logic. I wouldn't be surprised if I'm overlooking some undesirable consequence of such a major change in the model, but I don't see one upon first tho

Re: [Tutor] To write data in two different fonts?

2009-08-11 Thread Michael M Mason
the whole sorce file, instead of doing for each line. I think the tag will work, but it will force the font to be monospaced, overriding the "" tag that the OP has included. -- Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] packing a list of lists

2009-08-28 Thread Michael M Mason
out_list.append([ll[0],ll[1]]) And you need to add a return at the end of the function, otherwise it returns None: return out_list -- Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] run command

2009-09-05 Thread Michael M Mason
this at the python prompt (>>>): import hello The import command loads the python file and executes the code in the file. Note that you use "hello" and not "hello.py". -- Michael ___ Tutor maillist - Tutor@python.org

[Tutor] scoping oddity

2005-05-07 Thread Michael . Coll-Barth
Good morning, I came across a rather odd issue with scoping. Can someone explain why testa and testc works, but not testb. I am running under python 2.4.1 on Windows NT. thanks, Michael x = 5 def testa(astr): print astr, x testa(22) def testb(astr): x = x - 1 print astr, x

Re: [Tutor] scoping oddity

2005-05-07 Thread Michael . Coll-Barth
I had used outside of that 'def' block and got 'bitten'. It was in tracking my bug down that I became a tad confused. Actually, now that I know the answer, it all seems so obvious. At least until I get bitten by it again! D'OH! Michael -Original Message

Re: [Tutor] scoping oddity

2005-05-09 Thread Michael . Coll-Barth
ne. Is there a utility of some sort that will present me with a list of the variables used in an application? Preferably, something that might pick up possible scope 'collisions'? If you know what I mean. And if that isn't the right word, what is? thanks guys! Michael -Orig

Re: [Tutor] interactif or not

2005-06-04 Thread Michael P. Reilly
On 6/3/05, Cedric BRINER <[EMAIL PROTECTED]> wrote: hi,How can I know if a script is launched interactively or not because I'd like to make a script verbose or not depending if it is executed as interactive or not.eg.If I invoke it in a shell.. then it can be verboseIf it is launched from a crontab

Re: [Tutor] Process problem

2005-06-16 Thread Michael P. Reilly
On 6/16/05, Alberto Troiano <[EMAIL PROTECTED]> wrote: Hey allNevermind, it worked with the & trick.I just posted because the first 2 times didn't do anything but there was anerror in the crontab so... Alberto, If you are going to use put the processes in the background with the ampersand ('&'), t

Re: [Tutor] Clearing the Console Screen

2005-06-16 Thread Michael P. Reilly
On 6/16/05, Don Parris <[EMAIL PROTECTED]> wrote: Thanks!  I thought there had to be a way to call the OS' clear screencommand, but was going about it the wrong way.  I was trying to usesys.clear instead of os.system.  Would it be difficult to test the OS, store the result in a variable, and call t

Re: [Tutor] Help with Tkinter teachers' report program?

2005-06-24 Thread Michael P. Reilly
On 6/24/05, Adam Cripps <[EMAIL PROTECTED]> wrote: I am a teacher and have written this little Python/Tkinter applicationto help me with my report writing:http://cvs.sourceforge.net/viewcvs.py/squawk/ It's released under GPL and was quite fun to write.However, currently the application only allows

Re: [Tutor] Help with Tkinter teachers' report program?

2005-06-24 Thread Michael P. Reilly
On 6/24/05, Adam Cripps <[EMAIL PROTECTED]> wrote: I hadn't thought about a scrollbar - that would be very useful,although doesn't add to the management side of the statement (i.e.organising them according to subjects).The user can load a text file and adapt that - so they don't have to enter them

Re: [Tutor] Help with Tkinter teachers' report program?

2005-06-24 Thread Michael P. Reilly
On 6/24/05, Adam Cripps <[EMAIL PROTECTED]> wrote: On 6/24/05, Michael P. Reilly <[EMAIL PROTECTED]> wrote:> On 6/24/05, Adam Cripps <[EMAIL PROTECTED]> wrote:> > I hadn't thought about a scrollbar - that would be very useful, > > although doesn't add t

Re: [Tutor] OT self-implementation?

2005-07-01 Thread Michael P. Reilly
On 7/1/05, Brian van den Broek <[EMAIL PROTECTED]> wrote: Hi all,a bit off topic for Python Tutor, but I am think there are decent oddsthat folks here both know good resources and have an idea of whatlevel would be appropriate for me. So, I hope no one minds. A recent thread on comp.lang.python has

[Tutor] New Introductory Book

2007-11-06 Thread Michael H. Goldwasser
We are pleased to announce the release of a new Python book. Object-Oriented Programming in Python by Michael H. Goldwasser and David Letscher Prentice Hall, 2008 (available as of 10/29/2007) The book differs greatly from existing introductory Python books as it

Re: [Tutor] New Introductory Book

2007-11-06 Thread Michael H. Goldwasser
eview copies to educators and sending representatives to campuses. In any event, we believe that the book can be quite useful outside the traditional classroom for new programmers or those new to object-oriented programming. Best regards, Michael On Tuesday November 6, 2007, jay wrote: >

[Tutor] From Numpy Import *

2007-11-07 Thread Michael H. Goldwasser
namespace. If you were using some other package that also defined an "array" and then you were to use the "from numpy import *", the new definition would override the other definition. The use of qualified names helps to avoid these collisions and makes clear where those def

Re: [Tutor] New Introductory Book

2007-11-08 Thread Michael H. Goldwasser
tact our publisher today so that we can get full source code from the entire book up on their website. I'm not sure of their willingness for a sample chapter, but will ask about that as well. With regard, Michael +-------

[Tutor] Problem with default arguments for function

2007-11-11 Thread Michael H. Goldwasser
t;> print fact(50, None) 30414093201713378043612608166064768844377641568960512 With regard, Michael On Sunday November 11, 2007, Dick Moores wrote: >def fact(n, precision=15, full=False): > """ > compute n! > """

[Tutor] assignment question

2007-11-11 Thread Michael H. Goldwasser
On Sunday November 11, 2007, Ryan Hughes wrote: >Hello, > >Why does the following not return [1,2,3,4] ? > >>>> x = [1,2,3].append(4) >>>> print x >None The reason is that the append method does not return anything. In effect, the expresison [1,2,3].append(4) tempo

Re: [Tutor] global is bad but ...

2007-11-13 Thread Michael H. Goldwasser
other array. In this sense, the code is not reusable. If it accepted G as a parameter, then it would be more general. The main advantage of globals is convenience (for example, if all you care about is getting this particular program working as soon as possi

Re: [Tutor] manipulating data

2007-11-15 Thread Michael H. Goldwasser
t() # I've left this here, but not sure # why you have it. The for loop # already advances from line to line Note as well that it is better to perform the split once per line (rather than recomputing it as you do in your or

[Tutor] Little subclass understanding problem

2007-11-15 Thread Michael H. Goldwasser
example is certainly not a proper use of inheritance. With regard, Michael On Thursday November 15, 2007, Michael H. Goldwasser wrote: > >On Thursday November 15, 2007, Tom wrote: > >>I am trying to understand what happens in the following scenario: >>

[Tutor] Little subclass understanding problem

2007-11-15 Thread Michael H. Goldwasser
lass Set(list): def __init__(self, value = []): list.__init__([]) self.concat(value) # copies mutable default That fourth line uses a custom method defined later to insert designated values into the set while making sure to avoid

[Tutor] repeat

2007-11-17 Thread Michael H. Goldwasser
On Saturday November 17, 2007, Michael wrote: >Hi All > >This has probably been asked before but can I get some clarification on >why Python does not have a repeat...until statement, and does that mean >repeat...until is bad practice? I was trying to ge

Re: [Tutor] Variables and Functions

2007-11-28 Thread Michael H. Goldwasser
With regard, Michael class Sudoku: def __init__(self): self.puzzle = [[1,2,3,4,5,6,7,8,9], [4,5,6,7,8,9,1,2,3], [7,8,9,1,2,3,4,5,6], [2,3,4,5,6,7,8,9,1], [5,6,7,8,9,1,

Re: [Tutor] parsing a continuous log file

2007-11-29 Thread Michael H. Goldwasser
uot;do what you want with", line else: # currently at end of file time.sleep(1) # don't want to poll too quickly Good luck, Michael On Friday November 30, 2007, Alan Gauld wrote: > >"ray sa" <[EMAIL PROTECTED]> wro

Re: [Tutor] Use of sqrt() from math module

2007-12-01 Thread Michael H. Goldwasser
th.sqrt is likely due to an attempt to take the square root of a negative number (presumably because your (ypos - 384 * 160) factor is negative. With regard, Michael On Saturday December 1, 2007, Matt Smith wrote: >Matt Smith wrote: >> import sys, pygame, math >> >

[Tutor] Timed While Loops and Threads

2007-12-08 Thread Michael H. Goldwasser
numSeconds, 'seconds, you scored', score, 'points.' +--- | Michael Goldwasser | Associate Professor | Dept. Mathematics and Computer Science | Saint Louis Unive

[Tutor] what is the difference

2007-12-13 Thread Michael H. Goldwasser
. else: return With regard, Michael On Thursday December 13, 2007, johnf wrote: >if self._inFlush: > return >self._inFlush = True > > >AND > >if not self._inFlush: > ... > self._inFlush = True >else:

[Tutor] Bound To Be A Typo

2007-12-17 Thread Michael H. Goldwasser
You've inadvertently used three underscores around __init__ rather than two, and therefore you are not really defining __init__ but instead are relying upon the inherited one from object (which takes no parameters). With regard, Michael On Monday December 17, 2007, earlylight publishing

[Tutor] Regular Expression

2007-12-21 Thread Michael H. Goldwasser
patt = re.compile(r"~02(\d*)~") Also, your outfile.write command below doesn't provide any substitute for %s. Presumably you mean outfile.write("%s\n" % m.group(1)) . Good luck, Michael On Friday December 21, 2007, Que Prime wrote: >I need to pull the highligted d

Re: [Tutor] Closing GUI program

2007-12-28 Thread Michael H. Goldwasser
operating system. Some interesting reading is at http://www.3dartist.com/WP/python/tknotes.htm With regard, Michael --- from Tkinter import Tk,Label def onClose(): root.destroy() # stops the main loop and interpreter root = Tk() roo

[Tutor] classes and the deepcopy function

2008-01-04 Thread Michael H. Goldwasser
Hi Michael, This is a very interesting example. You do indeed have two distinct copies. The interdependence you are observing is because you have defined CLASS-LEVEL variables (akin to static in Java) rather than instance-level variables. This is because of their declaration within

[Tutor] Urgent: Help

2008-01-07 Thread Michael H. Goldwasser
u through these problems. He or she is best qualified to know your current level and the context for such a homework assignment. Of course, reading the book is also likely to help. For everyone else, if you like these exercises there are 300 more where they came from. ;-) With

Re: [Tutor] Scope and elegance revisited

2008-01-09 Thread Michael H. Goldwasser
han Foo. >> def main(): >> Foo.class_variable = "Done" >> Foo() Notice the above change matches the style you are using in main(). Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pointers in python ??

2008-01-20 Thread Michael H. Goldwasser
ent, as you need to explicitly dereference them to access the underlying instance, as in c->setX(3) rather than c.setX(3). If you are comfortable with Java's syntax and semantics, it is easy to explain. The model for all data types in Python is the same as the model used for non-primit

[Tutor] sorting objects on two attributes

2008-03-03 Thread Michael H. Goldwasser
you may adjust the sign of the decorate elements if necessary. With regard, Michael +------- | Michael Goldwasser | Associate Professor | Dept. Mathematics and Computer Science | Saint Louis University | 22

Re: [Tutor] Generate 8 digit random number

2005-08-26 Thread Michael P. Reilly
On 8/26/05, Alberto Troiano <[EMAIL PROTECTED]> wrote: Hi everyoneI need to generate a password..It has to be an 8 digit number and it has tobe randomThe code I've been trying is the following:import randomrandom.randrange(,) The code works but sometimes it picks a number with 7 dig

Re: [Tutor] Killing a thread from main - was RE: "Lock"ing threads

2005-08-30 Thread Michael P. Reilly
On 8/29/05, Hans Dushanthakumar <[EMAIL PROTECTED]> wrote: Thanks KentHow do I send a signal from the main thread to stop execution of a childthread?I tried the foll:, but got an error:Other than by this method, is there any other mechanism to stop athread? import threadingimport timeclass shownum(

Re: [Tutor] Where did those spaces come from?

2005-09-13 Thread Michael P. Reilly
On 9/12/05, Tom Tucker <[EMAIL PROTECTED]> wrote: Tutor, Good evening!    The goal is to parse a simple file and grab column one.  Then print each value horizontally separated by a comma. Why is Python adding a space padding between each value?   Please see below. Thanks ahead of time. INPU

Re: [Tutor] launching and monitor from make

2005-10-12 Thread Michael P. Reilly
On 10/12/05, Ertl, John <[EMAIL PROTECTED]> wrote: I have a very simple python program that reads one file and overwritesanouther text file.  This workes great from the command line and it haserror checking but just outputs messages and the like to the screen. The CM team here would like to have th

Re: [Tutor] Difference between popens

2006-06-10 Thread Michael P. Reilly
On 6/9/06, Bernard Lebel <[EMAIL PROTECTED]> wrote: Hey, thanks for the nice explanation Michael!BernardWhoops.. Hit "reply" instead of "reply to all".  My apologies to the group.  Dang gmail.  -Michael -- There's so many different worlds,So many different suns.An

Re: [Tutor] How can I copy files recursively?

2006-07-11 Thread Michael P. Reilly
On 7/10/06, Richard Querin <[EMAIL PROTECTED]> wrote: I know this is probably a dumb question:I've got mp3 files that are downloaded (by ipodder) into individual subfolders. I'd like to write a quick script to move (not copy) all the mp3 files in those folders into a single destination folder. I wa

Re: [Tutor] Need Help

2006-07-11 Thread Michael P. Reilly
On 7/10/06, Shappell, John J CW2 <[EMAIL PROTECTED]> wrote: Here is the assignment You've been given an assignment by your supervisor to program a small application to monitor the current status of the cash account in the firm's petty cash fund (the amount of cash kept on hand in the off

Re: [Tutor] create 1000 000 variables

2006-07-15 Thread Michael P. Reilly
On 7/14/06, Сергій <[EMAIL PROTECTED]> wrote: suppose I need to create 1000 000 variables var_1, var_2, var_100   how to do this using for? (something like for i in range(100): ___var_ You should think about not creating variables like this, it is bad programming and continuing to use

Re: [Tutor] create 1000 000 variables

2006-07-15 Thread Michael P. Reilly
Good.  But one VERY important point to note is that that you are not working with "variables" here.  You are working with members of a class instance.  This is a very different beast.  You could just use getattr(), setattr() and delattr() for these. But continuing... you might want to think about t

Re: [Tutor] So close! But ... error: (10054, 'Connection reset by peer')

2006-07-16 Thread Michael P. Reilly
You are running on a PC, which doesn't have a SMTP server running on it.  The default hostname for smtplib.SMTP().connect() is to localhost (your own machine).   You will need to find out the hostname of the mail server that your ISP provides.  You probably set it when you set up your email (based

Re: [Tutor] Calling a function by string name

2006-07-21 Thread Michael P. Reilly
On 7/21/06, Smith, Jeff <[EMAIL PROTECTED]> wrote: I have an object and I want to call a method that I have constructed the name for in a string.   For example: str_method = 'myfun' obj.str_method   Of course, this fails.  I know I could probably do this with exec but is there a better

Re: [Tutor] problem with rejected mail smtplib

2006-07-30 Thread Michael P. Reilly
On 7/29/06, shawn bright <[EMAIL PROTECTED]> wrote: Hello there,i have a customer list, each with a number of email address that we send notifications to via text message.the problem is, there are a number of providers ( just two ) that reject our messages. the script goes a little something like t

Re: [Tutor] When am I ever going to use this?

2006-08-02 Thread Michael P. Reilly
On 8/1/06, Christopher Spears <[EMAIL PROTECTED]> wrote: I've been working through a tutorial:http://www.ibiblio.org/obp/thinkCSpy/index.htm.Lately, I have been learning about abstract data types(linked lists, stacks, queues, trees, etc.).  While I do enjoy the challenge of creating these objects,

Re: [Tutor] How to un-import modules?

2006-08-14 Thread Michael P. Reilly
On 8/14/06, Dick Moores <[EMAIL PROTECTED]> wrote: Actually, my question is, after using IDLE to do some importing ofmodules and initializing of variables, how to return it to it'sinitial condition without closing and reopening it.So, for example after I've done >>> import math, psyco >>> a = 4**2

Re: [Tutor] HTML page status

2006-09-12 Thread Michael P. Reilly
On 9/12/06, Johan Geldenhuys <[EMAIL PROTECTED]> wrote: Hi all,I looked a little bit at the urllib and it all looks fairly easy.What I didn't see, if it is there, was how to know or identify if a pagewas successfully downloaded. I want to do tests to see if a connection to a webpage was successful

Re: [Tutor] tuples versus lists

2006-09-14 Thread Michael P. Reilly
Tuples, like other immutable data types, are hashable (assuming the contents are immutable as well), and so they can be used as keys to dictionaries.  Lists cannot be used this way. >>> {['a']: 'a'}Traceback (most recent call last):  File "", line 1, in ?TypeError: list objects are unhashable>>> {(

Re: [Tutor] file open (take 2)

2006-09-27 Thread Michael P. Reilly
On 9/27/06, Dave S <[EMAIL PROTECTED]> wrote: Hi,I am trying to read in an ascii text file, do some alterations and write itback.file = open(self.config.get('pdf','cert') + '/cert.pdf' , 'r+')lines = file.readlines()... process lines ... file.writelines(lines)file.close()works but ends up appending

Re: [Tutor] what is "user time" in os.times()?

2006-10-03 Thread Michael P. Reilly
t;[EMAIL PROTECTED]> wrote:At 05:24 AM 10/3/2006, Michael P. Reilly wrote: >It is not really a "ghost".  On most systems, there is a split>between what happens while you are a "user" and what happens deep>inside the operation "system".  The function is showin

Re: [Tutor] python equivalent of perl readlink()?

2006-10-15 Thread Michael P. Reilly
On 10/15/06, Bill Campbell <[EMAIL PROTECTED]> wrote: Is there a python equivalent of the perl readlink() function(e.g. one that returns the relative path in cases where a commandsuch as ``ln -s ls /usr/local/bin/gls'' created the link?Reading the documentation on the various os.path functions, th

Re: [Tutor] Exception and sys.exit() in a cgi script

2006-10-22 Thread Michael P. Reilly
On 10/21/06, Paulino <[EMAIL PROTECTED]> wrote: Mike Hansen Mike.Hansen at atmel.com Mon Oct 16 18:43:29 CEST 2006 > This is a peace of a CGI script i have.> > 1 import cgi> 2 form=cgi.FieldStorage()> 3 try :> 4 ano=form["ano"].value> 5 conta=form["conta"].v

Re: [Tutor] is gotchas?

2006-11-06 Thread Michael P. Reilly
On 11/6/06, Tim Johnson <[EMAIL PROTECTED]> wrote: * Kent Johnson <[EMAIL PROTECTED]> [061106 10:31]:>> In [9]: a=[1,2]>> In [10]: b=[1,2]  Hmmm! Hmmm!  Lookee here:  ## console session >>> a=[1,2]>>> b=[1,2]>>> a is bFalse>>> c='1'  ## one byte>>> d='1'  ## one byte>>> c is dTrue>>> c='1,2'>>> d='

Re: [Tutor] shebang question

2006-11-26 Thread Michael P. Reilly
Very true about Python being installed in different places. In fact, for system compatibility reasons, it is sometime required that two or three very different releases of Python need to exist on the same system. If more than one happen to be in your path, then the use of "env python" becomes a

Re: [Tutor] __init__.py for running a file from commandline?

2006-11-27 Thread Michael P. Reilly
Marcus, When you type something from the command-line, you are at the whims of the WinXP command shell. You have to follow its rules, not Python's. It would need to have "python" in %PATH%, and then it would need to have to run "python C:\path\to\pyroot\utils\commands\mygrep.py". The arguments

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Michael P. Reilly
On 2/16/07, Alan Gauld <[EMAIL PROTECTED]> wrote: As to standard list behaviour, I don't know of any list thats been around for more than say 10 years that uses Reply to send to All. This seems to be a very recent thing. (And most of the lists I am on have been around for much more than 10 years

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Michael P. Reilly
On 2/16/07, ALAN GAULD <[EMAIL PROTECTED]> wrote: > However, the "standard behavior" at the time was that > replies went back to the mailing list, not to the original sender. But the mailing list was the original sender so it was all wonderfully consistent. Reply goes to sender only, which hap

Re: [Tutor] how to wirte code In python :str = (a>b?"Yes":"NO")

2007-02-16 Thread Michael P. Reilly
On 2/16/07, Wolfram Kraus <[EMAIL PROTECTED]> wrote: On 16.02.2007 08:01, xiufeng liu wrote: > Hi, all, > > In python if there is any similar way like in Java, or C++ to express > the following: > str = (a>b?"Yes":"NO") > > > thanks! In Python 2.5 you can do the following (untested): str = "Ye

[Tutor] PyCon2009 Tutorial: An Introduction to Object-Oriented Programming

2009-01-31 Thread Michael H . Goldwasser
ations together with hands-on demonstrations and exercises. For a more detailed outline of the topics or a link to registration, see http://us.pycon.org/2009/tutorials/schedule/2PM1 If you have other questions about what to expect, feel free to contact me. With regard

Re: [Tutor] nested loops

2011-02-07 Thread Michael M Mason
ething: > > if x+y+z > highscore: > > highscore = x+y+z > > alignment = newalignment > found = True > break > > HTH, That's going to exit fi

Re: [Tutor] broken script - curiouser and curiouser

2011-07-07 Thread Michael M Mason
Michael M Mason wrote on 07 July 2011 at 15:38:- > > In error, I downloaded ex26 before I had done ex25. So I left > > it and did ex25. > > > > Having finally given up on ex25, I am now doing ex26. And guess > > what?! Line 10 has a missing colon. > > >

Re: [Tutor] broken script - curiouser and curiouser

2011-07-07 Thread Michael M Mason
ause problems in ex25 Maybe you've been editing ex25 and then executing ex26. That'd get you the same error in the same place over and over again. -- Michael This mail was sent via Mail-SeCure System.

Re: [Tutor] Is the Python 3.2.1 documentation available as a .chm file?

2011-07-21 Thread Michael M Mason
you haven't told Windows that it's safe yet. You need to right-click the CHM file, select 'Properties', and then click the 'Unblock' button. -- Michael This mail was sent via Mail-SeCure System. ***

Re: [Tutor] Okay, this time I tried doing a little research but no luck in solving this one.

2011-11-11 Thread Michael M Mason
s\net2010> This is normal with Python on Windows. The Python installer doesn't add the program directory to the PATH, so you have to include the full pathname to run Python from the command line, something like this:- C:\Python27\python -c "im

Re: [Tutor] Weird Try..Except Error

2011-11-28 Thread Michael M Mason
hese commands:- assoc .py = Python32.File assoc .pyw = Python32.NoConFile assoc .pyc = Python32.CompiledFile ...and to use Python 2.7 we'd use these commands:- assoc .py = Python27.File assoc .pyw = Python27.NoConFile assoc .pyc = Python27.CompiledFile -- Michae

Re: [Tutor] Notepad++ question

2012-06-07 Thread Michael M Mason
d off you go! There is also an option to make tab characters and space characters visible. In the 'View' menu, select 'Show Symbol' and then make sure the 'Show White Space and TAB' option is ticked. That

[Tutor] An Advice to a dedicated beginner

2016-01-18 Thread Michael Appiah Boachie
nothing on how to transition into that. That’s exactly how I’m feeling. Hoping to receive some kind words. Michael ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Michael J. McConachie
On 02/14/2013 05:06 PM, bob gailer wrote: > On 2/14/2013 3:55 PM, Michael McConachie wrote: > [snip] > > I agree with dave angel - the specification is far from clear. please > clarify. perhaps a simple example that goes from input to desired output. > _

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Michael J. McConachie
, Mike On 02/14/2013 05:48 PM, Steven D'Aprano wrote: > On 15/02/13 07:55, Michael McConachie wrote: > >> Essentially: >> >> 1. I have a list of numbers that already exist in a file. I >> generate this file by parsing info from logs. >> 2. Each line co

Re: [Tutor] Newbie Here -- Averaging & Adding Madness Over a Given (x) Range?!?!

2013-02-15 Thread Michael J. McConachie
On 02/15/2013 04:03 PM, Albert-Jan Roskam wrote: > >> Eventually what I'll need to do is: >> 1. Index the file and/or count the lines, as to identify each line's >> positional relevance so that it can average any range of numbers that are >> sequential; one to one another. > In other words: you

Re: [Tutor] writing python on the web

2013-10-06 Thread R. Michael Weylandt
On Oct 5, 2013, at 11:47, roberto wrote: > > Thank you guys, I'll take a look at what you suggested! Also take note of some of the cloud based solutions developed in the scientific community. Wakari (from Continuum Analytics) has a free plan that would likely suffice for students in their f

[Tutor] If, elif, else

2014-01-28 Thread Michael L. Pierre
uot;, age, "years old" else: age = int(current_split[0]) - int(dob_split[0]) print "You are", age, "and today is your birthday ***HAPPY BIRTHDAY***" Any help would be greatly

[Tutor] Kill a socket doing a recvfrom

2010-01-13 Thread Michael Bernhard Arp Sørensen
Greetings my masters. How do I kill a socket which is locked in a recvfrom? My effort to kill it failed. The socket is running in its own thread. Any bright ideas? Med venlig hilsen/Kind regards Michael B. Arp Sørensen Programmer / BOFH "If you want to enter my network while I'm ou

[Tutor] Making a sound

2010-07-31 Thread Michael Bernhard Arp Sørensen
a file and play it afterwards. Preferably it should be something from PYPI. Any suggestions? Thanks in advance. Kind regards Michael B. Arp Sørensen Programmer / BOFH "If you want to enter my network while I'm out, you can find my SSH-key under my mouse mat" - Mich

[Tutor] Find a good linux distribution with python.

2009-05-24 Thread Michael Bernhard Arp Sørensen
nd, any code I migth write would be difficult for others to use. Any ideas or comments? I use emacs with rope, ipython and python. I like those in newer versions if not bleeding edge. Med venlig hilsen/Kind regards Michael B. Arp Sørensen Programmer / BOFH Denmark "If you want to enter my networ

Re: [Tutor] Find a good linux distribution with python.

2009-05-25 Thread Michael Bernhard Arp Sørensen
good linux distro contains all the great modes for Emacs and the newest version of Emacs and Python. Thank you all very much. Med venlig hilsen/Kind regards Michael B. Arp Sørensen Programmer / BOFH "If you want to enter my network while I'm out, you can find my SSH-key under my mouse m

<    3   4   5   6   7   8   9   >