Lissard 0.1 Release - Templating System

2007-12-13 Thread tweekgeek
I'd like to announce the alpha release of Lissard -- a minimal python templating system (GPL) designed to be easy to learn, fast, and all together simple to extend. Lissard makes no attempt to complicate it's code base with powerful and generally over-specialized features or syntax enhancements,

Call for Papers (Python or PyPy): Workshop on Self-sustaining Systems (S3) 2008

2007-12-13 Thread Raymond Hettinger
*** Workshop on Self-sustaining Systems (S3) 2008 *** May 15-16, 2008 Potsdam, Germany http://www.swa.hpi.uni-potsdam.de/s3/ -- Call for papers: The Workshop on Self-sustaining Systems (S3) is a forum for discussion of topics relating to computer systems and languages that are able to

Re: October PSF Board meeting minutes available

2007-12-13 Thread David Goodger
Minutes of a Regular Meeting of the Board of Directors of the Python Software Foundation, November 12, 2007: http://www.python.org/psf/records/board/minutes/2007-11-12/ -- David Goodger http://python.net/~goodger -- http://mail.python.org/mailman/listinfo/python-announce-list Support

Re: Monitoring the output of an external program

2007-12-13 Thread Vladimir Rusinov
On 12/13/07, Caleb Marcus [EMAIL PROTECTED] wrote: I'm writing something that has to invoke an external program, and every time the external program prints something, update a UI. How would I go about doing this? Use sys.popen or pexpect module. With pexpect you can even use single thread.

Re: Difference between del and remove?

2007-12-13 Thread Tim Roberts
Yansky [EMAIL PROTECTED] wrote: Got a quick n00b question. What's the difference between del and remove? It would have been easier to answer if you had given a little context. del is a Python statement that removes a name from a namespace, an item from a dictionary, or an item from a list.

Re: Dynamic or not?

2007-12-13 Thread Tim Roberts
[EMAIL PROTECTED] wrote: I'm trying to write a program that will find the distance between two groups of points in space, which have cartesian co-ordinates X,Y and Z. I need to find the distances between each point in one group and every point in the other group. So if group 1 has 6 points and

Re: Dynamic or not?

2007-12-13 Thread John Machin
On Dec 13, 3:33 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 12 Dec 2007 19:18:20 -0800, rishiyoor wrote: I'm trying to write a program that will find the distance between two groups of points in space, which have cartesian co-ordinates X,Y and Z. points1 = [

Re: Newbie NameError problem

2007-12-13 Thread cokofreedom
On Dec 12, 7:03 pm, Paul Rudin [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: On Dec 12, 5:51 pm, Paul Rudin [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: I don't understand what I don't understand in the following: I haven't tried to understand what your code is doing - but

Re: Dynamic or not?

2007-12-13 Thread Steven D'Aprano
On Thu, 13 Dec 2007 00:39:55 -0800, John Machin wrote: X, Y, umm, aren't we short a dimension? I'm not going to do *everything* for the OP. He can extend it to three dimensions. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

looping list?

2007-12-13 Thread datulaida ali
hi.. i'm trying to insert value into list according to the key (ASCII) that i generate.. example : win = 95, so must insert into list[95] and = 70, so must insert into list[70] this is my coding.. __ list = [] try: conn =

what the heck does this mean?

2007-12-13 Thread katie smith
Traceback (most recent call last): File C:\Python25\empire\Empire Strategy.pyw, line 322 Maty = Searched(number) TypeError: 'list' object is not callable My list is NewMap1 =[0,0,0,0,0,0,2,0,2,2,3,2,0,0,0,0] so Maty Searched(number is supposed to give me 0 when Search = NewMap

Re: what the heck does this mean?

2007-12-13 Thread Gary Herron
katie smith wrote: Traceback (most recent call last): File C:\Python25\empire\Empire Strategy.pyw, line 322 Maty = Searched(number) TypeError: 'list' object is not callable My list is NewMap1 =[0,0,0,0,0,0,2,0,2,2,3,2,0,0,0,0] so Maty Searched(number is supposed to give me 0 when

Re: Is Python really a scripting language?

2007-12-13 Thread Bruno Desthuilliers
Doug Morse a écrit : ottop-post corrected/ot But here's my problem, most of my coworkers, when they see my apps and learn that they are written in Python ask questions like, Why would you write that in a scripting language? Whenever I hear a comment like that I can feel myself boiling

Re: Is Python really a scripting language?

2007-12-13 Thread Bruno Desthuilliers
Terry Reedy a écrit : Ron Provost [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] But here's my problem, most of my coworkers, when they see my apps and learn that they are written in Python ask questions like, Why would you write that in a scripting language? Then ask them

MySQLdb extracting to a list

2007-12-13 Thread dave . dex
Hi all, I've been searching the docs like mad and I'm a little new to python so apologies if this is a basic question. I would like to extract the results of the following query into a list - SELECT columnname FROM tablename. I use the following code. # Create a connection object and create a

Re: Is Python really a scripting language?

2007-12-13 Thread Marco Mariani
Bruno Desthuilliers wrote: As far as I'm concerned, anyone (I mean, anyone pretending to be a programmer) being ignorant enough to ask such a question ranks high in my bozo list. Don't waste time with bozos. Alan Kay said it well enough without using words like pretending, ignorant and

Re: what the heck does this mean?

2007-12-13 Thread Bruno Desthuilliers
(Answering to Katie Smith) katie smith wrote: Traceback (most recent call last): File C:\Python25\empire\Empire Strategy.pyw, line 322 Maty = Searched(number) TypeError: 'list' object is not callable And which is line 322 ? My list is NewMap1 =[0,0,0,0,0,0,2,0,2,2,3,2,0,0,0,0] so

Re: Is Python really a scripting language?

2007-12-13 Thread Bruno Desthuilliers
Marco Mariani a écrit : Bruno Desthuilliers wrote: As far as I'm concerned, anyone (I mean, anyone pretending to be a programmer) being ignorant enough to ask such a question ranks high in my bozo list. Don't waste time with bozos. Alan Kay said it well enough without using words like

Re: MySQLdb extracting to a list

2007-12-13 Thread John Machin
On Dec 13, 9:03 pm, [EMAIL PROTECTED] wrote: Hi all, I've been searching the docs like mad and I'm a little new to python so apologies if this is a basic question. I would like to extract the results of the following query into a list - SELECT columnname FROM tablename. I use the following

Re: what the heck does this mean?

2007-12-13 Thread Remco Gerlich
On Dec 13, 2007 4:57 AM, katie smith [EMAIL PROTECTED] wrote: Traceback (most recent call last): File C:\Python25\empire\Empire Strategy.pyw, line 322 Maty = Searched(number) TypeError: 'list' object is not callable This is the error message. The first line basically says This is what

Very beautiful girls and many useful resources and more, please check it out

2007-12-13 Thread [EMAIL PROTECTED]
Very beautiful girls and many useful resources and more,please check it out http://groups.google.com/group/all-good-things/web/beautiful-girls-and-ladies -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb extracting to a list

2007-12-13 Thread dave . dex
On Dec 13, 10:40 am, John Machin [EMAIL PROTECTED] wrote: On Dec 13, 9:03 pm, [EMAIL PROTECTED] wrote: Hi all, I've been searching the docs like mad and I'm a little new to python so apologies if this is a basic question. I would like to extract the results of the following query

Re: Is a real C-Python possible?

2007-12-13 Thread Bruno Desthuilliers
sturlamolden a écrit : On 12 Des, 17:00, Chris Mellon [EMAIL PROTECTED] wrote: Python has not become what it is, and achieved the success it has, because a bunch of people really wanted to use Lisp but didn't think other people could handle it. The goal of these sorts of discussions should

kniterbasdb and datetime

2007-12-13 Thread Laszlo Nagy
Hi All, I connected to a FireBird 1.5 database this way: import kinterbasdb kinterbasdb.init(type_conv=200) # See http://kinterbasdb.sourceforge.net/dist_docs/usage.html#faq_fep_is_mxdatetime_required Then I try to update the database: sql = UPDATE TABLE1 SET DATEFIELD=? where ID = ?

releasing the reference returned by PyLong_FromLong, PyString_FromString friends

2007-12-13 Thread grbgooglefan
I am having a object tuple created at application startup. This tuple I pass on to a python function in call to: PyObject_CallObject(pcatInfo-pPyEvalFunction,pTuple); For setting the values in this tuple, I am using PyLong_FromLong, PyString_FromString friends functions.

Re: do as a keyword

2007-12-13 Thread Tommy Grav
On Wed, 12 Dec 2007 09:46:09 -0600, Chris Mellon wrote: I agree that it's fundamental, but I'd like to mention that I've written many thousands of lines of Python code, from throwaway code for demonstration to enterprisey servers and all sorts of things in between and I've *never*

Re: do as a keyword

2007-12-13 Thread BJörn Lindqvist
On Dec 11, 2007 4:06 PM, Neil Cerutti [EMAIL PROTECTED] wrote: However, did you have an specific need for a do-while construct? Perhaps we could show you the alternatives. I have wanted do-while loops in exactly one kind of algorithms, when you generate something and you have to keep trying

Re: determining bytes read from a file.

2007-12-13 Thread Diez B. Roggisch
vineeth wrote: Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open(somefile) data = file.read() print bytes read , len(data) --- But the bytes read

Re: Difference between del and remove?

2007-12-13 Thread Yansky
Thanks for the clarification guys. :) On Dec 13, 7:05 pm, Tim Roberts [EMAIL PROTECTED] wrote: Yansky [EMAIL PROTECTED] wrote: Got a quick n00b question. What's the difference between del and remove? It would have been easier to answer if you had given a little context. del is a Python

determining bytes read from a file.

2007-12-13 Thread vineeth
Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open(somefile) data = file.read() print bytes read , len(data) --- But the bytes read is not being printed

Re: determining bytes read from a file.

2007-12-13 Thread John Machin
On Dec 13, 11:04 pm, vineeth [EMAIL PROTECTED] wrote: Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open(somefile) data = file.read() print bytes read ,

Re: determining bytes read from a file.

2007-12-13 Thread vineeth
On Dec 13, 5:13 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: vineeth wrote: Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open(somefile) data =

problem in reading indices

2007-12-13 Thread Xavier Barthelemy
Hi all I'm becoming mad, because I can't see what's wrong: I am constructing a GUI, to plot some data. so let's have a look of what's wrong: in my code I have a variable named choice[i].current which is the current selection of the i-th Listbox object. it is a tuple, with one element. so

Re: determining bytes read from a file.

2007-12-13 Thread Matt Nordhoff
vineeth wrote: parser.add_option(-b, --bytes, dest=bytes) This is an aside, but if you pass 'type=int' to add_option, optparse will automatically convert it to an int, and (I think), give a more useful error message on failure. -- -- http://mail.python.org/mailman/listinfo/python-list

Re: determining bytes read from a file.

2007-12-13 Thread vineeth
On Dec 13, 5:27 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Thu, 13 Dec 2007 04:04:59 -0800, vineeth wrote: I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file =

XML partial validation.

2007-12-13 Thread Jos� Rui Faustino de Sousa
Hi! I am writing a text to XML parser that as to be easily extensible (via new text format plug-ins) and modifiable if the XML format used changes. Since the text order does not match the XML document order I have to use a package that allows DOM-like handling of XML (elementtree for

Re: Improvements to the Python core

2007-12-13 Thread Paul Boddie
On Dec 13, 3:56 am, Christian Heimes [EMAIL PROTECTED] wrote: Paul Boddie wrote: Then you haven't been reading the right IRC channel recently. ;-) What's the right channel? I'm on #python and #python-dev But where are people who might know Psyco likely to hang out? ;-) Anyway, it remains to

Re: kniterbasdb and datetime

2007-12-13 Thread DarkBlue
On Dec 13, 7:45 pm, Laszlo Nagy [EMAIL PROTECTED] wrote: Hi All, I connected to a FireBird 1.5 database this way: import kinterbasdb kinterbasdb.init(type_conv=200) # Seehttp://kinterbasdb.sourceforge.net/dist_docs/usage.html#faq_fep_is_mx... Then I try to update the database: sql =

Re: determining bytes read from a file.

2007-12-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Dec 2007 04:04:59 -0800, vineeth wrote: I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open(somefile) data = file.read() print bytes read , len(data) ---

Re: determining bytes read from a file.

2007-12-13 Thread John Machin
On Dec 13, 11:04 pm, vineeth [EMAIL PROTECTED] wrote: Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open(somefile) data = file.read() print bytes read ,

Re: E-Mail Parsing

2007-12-13 Thread Merrigan
On Dec 13, 9:29 am, Matt Nordhoff [EMAIL PROTECTED] wrote: Merrigan wrote: I am writing a script to administer my E-Mail Server. The One thing I'm currently struggling with is kind of Parsing the E-Mail adress that I supply to the script. I need to get the username (The part BEFORE the @

Re: E-Mail Parsing

2007-12-13 Thread Matt Nordhoff
Merrigan wrote: Hi Matt, Thank you very much for the help. It was exactly what I was looking for, and made my script much safer and easier to use. Blessings! -- Merrigan You're welcome. :-) -- -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient data loading with Python, is that possible possible?

2007-12-13 Thread bearophileHUGS
igor: The fundamental difference is that in C++, I create a single object (a line buffer) that's reused for each input line and column values are extracted straight from that buffer without creating new string objects. In python, new objects must be created and destroyed by the million which

Re: kniterbasdb and datetime

2007-12-13 Thread Laszlo Nagy
DarkBlue írta: On Dec 13, 7:45 pm, Laszlo Nagy [EMAIL PROTECTED] wrote: Hi All, I connected to a FireBird 1.5 database this way: import kinterbasdb kinterbasdb.init(type_conv=200) # Seehttp://kinterbasdb.sourceforge.net/dist_docs/usage.html#faq_fep_is_mx... Then I try to update

Re: problem in reading indices

2007-12-13 Thread Bjoern Schliessmann
Xavier Barthelemy wrote: so when I call another array with these indices ArrayWithData[i,int(choice[i].current[0])] You don't call arrays with indices. You are indexing the list ArrayWithData using the index i,int(blah) which is invalid. Indices must be integers, not comma seperated values.

Re: problem in reading indices

2007-12-13 Thread Bruno Desthuilliers
Xavier Barthelemy a écrit : Hi all I'm becoming mad, because I can't see what's wrong: I am constructing a GUI, to plot some data. so let's have a look of what's wrong: in my code I have a variable named choice[i].current which is the current selection of the i-th Listbox object.

Re: doctest quiet again before exit how

2007-12-13 Thread pelavarre
By the way, I copied this 2006-10 clp issue into Bugs.python.org. -- Pat LaVarre http://bugs.python.org/issue1611 TITLE: doctest.testmod gets noisy if called more than once per SystemExit SUMMARY: Calling doctest.testmod more than once before SystemExit spews stderr messages such as ***

Re: sqlite weirdness

2007-12-13 Thread kyosohma
On Dec 13, 12:12 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 12 Dec 2007 16:02:35 -0800 (PST), [EMAIL PROTECTED] declaimed the following in comp.lang.python: Thanks Duncan and John! That makes sense. But why does the official Python docs show an example that seems to imply that

Re: sqlite weirdness

2007-12-13 Thread kyosohma
On Dec 13, 1:54 am, Tim Roberts [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: snipped I'll have to refactor my code somewhat to force it to use the '-MM- DD' format. Another possible solution is to use a real database. I am using a real database: MS SQL Server 2000. Unfortunately,

Re: to Doctest as SystemExit is to Python

2007-12-13 Thread pelavarre
Sent: 2006-11-09; To: comp.lang.python Can doctest ... be persuaded to exit after a catastroph[e]...? ... sys.exit() doesn't do what I mean: it raises SystemExit ... [and doesn't exit] ... doctest.REPORT_ONLY_FIRST_FAILURE doesn't do what I mean [it filters stdout but doesn't exit] Yes

Re: determining bytes read from a file.

2007-12-13 Thread Chris
A couple potential optimizations: # create the member variable name. mem_var_name = options.inputfilename mem_var_name = mem_var_name.replace(' ','_') mem_var_name = mem_var_name.replace('.','_') mem_var_name = options.inputfilename.replace(' ','_').replace('.','_') No need to assign it 3

Re: Dynamic or not?

2007-12-13 Thread rishiyoor
On Dec 12, 11:33 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 12 Dec 2007 19:18:20 -0800, rishiyoor wrote: I'm trying to write a program that will find the distance between two groups of points in space, which have cartesian co-ordinates X,Y and Z. I need to find

Re: Finding Line numbers of HTML file

2007-12-13 Thread Ramdas
Hi Paul, I am cross posting the same to grab your attention at pyparsing forums too. 1000 apologies on the same count! I am a complete newbie to parsing and totally new to pyparsing. I have adapted your code to store the line numbers as below. Surprisingly, the line numbers printed, when I

Re: Finding Line numbers of HTML file

2007-12-13 Thread Ramdas
Hi Paul, I am cross posting the same to grab your attention at pyparsing forums too. 1000 apologies on the same count! I am a complete newbie to parsing and totally new to pyparsing. I have adapted your code to store the line numbers as below. Surprisingly, the line numbers printed, when I

Re: efficient data loading with Python, is that possible possible?

2007-12-13 Thread Neil Cerutti
On 2007-12-13, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Dec 12, 4:03 pm, John Machin [EMAIL PROTECTED] wrote: Inside your function [you are doing all this inside a function, not at global level in a script, aren't you?], do this: from time import mktime, strptime # do this ONCE

Re: Is anyone happy with csv module?

2007-12-13 Thread Neil Cerutti
On 2007-12-12, John Machin [EMAIL PROTECTED] wrote: On Dec 13, 12:58 am, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-12-12, John Machin [EMAIL PROTECTED] wrote: It's clear that I am thinking to completely different usages for CSV than what most people in this thread. I use csv to export

Re: kniterbasdb and datetime

2007-12-13 Thread Laszlo Nagy
Kinterbasdb probably expects the format looking like month/day/year rather than year-month-day All right, I tried the month/day/year version: print sql print params cur.execute(sql,params) Results in: Inserting new TTT codes...insert into ttt( ID, TTT,

Re: Is Python really a scripting language?

2007-12-13 Thread Bruno Desthuilliers
Neil Cerutti a écrit : On 2007-12-13, Steven D'Aprano [EMAIL PROTECTED] wrote: I have repeatedly argued in the past that we do ourselves a disservice by describing Python as an interpreted language. Python is compiled. It has a compiler. It even has a built-in function compile. It's just not

Re: Dynamic or not?

2007-12-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Dec 2007 06:51:23 -0800, rishiyoor wrote: When you say python automatically allocates memory, what would you do if you don't know the size of the list of, say for example, the nearest pairs between the two groups. I would probably iterate over all the pairs and create a new list. I

Re: How to get milliseconds when substructing datetime objects?

2007-12-13 Thread Dmitri O.Kondratiev
*Gabriel thanks for detailed info! Actually I have already went the same (only more limited :) way as you suggested and did some poking with dir() at datetime and timedelta objects. This time I have bumped into the following problems that I can't find ready solutions yet: Subtracting of

Re: Is Python really a scripting language?

2007-12-13 Thread Neil Cerutti
On 2007-12-13, Steven D'Aprano [EMAIL PROTECTED] wrote: I have repeatedly argued in the past that we do ourselves a disservice by describing Python as an interpreted language. Python is compiled. It has a compiler. It even has a built-in function compile. It's just not compiled to *machine

Re: Pascal code checker!

2007-12-13 Thread Neil Cerutti
On 2007-12-13, Dotan Cohen [EMAIL PROTECTED] wrote: On 13/12/2007, Tim Chase [EMAIL PROTECTED] wrote: Oof! Fond as I am of promoting pyparsing, writing a Pascal compiler (or even just syntax checker) is not a job I would tackle lightly, much less suggest to a new Python developer.

Re: Pascal code checker!

2007-12-13 Thread Zentrader
The OP was not talking about a Python program to check the Pascal program as I read it to make application in python that would send code (text) to pascal compiler...and it would return result and then application would show that result. So he/she/it would want subprocess to compile the

Re: Question from a python newbie

2007-12-13 Thread Duncan Booth
Russell [EMAIL PROTECTED] wrote: I've searched the Language Reference and was not able to find any info regarding the structure of this code fragment: int(text) if text.isdigit() else text http://docs.python.org/whatsnew/pep-308.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding Line numbers of HTML file

2007-12-13 Thread Paul McGuire
On Dec 13, 9:01 am, Ramdas [EMAIL PROTECTED] wrote: Hi Paul, I am cross posting the same to grab your attention at pyparsing forums too. 1000 apologies on the same count! I am a complete newbie to parsing and totally new to pyparsing. I have adapted your code to store the line numbers as

Re: Question from a python newbie

2007-12-13 Thread Remco Gerlich
On Dec 13, 2007 4:39 PM, Russell [EMAIL PROTECTED] wrote: I've been learning Python slowly for a few months, coming from a C/C+ +, C#, Java, PHP background. I ran across a code fragment I'm having trouble wrapping my brain around. I've searched the Language Reference and was not able to

Re: Is Python really a scripting language?

2007-12-13 Thread Paul Rudin
Neil Cerutti [EMAIL PROTECTED] writes: On 2007-12-13, Steven D'Aprano [EMAIL PROTECTED] wrote: I have repeatedly argued in the past that we do ourselves a disservice by describing Python as an interpreted language. Python is compiled. It has a compiler. It even has a built-in function

Re: Dynamic or not?

2007-12-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Dec 12, 11:33 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: (snip) When you say python automatically allocates memory, what would you do if you don't know the size of the list thelist = [] thelist.append('Ever') thelist.append('bothered')

Re: Tuples !?!?

2007-12-13 Thread Jason
On Dec 11, 3:08 pm, [EMAIL PROTECTED] wrote: On 11 Dez, 22:02, [EMAIL PROTECTED] wrote: Ok. This is small code. The problem is '2' != 2 there is a way of converting 'some number' in number ? Thanks. # -*- coding: cp1252 -*- import random import csv import struct import array

Re: Is Python really a scripting language?

2007-12-13 Thread Neil Cerutti
On 2007-12-13, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Neil Cerutti a écrit : On 2007-12-13, Steven D'Aprano [EMAIL PROTECTED] wrote: I have repeatedly argued in the past that we do ourselves a disservice by describing Python as an interpreted language. Python is compiled. It has a

Question from a python newbie

2007-12-13 Thread Russell
I've been learning Python slowly for a few months, coming from a C/C+ +, C#, Java, PHP background. I ran across a code fragment I'm having trouble wrapping my brain around. I've searched the Language Reference and was not able to find any info regarding the structure of this code fragment:

Re: kniterbasdb and datetime

2007-12-13 Thread Uwe Grauer
Laszlo Nagy wrote: Hi All, I connected to a FireBird 1.5 database this way: import kinterbasdb kinterbasdb.init(type_conv=200) # See http://kinterbasdb.sourceforge.net/dist_docs/usage.html#faq_fep_is_mxdatetime_required Then I try to update the database: sql = UPDATE TABLE1 SET

Re: Question from a python newbie

2007-12-13 Thread Russell
I suspected it was a ternary type of operator, but was unable to confirm it. And I didn't realize it was new to 2.5. Perfectly clear now. :) Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Question from a python newbie

2007-12-13 Thread J. Clifford Dyer
On Thu, Dec 13, 2007 at 04:57:04PM +0100, Remco Gerlich wrote regarding Re: Question from a python newbie: On Dec 13, 2007 4:39 PM, Russell [EMAIL PROTECTED] wrote: I've been learning Python slowly for a few months, coming from a C/C+ +, C#, Java, PHP background. I ran

how to include a tiny debug feature in my project ?

2007-12-13 Thread Stef Mientki
hello, I've large program based, with a GUI based on wxPython, where the user can add small parts, which I call Bricks. A new Brick is created by inheriting from the standard-Brick. The user should only override 1 or 2 functions from the standard-Brick. The main properties used in those 2

Clearing a DOS terminal in a script

2007-12-13 Thread Stephen_B
This doesn't seem to work in a dos terminal at the start of a script: from os import popen print popen('clear').read() Any idea why not? Thanks. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic or not?

2007-12-13 Thread rishiyoor
On Dec 13, 10:24 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Thu, 13 Dec 2007 06:51:23 -0800, rishiyoor wrote: When you say python automatically allocates memory, what would you do if you don't know the size of the list of, say for example, the nearest pairs between the two

Re: How to get milliseconds when substructing datetime objects?

2007-12-13 Thread Dmitri O.Kondratiev
While looking for ready to use library I have roughly skteched the functions that I need: import datetime from datetime import * def timedelta2Micros(dt): Convert timedelta object to micriseconds days = dt.days sec = dt.seconds micros = dt.microseconds daysSec = 24 * 60 * 60

Re: Monitoring the output of an external program

2007-12-13 Thread Calvin Spealman
I always recommend the subprocess module for any needs like this. Read up on it and it should provide everything you need. On Dec 13, 2007, at 2:41 AM, Caleb Marcus wrote: I'm writing something that has to invoke an external program, and every time the external program prints something,

Re: what the heck does this mean?

2007-12-13 Thread Calvin Spealman
On Dec 12, 2007, at 10:57 PM, katie smith wrote: Traceback (most recent call last): File C:\Python25\empire\Empire Strategy.pyw, line 322 Maty = Searched(number) Look, you're calling Searched right here with Searched(number) TypeError: 'list' object is not callable ... Maty

Re: Clearing a DOS terminal in a script

2007-12-13 Thread Chris Mellon
On Dec 13, 2007 10:48 AM, Stephen_B [EMAIL PROTECTED] wrote: This doesn't seem to work in a dos terminal at the start of a script: from os import popen print popen('clear').read() Any idea why not? Thanks. It opens clear with it's own virtual terminal and clears that instead. There's an

Re: Clearing a DOS terminal in a script

2007-12-13 Thread Stephen_B
On Dec 13, 11:21 am, Chris Mellon [EMAIL PROTECTED] wrote: It opens clear with it's own virtual terminal and clears that instead. Even when I launch the script from a cmd shell with python myscript.py? There's an ANSI control code you can use to reset the screen, try printing that. I

looking for gui for python code

2007-12-13 Thread [EMAIL PROTECTED]
hi i have written some python scripts which take command line arguments and do some job. i would like to make it into a .exe using py2exe and distribute it with innosetup.. befor that i would like to add some GUI support..i mean select some values using a folder explorer etc..which would be a good

Re: looking for gui for python code

2007-12-13 Thread James Matthews
Using any GUI package you should be able to build your application into EXE format! On Dec 13, 2007 6:46 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi i have written some python scripts which take command line arguments and do some job. i would like to make it into a .exe using py2exe and

Re: Is a real C-Python possible?

2007-12-13 Thread Patrick Mullen
Kay Schluehr wrote: Python 2.6 and 3.0 have a more Pythonic way for the problem: class A(object): @property def foo(self): return self._foo @foo.setter def foo(self, value) self._foo = value @foo.deletter def

Re: Best way to protect my new commercial software.

2007-12-13 Thread farsheed
Thank you all. I explain what I did to do it. Very simple but what I want: I find the host id of system (using ipconfig) and create a hash code based on it.(some math, md5 and functions). the code for licensing is about 15 lines and is very fast. I needed 20 licenses and I wrote a keygen for

python vs perl performance test

2007-12-13 Thread igor . tatarinov
First, let me admit that the test is pretty dumb (someone else suggested it :) but since I am new to Python, I am using it to learn how to write efficient code. my $sum = 0; foreach (1..10) { my $str = chr(rand(128)) x 1024; foreach (1..100) { my $substr = substr($str,

Re: Is a real C-Python possible?

2007-12-13 Thread Chris Mellon
On Dec 13, 2007 12:04 PM, Patrick Mullen [EMAIL PROTECTED] wrote: Kay Schluehr wrote: Python 2.6 and 3.0 have a more Pythonic way for the problem: class A(object): @property def foo(self): return self._foo @foo.setter def foo(self,

Re: Is Python really a scripting language?

2007-12-13 Thread sturlamolden
On 13 Des, 02:19, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: I have repeatedly argued in the past that we do ourselves a disservice by describing Python as an interpreted language. Python is compiled. It has a compiler. It even has a built-in function compile. Python is

Re: How to get milliseconds when substructing datetime objects?

2007-12-13 Thread Gabriel Genellina
En Thu, 13 Dec 2007 14:07:10 -0300, Dmitri O.Kondratiev [EMAIL PROTECTED] escribi�: While looking for ready to use library I have roughly skteched the functions that I need: They look fine to me. Just one thing: days = micros / oneDayMicros # whole number of days It's safer to use

Re: TCP reset caused by socket.py

2007-12-13 Thread Gabriel Genellina
En Wed, 12 Dec 2007 20:12:43 -0300, Object01 [EMAIL PROTECTED] escribi�: I don't know much about the timing of Python's garbage collection. Is it pretty aggressive? As soon as the reference count reaches zero (at least for current CPython version). Objects that are part of a reference cycle

Christmas Shopping Made Easy

2007-12-13 Thread rzt8lias
This site helped me during the holidays.Check out http://www.christmasplayland.com which offers some great resources and tons of deals.I definitely saved time shopping for deals online at this site. -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs perl performance test

2007-12-13 Thread Chris Mellon
On Dec 13, 2007 12:11 PM, [EMAIL PROTECTED] wrote: First, let me admit that the test is pretty dumb (someone else suggested it :) but since I am new to Python, I am using it to learn how to write efficient code. my $sum = 0; foreach (1..10) { my $str = chr(rand(128)) x 1024;

Re: Clearing a DOS terminal in a script

2007-12-13 Thread John Machin
On Dec 14, 3:48 am, Stephen_B [EMAIL PROTECTED] wrote: This doesn't seem to work in a dos terminal at the start of a script: from os import popen print popen('clear').read() Any idea why not? Thanks. Maybe you are using a different dos terminal. What is clear? C:\junkclear 'clear' is not

Re: Dynamic or not?

2007-12-13 Thread John Machin
On Dec 14, 2:29 am, Bruno Desthuilliers While you're at it, add list comprehensions, iterators/generators and itertools to the list (pun intented). 'Intented' is a novel word; is it the opposite of 'decamped'? -- http://mail.python.org/mailman/listinfo/python-list

Newbie design problem

2007-12-13 Thread MartinRinehart
Thanks to a lot of help, I've got the outer framework for my tokenizer down to this: for line_number, line in enumerate(text): output = '' for char_number, char in enumerate(line): output += char print 'At ' + str(line_number) + ', '+ str(char_number) +

Re: python vs perl performance test

2007-12-13 Thread Arnaud Delobelle
On Dec 13, 6:11 pm, [EMAIL PROTECTED] wrote: from random import randrange from itertools import imap, repeat from operator import getitem, add, getslice result = 0 zeros = [0]*100 for i in xrange (10): s = [chr(randrange(128))] * 1024 starts = repeat(randrange(900), 100)

Eclipse/PyQt/Eric4 question

2007-12-13 Thread king kikapu
Hi, this is actually goes to whoever is using Eclipse and Eric4, the IDE that comes bundled with PyQt. I was using Eclipse until i saw Eric4 and i started experiment with it, very nice work. Eric4 has a feature that actually reminds us the work of some expensive IDEs, like Visual Studio, Delphi

Python implementation of include

2007-12-13 Thread lloyd
Hello, I've been using the Python-based Karrigell web application framework. It has the very handy word include that inserts a code file into into the stream of execution. E.g. if myFile.py contains the code: print This is a message from myFile.pybr and my script is: print Somethingbr include

Re: Eclipse/PyQt/Eric4 question

2007-12-13 Thread Fabio Zadrozny
In Eclipse, i have the luxury of double-click a .ui file and thus Qt Designer opens and then design my forms there, but i cannot fing an automatic way to accomplish the thing that eric4 does: e.x. automatically compile changed .ui files when i hit F9. And it really a loss of time to go to

  1   2   3   >