[Tutor] Explicitly define the lib path for python during build time

2014-06-26 Thread Tony Wang
n ask user to do export PYTHONHOME, but is there any way to explicitly define more than one lib search path during build time? BR, Tony ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailma

Re: [Tutor] Checking for file completion.

2012-02-21 Thread Tony Pelletier
main, I'm using filename to then make the call to >> getEventAttachments and passing in filename.  The None you see is a >> result of my "print filename" statement. >> > > Clearly this is Python 2.x code.  print is a statement and has no retu

Re: [Tutor] Checking for file completion.

2012-02-21 Thread Tony Pelletier
> Please post your message again, as a text message rather than an html one. >  Reading non-trivial python code that's lost all its indentation is > impossible.  You've done it before, but that case was simple enough to not > matter much. > > > > -- > > DaveA > Sorry about that. I actually though

Re: [Tutor] Trouble with encoding/decoding a file

2012-02-06 Thread Tony Pelletier
On Mon, Feb 6, 2012 at 1:13 PM, Alan Gauld wrote: > On 06/02/12 15:11, Tony Pelletier wrote: > >> Hi, >> >> I've been tasked with getting the encoded value using a SOAP call and >> then writing the file out. I first used the interpreter to do so like >>

[Tutor] Trouble with encoding/decoding a file

2012-02-06 Thread Tony Pelletier
file.write(string) outfile = open(filename, 'w') outfile.write(data) outfile.close() except suds.WebFault as e: print e.fault.detail The txt file is only there to make sure I'm writing out one long string which is what I'm pasting in so I'm assuming that's correct. Any

Re: [Tutor] Facebook apps with python

2012-01-19 Thread Tony Pelletier
On Wed, Jan 18, 2012 at 8:34 AM, karthik s wrote: > Well, my question is simple.. > How do I create facebook apps with python. I have couple of interesting/ > funky programs and want to make them as apps. > So, > 1. What all things I should know for writing facebook apps. > 2. I read that we shoul

[Tutor] Handling a Unicode Return using Pyodbc

2011-11-14 Thread Tony Pelletier
s I'm not really sure how to handle it and whether or not it's failing on the query or the insert to the csv. The Exception is: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128) Thanks Tony __

Re: [Tutor] Windows vs Linux processing speed.

2011-10-14 Thread Tony Pelletier
FYI, my windows laptop is actually much more capable than my linux laptop. Linux is an IBM Thinkpad T61 Windows is an Alienware M11x R2( i7 with 4gb of ram) Thanks again. Tony On Fri, Oct 14, 2011 at 7:01 PM, Steven D'Aprano wrote: > Tony Pelletier wrote: > > So, my question is. Wh

[Tutor] Windows vs Linux processing speed.

2011-10-14 Thread Tony Pelletier
he socket? Does windows open and close it whereas linux might leave it open and just pump data through? It's not really a problem since I just added sleep time, but I'm curious. Thanks Tony ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Installation problem: Python 2.6.6 (32-Bit) on Windows 7 (32-Bit)

2010-08-31 Thread Tony Cappellini
Has anyone else had problems running the msi for Python 2.6.6 on Windows 7? If I don't check "Compile .py to byte code", the installer completes without error. Checking "Compile .py to byte code" causes the following to be displayed "There is a problem with the windows installer package. A progra

[Tutor] When max() doesn't work as expected

2009-12-03 Thread Tony Cappellini
I have a list of 2300 strings. When I call max() on the list, it returned an item with 37 characters. I am only passing 1 argument to max(). I know for a fact that the largest item has 57 characters, and when I called mylist.index('my_57_character_string') the index was found. Printing len(mylist

[Tutor] String formatting hex numbers

2009-05-30 Thread Tony Cappellini
I was looking at a this code which uses this code to dsiplay some hex numbers sys.stdout.write( "\r%-8s ... 0x%08X->0x%08X " % ( descr, long(startAddr), long(endAddr) ) The hex values are in this range 0x1BFFF400 to 1BFFF000 Why are these displayed with a leading negative sign (between the 0x a

[Tutor] Determining periodicity of rand.randint()

2009-01-31 Thread Tony Cappellini
Has anyone ever measured how random (or deterministic) a given sequence of numbers generated by rand.randint() are? Using these arguments for rand.randint(0, 1000 ) if a program which calls rand.randint() runs for 10 hours (or a few days), will it keep generating a repeatable set of numbers at

Re: [Tutor] Using the curses module (or a better solution)

2008-10-06 Thread Tony Cappellini
> See the recent discussion of urwid for discussion of a similar problem. > http://thread.gmane.org/gmane.comp.python.tutor/50500/ This looks interesting. Thanks! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Using the curses module (or a better solution)

2008-10-06 Thread Tony Cappellini
I'm maintaining a framework of tests which are run on a diskless Linux client, in character mode (no graphical desktop). The tests often print out a lot of info, which scrolls off the screen. I'd like to add a 1-2 line no-scroll-area at the top of the screen, so as to print a message which indica

[Tutor] cmd module

2008-09-03 Thread Tony Cappellini
I was just reading the PYMOTW article on the cmd module, and trying the examples. http://www.doughellmann.com/PyMOTW/cmd/cmd.html Scroll down to Auto-Completion. Does the tab key work for anyone running Windows ? Is this an OS specific feature? I see the bash prompts in the article, tab does so

[Tutor] using sys.excepthook to handle unhandled exception (corrected and reposted)

2008-08-27 Thread Tony Cappellini
I'm maintaining a large framework of python code where the original authors left many assert statements. When an unhandled exception occurs, the traceback is displayed on the screen. Ideally, I don't want the users to see the tracebacks from unhandled exceptions, but rather a short, useful message

[Tutor] using sys.excepthook to handled unhandled exceptions

2008-08-27 Thread Tony Cappellini
The original authors left asserts in many places and I don't want the people using the code to see the ugly tracebacks. want to add an unhandled exception handler to a large framework that I'm maintaining, to make the applications behave better, Users of a program shouldn't need to know anything

Re: [Tutor] Tutor Digest, Vol 53, Issue 18

2008-07-06 Thread Tony Cappellini
Message: 7 Date: Sat, 05 Jul 2008 12:23:36 -0600 From: Nathan Farrar <[EMAIL PROTECTED]> Subject: [Tutor] Exploring the Standard Library To: Python Tutor Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" >>I'd like to spend some time exploring the standard library. This

Re: [Tutor] Wave module

2008-07-06 Thread Tony Cappellini
Message: 1 Date: Sat, 5 Jul 2008 16:50:35 -0600 From: "Alex Krycek" <[EMAIL PROTECTED]> Subject: [Tutor] Wave module To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Hello, I'm trying to join two .wav files with the wave module. But when I

Re: [Tutor] Is "var = None" in Python equivalent to "Set var

2008-06-30 Thread Tony Cappellini
This thread got a bit off track > >>but in Python these statements are unnecessary. > > What happened to "Explicit is better than implicit"? > Regarding the "original poster" contrasting VB with Python setting someObject = None is perfectly fine in Python, and a good analogy between the langu

Re: [Tutor] Is "var = None" in Python equivalent to "Set var

2008-06-30 Thread Tony Cappellini
Message: 5 Date: Mon, 30 Jun 2008 11:49:59 +0200 From: "Andre Engels" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Is "var = None" in Python equivalent to "Set var = Nothing"in VB? To: Kelie <[EMAIL PROTECTED]> Cc: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text

Re: [Tutor] Is "var = None" in Python equivalent to "Set var

2008-06-29 Thread Tony Cappellini
Wes, is this not your reply? "the reason why i ask is because it's not standard practice i see people doing this with Python, so i'm trying to get a better understanding of what you're trying to do. thanks! -- wesley" > *exactly* why, other than most of the time, people let objects go > out-of

Re: [Tutor] Is "var = None" in Python equivalent to "Set var

2008-06-29 Thread Tony Cappellini
Message: 9 Date: Sun, 29 Jun 2008 01:20:16 -0700 From: "wesley chun" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Is "var = None" in Python equivalent to "Set var = Nothing"in VB? To: [EMAIL PROTECTED], "Alan Gauld" <[EMAIL PROTECTED]> Cc: tutor@python.org >>the reason why i ask is becau

Re: [Tutor] Grabbing data from changing website

2008-06-05 Thread Tony Cappellini
-- > > Message: 4 > Date: Wed, 4 Jun 2008 10:00:46 -0400 > From: James <[EMAIL PROTECTED]> > Subject: [Tutor] Grabbing data from changing website > To: tutor@python.org > Message-ID: ><[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > > >>urll

[Tutor] Python Programming for the Absolute Beginner-OT

2008-05-28 Thread Tony Cappellini
A bit OT, but still within the realm of beginning Python... My co-worker whom has just started learning Python, bought this book in used condition. http://www.courseptr.com/ptr_detail.cfm?group=Programming&subcat=Other&isbn=978%2D1%2D59863%2D112%2D8 Unfortunately it came without the CD, and the p

Re: [Tutor] Tutor Open a directory in the default file manager

2008-05-20 Thread Tony Cappellini
*Tim Michelsen* timmichelsen at gmx-topmail.de *Mon May 19 21:36:30 CEST 2008* - Previous message: [Tutor] Open a directory in the default file manager - Next message: [Tutor] Getting started with Python

[Tutor] Re Open a directory in the default file manager

2008-05-20 Thread Tony Cappellini
Message: 2 Date: Thu, 15 May 2008 20:10:05 +0200 From: Tim Michelsen <[EMAIL PROTECTED]> Subject: [Tutor] Open a directory in the default file manager To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Hello, >>is there any function/mo

Re: [Tutor] Memory Leak?

2008-05-07 Thread Tony Cappellini
Message: 5 Date: Wed, 7 May 2008 16:18:23 -0400 From: "Michael Langford" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Memory Leak? To: "Keith Suda-Cederquist" <[EMAIL PROTECTED]> Cc: Python Tutor List Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" >>You can alw

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

2008-04-29 Thread Tony Cappellini
I think you may have to send a message to the event look of you application manually, to let it know you have a key event for it. You may also need to temporarily enable/disbale the keydown event handler for pyHook, or else you wont be able to easily break out of that code (at least I couldn't) :-

Re: [Tutor] Copy script

2008-04-10 Thread Tony Cappellini
>>Of course they do - they can use input redirection just like Unix. Oh,-I have forgotten about that. But why use clunky batch language when you can use Python? After all, he did post this to the python list. ___ Tutor maillist - Tutor@python.org http:/

Re: [Tutor] Copy script

2008-04-10 Thread Tony Cappellini
Message: 7 Date: Thu, 10 Apr 2008 01:46:49 +0100 From: "Alan Gauld" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Copy script To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original >>I don;t see how the input file r

Re: [Tutor] Don't miss "Python-by-example - new online guide to

2008-04-04 Thread Tony Cappellini
Date: Fri, 04 Apr 2008 07:12:11 -0700 From: Dick Moores <[EMAIL PROTECTED]> Subject: [Tutor] Don't miss "Python-by-example - new online guide to Python Standard Library" To: Python Tutor List Message-ID: <[EMAIL PROTECTED]> Dick- there was no url with your message. Also See Python Module

Re: [Tutor] Tutor Digest, Vol 49, Issue 78

2008-03-26 Thread Tony Cappellini
>>Draft notes for the next Kent's Korner presentation are available at >>http://personalpages.tds.net/~kent37/kk/00010.html >>Comments welcome. I vote Kent move out of the korner and into the front of the classroom! Nice color scheme, easy to look at, good layout, font, size, and small chunks (pa

Re: [Tutor] Python to C++

2008-03-25 Thread Tony Cappellini
h Python. > > Andreas > > > Am Montag, den 24.03.2008, 23:39 -0700 schrieb Tony Cappellini: > > > > Another alternative is Weave > > http://www.scipy.org/Weave > > > > But mixing C/C++ with Python sort of defeats the reasons for using > > Pytho

Re: [Tutor] Python to C++

2008-03-24 Thread Tony Cappellini
Another alternative is Weave http://www.scipy.org/Weave But mixing C/C++ with Python sort of defeats the reasons for using Python to begin with Message: 2 Date: Sat, 22 Mar 2008 02:44:54 +0100 From: Eike Welk <[EMAIL PROTECTED]> Subject: Re: [Tutor] Python to C++ To: tutor@python.org Message-ID:

Re: [Tutor] what is @classmethod and @staticmethod ??

2008-03-23 Thread Tony Cappellini
> I don't use classmethods so I can't discuss that. For staticmethods, > suppose I have in foo.py Where is the word "staticmethod" in the example below? Where is it used? This is what I was hoping to see. > > class Foo(object): ># Lots of useful stuff > > > In client.py I have > > from f

Re: [Tutor] what is @classmethod and @staticmethod ??

2008-03-23 Thread Tony Cappellini
Kent Would you show the examples which show where staticmethod & classmethod are used? I've often wondered about the usefulness of these myself. Having read many of the popular books on python, none provide a good clear explanation of why or where these should be used, and what the alternatives a

Re: [Tutor] Make sound with python? Cross platform?

2008-03-10 Thread Tony Cappellini
> Thanks very much. Not quite sure why I didn't find those earlier! I'll > have a look now. I think this cuts more to the chase than using a game framework http://pysonic.sourceforge.net/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/m

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-20 Thread Tony Cappellini
-1 > >--michael > > > On Feb 19, 2008 4:53 PM, Tony Cappellini <[EMAIL PROTECTED]> wrote: > > When I executing a program external to the main program in a thread, > > and that thread hangs, can the thread be terminated? > > How does one handle thi

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread Tony Cappellini
On Feb 19, 2008 2:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > Tony Cappellini wrote: > > When I executing a program external to the main program in a thread, > > and that thread hangs, can the thread be terminated? > > > Please define "hangs". > A

[Tutor] How to deal with a thread that doesn't terminate

2008-02-19 Thread Tony Cappellini
When I executing a program external to the main program in a thread, and that thread hangs, can the thread be terminated? How does one handle this situation? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hello and newbie question about "self"

2008-02-03 Thread Tony Cappellini
>>http://www.ibiblio.org/swaroopch/byteofpython/read/self.html Is there a typo in the contents of this web page? Should this statement Note for C++/Java/C# Programmers The self in Python is equivalent to the "self" pointer in C++ and the this reference in Java and C#. Actually be Note for C++

Re: [Tutor] shutils.copytree

2008-01-11 Thread Tony Cappellini
> The source for copytree says, "The destination directory must not > already exist." I suppose that is why you have a problem but I don't > know the specific cause. Did you get a traceback? > > The source also says, "Consider this example code rather than the > ultimate tool" so maybe you should j

[Tutor] shutils.copytree

2008-01-10 Thread Tony Cappellini
I'm using shutils for the first time, and I've un into a problem. The docs for copytree are pretty sparse and don't mention any problem situations Under WinXP, I'm trying to copy a directory tree to a USB device using copytree, but copytree doesn't like a drive letter as a destination. copytree('

Re: [Tutor] Tutor Digest, Vol 47, Issue 8

2008-01-03 Thread Tony Cappellini
h the particular toolkit by the programmer. On Jan 3, 2008 1:00 PM, Marc Tompkins <[EMAIL PROTECTED]> wrote: > On Jan 3, 2008 10:31 AM, Tony Cappellini <[EMAIL PROTECTED]> wrote: > It's like OCR and speech-to-text. At some point it becomes easier to do it > by hand t

Re: [Tutor] Tutor Digest, Vol 47, Issue 8

2008-01-03 Thread Tony Cappellini
Message: 1 Date: Thu, 3 Jan 2008 10:06:01 -0200 From: Tiago Saboga <[EMAIL PROTECTED]> Subject: Re: [Tutor] Choice of GUI builders To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=us-ascii >>But since 2005, according to wikipedia, the Qt Windows is also >>lice

Re: [Tutor] Choice of GUI builders

2008-01-03 Thread Tony Cappellini
Message: 1 Date: Thu, 3 Jan 2008 08:11:05 - From: "Alan Gauld" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Choice of GUI builders To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original >>OK, wxPython is a fin

Re: [Tutor] Tutor Digest, Vol 45, Issue 58

2007-11-20 Thread Tony Cappellini
- Forwarded Message From: Doug Glenn <[EMAIL PROTECTED]> To: Alan Gauld <[EMAIL PROTECTED]> Sent: Tuesday, 20 November, 2007 4:08:12 AM Subject: Re: [Tutor] Wrong version of Python being executed >>It is a bit odd since normally Pythons installation mechinism only >>does it for the PY fil

Re: [Tutor] Wrong version of Python being executed

2007-11-19 Thread Tony Cappellini
version of Python is invoked. How do other people deal with having multiple versions of Python on their system, and not run into this issue?? On Nov 10, 2007 6:16 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Tony Cappellini wrote: > > When I run this python script, the f

Re: [Tutor] Wrong version of Python being executed

2007-11-12 Thread Tony Cappellini
Date: Mon, 12 Nov 2007 09:14:05 - From: "Alan Gauld" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Wrong version of Python being executed To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original >>Umm, have you

Re: [Tutor] Wrong version of Python being executed

2007-11-11 Thread Tony Cappellini
Message: 2 Date: Sun, 11 Nov 2007 16:57:01 -0600 From: Martin Walsh <[EMAIL PROTECTED]> Subject: Re: [Tutor] Wrong version of Python being executed To: Tutor Python Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1 >>My initial thought based on your description was tha

Re: [Tutor] Tutor Digest, Vol 45, Issue 30

2007-11-11 Thread Tony Cappellini
> Message: 4 > Date: Mon, 12 Nov 2007 00:16:35 - > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Wrong version of Python being executed > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=

Re: [Tutor] Wrong version of Python being executed

2007-11-11 Thread Tony Cappellini
Martin Walsh mwalsh at groktech.org Sun Nov 11 06:13:10 CET 2007 >>That is odd. >>Try using the full path to python, just to be sure: c:\python25\python >>script.py -- do you get the same behavior? This works just fine- I would expect it to. >>Also, if you haven't already, you can run python wit

Re: [Tutor] Wrong version of Python being executed

2007-11-10 Thread Tony Cappellini
>>What do you get if you print sys.path from > the interpreter? I've printed out sys.path from inside the script as well, and all references to Python25 are replaced with Python23 FWIW- This isn't a problem unique to this script. I've just printed out sys.path from another script in another dire

Re: [Tutor] Wrong version of Python being executed

2007-11-10 Thread Tony Cappellini
Thanks for replying Kent. This is quite a strange mystery. > A couple of possibilities... > Is there a #! line at the start of the script that specifies Python 2.3 > (I'm not sure if those work in windows though...) No- The shebang line is for non-Windows systems (Unix variants) > How do you run

[Tutor] Wrong version of Python being executed

2007-11-10 Thread Tony Cappellini
I've got Python 2.3, 2.4 and 2.5 installed on a Windows XP machine.. I currently have Python 2.5 in my path, and there are no other versions of Python in the path. I'm trying to run a program which expects Python 2.4 or later to be installed, because there is a call to logging.BasicConfig(arg1, a

Re: [Tutor] os.rename anomaly in Python 2.3 on Windows XP

2007-10-09 Thread Tony Cappellini
Thanks. Unfortunately,os.listdir() returns the same string as glob.glob, for the problem file I mentioned. When I pass that string to os.rename() OSError: [Errno 22] Invalid argument > Sounds like it has something to do with Unicode. > Your filenames aren't being interpreted correctly. Perhaps

[Tutor] os.rename anomaly in Python 2.3 on Windows XP

2007-10-08 Thread Tony Cappellini
Using Windows XP, SP2 and Python 2.3 I've written a script which walks through a bunch of directories and replaces characters which are typically illegals as filenames, with an '_' character. The directories are part of a package of software which is released by a group of people from Japan, and

[Tutor] Random module.. or?

2007-08-07 Thread Tony Noyeaux
gram that kind of randomness? Or another way to look at it. BasketballerA Can score 4-45pts a game. Most games, he scores 15-25 pts Maybe 1 in 1000 games he scores 30 plus pts Maybe 1 in 1 he scores 45 pts. The actual %'s

[Tutor] Python Editors .. which do you reccomend for a amateur?

2007-08-04 Thread Tony Noyeaux
're new to python? Tony Noyeaux _ Learn. Laugh. Share. Reallivemoms is right place! http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us___ Tutor maillist - Tutor@python.org htt

[Tutor] Sum of Scores

2007-07-26 Thread Tony Noyeaux
at each out etc, and high scores list towards the end. First things first,... and the project at hand. How do i ... post the totals... as listed above, to the working code below. Thanks as always Tony Noyeaux -

Re: [Tutor] Newbie Project part 2...

2007-07-15 Thread Tony Noyeaux
,\"aah":"You plane is shot down",\} ---> > Message: 7> Date: Sat, 14 Jul 2007 20:38:58 +0100> From: "Alan Gauld" <[EMAIL PROTECTED]>> Subject: Re: [Tutor] Newbie Project part 2...> To: tutor@python.org> Message-ID: <[EMAIL PROTECTED]>&g

[Tutor] Newbie Project part 2...

2007-07-14 Thread Tony Noyeaux
oted to Secretary of the Navy", "You lose a leg in a torpedo attack". All the actual responces and random results are just examples to get the structure and code working. I am hoping to be able to print a summary of each happening

[Tutor] Code query..works in IDLE but not DrPython editor

2007-07-10 Thread Tony Noyeaux
Simple Random code. import randomprint random.choice(['Apple', 'Pear', 'Shrimp', 'Death', 'Life']) Works in IDLE gui, no problem. Gives me a random pick no problem. When i changed to DrPython, to continue building parts of my code.. it won't take that code. Gives me this error. C:/P

[Tutor] Resource request

2007-07-09 Thread Tony Noyeaux
I am looking for a good online resource for the "def Menu" and/or "elif choice" commands. Any help would be much appreciated. _ Don't get caught with egg on your face. Play Chicktionary!   http://club.live.com/chicktiona

[Tutor] Guidance on a Begginer Project.

2007-07-05 Thread Tony Noyeaux
Taking on a pet project to teach myself some things and hone some amateur skills.Wondering if you could help point me in the right direction and assist me with some technical points as i get stuck.I have a basic idea of how i would do this,... but i'm not sure whether it is the best way. So ...

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

2007-06-24 Thread Tony Cappellini
Take a look at pyHook >1. Re: Catch event's on my computer (Alan Gauld) > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Catch event's on my computer > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; >

[Tutor] Dictionary Values Questions

2007-05-01 Thread Tony Waddell
I am wondering how look for a key in a dictionary, given a value. I have a dictionary similar to this: a = { 'a1':1, 'a2':2, 'a3':3, 'a4'.:4} If I have the value of 2, how would I look at the dictionary to turn that into 'a2'. ___ Tutor maillist - Tut

Re: [Tutor] HTTP file download

2007-03-13 Thread Tony Cappellini
How do you handle a binary file? Message: 4 Date: Tue, 13 Mar 2007 13:23:44 +0100 From: "Jean-Philippe Durand" <[EMAIL PROTECTED]> Subject: Re: [Tutor] HTTP file download To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Cc: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plai

Re: [Tutor] Tutor Digest, Vol 37, Issue 15

2007-03-05 Thread Tony Cappellini
Rename your file from .py to .pyw. This will prevent the DOS window from appearing Message: 6 Date: Mon, 5 Mar 2007 16:51:42 +0100 From: learner404 <[EMAIL PROTECTED]> Subject: [Tutor] Hiding/Killing a DOS window (from a previous os.system call) To: "Tutor Python" Message-ID: <[EMAI

Re: [Tutor] How does this work?

2007-02-07 Thread Tony Cappellini
Thanks. I'm not using wx, but that doesn't matter. I'll see if there's some way I can get the author to let me pass in the logging handler to his main. On 2/7/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Kent Johnson wrote: > > You should be able to make the logging module work with you, it is ve

Re: [Tutor] How does this work?

2007-02-07 Thread Tony Cappellini
> You should be able to make the logging module work with you, it is very > flexible. You should hook into the logging module. Write a custom > handler that pushes log methods into your GUI. Add the handler to the > root logger. The cmd line app already uses the logging module- this is where the p

Re: [Tutor] How does this work?

2007-02-07 Thread Tony Cappellini
> The application needs to be rewritten if this is true. The author's > implementation is not logical, regardless- I won't ask him to do this, it's just the way it is. I don't know why it was written this way. > if I'm inferring correctly that he knows there are other apps depending > on this. Ye

Re: [Tutor] How does this work?

2007-02-07 Thread Tony Cappellini
> If I understand you, you have a python cmdline app that does something > useful. You have users who aren't comfortable with the command line, so > you are writing a GUI wrapper that calls the cmdline app with popen(). That is correct > A better approach is to turn the functional part of the cmdl

Re: [Tutor] How does this work?

2007-02-07 Thread Tony Cappellini
> > PS To import a file whose name is in a variable (string), see __import__(). I've started doing the import instead of exec/eval , but the person who wrote the module being called, started using the logging module. Now I can't capture the output of the module I'm calling, and display it in a GUI

Re: [Tutor] How does this work?

2007-02-06 Thread Tony Cappellini
Hi Danny, > > > Hi Tony, > > Ack! > > This is not safe. I would strongly recommend not to do this. There is a > much simpler way for the caller to be written: What is not safe about doing it this way ? > > import test

[Tutor] How does this work?

2007-02-06 Thread Tony Cappellini
I saw a snippet of python which is used to execute another python script, and I'm trying to understand the mechanism. Simple as it is, I don't understand how it works :-) this is the caller ## callee=open("tester.py").read() exec(callee) eval("main(['', 'argument'])")

Re: [Tutor] Purging/deleting the logfile with the logging module

2007-01-30 Thread Tony Cappellini
*close*( ) > > Tidy up any resources used by the handler. This version does nothing > and is intended to be implemented by subclasses. > > How can I purge/delete & reopen the logfile? >>FileHandler has a close() method that presumably does something useful. see above- It says i

[Tutor] Purging/deleting the logfile with the logging module

2007-01-30 Thread Tony Cappellini
I want to purge (empty) or delete the logfile created by the logging module, and reopen it for a new session. There is reference to a close function in the 2.3 docs, but I don't see how I can purge or delete the file, since I don't have access to the file descriptor. *close*( ) Tidy up any resour

Re: [Tutor] reassigning/replacing sys.stdout

2007-01-30 Thread Tony Cappellini
That would be ideal- but I'm using 2.4 now, and the people using the app would also have to upgrade to 2.5. I don't like upgrading unless there's a pressing need. On 1/30/07, Danny Yoo <[EMAIL PROTECTED]> wrote: > The author of the cmd line app suggested I temporarily replace > sys.stdout'with

Re: [Tutor] reassigning/replacing sys.stdout

2007-01-30 Thread Tony Cappellini
got it -thanks On 1/30/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Tony Cappellini wrote: > > I'm writing a python gui app that will call a python cmd line app. The > gui will take users input, pass it to the cmd line app, then display > the cmd app program outp

[Tutor] reassigning/replacing sys.stdout

2007-01-30 Thread Tony Cappellini
I'm writing a python gui app that will call a python cmd line app. The gui will take users input, pass it to the cmd line app, then display the cmd app program output. The idea is to give users who aren't comfortable with the cmd line a way to run the program, without having to open a shell window

[Tutor] Are there any MAC OSX python users here?

2007-01-20 Thread Tony Cappellini
I'm trying to help some people run a python cmd line program on OSX. Would you email me off list if you have OSX and run python apps form the cmd line? thanks ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 35, Issue 18

2007-01-05 Thread Tony Cappellini
Message: 7 Date: Fri, 5 Jan 2007 08:04:23 -0800 (PST) From: Mike Ellis <[EMAIL PROTECTED]> Subject: [Tutor] Python gui for file input To: tutor@python.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Hi all, I am looking to create a simple gui interface to a sma

[Tutor] Assigning a variable stored in a dictionary

2007-01-04 Thread Tony Cappellini
I can't see the forest through the trees. I have stored 3 global variables in a dictionary, and associated each variable with a filename. Ideally, I want to read the contents of the text files, and store the contents in the global variables. The globals will be used by another function. However,

Re: [Tutor] Embedding strings in a python script

2007-01-03 Thread Tony Cappellini
Message: 5 Date: Thu, 4 Jan 2007 16:13:51 +1300 From: "John Fouhy" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Embedding strings in a python script To: tutor-python Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 04/

[Tutor] Embedding strings in a python script

2007-01-03 Thread Tony Cappellini
I have a number of text files which need to be checked into CVS. Each file needs a special text header/footer in order that CVS can track changes and version numbers. Python to the rescue. I've written a small python program which will write the header/footer to all files in the current director

Re: [Tutor] Tutor Digest, Vol 35, Issue 8

2007-01-03 Thread Tony Cappellini
Take a look at Movable Python. It may not be exactly what you're looking for, but it may turn out to be a resource to leverage from. Message: 1 Date: Tue, 2 Jan 2007 21:14:16 -0500 From: "Daniel McQuay" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Starting python from a DOS prompt from any dire

Re: [Tutor] Starting python from a DOS prompt from any

2007-01-01 Thread Tony Cappellini
Message: 3 Date: Sun, 31 Dec 2006 00:10:39 -0500 From: "Daniel McQuay" <[EMAIL PROTECTED]> Subject: [Tutor] Starting python from a DOS prompt from any directory? sorry for such a newbie question but i would like to figure this out because there are some situations where i need that to wo

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

2006-12-29 Thread Tony Cappellini
Message: 1 Date: Thu, 28 Dec 2006 17:24:41 -0800 From: "Chris Hengge" <[EMAIL PROTECTED]> Subject: Re: [Tutor] OT: Python 2.5 (Was Re: Length of longest item in I hope this is related enough for this thread, but I'm curious why people didn't seem to unanimously jump into 2.5 upon release. One

Re: [Tutor] Length of longest item in a list, using a list comp

2006-12-28 Thread Tony Cappellini
Thanks, but I am restricted to using 2.3.4 for now, so longest = max([len(x) for x in ll]) works for me On 12/28/06, Andreas Kostyrka <[EMAIL PROTECTED]> wrote: * Python <[EMAIL PROTECTED]> [061228 20:44]: > On Thu, 2006-12-28 at 11:27 -0800, Tony Cappellini wrote: > >

[Tutor] Length of longest item in a list, using a list comp

2006-12-28 Thread Tony Cappellini
I want to use a list comp to get the length of the longest string in a list, but can't quite get the syntax right. l1=['abc', 'abcde', 'abcfdtea'] longest=0 [x for x in l1 if len(x) > longest] The problem is I can't add the true clause to the if statement in a list comp as in if len(x) > longes

[Tutor] Docs for os popen and Popen2 modules

2006-12-05 Thread Tony Cappellini
Running python 2.3.4, on Windows XP the popen2 docs show 6.8 popen2 -- Subprocesses with accessible I/O streams This module allows you to spawn processes and connect to their input/output/error pipes and >>obtain their return codes under Unix and Windows.<< Then it further goes to say The onl

[Tutor] How To structure a program for cmd line mode & gui mode

2006-12-01 Thread Tony Cappellini
I"m writing a cmd line program which will automate getting some modules out of cvs, based on some input criteria. Initiallly, I will do a cmd line version, but would like to make a gui version later with QT. I would like to find out how to structure the program so that when the gui version is fi

[Tutor] e: moving from pack to grid in tkinter

2006-11-27 Thread Tony Cappellini
Date: Mon, 27 Nov 2006 18:07:33 +1300 From: "John Fouhy" <[EMAIL PROTECTED]> Subject: Re: [Tutor] moving from pack to grid in tkinter To: tutor-python Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 27/11/06, Tony Cappel

[Tutor] moving from pack to grid in tkinter

2006-11-26 Thread Tony Cappellini
I've got a main window which is 640 * 400. self.root.geometry("600x400") self.label.pack(side=BOTTOM, fill=X) This line would put the label at the bottom of the window, and extend to both left and right edges of the window. I want to change to grid geometry because I have several more widge

[Tutor] using CVS through Python

2006-11-11 Thread Tony Cappellini
I need to do some automated checkouts of CVS projects from Python scripts, and want ot be able to handle success and failure conditions.While sending the command lines to cvs isn't a problem, I could use some suggestions for how to check the cvs responses. Parsing the text returned from CVS isn't 

Re: [Tutor] Print Screen

2006-11-03 Thread Tony Cappellini
Date: Thu, 02 Nov 2006 20:09:59 -0500From: Bill Burns <[EMAIL PROTECTED]>Subject: Re: [Tutor] Print Screen To: Chris Hengge <[EMAIL PROTECTED]>Cc: pythontutor < tutor@python.org>Message-ID: <[EMAIL PROTECTED]>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>pressed, try pyHook. Note: p

Re: [Tutor] Running multiple version of Python on 1 windows

2006-10-31 Thread Tony Cappellini
>From Kent >>You don't say what OS you are running but under Windows it is trivial to>>have multiple versions of Python installed, I have 2.3, 2.4 and 2.5.>>They are each in their own directories, all in the system path. I have >>aliases called py23, py24 and py25 that let me launch the version I>>

  1   2   >