Re: [Tutor] what happens when...

2006-09-14 Thread josip
When I remove board I get message: global name 'board' is not defined. Ok I understand that. But I would like to get some explaination to understand better.Thanks!John Fouhy [EMAIL PROTECTED] wrote: On 14/09/06, josip <[EMAIL PROTECTED]>wrote: Hi all! Can You explain me what happens when in

Re: [Tutor] Using my own installed python version in my directory tree.

2006-09-14 Thread Ewald Ertl
Hi Ziad Rahhal wrote: Hi, I installed pythin on Linux operating system but on my own tree directory. Now I want to get rid (not deleting) the default python installation, which means I want my own python version to be recognized when I use python command. PYTHONPATH has nothing to do

[Tutor] Clipboard manager for windows

2006-09-14 Thread Derick Van Niekerk
Hey,I came accross this explanation of how the windows clipboard can be handled with Python:http://www.bigbold.com/snippets/posts/show/724I want to write myself a simple text filter for pasting csv into excel, pasting syntax highlighted code as html and custom formatting text with regular

Re: [Tutor] List manipulation

2006-09-14 Thread Kent Johnson
Srinivas Iyyer wrote: Thank you Bob for your email. Sorry for the confusion. here is what I ment: test = ['10\t15', '16\t20', '25\t35', '45\t50', '55\t60', '61\t65', '75\t80'] I would get: 10 20 25 35 45 50 55 65 75 80 Here is my take on it: test =

Re: [Tutor] GDAL- Help

2006-09-14 Thread Kent Johnson
Nagendra Singh wrote: Hi, I am just starting to learn Python and I want to perform some GIS tasks which requires the gdal module (http://www.gdal.org/). I have installed FWTools which also comes with a built in Python interface but I also have a stand alone version of Python which I use. I

[Tutor] How do I open my browser from within a Python program

2006-09-14 Thread nimrodx
Basically a dumb question I can't seem to find the answer to. How do I execute a bash command from within a python program. I've been looking through my book on python, and the docs, but can't seem to find something so basic (sure it is there, but I am not looking for the correct terms, I

Re: [Tutor] How do I open my browser from within a Python program

2006-09-14 Thread Kent Johnson
nimrodx wrote: Basically a dumb question I can't seem to find the answer to. How do I execute a bash command from within a python program. To open your browser you can use the webbrowser module. To run any external program use os.system(). To run an actual bash command (as opposed to

Re: [Tutor] How do I open my browser from within a Python program

2006-09-14 Thread Simon Brunning
On 9/14/06, nimrodx [EMAIL PROTECTED] wrote: Basically a dumb question I can't seem to find the answer to. How do I execute a bash command from within a python program. Well, this question doesn't match the subject line. So, *two* answers. To open a web browser from within a python program,

Re: [Tutor] Input mask for console?

2006-09-14 Thread Tiago Saboga
Em Quarta 13 Setembro 2006 21:55, Chris Hengge escreveu: nevermind.. figured it out.. Thanks. Hi Chris, It's not just for you, but I'd like to make a comment. When you write to this list, remember that other people read your questions too, and may be interested in the answers. By the way,

Re: [Tutor] Excluding branches while walking directory tree

2006-09-14 Thread William O'Higgins Witteman
On Wed, Sep 13, 2006 at 11:34:25AM -0400, Kent Johnson wrote: William O'Higgins Witteman wrote: I have to walk a directory tree and examine files within it. I have a set of directory names and filename patterns that I must skip while doing this walk. How do I create a set of rules to skip

Re: [Tutor] Excluding branches while walking directory tree

2006-09-14 Thread Kent Johnson
William O'Higgins Witteman wrote: On Wed, Sep 13, 2006 at 11:34:25AM -0400, Kent Johnson wrote: William O'Higgins Witteman wrote: I have to walk a directory tree and examine files within it. I have a set of directory names and filename patterns that I must skip while doing this walk. How do

[Tutor] and chomp

2006-09-14 Thread William Allison
Hi, I'm new to programming and started with Perl but have been reading a lot of good things about Python. Thought I would switch before I have too much time invested in Perl. Anyway, my question is, is there something in Python similar to the diamond operator and chomp from Perl? I'm trying to

[Tutor] Clipboard manager for windows

2006-09-14 Thread János Juhász
Hi Derick, So I need a way to hijaak the Ctrl-C and Ctrl-V shortcuts and have my application run in the system tray. I don't need a gui other than changing the context menu (which I believe is done in the registry) - although, I'd probably need to use wxPython for using the system tray - unless

Re: [Tutor] and chomp

2006-09-14 Thread David Rock
* William Allison [EMAIL PROTECTED] [2006-09-14 12:14]: Hi, I'm new to programming and started with Perl but have been reading a lot of good things about Python. Thought I would switch before I have too much time invested in Perl. Anyway, my question is, is there something in Python similar

Re: [Tutor] and chomp

2006-09-14 Thread Kent Johnson
William Allison wrote: Hi, I'm new to programming and started with Perl but have been reading a lot of good things about Python. Thought I would switch before I have too much time invested in Perl. Anyway, my question is, is there something in Python similar to the diamond operator and

Re: [Tutor] and chomp

2006-09-14 Thread Dave Kuhlman
On Thu, Sep 14, 2006 at 12:14:27PM -0400, William Allison wrote: Hi, I'm new to programming and started with Perl but have been reading a lot of good things about Python. Thought I would switch before I have too much time invested in Perl. Anyway, my question is, is there something in Python

[Tutor] show all dbm data

2006-09-14 Thread federico ramirez
Hi, im have just started programming python with cgi and i will try to use dbm as a db to practiseBut i cant figure out how to diplay all the data from it..this is the code im using/#!/usr/bin/python print Content-Type: text/html\n\nimport cgi, dbmdef startpage(title): print

Re: [Tutor] python for web developing

2006-09-14 Thread Andrei
federico ramirez wrote: Hello! I have heard that python is very good for web development, but you need frameworks, like django or turbogears. There are also more lightweight frameworks, like web.py (http://webpy.org). Im a php programmer, and i want to make another dinamic site with sql,

[Tutor] (no subject)

2006-09-14 Thread timothyh
This is the first time I have posted to this list so I hope I am asking appropriate question in acceptable way. Want I want to do is take a file and cut it into pieces so each piece is a new unique file; the new files would be one line (newline) from the file I want to cut up. The file I want to

Re: [Tutor] what happens when...

2006-09-14 Thread Alan Gauld
def human_move(human): # = here is board removed legal = legal_moves(board) where does the board come from here? If you had it as a parameter then thats where it would come from. Without a parameter you need to have a global variable called board. The parameters are the communications

Re: [Tutor] Input mask for console?

2006-09-14 Thread Chris Hengge
The chosen solution was posted by kent... he said getpass.getpass(). As far as a sample password... how do I display something I was asking how to hide? =P Enter Password: nothing seen here =D On 9/14/06, Tiago Saboga [EMAIL PROTECTED] wrote: Em Quarta 13 Setembro 2006 21:55, Chris Hengge

[Tutor] pymssql or ODBC

2006-09-14 Thread Chris Hengge
Does anyone know how to make pymssql use windows authentication? Also, can anyone point me to a simple ODBC guide for SQL? I'd like to use ODBC if I can so that users of my software dont have to install extra libraries to use my utilities. Thanks.

Re: [Tutor] (no subject)

2006-09-14 Thread John Fouhy
On 15/09/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is the first time I have posted to this list so I hope I am asking appropriate question in acceptable way. Want I want to do is take a file and cut it into pieces so each piece is a new unique file; the new files would be one line

Re: [Tutor] (no subject)

2006-09-14 Thread Luke Paireepinart
John Fouhy wrote: On 15/09/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is the first time I have posted to this list so I hope I am asking appropriate question in acceptable way. Want I want to do is take a file and cut it into pieces so each piece is a new unique file; the new

Re: [Tutor] Methods and classes

2006-09-14 Thread Alan Gauld
Kent Johnson [EMAIL PROTECTED] wrote You have to distinguish between a method (a function that is part of a class definition) and a standalone function (not part of any class). Python allows both. Standalone functions don't have a 'self' parameter; class methods always do (you can give it

Re: [Tutor] show all dbm data

2006-09-14 Thread Alan Gauld
Hi, im have just started programming python with cgi and i will try to use dbm as a db to practise dbm is pretty low level, I'd recommend using the shelve module as a layer above dbm. Basically shelve makes a file look like a dictionary. Not the answer you asked for but since you don't

[Tutor] and chomp

2006-09-14 Thread allison . william
Thanks for all the responses guys. I was actually able to figure out the infile = open('infilename.txt', 'r') for line in infile: Just wasn't sure if it was Pythonic or not. Had no clue about the line = line.rstrip('\n') so thanks again. I'll get to reading those links. P.S. David, I'm

[Tutor] arrays

2006-09-14 Thread federico ramirez
Hi all! Im started with python some days ago, im trying to make a basic cgi script, with dbm, and dbm returns a dictionary witout order, so i put it in an array to order the keys and then display it in order but..python orders the array like this ['_1', '_10', '_11', '_12', '_13', '_2', '_3',

[Tutor] How to split a file (was (no subject))

2006-09-14 Thread Bob Gailer
[EMAIL PROTECTED] wrote: This is the first time I have posted to this list so I hope I am asking appropriate question in acceptable way. Want I want to do is take a file and cut it into pieces so each piece is a new unique file; the new files would be one line (newline) from the file I want to

Re: [Tutor] arrays

2006-09-14 Thread John Fouhy
On 15/09/06, federico ramirez [EMAIL PROTECTED] wrote: an array to order the keys and then display it in order but..python orders the array like this ['_1', '_10', '_11', '_12', '_13', '_2', '_3', '_4', '_5', '_6', '_7', '_8', '_9'] and i want ['_1', '_2', '_3', '_4', '_5', '_6', '_7',

[Tutor] Problems serving up PDF

2006-09-14 Thread Tim Johnson
Hi: This is *not* really a python problem, but :-) since this is such an helpful list and others may have the same issue... I have a python script which searches a server for a pdf file and if found, reads the file to stdout, as one would read html to stdout. The question is really about the

Re: [Tutor] Problems serving up PDF

2006-09-14 Thread Luke Paireepinart
Tim Johnson wrote: Hi: This is *not* really a python problem, but :-) since this is such an helpful list and others may have the same issue... I have a python script which searches a server for a pdf file and if found, reads the file to stdout, as one would read html to stdout. The

[Tutor] RfC822 or email module

2006-09-14 Thread STREET Gideon (SPARQ)
Morning all, I'm currently trying to figure out a way of downloading email and passing it into a SQLite database. I've got the downloading email side worked out using a variation of popmail.py from one of the python books I've got. Also worked out how to talk to the database from Alan Gauld's

Re: [Tutor] Problems serving up PDF

2006-09-14 Thread Tim Johnson
* Luke Paireepinart [EMAIL PROTECTED] [060914 17:36]: Tim Johnson wrote: Hi: This is *not* really a python problem, but :-) since this is such an helpful list and others may have the same issue... I have a python script which searches a server for a pdf file and if found, reads the file

Re: [Tutor] Problems serving up PDF

2006-09-14 Thread Tim Johnson
* Luke Paireepinart [EMAIL PROTECTED] [060914 17:37]: Sounds like it's working to me. On Internet Explorer 6, Windows XP, the user experience is different. IE ignores the file name, and does no progress reporting, but does understand the file type. Sounds like it's working to me.

[Tutor] tuples versus lists

2006-09-14 Thread Kermit Rose
Hello Brian. Today I read through chapter five of the python tutorial and discovered that tuples are not the same thing as lists. This surprised me. I do not see any difference in the capability of lists and tuples. Why would you use one in preference to the other? Kermit [EMAIL

Re: [Tutor] tuples versus lists

2006-09-14 Thread Tim Johnson
* Kermit Rose [EMAIL PROTECTED] [060914 18:29]: Hello Brian. Today I read through chapter five of the python tutorial and discovered that tuples are not the same thing as lists. This surprised me. I do not see any difference in the capability of lists and tuples. Hi Kermit:

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 stdin, line 1, in ?TypeError: list objects are unhashable

Re: [Tutor] Problems serving up PDF

2006-09-14 Thread Luke Paireepinart
One note, you should be using \r\n instead of \n. Both development and deployment are on a linux OS, so this is the correct procedure. However, I don't think that using '\r' does any harm on *nix in fact, it would be the more portable approach. Thanks for pointing

Re: [Tutor] tuples versus lists

2006-09-14 Thread John Fouhy
Generally, you should use a tuple when you have different things that you want to clump together to make one data structure. Whereas you should use a list when you have multiple things that are the same, that you want to iterate over. -- John. ___

Re: [Tutor] pymssql or ODBC

2006-09-14 Thread Chris Hengge
4.5 hours... all I'm seeing are a few other libraries, none of which mention having windows authentication :/ On Thu, 2006-09-14 at 16:12 -0700, Chris Hengge wrote: Does anyone know how to make pymssql use windows authentication? Also, can anyone point me to a simple ODBC guide for SQL?

Re: [Tutor] pymssql or ODBC

2006-09-14 Thread Luke Paireepinart
Chris Hengge wrote: 4.5 hours... all I'm seeing are a few other libraries, none of which mention having windows authentication :/ On Thu, 2006-09-14 at 16:12 -0700, Chris Hengge wrote: Does anyone know how to make pymssql use windows authentication? No, but if you know how to do

Re: [Tutor] pymssql or ODBC

2006-09-14 Thread Chris Hengge
I'm not sure how it works... all the modules I've seen just seem to be wrappers for odbc... but I can't find any information on connection strings.. I guess I could just try the same connection string I use for c#. On Thu, 2006-09-14 at 22:53 -0500, Luke Paireepinart wrote: Chris Hengge wrote:

Re: [Tutor] pymssql or ODBC

2006-09-14 Thread Chris Hengge
Now that I've looked, its just a wrapper for _mssql, but this still isn't a solution. On Thu, 2006-09-14 at 22:53 -0500, Luke Paireepinart wrote: Chris Hengge wrote: 4.5 hours... all I'm seeing are a few other libraries, none of which mention having windows authentication :/ On Thu,