UNIX shell in Python?

2007-02-08 Thread Deniz Dogan
Hello. I was thinking about writing a UNIX shell program using Python. Has anyone got any experience on this? Is it even possible? I have programmed a simple shell in C before and I came to think about how perfect Python would be for parsing user input. Regards, Deniz Dogan -- http://mail.

Re: Overloading the tilde operator?

2007-02-08 Thread Markus Triska
[EMAIL PROTECTED] writes: > Also some flavours of Prolog, as descrived in the classic book by op/3 is part of the Prolog ISO standard: http://pauillac.inria.fr/~deransar/prolog/bips.html#operators so every compliant implementation has it. -- http://mail.python.org/mailman/listinfo/python-list

pyExcelerator - Protecting Cells

2007-02-08 Thread Chris
I'm sitting with a bit of an issue with pyExcelerator and creating an Excel file with certain cells protected while the rest of the spreadsheet is password protected. The Protection class under Formatting has 2 variables for cell_locked and formula_hidden, tbh I only need to alter cell_locked to 0

Win98 - exceptions.IOError: (13, 'Permission denied')

2007-02-08 Thread Robert Dollinger
Hi to everyone, I have a Service, that runs on a WinXP machine. The service read a file on a Win98 machine and write the content in a file on the WinXP machine. After tree times I get the error message exceptions.IOError: (13, 'Permission denied'). The following things I have already tested: -

Re: postgres backup script and popen2

2007-02-08 Thread flupke
flupke schreef: Thanks for all the info. I'm sure i will get it right this time :) Benedict -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Interpolation in Numpy?

2007-02-08 Thread Hendrik van Rooyen
LAPI, VINCENT J, ATTLABS wrote: >Hi, >Please bear with me as I am new to Python and have not done any programming in about 20 years. I am >attempting to do a simple interpolation of a line's intermediate points given the x,y coordinates of the line's two >endpoints within an Active State Pytho

Re: Regexp not performing the same in FTP versus Python

2007-02-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, IamIan wrote: > Hello all, > > I'm trying to use a regular expression in an FTP script to list > certain files. When run in a standard FTP session the command: > > dir .??[oOdDnNmM]* > > returns 48 files. When I use the following Python script it prints > roughly

Re: Is Python for me?

2007-02-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jiddu wrote: > I'm planning to create a poker calculator, I learned some basic in > highschool years ago and I was told for beginners Python is a good > language to start. There's a recipe in the Cookbook that might be interesting for you: http://aspn.activestate.com/AS

Re: Thanks for the help

2007-02-08 Thread azrael
On Feb 9, 4:06 am, "Reid" <[EMAIL PROTECTED]> wrote: > Hello All > > Thanks for taking the time to answer my question. I do not need 3d stuff. > Just a couple of buttons and menu's. The reason I am looking at python is it > is free to download. I cannot afford VB or other commercial languages. > >

Re: Is Python for me?

2007-02-08 Thread azrael
i forgot a query language. something like postgre or mysql On Feb 9, 7:37 am, "azrael" <[EMAIL PROTECTED]> wrote: > i hope you know that for this task, if you want it to be successfull, > you need a really big database. it sounds very simple to this. it > sounds like go through all possible permu

Re: Is Python for me?

2007-02-08 Thread azrael
i hope you know that for this task, if you want it to be successfull, you need a really big database. it sounds very simple to this. it sounds like go through all possible permutations. before you start writing any code take a pencil and a big paper and do some maths. i sugesst you read and practis

Re: Newbie Question

2007-02-08 Thread Tina I
azrael wrote: > but look out for pyqt. there is one thing in the eula i don't like. > there is written that if you use qtWidgets and they like the > aplication, you have to give up all your rights of the aplication. > patent, idea, money everything is gone. i know this is open source, > but maybe o

Re: strange problem using modules from my own package.

2007-02-08 Thread krishnakant Mane
On 09/02/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Friday 9/2/2007 02:10, you wrote: > > Please keep posting on the list - you'll reach a whole lot of people > there... sorry, I had just hit the reply button and did not notice that python-list was not there. >my crystal ball I can see t

Re: Calling J from Python

2007-02-08 Thread Tina I
Hendrik van Rooyen wrote: > > I am under the impression that Loki had a daughter called Hel ... > > - Hendrik > Yes. And Hel was the queen of the underworld which was also called 'Hel' (Which of course is 'hell', in modern Norwegian : "helvete") -- http://mail.python.org/mailman/listinfo/pyt

Re: strange problem using modules from my own package.

2007-02-08 Thread Gabriel Genellina
At Friday 9/2/2007 02:10, you wrote: Please keep posting on the list - you'll reach a whole lot of people there... On 09/02/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: It's a bit hard to tell from your description - would be better if you had copied the exact error messages. But the over

Re: Is Python for me?

2007-02-08 Thread James Stroud
jiddu wrote: > Hi, > > I'm planning to create a poker calculator, I learned some basic in > highschool years ago and I was told for beginners Python is a good > language to start. > > What I wanted to do is to first write a program which will be able to run > through all the possible combinations

Re: Dictionary Question

2007-02-08 Thread Gabriel Genellina
At Friday 9/2/2007 00:50, you wrote: Hey Gabriel, Please keep posting on the list - you'll reach a whole lot of people there... Thanks again for the help... but im still having some issues. For some reason the "domsrch.search(key)" is pointing to a memory reference... so when

Re: Calling J from Python

2007-02-08 Thread Hendrik van Rooyen
"Tina I" <[EMAIL PROTECTED]> wrote: Gosi wrote: > On Feb 7, 3:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, Gosi wrote: >>> I like to use J for many things and I think that combining Python and >>> J is a hell of a good mixture. >> I was able to follow this

Is Python for me?

2007-02-08 Thread jiddu
Hi, I'm planning to create a poker calculator, I learned some basic in highschool years ago and I was told for beginners Python is a good language to start. What I wanted to do is to first write a program which will be able to run through all the possible combinations of cards dealt out and use s

Re: Newbie Question

2007-02-08 Thread Gabriel Genellina
En Fri, 09 Feb 2007 01:18:49 -0300, azrael <[EMAIL PROTECTED]> escribió: > but look out for pyqt. there is one thing in the eula i don't like. > there is written that if you use qtWidgets and they like the > aplication, you have to give up all your rights of the aplication. > patent, idea, money

Re: Looking for a MoinMoin guru - MoinMoin+SpamBayes == no wiki spam?

2007-02-08 Thread skip
fuzzyman> You could also try akismet which is designed for finding spam fuzzyman> 'comments' in blogs, a similar problem area. Thanks. It appears that Akismet is a non-free tool, so doesn't fit in real well with the open source nature of MoinMoin and SpamBayes. I think I'll leave it to

Re: Newbie Question

2007-02-08 Thread azrael
but look out for pyqt. there is one thing in the eula i don't like. there is written that if you use qtWidgets and they like the aplication, you have to give up all your rights of the aplication. patent, idea, money everything is gone. i know this is open source, but maybe one day i will manage to

Re: Looking for a MoinMoin guru - MoinMoin+SpamBayes == no wiki spam?

2007-02-08 Thread skip
T> I think it's a fantastic idea, myself. I think it should work well. T> It's probably important to filter the edit, not the whole article, T> otherwise the ham might obscure the spam. That would be a good second phase. My experience with most wiki spam so far is that the spammers r

Re: Looking for a MoinMoin guru - MoinMoin+SpamBayes == no wiki spam?

2007-02-08 Thread [EMAIL PROTECTED]
I think it's a fantastic idea, myself. I think it should work well. It's probably important to filter the edit, not the whole article, otherwise the ham might obscure the spam. Cheers, -T -- http://mail.python.org/mailman/listinfo/python-list

Thanks for the help

2007-02-08 Thread Reid
Hello All Thanks for taking the time to answer my question. I do not need 3d stuff. Just a couple of buttons and menu's. The reason I am looking at python is it is free to download. I cannot afford VB or other commercial languages. Reid -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Papers second issue now available!

2007-02-08 Thread [EMAIL PROTECTED]
http://pythonpapers.cgpublisher.com/product/pub.169/prod.5 Sorry, forgot to add the URL -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary Question

2007-02-08 Thread Gabriel Genellina
En Thu, 08 Feb 2007 23:32:50 -0300, Sick Monkey <[EMAIL PROTECTED]> escribió: > db = {'[EMAIL PROTECTED]':'none', '[EMAIL PROTECTED]':'none', > '[EMAIL PROTECTED]':'none', > '[EMAIL PROTECTED]':'none',} > > And I want to pull out all of the "gmail.com" addresses.. How would I do > this? > > N

Re: strange problem using modules from my own package.

2007-02-08 Thread Gabriel Genellina
En Thu, 08 Feb 2007 18:40:39 -0300, krishnakant Mane <[EMAIL PROTECTED]> escribió: > I found a very strange kind of behaviour in python with my own package. > I created a package in which there were 4 modules and one __init__.py > file > I created the entire project in eclipse (pydev). > it wo

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-08 Thread kernel1983
On Feb 9, 10:29 am, "Klaas" <[EMAIL PROTECTED]> wrote: > On Feb 6, 11:07 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <[EMAIL PROTECTED]> > > wrote: > > >Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > > Huge amounts of my pure Py

Dictionary Question

2007-02-08 Thread Sick Monkey
Hello All. I have a question concerning searching data within dictionaries. Lets say I have a dictionary called db. db = {'[EMAIL PROTECTED]':'none', '[EMAIL PROTECTED]':'none', '[EMAIL PROTECTED]':'none', '[EMAIL PROTECTED]':'none',} And I want to pull out all of the "gmail.com" addresses..

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-08 Thread Klaas
On Feb 6, 11:07 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > >Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > Huge amounts of my pure Python code was broken by Python 2.5. > > >Interesting. Could you give a

Python Papers second issue now available!

2007-02-08 Thread [EMAIL PROTECTED]
G'day Pythonistas! Welcome to Issue Two of The Python Papers. It has been an exciting time and we are pleased to have reached this milestone. I'd like to say a big hello to all the people who have provided their input in making this a reality: the python-advocacy list, comp.lang.python, the Python

Re: Built-in datatypes speed

2007-02-08 Thread Klaas
On Feb 7, 2:34 am, Maël Benjamin Mettler <[EMAIL PROTECTED]> wrote: > Anyway, I reimplemented parts of TigerSearch > (http://www.ims.uni-stuttgart.de/projekte/TIGER/TIGERSearch/) in Python. > I am currently writing the paper that goes along with this > reimplementation. Part of the paper deals wit

Re: [Windows] Sending CTRL-C event to console application

2007-02-08 Thread Gabriel Genellina
En Thu, 08 Feb 2007 15:54:05 -0300, Daniel Clark <[EMAIL PROTECTED]> escribió: > I have a Windows command line based application that only shuts down > cleanly if it sees "CTRL-C" on the console. I need to automate the > running of this application, but still allow the user sitting at the > mach

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread Gabriel Genellina
En Thu, 08 Feb 2007 14:20:57 -0300, Shawn Milo <[EMAIL PROTECTED]> escribió: > On 8 Feb 2007 09:05:51 -0800, Gabriel Genellina <[EMAIL PROTECTED]> > wrote: >> On 8 feb, 12:41, "Shawn Milo" <[EMAIL PROTECTED]> wrote: >> >> > I have come up with something that's working fine. However, I'm fairly

Re: struct.pack bug?

2007-02-08 Thread John Machin
On Feb 9, 8:58 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Hello > > I find the following inconsistent: > === > >>> sys.version > '2.4.1a0 (#2, Feb 9 2005, 12:50:04) \n[GCC 3.3.5 (Debian 1:3.3.5-8)]' > >>> pack('>B', 256) > '\x00' > >>> pack(' '\x00' > >>> pack('B', 256) > Traceback (most r

Re: Best Free and Open Source Python IDE

2007-02-08 Thread MrJean1
On Feb 8, 6:03 am, "Srikanth" <[EMAIL PROTECTED]> wrote: > Yes, > > All I need is a good IDE, I can't find something like Eclipse (JDT). > Eclipse has a Python IDE plug-in but it's not that great. Please > recommend. > > Thanks, > Srikanth Here is a list

Re: Regexp not performing the same in FTP versus Python

2007-02-08 Thread IamIan
It's strange but since more files have been added to this directory the regexp appears to be working correctly. Sorry to bother the list and thanks for your time. Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a MoinMoin guru - MoinMoin+SpamBayes == no wiki spam?

2007-02-08 Thread Fuzzyman
On Feb 9, 12:31 am, [EMAIL PROTECTED] wrote: > I have this idea that I should be able to write a security policy for > MoinMoin which uses SpamBayes to judge the appropriateness of any given > submission. It would be more accurate and faster than the current default > security policy in MoinMoin.

Re: Best Free and Open Source Python IDE

2007-02-08 Thread Fuzzyman
On Feb 8, 12:03 pm, "Srikanth" <[EMAIL PROTECTED]> wrote: > Yes, > > All I need is a good IDE, I can't find something like Eclipse (JDT). > Eclipse has a Python IDE plug-in but it's not that great. Please > recommend. > > Thanks, > Srikanth There's a new kid on the block (free and OSS) which doesn

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread W. Watson
Robert Kern wrote: > W. Watson wrote: > >> Here's the program I ran. >> >> ### begin >> #!/usr/bin/python >> >> # Check mysys >> >> import sys >> print sys.executable >> >> ### end >> >> It put up a black screen in a flash and disappeared. > > Run it from the terminal or execute those lines in th

Re: excel find last column

2007-02-08 Thread [EMAIL PROTECTED]
> > I get the error that xlPrevious is not defined. > If you are using pythonwin, run the COM Makepy utility on Microsoft Excel Object Library. Then you have access to the defined constants as follows. >>> import win32com.client >>> win32com.client.constants.xlPrevious 2 Hope this helps. Paul

Looking for a MoinMoin guru - MoinMoin+SpamBayes == no wiki spam?

2007-02-08 Thread skip
I have this idea that I should be able to write a security policy for MoinMoin which uses SpamBayes to judge the appropriateness of any given submission. It would be more accurate and faster than the current default security policy in MoinMoin. I started to work on it and have something that see

Re: Newbie Question

2007-02-08 Thread [EMAIL PROTECTED]
You have a large number of basic languages that use opengl and wxwindows. I haven't tried them but when you are looking at 3d stuff all the opengl stuff is pretty fried. You can get around this with a whole host of other 3d options including directx. I have also used borlands c++ and it does som

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread W. Watson
Robert Kern wrote: > W. Watson wrote: > >> Here's the program I ran. >> >> ### begin >> #!/usr/bin/python >> >> # Check mysys >> >> import sys >> print sys.executable >> >> ### end >> >> It put up a black screen in a flash and disappeared. > > Run it from the terminal or execute those lines in th

Re: uml and python

2007-02-08 Thread Jorge Godoy
"azrael" <[EMAIL PROTECTED]> writes: > hy guys > > i've been googling and got several posts, but nothing that is a > satisfaction in my eyes. can someone tell me a nice uml diagram tool > with python export (if possible nice gui), or at least nice uml tool > > gpl or freeware (widows) prefered I

Re: Newbie Question

2007-02-08 Thread John
Visual Basic is also good. "Reid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello all > > I am just starting to play with programing again as a hobby. I have heard > good things about python. I have not really looked into the language much. > My question is, will python make p

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread Robert Kern
W. Watson wrote: > Here's the program I ran. > > ### begin > #!/usr/bin/python > > # Check mysys > > import sys > print sys.executable > > ### end > > It put up a black screen in a flash and disappeared. Run it from the terminal or execute those lines in the interactive interpreter in IDLE.

Re: Referencing vars, methods and classes by name

2007-02-08 Thread greg
Gabriel Genellina wrote: > On 8 feb, 05:51, Paul Rubin wrote: > > > "Gabriel Genellina" <[EMAIL PROTECTED]> writes: > > > > > Surely you meant to say getattr(obj, a)() > > > > Yeah, darn. Counterintuitive. > > A generic function helps on using it on objects of any kind

Re: Best Free and Open Source Python IDE

2007-02-08 Thread Enrico 'Mc Osten' Franchi
Srikanth <[EMAIL PROTECTED]> wrote: > All I need is a good IDE, I can't find something like Eclipse (JDT). > Eclipse has a Python IDE plug-in but it's not that great. Have you tried the 'full' plugin (you have to pay about 30 $ IIRC or something like that)? My favourite Python editor is TextMate

Regexp not performing the same in FTP versus Python

2007-02-08 Thread IamIan
Hello all, I'm trying to use a regular expression in an FTP script to list certain files. When run in a standard FTP session the command: dir .??[oOdDnNmM]* returns 48 files. When I use the following Python script it prints roughly 12 files (a subset of the 48), ending with 'None': imp

Re: def obj()

2007-02-08 Thread Gert Cuykens
#include function hello(){ struct obj = { char *data = 'hello'} obj.add = obj_add(obj); return obj; } function obj_add(obj){ function add(value){ obj.data += value; return obj; } } main(){ test = hello(); test.add('world'); printf(test.data); } I

Re: Strings in Python

2007-02-08 Thread MRAB
On Feb 8, 6:32 pm, [EMAIL PROTECTED] wrote: > On Feb 8, 8:28 am, "Johny" <[EMAIL PROTECTED]> wrote: > > > > > Playing a little more with strings, I found out that string.find > > function provides the position of > > the first occurance of the substring in the string. > > Is there a way how to find

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread W. Watson
Robert Kern wrote: > W. Watson wrote: >> Robert Kern wrote: >>> W. Watson wrote: >>> I did a search in the python24 folder for sys.exec* (in c:\python24), but came up with nothing. [nothing in a search of c:--sys.exec*] I have two python folders, c:\python24 and c:\python25. The co

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread MRAB
On Feb 8, 6:20 pm, "k0mp" <[EMAIL PROTECTED]> wrote: > On Feb 8, 6:54 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > > > > > k0mp wrote: > > > Is there a way to retrieve a web page and before it is entirely > > > downloaded, begin to test if a specific string is present and if yes > > > stop the do

Re: Newbie Question

2007-02-08 Thread Eric . Gabrielson
On Feb 8, 2:17 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-02-08, Reid <[EMAIL PROTECTED]> wrote: > > > I am just starting to play with programing again as a hobby. I have heard > > good things about python. I have not really looked into the language much. > > My question is, will python

Re: Python Newbie

2007-02-08 Thread Brian van den Broek
spazziam said unto the world upon 02/08/2007 04:18 PM: > SyntaxError: invalid syntax > File "C:\Python23\vdrop2\final py\vdrop2.py", line 123 > def INIT_HIGHS(): > ^ > SyntaxError: invalid syntax > > Why would this come up? > Hi, Most likely, a previous line contains an unfinished s

Re: Best Free and Open Source Python IDE

2007-02-08 Thread cyberco
Go for BOA if you're going to use wxPython, whose python text editor is excellent as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing HTML

2007-02-08 Thread Paul McGuire
On Feb 8, 4:15 pm, "mtuller" <[EMAIL PROTECTED]> wrote: > I was asking how to escape the quotation marks. I have everything > working in pyparser except for that. I don't want to drop everything > and go to a different parser. > > Can someone else help? > > Mike - pyparsing includes a helper for c

Re: distutils: different names in src and dist/build

2007-02-08 Thread Richard Jones
Anastasios Hatzis wrote: > is it possible to have different names between the original package name > and that which will be installed? > [snip] > Of course with-out changing the original src package name "sdk" to > "MySDK" (which likely would be the easiest way, hum). > > Any suggestion or link

Re: Python Newbie

2007-02-08 Thread Grant Edwards
On 2007-02-08, spazziam <[EMAIL PROTECTED]> wrote: > SyntaxError: invalid syntax > File "C:\Python23\vdrop2\final py\vdrop2.py", line 123 > def INIT_HIGHS(): > ^ > SyntaxError: invalid syntax > > Why would this come up? Because the syntax is invalid. You're going to have to post more

Re: doctests for interactive functions

2007-02-08 Thread Brian van den Broek
Neil Cerutti said unto the world upon 02/08/2007 02:25 PM: > On 2007-02-08, Brian van den Broek <[EMAIL PROTECTED]> wrote: >> All classes take an optional argument input_function that >> determines how the class instance gets its input. If this is >> not provided, it defaults to raw_input. doctest

Re: doctests for interactive functions

2007-02-08 Thread Brian van den Broek
Ben Finney said unto the world upon 02/08/2007 03:03 PM: > Brian van den Broek <[EMAIL PROTECTED]> writes: > >> Since the classes are for getting input interactively, a >> straightforward use of doctest is not going to work. (The tests >> won't run automatically.) I've come up with a way to make i

Re: Re-installing Numeric and PIL Files

2007-02-08 Thread Robert Kern
W. Watson wrote: > Robert Kern wrote: >> W. Watson wrote: >> >>> I did a search in the python24 folder for sys.exec* (in c:\python24), but >>> came up with nothing. [nothing in a search of c:--sys.exec*] I have two >>> python folders, c:\python24 and c:\python25. The contents of both folders >>>

Python Newbie

2007-02-08 Thread spazziam
SyntaxError: invalid syntax File "C:\Python23\vdrop2\final py\vdrop2.py", line 123 def INIT_HIGHS(): ^ SyntaxError: invalid syntax Why would this come up? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question

2007-02-08 Thread Grant Edwards
On 2007-02-08, Reid <[EMAIL PROTECTED]> wrote: > I am just starting to play with programing again as a hobby. I have heard > good things about python. I have not really looked into the language much. > My question is, will python make programs with a gui under windows xp. Yes. There are a nu

Re: Parsing HTML

2007-02-08 Thread mtuller
I was asking how to escape the quotation marks. I have everything working in pyparser except for that. I don't want to drop everything and go to a different parser. Can someone else help? > > > I am trying to parse a webpage and extract information. > > BeautifulSoup is a great Python module fo

Re: def obj()

2007-02-08 Thread Gert Cuykens
On 2/8/07, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > def obj(): > result = {'data': 'hello'} > result['add'] = adder(result) > return result > > def adder(obj): > def add(value): > obj['data'] += value > return add > > if __name__ == '__main__': > test = obj(

Newbie Question

2007-02-08 Thread Reid
Hello all I am just starting to play with programing again as a hobby. I have heard good things about python. I have not really looked into the language much. My question is, will python make programs with a gui under windows xp. If it will do this I will explore the language more, if not I wil

Re: def obj()

2007-02-08 Thread Terry Reedy
"Gert Cuykens" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | def obj(): |return {'data':'hello', |'add':add(v)} v is undefined | def add(v): |data=data+v data is undefined | if __name__ == '__main__': |test=obj() |test.add('world') test.add is

struct.pack bug?

2007-02-08 Thread Jonathan Fine
Hello I find the following inconsistent: === >>> sys.version '2.4.1a0 (#2, Feb 9 2005, 12:50:04) \n[GCC 3.3.5 (Debian 1:3.3.5-8)]' >>> pack('>B', 256) '\x00' >>> pack('>> pack('B', 256) Traceback (most recent call last): File "", line 1, in ? struct.error: ubyte format requires 0<=number<=2

Re: def obj()

2007-02-08 Thread Leif K-Brooks
Gert Cuykens wrote: > def obj(): >return {'data':'hello', >'add':add(v)} > > def add(v): >data=data+v > > if __name__ == '__main__': >test=obj() >test.add('world') >print test.data > > I don't know why but i have one of does none class c programing style > mo

excel find last column

2007-02-08 Thread Lance Hoffmeyer
Hi all, I am trying to find the last used column in an excel sheet using win32com: lastcol = sh.UsedRange.Columns.Count works, but only if there is no formatting. I want to allow formatting in the columns. I would rather use the code below because formatted cells are irrelevant. using: last

def obj()

2007-02-08 Thread Gert Cuykens
def obj(): return {'data':'hello', 'add':add(v)} def add(v): data=data+v if __name__ == '__main__': test=obj() test.add('world') print test.data I don't know why but i have one of does none class c programing style moods again. I was wondering if the followin

Re: multithreading concept

2007-02-08 Thread Carl J. Van Arsdall
Bjoern Schliessmann wrote: > [snip] > What makes you think that'll be faster? > > Remember: > - If you have one CPU, there is no parallelity at all. > - If you do have multiple CPUs but only one network device, there is > no parallel networking. > > Not necessarily, if he's on a full duplex ethe

strange problem using modules from my own package.

2007-02-08 Thread krishnakant Mane
hello all, I found a very strange kind of behaviour in python with my own package. I created a package in which there were 4 modules and one __init__.py file I created the entire project in eclipse (pydev). it works fine there with the ide. but now when I try running the code without eclipse, that

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread James
On Feb 8, 3:26 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Shawn Milo a écrit : > > > > > To the list: > > > I have come up with something that's working fine. However, I'm fairly > > new to Python, so I'd really appreciate any suggestions on how this > > can be made more Pythonic. > > > T

Re: python linux distro

2007-02-08 Thread Matthew Franz
> thanks guys > > when i wrote this, i thought that out there is some crazy guy like me. > i was hoping for more support but after these arguments, there is > nothing more then to say:you are right. the world doesnt need another > distro. but if one day I mange to do it, hope you will be glade that

Re: Array delete

2007-02-08 Thread Kent Johnson
azrael wrote: > if you are new to python then this will be easier to understand. if > you change this a liitle bit (depending on syntax) it should work in > any language. > just copy and paste to a .py file Yikes. If you are new to Python please ignore this un-Pythonic abomination. Check(listItem

Re: Can Parallel Python run on a muti-CPU server ?

2007-02-08 Thread azrael
no, not renting. i need such one at home. when you say rent it sounds like buy a hosting package. i need one to work all the time on max power. cracking md5 needs power. :-D -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyserial example program error: win32file.SetupComm reports 'Incorrect function.'

2007-02-08 Thread Ron Jackson
Dennis Lee Bieber wrote: > On Wed, 07 Feb 2007 11:14:39 -0800, Ron Jackson > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > >>I am using Python 2.5 on Windows XP. I have installed Pyserial and >>win32all extensions. >> > > 2.4 on XP Pro SP2... > > >>When I try to

Re: doctests for interactive functions

2007-02-08 Thread Ben Finney
Brian van den Broek <[EMAIL PROTECTED]> writes: > Since the classes are for getting input interactively, a > straightforward use of doctest is not going to work. (The tests > won't run automatically.) I've come up with a way to make it work, > but I would like to know from more experienced people

Re: Best Free and Open Source Python IDE

2007-02-08 Thread Ben Finney
"Srikanth" <[EMAIL PROTECTED]> writes: > All I need is a good IDE, I can't find something like Eclipse (JDT). > Eclipse has a Python IDE plug-in but it's not that great. Please > recommend. A powerful, well-supported text editor (either Emacs or Vim) plus the corresponding Python support. -- \

Shed Skin Python-to-C++ Compiler

2007-02-08 Thread Mark Dufour
Hi all, I have just released version 0.0.19 of Shed Skin, an optimizing Python-to-C++ compiler. It allows for translation of pure (unmodified), implicitly statically typed Python programs into optimized C++, and hence, highly optimized machine language. This latest release adds basic support for i

Re: doctests for interactive functions

2007-02-08 Thread Neil Cerutti
On 2007-02-08, Brian van den Broek <[EMAIL PROTECTED]> wrote: > All classes take an optional argument input_function that > determines how the class instance gets its input. If this is > not provided, it defaults to raw_input. doctest tests reassign > it so that they can be run automatically. What

Re: Best Free and Open Source Python IDE

2007-02-08 Thread jean-michel bain-cornu
> On the OSS side, SPE is very good too - more of an IDE than Komodo > Edit. DrPython is worth a look as is the similar Ulipad. Also have a > look at Boa. > Boa is excellent if you plan to use wxwidgets. Regards jm -- http://mail.python.org/mailman/listinfo/python-list

Latest approach to controlling non-printable / multi-byte characters

2007-02-08 Thread metaperl
There is no end to the number of frantic pleas for help with characters in the realm beyond ASCII. However, in searching thru them, I do not see a workable approach to changing them into other things. I am dealing with a file and in my Emacs editor, I see "MASSACHUSETTS- AMHERST" ... in other wor

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Michele Simionato
On Feb 8, 8:15 pm, Thomas Heller <[EMAIL PROTECTED]> wrote: > I agree with most of the posters is this thread that it is confusing to spread > the definition of a class over several places or files. > > But, there are cases where the trick come in handy - when classes are created > not by class sta

Re: python linux distro

2007-02-08 Thread John McCallum
Hiya, > last night i was lying in my bed and thinking about something. is > there any linux distro that is primary oriented to python. Well, it's a general purpose distro, but Gentoo (www.gentoo.org) relies on Python as it's package management system is written in Python & Bash. most python thing

Re: Fwd: Python new user question - file writeline error

2007-02-08 Thread Bruno Desthuilliers
Shawn Milo a écrit : > To the list: > > I have come up with something that's working fine. However, I'm fairly > new to Python, so I'd really appreciate any suggestions on how this > can be made more Pythonic. > > Thanks, > Shawn > > > > > > > Okay, here's what I have come up with: > > >

doctests for interactive functions

2007-02-08 Thread Brian van den Broek
Hi all, I have a module of classes for getting input from the user that satisfies various constraints. For instance, one class is created with a menu of option, presents them to the user, and rejects any input other than a menu option; another ensures that the user's input is interpretable as

Re: default mutable arguments

2007-02-08 Thread Bruno Desthuilliers
Gigs_ a écrit : > I read that this is not the same: > if arg is None: arg = [] > arg = arg or [] > > > def functionF(argString="abc", argList = None): > if argList is None: argList = [] # < this > ... > def functionF(argString="abc", argList=None): > argList = argList

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
On Feb 8, 8:02 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > k0mp wrote: > > It seems to take more time when I use read(size) than just read. > > I think in both case urllib.openurl retrieve the whole page. > > Google's home page is very small, so it's not really a great test of > that. Here's a t

Re: Functions, parameters

2007-02-08 Thread Bruno Desthuilliers
Boris Ozegovic a écrit : > Bruno Desthuilliers wrote: > > >>Why don't you just read the source code ? Django is free software, you >>know !-) > > Yes, I know. :) > >>What about something like: > > >>def filter(self, **kw): >> for argname, value in kw.items(): >> fieldname, op = arg

Re: postgres backup script and popen2

2007-02-08 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > On 8 feb, 10:27, Maël Benjamin Mettler <[EMAIL PROTECTED]> wrote: > > > flupke schrieb: > > > i made a backup script to backup my postgres database. > > > Problem is that it prompts for a password. It thought i > >

Re: Parsing HTML

2007-02-08 Thread metaperl
On Feb 8, 2:38 pm, "mtuller" <[EMAIL PROTECTED]> wrote: > I am trying to parse a webpage and extract information. BeautifulSoup is a great Python module for this purpose: http://www.crummy.com/software/BeautifulSoup/ Here's an article on screen scraping using it: http://iwiwdsmi.blogsp

Parsing HTML

2007-02-08 Thread mtuller
I am trying to parse a webpage and extract information. I am trying to use pyparser. Here is what I have: from pyparsing import * import urllib # define basic text pattern spanStart = Literal('') spanEnd = Literal('') printCount = spanStart + SkipTo(spanEnd) + spanEnd # get printer addresses p

Survey about Architecture and Design Patterns

2007-02-08 Thread Joerg Rech
Dear software practitioners, consultants, and researchers, we are currently conducting an international survey about architecture and design patterns. Our goal is to discover how familiar people are with these patterns (and anti-patterns) as well as to elicit the information need, the usage behav

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread k0mp
On Feb 8, 8:06 pm, Björn Steinbrink <[EMAIL PROTECTED]> wrote: > On Thu, 08 Feb 2007 10:20:56 -0800, k0mp wrote: > > On Feb 8, 6:54 pm, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > >> k0mp wrote: > >> > Is there a way to retrieve a web page and before it is entirely > >> > downloaded, begin to test i

Re: Functions, parameters

2007-02-08 Thread Boris Ozegovic
Paul Rubin wrote: > Since split is applied to argname, it retrieves 'question' and 'startswith'. Exactly. :) And, 'questions' and 'startswith' are two string, and not references at Poll.question, or more precisely, instanceOfPoll.question. I suppose this is what I was looking for: __getattri

  1   2   3   >