Re: [Tutor] Tutor Digest, Vol 54, Issue 72

2008-08-21 Thread Lie Ryan
On Wed, 2008-08-20 at 23:06 +0200, [EMAIL PROTECTED] wrote: > > Message: 6 > Date: Wed, 20 Aug 2008 23:50:55 +0300 > From: "Dotan Cohen" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Reformatting phone number > To: python-tutor. > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain;

Re: [Tutor] Reformatting phone number

2008-08-22 Thread Lie Ryan
> Message: 4 > Date: Thu, 21 Aug 2008 12:13:58 +0200 > From: "Dotan Cohen" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Reformatting phone number > To: OmerT <[EMAIL PROTECTED]> > Cc: "python-tutor." > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8 > > 2008/8/21

Re: [Tutor] pass argument into running program *outside* of program

2008-08-22 Thread Lie Ryan
> Message: 8 > Date: Fri, 22 Aug 2008 10:28:44 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] pass argument into running program *outside* of > program > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-885

Re: [Tutor] Problem with creating a class to access a 2d array

2008-08-23 Thread Lie Ryan
On Sat, 2008-08-23 at 12:00 +0200, [EMAIL PROTECTED] wrote: > > Message: 1 > Date: Fri, 22 Aug 2008 20:46:25 -0400 > From: "lawful falafel" <[EMAIL PROTECTED]> > Subject: [Tutor] Problem with creating a class to access a 2d array > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> >

Re: [Tutor] Python open of c:\ path Problem

2008-08-25 Thread Lie Ryan
> Message: 7 > Date: Sun, 24 Aug 2008 00:21:45 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Python open of c:\ path Problem > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=origina

Re: [Tutor] Python installing in root

2008-08-26 Thread Lie Ryan
On Tue, 2008-08-26 at 12:00 +0200, [EMAIL PROTECTED] wrote: > > > Message: 2 > Date: Tue, 26 Aug 2008 10:40:42 +0200 > From: "Andre Engels" <[EMAIL PROTECTED]> > Subject: [Tutor] Python installing in root > To: "Python Tutor List" > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/

Re: [Tutor] __iter__ loops, partitioning list among children

2008-08-28 Thread Lie Ryan
> > > Just for the sake of argument, here's the principle I'm working > from: > > > > # > lst = range(10) > iterlst = iter(lst) > iterlst.next() > > 0 > for x in iterlst: > > ... if x < 5: > > ... print x > > ... else: > > ... break > > ... > > 1 > > 2 > > 3 >

Re: [Tutor] how do I create a lists of values associated with a key?

2008-08-28 Thread Lie Ryan
Message: 8 Date: Thu, 31 Jul 2008 20:16:54 -0700 (PDT) From: Angela Yang <[EMAIL PROTECTED]> Subject: [Tutor] how do I create a lists of values associated with a key? To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" > That did not work bec

Re: [Tutor] dynamic argument lists

2008-08-30 Thread Lie Ryan
On Sat, 2008-08-30 at 12:00 +0200, [EMAIL PROTECTED] wrote: > > Message: 2 > Date: Sat, 30 Aug 2008 10:09:36 +0100 > From: eShopping <[EMAIL PROTECTED]> > Subject: Re: [Tutor] dynamic argument lists > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=us-asc

Re: [Tutor] Sending email as html

2008-09-05 Thread Lie Ryan
> Message: 3 > Date: Sat, 6 Sep 2008 00:17:43 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Sending email as html > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > > "Ti

Re: [Tutor] Tutor Digest, Vol 55, Issue 84

2008-09-29 Thread Lie Ryan
On Mon, 2008-09-29 at 03:00 +0200, [EMAIL PROTECTED] wrote: > > Message: 2 > Date: Sun, 28 Sep 2008 23:36:07 + > From: [EMAIL PROTECTED] > Subject: [Tutor] Hello and some questions. > To: tutor@python.org > Message-ID: > <[EMAIL PROTECTED]> > > > Hello all. > > I recently s

Re: [Tutor] Idle and windows XP firewall

2008-10-01 Thread Lie Ryan
On W W wrote: > > Message: 6 > Date: Wed, 1 Oct 2008 08:46:50 -0500 > From: "W W" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Idle and windows XP firewall > To: [EMAIL PROTECTED] > Cc: tutor python > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Wh

Re: [Tutor] Tutor Digest, Vol 56, Issue 22

2008-10-05 Thread Lie Ryan
On Mon, 2008-10-06 at 05:32 +0200, [EMAIL PROTECTED] wrote: > > Message: 8 > Date: Sun, 5 Oct 2008 20:27:39 -0700 > From: Anthony Smith <[EMAIL PROTECTED]> > Subject: [Tutor] first call - newcomer > To: > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > > Thi

Re: [Tutor] first call - newcomer

2008-10-10 Thread Lie Ryan
On Mon, 2008-10-06 at 05:32 +0200, [EMAIL PROTECTED] wrote: > > Message: 8 > Date: Sun, 5 Oct 2008 20:27:39 -0700 > From: Anthony Smith <[EMAIL PROTECTED]> > Subject: [Tutor] first call - newcomer > To: > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > > Thi

Re: [Tutor] Looking for Clues to Make a Program Produce avi Files Instead ...

2008-10-15 Thread Lie Ryan
On Wed, Oct 15, 2008 at 1:25 AM, Wayne Watson <[EMAIL PROTECTED]> wrote: > ... of mov files. (See Subject). Our meteor software program uses a py > program to produce a movie from images taken by an all-sky camera. The > frames are in a simple but different format than likely used anywhere > else.

Re: [Tutor] [tutor] run a program and direct it's print file to a file?

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 07:56:53 -0400, Fast Primes wrote: > Hi, > > I'm very rusty. From a linux box, I want to run a program X.py after or > while setting it's list output to a file L.txt. How do I do that please? I think this is a linux question more than python question. In Linux, it's easy to

Re: [Tutor] please help with simple python CGI script

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 08:32:52 +, Alan Gauld wrote: > "aivars" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>I finally get the script working! >> >> I renamed the script directory from Cgi-bin to cgi-bin just as Alan >> told. > > I'm glad it worked but I confess I'm not sure w

Re: [Tutor] pickling, writing, reading individual lists from a file

2008-11-03 Thread Lie Ryan
On Mon, 03 Nov 2008 06:42:28 -0500, Kent Johnson wrote: > On Mon, Nov 3, 2008 at 6:15 AM, Lie Ryan <[EMAIL PROTECTED]> wrote: >> On Sun, 02 Nov 2008 23:20:47 -0800, Dinesh B Vadhia wrote: >> >>> I want to pickle a bunch of lists and write each list separately to a &

Re: [Tutor] request from john caldwell to get off the mailing list

2008-11-03 Thread Lie Ryan
On Sun, 02 Nov 2008 12:59:16 -0800, john caldwell wrote: > Please take me oof of the mailing list. thank you > [EMAIL PROTECTED] > > You can unsubscribe from here: http://mail.python.org/mailman/listinfo/ tutor alternatively, you can also send some magic mail to a magic email address con

Re: [Tutor] pickling, writing, reading individual lists from a file

2008-11-03 Thread Lie Ryan
On Sun, 02 Nov 2008 23:20:47 -0800, Dinesh B Vadhia wrote: > I want to pickle a bunch of lists and write each list separately to a > fileand then read them back. Here is my code with the EOF error: > > filename = 'lists.txt' > fw = open(filename, 'w') > for l in m: > n = pickle.dumps(l,

Re: [Tutor] (no subject)

2008-11-03 Thread Lie Ryan
On Sat, 01 Nov 2008 06:17:06 -0500, otu wrote: > Dear Friends, > I have just started learning python programming. I have no previous > programming knowledge. > I am presently using Python 2.6 windows version. I am struggling with > how to enable executable files. I copied the ff program on idlle >

Re: [Tutor] unsubscribing to tutor assistance

2008-11-03 Thread Lie Ryan
On Sun, 02 Nov 2008 20:53:41 -0600, Sean Fisher wrote: > please end y tutor e-mail assistance > Thank you You can unsubscribe from here: http://mail.python.org/mailman/listinfo/ tutor alternatively, you can also send some magic mail to a magic email address containing some magic subject line a

Re: [Tutor] stopping threads ?

2008-11-03 Thread Lie Ryan
On Mon, 03 Nov 2008 14:46:09 +, dave selby wrote: > Hi All, > > Why when I use threads in my app (I know they are evil ...lol) does it > not stop with ctrl-c, I have to use ctrl-z ? > > Cheers > > Dave Wonder why? Because Ctrl-C merely raises KeyboardInterrupt in the main thread, breaking

Re: [Tutor] how to read over serial port

2008-11-03 Thread Lie Ryan
On Mon, 03 Nov 2008 08:48:44 -0600, shawn bright wrote: > ok, i have another question: > if i run this: > #!/usr/bin/env python > f = 'test_out' > f = open(f, 'r').read() > for i in f: > print ord(i) > > I get this: > 0 > 6 > 0 > 58 > 128 > 31 > 22 > 103 > 74 > 115 > 222 > 192 > 74 > 115 > 22

Re: [Tutor] how to read over serial port

2008-11-03 Thread Lie Ryan
On Mon, 03 Nov 2008 08:48:44 -0600, shawn bright wrote: > ok, i have another question: > if i run this: > #!/usr/bin/env python > f = 'test_out' > f = open(f, 'r').read() > for i in f: > print ord(i) > > I get this: > 0 > 6 > 0 > 58 > 128 > 31 > 22 > 103 > 74 > 115 > 222 > 192 > 74 > 115 > 22

Re: [Tutor] Intermediate/advanced concepts

2008-11-07 Thread Lie Ryan
On Thu, 06 Nov 2008 23:14:38 -0500, btkuhn wrote: > Hi everyone, > > I've been teaching myself python for a few months and I'm becoming > frustrated because I've kind of hit a wall in terms of learning new > information. In an effort to continue to learn I've found some material > on more interme

Re: [Tutor] Upgrading from Python 2.5 to Python 2.6 - IDLE not working...

2008-11-09 Thread Lie Ryan
On Sat, 08 Nov 2008 18:34:54 -0500, Dan wrote: > Hi All, > > This is my first post, so I apologize in advance for any etiquette > violations. > > I am interested in learning Python, and to that end, I undertook to > upgrade my current version of Python 2.5 (available via openSUSE > repositories

Re: [Tutor] get a module's own (top_level) dict?

2008-11-09 Thread Lie Ryan
On Sun, 09 Nov 2008 11:34:37 +0100, spir wrote: > Hello pyhonistas, > > Example: > === module content === > a = 1 > b = 2 > == > > I'm looking for a way to get something like {'a':a, b':2}. Actually, > names defind in the module will be instances of a custom type. I want to >

Re: [Tutor] list output -- float output

2008-11-14 Thread Lie Ryan
On Fri, 14 Nov 2008 15:21:17 +0100, spir wrote: > Well, actually not really I guess. I asked for rounded floats, not > full-precision ones. > Now, after more reflexion on the topic, I understand that even rounded > floats need to keep full precision internally, because of the 'modular' > difference

Re: [Tutor] PYTHON ON DOS

2008-11-14 Thread Lie Ryan
On Fri, 14 Nov 2008 10:27:59 -0800, WM. wrote: > Some say that Python programs run better on DOS. I cannot find a way to > do that. I can go 'Python Command Line' to wind up on a black screen > version of IDLE but I can't get from the interactive to executive mode. > > Is there any advantage to

Re: [Tutor] Running Python from REVO screen???

2008-11-16 Thread Lie Ryan
On Sun, 16 Nov 2008 02:06:30 -0800, WM. wrote: > I asked tutor how to get to the black screen to run Python programs. I > got a three step answer but could not get step 1. to work; > > 1. > XP: Start > Run > type "cmd" > OK > > C:\Documents and Settings > The above line is where I wind up & I c

Re: [Tutor] Help Optimise Code

2008-11-19 Thread Lie Ryan
On Wed, 19 Nov 2008 13:13:18 +, Richard Lovely wrote: > I'm pretty new to code optimisation, so I thought I'd ask you all for > advice. > > I'm making an iterative prime number generator. This is what I've got so > far: > > Code: Select all > import math, array > > def count2(start_at=0): >

Re: [Tutor] Scrolling through output in shell

2008-11-19 Thread Lie Ryan
On Mon, 17 Nov 2008 09:20:55 -0500, Shawn Milochik wrote: > On Sun, Nov 16, 2008 at 1:21 PM, Mike Hoy <[EMAIL PROTECTED]> wrote: >> I'm writing a small program that writes to a text file. I want to be >> able to view the contents of the text file inside of shell. But the >> file is too large for a

Re: [Tutor] faulty code (maths)

2008-11-23 Thread Lie Ryan
On Sun, 23 Nov 2008 19:39:54 +0530, Arun Tomar wrote: > hi! > > > On Sun, Nov 23, 2008 at 5:07 PM, David <[EMAIL PROTECTED]> wrote: >> Hello everybody, >> >> I recently came across a book by Prof. Langtangen: Indroduction to >> Computer Programming: >> http://folk.uio.no/hpl/INF1100/INF1100-eboo

Re: [Tutor] the sense of brackets

2008-11-24 Thread Lie Ryan
On Sat, 22 Nov 2008 22:58:48 +0100, spir wrote: > W W a écrit : > > On Sat, Nov 22, 2008 at 9:42 AM, spir <[EMAIL PROTECTED]> wrote: > > > >> I have long thought "[]" /simply/ is a list constructor syntax. What > >> do you think of the following? > >> > >> t = "aze" > >> print t, list(t), [

Re: [Tutor] accessing list from a string

2008-11-25 Thread Lie Ryan
On Tue, 25 Nov 2008 06:59:13 -0800, Mark Tolonen wrote: > "Bryan Fodness" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I have a list in a text file that is in the python format., >> >> Positions = [2.5,2.8] >> >> and would like to grab the values. >> >> for line in file

Re: [Tutor] Sorting a dictionary on a value in a list.

2008-12-06 Thread Lie Ryan
On Thu, 04 Dec 2008 10:48:54 -0800, Lawrence Wickline wrote: > Thanks for the help I think I got it. > > As far as lines go I believe it will be processing hundreds of thousands > of lines if not a million or more lines per run. I haven't gotten to do > a full run but it has been running acceptab

Re: [Tutor] Newbie Wondering About Threads

2008-12-06 Thread Lie Ryan
On Sat, 06 Dec 2008 21:43:11 -0500, Damon Timm wrote: > On Sat, Dec 6, 2008 at 6:25 PM, Python Nutter <[EMAIL PROTECTED]> > wrote: >> I'm on my phone so excuse the simple reply. From what I skimmed you are >> wrapping shell commands which is what I do all the time. Some hints. 1) >> look into pope

Re: [Tutor] Sorting on different fields

2008-12-07 Thread Lie Ryan
On Sat, 06 Dec 2008 21:47:16 -0800, the New me wrote: > is there a straightforward example? >>> import operator >>> k = [[1, 2, 3, 4], [4, 3, 2, 1], [1, 3, 2, 4], [2, 4, 3, 1]] >>> sorted(l, key=operator.itemgetter(3, 2)) [[4, 3, 2, 1], [2, 4, 3, 1], [1, 3, 2, 4], [1, 2, 3, 4]] >>> for k in sorte

Re: [Tutor] 'for' loops

2008-12-07 Thread Lie Ryan
On Tue, 02 Dec 2008 01:17:41 +, Alan Gauld wrote: > while loops are used much less in Python than in other languages because > for loops are so powerful. Actually, I think python's for-loop is so powerful that while loop could be removed from the language and no power would be lost (although

Re: [Tutor] try except block for multiple statements

2008-12-07 Thread Lie Ryan
On Mon, 01 Dec 2008 20:44:20 -0500, Bryan Fodness wrote: > I would like to use a try except to see if a value exists. But, when I > use the following, if a does not exist it exits. I understand why this > does this, but is there a way to get b,c, and d if a does not exist > without using a try e

Re: [Tutor] Sorting a dictionary on a value in a list.

2008-12-09 Thread Lie Ryan
On Mon, 08 Dec 2008 08:55:40 -0800, Lawrence Wickline wrote: > On Dec 6, 2008, at 12:41 AM, Lie Ryan wrote: >> >> In most cases, in processing involving networking, the bottleneck is >> the >> network speed itself. To speed things up by optimizing your own code >

Re: [Tutor] MP3Info class usage

2008-12-10 Thread Lie Ryan
On Wed, 10 Dec 2008 04:48:38 -0800, Gareth at Serif wrote: > Has anyone ever used MP3Info to retrieve the ID3 tags from an MP3? It > seems to be a well written class that can access ID3 tags in v.1 or v.2, > but I've not used classes before and I'm struggling to figure out how to > use it. > > G

Re: [Tutor] no attribute

2008-12-11 Thread Lie Ryan
On Thu, 11 Dec 2008 21:56:19 +, Alan Gauld wrote: > "Bryan Fodness" wrote > >>I am trying to change values in a file. The following code does not >>seem to >> find the attribute. >> >> def anonymize(obj, attr): >>try: >>obj.attr = 'Anonymize' >>except AttributeError: >>

Re: [Tutor] reading output from a c executable.

2008-12-12 Thread Lie Ryan
On Fri, 12 Dec 2008 03:13:16 -0800, Ravi Kondamuru wrote: > Denis, These are 32bit, 64bit counters (essentially numbers). Bob, There > are well over 10K counters in the log file that are updated every 5 > secs. If a counter1's graph was requested, log will have to be parsed > once to get the data

Re: [Tutor] advice on regex matching for dates?

2008-12-12 Thread Lie Ryan
On Thu, 11 Dec 2008 23:38:52 +0100, spir wrote: > Serdar Tumgoren a écrit : >> Hey everyone, >> >> I was wondering if there is a way to use the datetime module to check >> for variations on a month name when performing a regex match? >> >> In the script below, I created a regex pattern that chec

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Lie Ryan
On Fri, 12 Dec 2008 20:05:23 -0500, Shrutarshi Basu wrote: > I normally would use exceptions, because I think exceptions are a great > idea. But since the functions may be time-consuming graphics functions > and the lists could easily be hundreds of such calls, I don't want the > user to sit aroun

Re: [Tutor] Ask a class for it's methods

2008-12-13 Thread Lie Ryan
On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote: > On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: >> I have a list containing strings like : >> >> func1[] >> func2[1,2] >> func3[blah] >> >> I want to turn them into method calls (with numeric or string >> arguments) o

Re: [Tutor] Ask a class for it's methods

2008-12-13 Thread Lie Ryan
On Sat, 13 Dec 2008 10:19:34 +0100, Andreas Kostyrka wrote: > On Sat, Dec 13, 2008 at 08:03:10AM +0000, Lie Ryan wrote: >> On Sat, 13 Dec 2008 02:59:34 +0100, Andreas Kostyrka wrote: >> >> > On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: >> >&

Re: [Tutor] listen in on other program's tcp connections

2008-12-16 Thread Lie Ryan
On Tue, 16 Dec 2008 02:55:55 -0600, W W wrote: > On Tue, Dec 16, 2008 at 12:57 AM, xbmuncher > wrote: > >> On windows XP, I'm running a program that sends TCP connections on port >> 5039. I'v ran wireshark to determine this. I want to create a simple >> program that listens for these connections

Re: [Tutor] what does the "@" operator mean?

2008-12-17 Thread Lie Ryan
On Tue, 16 Dec 2008 01:03:55 +, Alan Gauld wrote: > "Marc Tompkins" wrote > >> If you're just starting out in Python, decorators can be hard to get >> your head around... > > I've been using Python for oover 10 years and still find decorators hard > to get my head around! :-) > > I confess

Re: [Tutor] Exception Handling

2008-12-30 Thread Lie Ryan
On Mon, 29 Dec 2008 16:57:44 +0100, spir wrote: > On Mon, 29 Dec 2008 09:10:45 - > "Alan Gauld" wrote: > > >> "bob gailer" wrote >> >> > Also IMHO it is bad design to put a lot of code inside a try block. >> > In this case the user might make a mistake on day and then is forced >> > to re

Re: [Tutor] How do we upload multiple files simultaneously?

2009-01-10 Thread Lie Ryan
On Fri, 09 Jan 2009 21:48:51 -0800, john dow wrote: > Dear All, > > I a newbie to python... > > my problem is to upload more than one file on a single go. I have an > option open is using some FTP client... > You might be interested with Twisted. Alternatively you might also be interested wi

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-20 Thread Lie Ryan
On Mon, 19 Jan 2009 15:46:27 -0800, Steve Willoughby wrote: > On Mon, Jan 19, 2009 at 05:30:01PM -0500, Kent Johnson wrote: >> My guess is that pygame and Tkinter are both going to want to control >> the event loop. Googling 'pygame tkinter' gives both hints that it >> might be possible and hints

Re: [Tutor] Finding the shortest word in a list of words

2009-01-20 Thread Lie Ryan
On Mon, 19 Jan 2009 19:13:32 -0800, Marc Tompkins wrote: > 2009/1/19 John Fouhy > >> 2009/1/20 Emad Nawfal (عماد نوفل) : Of course, >> this is not necessarily the best answer for your particular problem. >> The problem with sorting is that you have to look at some elements more >> than once. F

Re: [Tutor] Ip address

2009-01-20 Thread Lie Ryan
On Mon, 19 Jan 2009 19:47:54 -0800, wormwood_3 wrote: > Hello, > > This is definitely possible. It's more a matter of system and OS > configuration than Python though, so you might want to check out some > Linux forums ( http://www.linuxforums.org/ ) for additional help. In > short, I think the s

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-20 Thread Lie Ryan
On Tue, 2009-01-20 at 08:04 -0800, Steve Willoughby wrote: > > In this case, that might be enough. I just need to show a video clip > in > an otherwise fairly simple GUI. A decorationless, borderless window > popped up on the screen over the Tk stuff would probably work. Thanks > for the advice

Re: [Tutor] Finding the shortest word in a list of words

2009-01-20 Thread Lie Ryan
On Tue, 20 Jan 2009 09:20:22 -0800, Marc Tompkins wrote: > On Tue, Jan 20, 2009 at 5:42 AM, Lie Ryan wrote: > >> > Using sys.maxint to prime minLen is overkill, of course - >> > "antidisestablishmentarianism" is only 28 letters long, after all - >> >

Re: [Tutor] Finding the End of a Def?

2009-01-24 Thread Lie Ryan
On Sat, 24 Jan 2009 11:43:00 +, Alan Gauld wrote: > > But I'm surprised there are no block movement commands given Scintilla's > primary goal of supporting programmers > I guess because block level movement is ambiguous in any programming language supporting nested class/function definition

Re: [Tutor] Defining "bit" type -- why not '!' ?

2009-01-29 Thread Lie Ryan
On Thu, 29 Jan 2009 12:22:29 +, Alan Gauld wrote: > "spir" wrote > >> Here is an overal and a trial to introduce my view on this topic. > ... >> * The mix of "extended logic" on non-logical types and treating >> integers >>as bit sequences provakes a kind of conceptual collision. >> * As

Re: [Tutor] role playing game - help needed

2010-12-11 Thread Lie Ryan
On 12/07/10 23:37, Robert Sjöblom wrote: > I've been told to use input() if I know that I'll only get integers, > and raw_input() for "everything." That is a bad piece of advice. You should only use input() when you can fully trust whoever doing the input (i.e. you). input() can accept any python

Re: [Tutor] 'or' in assignment (not if statement)?

2010-12-11 Thread Lie Ryan
On 12/11/10 04:12, Alan Gauld wrote: > "Steven D'Aprano" wrote >> As an experiment, offer to buy your wife dinner, and ask if she'd >> prefer to go to an Italian or Chinese restaurant. > > :-) > She would either answer "Yes" (she would like to go to one of > them, and if I'm lucky she might give

Re: [Tutor] sorting based on elements which are nested in a list

2011-04-03 Thread Lie Ryan
On 04/04/11 00:14, ranjan das wrote: > > I have a list which I want to sort based on ('a','b','c') first and then > based on (1,2,3) > > How do i do these using itemgetter() since the list is nested > > A=[('k3', ['b', 3]), ('k2', ['a', 1]), ('k1', ['a', 3]), ('k4', ['c', 2])] > > The solution

Re: [Tutor] Passing a Variable

2011-04-04 Thread Lie Ryan
On 04/04/11 11:55, Ryan Strunk wrote: > Hi list, > > I am in the midst of trying to code a game based entirely on audio cues, and > I've run into a bit of a snag when trying to monitor certain variables. I'll > lay out the framework of what I'm going for in the hope that it makes sense > when writ

Re: [Tutor] Python 3.2 Install Not Responding To Python Command!!

2011-04-08 Thread Lie Ryan
On 04/09/11 11:25, Nevins Duret wrote: > Hello Everyone, > > I recently installed python3.2 by building it from source and > noticed that it may have not been > installed 100% correctly. This is probably off topic in python tutor mailing list, better asked on the main mailing list or Ubuntu

Re: [Tutor] Evaluating program running time?

2011-04-08 Thread Lie Ryan
On 04/09/11 04:29, Cory Teshera-Sterne wrote: > Hi all, > > I have a small(ish) Python program, and I need to be able to log the > running time. This isn't something I've ever really encountered, and > I've been led to believe it can be a little hairy. Are there any > Python-specific approaches to

Re: [Tutor] Praser

2011-10-23 Thread Lie Ryan
On 10/23/2011 03:09 PM, Henry wrote: Hi Steven, First of all, I want to able to download the data from the web into the database. Here is the part of the link: http://boc.quotepower.com/web/bochk/stocks_mktTransactions.jsp?lang=en&domain=NCBHK&rand=-74344993&lastLevel1Name=nav_stocks&lastStock=

Re: [Tutor] Installing the uncertainties module

2011-10-29 Thread Lie Ryan
On 10/30/2011 12:31 PM, Richard D. Moores wrote: The uncertainties module () is now available for 64-bit Python 3.2. I've downloaded uncertainties-1.8.tar.gz. I need some utility that will handle both .gz and .tar, I presume. Looking for recommendations. 7zip has always been my multi-format com

Re: [Tutor] Installing the uncertainties module

2011-10-29 Thread Lie Ryan
On 10/30/2011 03:55 PM, Richard D. Moores wrote: On Sat, Oct 29, 2011 at 21:37, Richard D. Moores wrote: On Sat, Oct 29, 2011 at 18:31, Richard D. Moores wrote: The uncertainties module () is now available for 64-bit Python 3.2. I've downloaded un

Re: [Tutor] Single line webserver

2011-11-07 Thread Lie Ryan
On 11/08/2011 10:23 AM, Rich Lovely wrote: Hi all, I was part of this list a couple of years ago, and a recent discussion at a python dojo brought to mind something I'd seen then: a one-liner (potentially single statement) webserver. I'm pretty sure it was posted to this list, but I can't fi

Re: [Tutor] Prime Factorization Tool

2011-12-04 Thread Lie Ryan
On 12/02/2011 12:15 AM, Robert Sjoblom wrote: So I've recently started poking at the Project Euler site, because I feel that I need to practice writing code. For those of you interested in solving the problems on your own I advice you to not read this, as it will spoil the solution. Problem 3 is

Re: [Tutor] print method name

2011-12-08 Thread Lie Ryan
On 12/09/2011 01:49 AM, rail shafigulin wrote: i created a class and in some instances when i use it call some of its methods i need to print a method name. the online search did produce some results but none of them seem to work for me. for example one of them said just to use __name__ or func_n

Re: [Tutor] What style do you call Python programming?

2011-12-10 Thread Lie Ryan
On 12/10/2011 03:52 AM, Sarma Tangirala wrote: Well, what I meant was the way you write things like list comprehension. I agree, that comment gave a completely incorrect picture. Sorry about that. list comprehension originated from Haskell, which is a language with a very strong functional pa

Re: [Tutor] Need Explanation...

2011-12-10 Thread Lie Ryan
On 12/11/2011 04:04 AM, Alan Gauld wrote: On 10/12/11 16:46, Steven D'Aprano wrote: circumstances, regardless of which behaviour was choosen for append, it would catch out some people some time. Probably, although if returning 'self' were the default (which of course only makes sense in a pure

Re: [Tutor] return, why do I need it?

2011-12-11 Thread Lie Ryan
On 12/12/2011 01:38 AM, Pete O'Connell wrote: Hi I have been writing python code for a while now and I never return anything within any of my functions, I just (eg.) print stuff or make directories or update a log or what have you. When I look at other people's code they are always returning in t

Re: [Tutor] how to return an object generated during a python threading code

2011-12-11 Thread Lie Ryan
On 12/11/2011 03:46 AM, Massimo Di Stefano wrote: Hi All, > Trying to read the documentation, i'm looking on how to use " threading.Lock() " and its methods "acquire() and release()" that seems to be the solution to my issue ... but i'm really far to understand how to implement it in my exampl

Re: [Tutor] timedelta, difference calculation

2011-12-12 Thread Lie Ryan
On 12/13/2011 06:46 AM, rail shafigulin wrote: i found something interesting during the timedate difference calculation import datetime import time def main(): mydatetime = datetime.datetime.now() time.sleep(1) mydatetime2 = datetime.datetime.now() diff = mydatetime - mydatetime2

Re: [Tutor] pygame blinking text

2011-12-12 Thread Lie Ryan
On 12/13/2011 01:01 AM, Cranky Frankie wrote: I tried putting the ty_message block in a WHILE TRUE loop, and that didn't work. Then I tried the same with the games.screen.add(ty_message) line and that didn't work either. I think what might work is if I can find a way to delete the ty_message and

Re: [Tutor] insert queries into related tables referencing foreign keys using python

2011-12-23 Thread Lie Ryan
On 12/24/2011 11:07 AM, Monte Milanuk wrote: So... most python-sqlite tutorials concentrate on single tables. The few that deal with multiple tables and that mention foreign keys and such seem to demonstrate mainly using hard-coded data instead of parameterized insert queries into tables with au

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-23 Thread Lie Ryan
On 12/23/2011 03:20 PM, Wayne Watson wrote: Hi, I found it, but not in a place I would expect. It's under my username, Wayne. It is a folder and has three files: breakpoints.lst recent-files.lst ZZrecent-files.lst The last one has the odd ZZ, but is empty. breakpoints.lst is empty too. That c

Re: [Tutor] A few Python Mysteries [Reset]

2011-12-24 Thread Lie Ryan
On 12/25/2011 06:24 AM, Alan Gauld wrote: On 24/12/11 18:58, Wayne Watson wrote: Yikes. I gave the permissions for .idlerc above. The problem is with recent-files.py. IOError: [Errno 13] Permission denied: 'C:\\Users\\Wayne\\.idlerc\\recent-files.lst' Can you open it in Notepad from the same

Re: [Tutor] insert queries into related tables referencing foreign keys using python

2011-12-24 Thread Lie Ryan
On 12/25/2011 01:57 AM, Monte Milanuk wrote: Lie Ryan gmail.com> writes: Be careful that in multithreaded program, each thread should have their own cursors, or otherwise another thread could possibly do another insert before you can query the lastrowid. okay, this touches on someth

Re: [Tutor] An unknown error in my program

2011-12-25 Thread Lie Ryan
On 12/25/2011 09:46 PM, Joel Goldstick wrote: You can either move the stuff at the top of your program into main, or you could pass the outer new into main as a parameter:main(new): the third alternative is to use the global keyword, e.g. # declare a global named 'new' new = 0 def increm

Re: [Tutor] Wading through traceback output :p:

2011-12-26 Thread Lie Ryan
On 12/26/2011 11:52 PM, Thomas C. Hicks wrote: On Mon, 26 Dec 2011 07:10:45 -0500 Alan Gauld wrote: On 26/12/11 11:42, Thomas C. Hicks wrote: Given it was working before and not now the obvious question is what has changed? It looks like you are on a Linux box so do you have automatic updates

Re: [Tutor] question about pywin32

2011-12-26 Thread Lie Ryan
On 12/27/2011 12:18 AM, daedae11 wrote: Does pywin32 provide a module for AES encryption algorithm ? The description of some module in pywin32 document is so simple that there is not introduction about the function of the function. For example, "CryptProtectData" function in module win32crypt. --

Re: [Tutor] question about pywin32

2011-12-26 Thread Lie Ryan
On 12/27/2011 02:58 AM, Lie Ryan wrote: On 12/27/2011 12:18 AM, daedae11 wrote: Does pywin32 provide a module for AES encryption algorithm ? The description of some module in pywin32 document is so simple that there is not introduction about the function of the function. For example

Re: [Tutor] python logger

2011-12-28 Thread Lie Ryan
On 12/29/2011 04:13 AM, rail shafigulin wrote: has anyone used python logger before? i'm trying to adapt it for my workplace. right now it is pretty simplistic for me. i'm trying to generate extra output by the LoggerAdapter. however i'm getting errors. specifically i get the following message:

Re: [Tutor] Using Python for a client interactive map application

2012-01-06 Thread Lie Ryan
On 01/06/2012 04:16 AM, Alan Gauld wrote: That's a non trivial application. It sounds a lot like Google maps? If by map you meant real world maps, this task becomes pretty much trivial. It is fairly easy to embed Google Map in your own web app, and their API provides a lot for almost anything

Re: [Tutor] Subclassing Exceptions

2012-01-07 Thread Lie Ryan
On 01/07/2012 03:56 PM, Steven D'Aprano wrote: Chris Fuller wrote: You probably shouldn't inherit from SyntaxError, since it represents syntax errors in the Python code being interpreted or compiled. Any syntax error in your own data structures should be independent of SyntaxError. I'd say a s

Re: [Tutor] making a custom file parser?

2012-01-07 Thread Lie Ryan
On 01/08/2012 04:53 AM, Alex Hall wrote: Hello all, I have a file with xml-ish code in it, the definitions for units in a real-time strategy game. I say xml-ish because the tags are like xml, but no quotes are used and most tags do not have to end. Also, comments in this file are prefaced by an a

Re: [Tutor] something about sum, integer and delta function

2012-01-16 Thread Lie Ryan
On 01/16/2012 12:57 AM, lina wrote: Hi, are there some modules can be used to do below things like: sum and delta function, and intergeration. Are you trying to graphically render an equation, calculate the results of equation, or algebraically manipulate the equation?

Re: [Tutor] Is there space a between "#!" and "/usr/bin/env python" ?

2012-05-01 Thread Lie Ryan
> and is used by the various Unix command shells to specify what program > shall interpret this particular script. To be precise, the shell does not care about the shebang line either, the shebang is interpreted by the program loader in the kernel. The shell simply execve()-ed a script containing

Re: [Tutor] HELP- Regarding working with python

2013-01-18 Thread Lie Ryan
On 18/01/13 17:11, Gayathri S wrote: hi... I am using principal component analysis for dimensionality reduction in python. am having this following error... >>> import numpy as np >>> import matplotlib.pyplot as plt >>> import mlpy >>> np.random.seed(0) >>> mean,cov,n=[0,0],[[1,1]

Re: [Tutor] Question regular expressions - the non-greedy pattern

2013-01-21 Thread Lie Ryan
On 22/01/13 10:11, Marcin Mleczko wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Hugo, hello Walter, first thank you very much for the quick reply. The functions used here i.e. re.match() are taken directly form the example in the mentioned HowTo. I'd rather use re.findall() but I

<    1   2   3   4