Re: web service between python and c#

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 07:24], abhishek ([EMAIL PROTECTED]) wrote: >but have no idea on how to interface it with c# client. Totally depends on what exactly you need to accomplish. Some solutions can just use SOAP or REST. Others need full-fledged XML-RPC or other similar solutions. Some just us

Look for a string on a file and get its line number

2008-01-08 Thread Horacius ReX
Hi, I have to search for a string on a big file. Once this string is found, I would need to get the number of the line in which the string is located on the file. Do you know how if this is possible to do in python ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter variable trace problem

2008-01-08 Thread Peter Otten
C Martin wrote: > What am I doing wrong in this code? The callback doesn't work from the Entry > widget. > > ##start code > import Tkinter > > tk = Tkinter.Tk() > var = Tkinter.StringVar() > print var._name > > def cb(name, index, mode): > print "callback called with name=%r, index=%r, mod

Re: Look for a string on a file and get its line number

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:21], Horacius ReX ([EMAIL PROTECTED]) wrote: >I have to search for a string on a big file. Once this string is >found, I would need to get the number of the line in which the string >is located on the file. Do you know how if this is possible to do in >python ? (As

Strip lines from files

2008-01-08 Thread Francesco Pietra
I am posting again as previous identical message had alleged suspicious header. I used successfully script f=open("prod1-3_no_wat_pop.pdb", "r") for line in f: line=line.rstrip() if "WAT" not in line: print line f.close() to strip lines containing the word WAT fro

python syntax:urgent

2008-01-08 Thread mpho raborife
Anyone please help me get this syntax right subprocess.Popen(["gmmscore", "-i", Input, "-l", List, "-t", modeltype, > "-m", str(mixture), "-d", str(dimension), "-v", str(vfloor), "-n", > str(number), "-r", str(results)]) - Be a better friend, newshoun

Re: Look for a string on a file and get its line number

2008-01-08 Thread John Machin
On Jan 8, 7:33 pm, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080108 09:21], Horacius ReX ([EMAIL PROTECTED]) wrote: > > >I have to search for a string on a big file. Once this string is > >found, I would need to get the number of the

Re: Look for a string on a file and get its line number

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:51], John Machin ([EMAIL PROTECTED]) wrote: >Make that >= Right you are. Sorry, was doing it quickly from work. ;) And I guess the find will also be less precise if the word you are looking is a smaller part of a bigger word. E.g. find 'door' in a line that has

Re: Strip lines from files

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:40], Francesco Pietra ([EMAIL PROTECTED]) wrote: >A variant need has now emerged, to perform the same task from a very long >series of shorter files trp.pdb.1, trp.pdb.2 ,. Could you see how to adapt >the above script to the new need? Look at sys.argv and pass th

Re: Look for a string on a file and get its line number

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:51], John Machin ([EMAIL PROTECTED]) wrote: >Make that >= > >| >>> 'fubar'.find('fu') Or even just: if 'my-string' in line: ... Same caveat emptor applies though. -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウ

popen question

2008-01-08 Thread Robert Latest
Hello, look at this function: -- def test(): child = os.popen('./slow') for line in child: print line - The program "slow" just writes the numbers 0 through 9 on stdout, one line a second, and then quits. I would have expected the python program to spit

Re: I'm searching for Python style guidelines

2008-01-08 Thread Ben Finney
ajaksu <[EMAIL PROTECTED]> writes: > I've done this search before and it was very interesting, doing it > again gave me new results that also seem valuable. Here's most of > them (where PCG = Python Coding Guidelines). Thanks, this is an awesome list. It's good to have a variety of real examples

Re: dictionary/hash and '1' versus 1

2008-01-08 Thread Piet van Oostrum
> "Diez B. Roggisch" <[EMAIL PROTECTED]> (DBR) wrote: >DBR> So you can also do >DBR> "" + some_object >DBR> However, >DBR> some_object + "" >DBR> or >DBR> 1 + "" >DBR> don't work - the operator is only overloaded on the left argument. There is no problem with 1+"" neither with new Integ

Re: python syntax:urgent

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:42], mpho raborife ([EMAIL PROTECTED]) wrote: >subprocess.Popen(["gmmscore", "-i", Input, "-l", List, "-t", > modeltype, "-m", str(mixture), "-d", str(dimension), "-v", str(vfloor), > "-n&q

Passing contextual information when logging

2008-01-08 Thread Vinay Sajip
Some users of the logging package have raised an issue regarding the difficulty of passing additional contextual information when logging. For example, the developer of a networked application may want to log, in addition to specifics related to to the network service being provided, information ab

Re: Pet Store

2008-01-08 Thread Marc 'BlackJack' Rintsch
On Mon, 07 Jan 2008 22:21:53 -0800, George Maggessy wrote: > I'm an experience Java developer trying to learn Python. I just > finished the Python tutorial on python.org and I'm currently reading > the "Learning Python" book. However, if I could find something like a > simple web app with some bes

Re: Pet Store

2008-01-08 Thread Jarek Zgoda
George Maggessy napisał(a): > I'm an experience Java developer trying to learn Python. I just > finished the Python tutorial on python.org and I'm currently reading > the "Learning Python" book. However, if I could find something like a > simple web app with some best practices, such as those famo

Python modules - how to create & which are better

2008-01-08 Thread grbgooglefan
I have embedded Python in my C++ application & creating Python function from the expression. I am then evaluating those Python compiled function (byte code) using PyObject_CallObject. I want to create a Python module which will have functions called by my user defined functions from the embedded P

Re: I'm searching for Python style guidelines

2008-01-08 Thread grflanagan
On Jan 8, 3:08 am, ajaksu <[EMAIL PROTECTED]> wrote: > On Jan 7, 11:25 am, [EMAIL PROTECTED] wrote: > > > Anything written somewhere that's thorough? Any code body that should > > serve as a reference? > > I've done this search before and it was very interesting, doing it > again gave me new result

Re: popen question

2008-01-08 Thread Marc 'BlackJack' Rintsch
On Tue, 08 Jan 2008 09:20:16 +, Robert Latest wrote: > The program "slow" just writes the numbers 0 through 9 on stdout, one line a > second, and then quits. > > I would have expected the python program to spit out a numbers one by one, > instead I see nothing for 10 seconds and then the wh

Re: python syntax:urgent

2008-01-08 Thread Marc 'BlackJack' Rintsch
On Tue, 08 Jan 2008 10:03:56 +0100, Jeroen Ruigrok van der Werven wrote: > -On [20080108 09:42], mpho raborife ([EMAIL PROTECTED]) wrote: >>subprocess.Popen(["gmmscore", "-i", Input, "-l", List, "-t", >> modeltype, "-m", str(mixtu

Re: popen question

2008-01-08 Thread Robert Latest
Marc 'BlackJack' Rintsch wrote: > Both processes have to make their communication ends unbuffered or line > buffered. Yeah, I figured something like that. > And do whatever is needed to output the numbers from ``slow`` > unbuffered or line buffered. Hm, "slow" of course is just a little test pr

Re: Look for a string on a file and get its line number

2008-01-08 Thread Martin Marcher
Jeroen Ruigrok van der Werven wrote: > -On [20080108 09:21], Horacius ReX ([EMAIL PROTECTED]) wrote: >>I have to search for a string on a big file. Once this string is >>found, I would need to get the number of the line in which the string >>is located on the file. Do yo

Re: use fileinput to read a specific line

2008-01-08 Thread Martin Marcher
jo3c wrote: > i need to read line 4 from a header file http://docs.python.org/lib/module-linecache.html ~/2delete $ cat data.txt L1 L2 L3 L4 ~/2delete $ python Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type "help", "copyright", "credits" or "

Re: popen question

2008-01-08 Thread Robert Latest
Hrvoje Niksic wrote: > stdio uses different buffering strategies depending on the output > type. When the output is a TTY, line buffering is used; when the > output goes to a pipe or file, it is fully buffered. Makes sense. > If you see lines one by one, you are in luck, and you can fix things

Re: popen question

2008-01-08 Thread Hrvoje Niksic
Robert Latest <[EMAIL PROTECTED]> writes: > If 'slow' or some other program does buffered output, how come I can > see its output line-by-line in the shell? stdio uses different buffering strategies depending on the output type. When the output is a TTY, line buffering is used; when the output g

Re: use fileinput to read a specific line

2008-01-08 Thread Fredrik Lundh
Martin Marcher wrote: >> i need to read line 4 from a header file > > http://docs.python.org/lib/module-linecache.html I guess you missed the "using linecache will crash my computer due to memory loading, because i am working on 2000 files each is 8mb" part. -- http://mail.python.org/mailma

Paid subscription Python magazines

2008-01-08 Thread Jon Harrop
Are there any Python magazines that you can pay to subscribe to? (either paper or on-line). -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?u -- http://mail.python.org/mailman/listinfo/python-list

RE: Look for a string on a file and get its line number

2008-01-08 Thread Ryan Ginstrom
> On Behalf Of Horacius ReX > I have to search for a string on a big file. Once this string > is found, I would need to get the number of the line in which > the string is located on the file. Do you know how if this is > possible to do in python ? This should be reasonable: >>> for num, line

Re: Paid subscription Python magazines

2008-01-08 Thread Francesco Guerrieri
On Jan 8, 2008 11:17 AM, Jon Harrop <[EMAIL PROTECTED]> wrote: > > Are there any Python magazines that you can pay to subscribe to? (either > paper or on-line). > Python Magazine comes to mind www.pythonmagazine.com I am subscribed and find it very good. Francesco -- http://mail.python.org/mai

COM server and EXE

2008-01-08 Thread Teja
Hi All, I have a Python COM server. I need to deploy it on various sytems. When I run the COM server from python its showing an output " Registered : sample.lib" If I try to use the COM obj from a VB client like: obj = CreateObject("sample.lib") Its working fine without any errors Now I am try

(SOLVED) Re: popen question

2008-01-08 Thread Robert Latest
pexpect is the solution. Seems to wrap quite a bit of dirty pseudo-tty hacking. robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's great, in a word

2008-01-08 Thread alain
On Jan 7, 6:27 pm, "Henry Chang" <[EMAIL PROTECTED]> wrote: > What exactly does it mean "a bycycle for the mind"?? > > (assuming s/bycycle/bicycle) Sorry for my bad spelling. The original quote from Steve Jobs reads "the computer is a bicycle for the mind". This is what i feel when programming in

Re: Python's great, in a word

2008-01-08 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Would you Python old-timers try to agree on a word or two that > completes: > > The best thing about Python is ___. > > Please, no laundry lists, just a word or two. I'm thinking "fluid" or > "grace" but I'm not sure I've done enough to choose. "its pencil-like qu

Re: Passing contextual information when logging

2008-01-08 Thread Antoine Pitrou
Hi Vinay, > I would welcome your views on whether the LoggerAdapter class is > suitable for adding to the logging package in Python 2.6/3.0. Does it > do what might reasonably be expected out of the box? I think it's quite suited to the problem, yes. One question : why does the exception() meth

Re: COM server and EXE

2008-01-08 Thread Teja
On Jan 8, 3:33 pm, Teja <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a Python COM server. I need to deploy it on various sytems. > When I run the COM server from > python its showing an output " Registered : sample.lib" > > If I try to use the COM obj from a VB client like: > > obj = CreateObjec

Re: Open a List of Files

2008-01-08 Thread Fredrik Lundh
BJ Swope wrote: > given a list such as > > ['messages', 'recipients', 'viruses'] > > how would I iterate over the list and use the values as variables and > open the variable names a files? > > I tried > > for outfile in ['messages', 'recipients', 'viruses']: > filename = os.path.join(Hos

Re: Paid subscription Python magazines

2008-01-08 Thread [EMAIL PROTECTED]
On Jan 8, 6:17 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: > Are there any Python magazines that you can pay to subscribe to? (either > paper or on-line). The Python Papers (www.pythonpapers.org) is a free e-journal, including industry and academic articles. maurice -- http://mail.python.org/mailm

Want a strange XML RPC server

2008-01-08 Thread Laszlo Nagy
Hi, I would like to have a strage XML RPC server. It should use one main thread for all connections. I have some code like this (using a custom RPC server class): server_address = (LISTEN_HOST, LISTEN_PORT) # (address, port) server = mess.SecureXMLRPCServer.SecureXMLRPCServer(

Re: use fileinput to read a specific line

2008-01-08 Thread Fredrik Lundh
jo3c wrote: > hi everybody > im a newbie in python > i need to read line 4 from a header file > using linecache will crash my computer due to memory loading, because > i am working on 2000 files each is 8mb > > fileinput don't load the file into memory first > how do i use fileinput module to rea

Re: Open a List of Files

2008-01-08 Thread BJ Swope
On Jan 8, 2008 6:03 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > BJ Swope wrote: > > > given a list such as > > > > ['messages', 'recipients', 'viruses'] > > > > how would I iterate over the list and use the values as variables and > > open the variable names a files? > > > > I tried > > > > for

Re: Open a List of Files

2008-01-08 Thread John Machin
On Jan 8, 10:03 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > BJ Swope wrote: > > given a list such as > > > ['messages', 'recipients', 'viruses'] > > > how would I iterate over the list and use the values as variables and > > open the variable names a files? > > > I tried > > > for outfile in ['m

Re: popen question

2008-01-08 Thread Hrvoje Niksic
Robert Latest <[EMAIL PROTECTED]> writes: >> If you see lines one by one, you are in luck, and you can fix things >> on the Python level simply by avoiding buffering in popen. If not, >> you will need to resort to more advanced hackery (e.g. fixing stdio >> using LD_PRELOAD). > > Do I really? Aft

=?ISO-8859-1?Q?Intranet_Project_-_Rad_Or_Waterfall??=

2008-01-08 Thread bs866806
I have often used the analogy of building a bridge to explain to business colleagues the difference between Rapid Application Development (RAD) and Waterfall. Let's say that we are in the middle ages and the Mayor of Kingston- upon-Thames is evaluating whether or not to build a bridge over the riv

Re: Look for a string on a file and get its line number

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 12:59], Wildemar Wildenburger ([EMAIL PROTECTED]) wrote: >Style note: >May I suggest enumerate (I find the explicit counting somewhat clunky) >and maybe turning it into a generator (I like generators): Sure, I still have a lot to discover myself with Python. I'

Re: Open a List of Files

2008-01-08 Thread Fredrik Lundh
BJ Swope wrote: > the code looks ok. please define "not working". > > Yep, defining "not working" is always helpful! :) > > I want to have all 3 files open at the same time. I will write to each > of the files later in my script but just the last file is open for writing. to keep more th

Re: Open a List of Files

2008-01-08 Thread Neil Cerutti
On Jan 8, 2008 6:54 AM, BJ Swope <[EMAIL PROTECTED]> wrote: > > > given a list such as > > > > > > ['messages', 'recipients', 'viruses'] > > > > > > how would I iterate over the list and use the values as variables and > > > open the variable names a files? > > > > > > I tried > > > > > > for outfi

Re: Open a List of Files

2008-01-08 Thread Martin Marcher
BJ Swope wrote: > On Jan 8, 2008 6:03 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >> BJ Swope wrote: >> >> > given a list such as >> > >> > ['messages', 'recipients', 'viruses'] >> > >> > how would I iterate over the list and use the values as variables and >> > open the variable names a files

Re: Look for a string on a file and get its line number

2008-01-08 Thread Wildemar Wildenburger
Jeroen Ruigrok van der Werven wrote: > line_nr = 0 > for line in big_file: > line_nr += 1 > has_match = line.find('my-string') > if has_match > 0: > print 'Found in line %d' % (line_nr) > Style note: May I suggest enumerate (I find the explicit counting somewhat clunky) and ma

Re: Open a List of Files

2008-01-08 Thread Chris
On Jan 8, 1:03 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > BJ Swope wrote: > > given a list such as > > > ['messages', 'recipients', 'viruses'] > > > how would I iterate over the list and use the values as variables and > > open the variable names a files? > > > I tried > > > for outfile in ['me

Re: Open a List of Files

2008-01-08 Thread Hrvoje Niksic
Fredrik Lundh <[EMAIL PROTECTED]> writes: > BJ Swope wrote: > >> the code looks ok. please define "not working". >> >> Yep, defining "not working" is always helpful! :) >> >> I want to have all 3 files open at the same time. I will write to >> each of the files later in my script but just th

Re: use fileinput to read a specific line

2008-01-08 Thread Steven D'Aprano
On Mon, 07 Jan 2008 22:16:56 -0800, Russ P. wrote: > One second thought, I wonder if the reference counting mechanism would > be "smart" enough to automatically close the previous file on each > iteration of the outer loop. If so, the files don't need to be > explicitly closed. Python guarantees[

Re: Look for a string on a file and get its line number

2008-01-08 Thread Tim Chase
>> I have to search for a string on a big file. Once this string >> is found, I would need to get the number of the line in which >> the string is located on the file. Do you know how if this is >> possible to do in python ? > > This should be reasonable: > for num, line in enumerate(open

Re: use fileinput to read a specific line

2008-01-08 Thread Scott David Daniels
Russ P. wrote: > On Jan 7, 9:41 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> Given that the OP is talking 2000 files to be processed, I think I'd >> recommend explicit open() and close() calls to avoid having lots of I/O >> structures floating around... >> [effectively] >> for fid in

Hot clips,great clips:

2008-01-08 Thread [EMAIL PROTECTED]
Hot clips,great clips: http://groups.google.com/group/greatclips/web/great-clips -- http://mail.python.org/mailman/listinfo/python-list

Re: use fileinput to read a specific line

2008-01-08 Thread Fredrik Lundh
Steven D'Aprano wrote: > Python guarantees[1] that files will be closed, but doesn't specify when > they will be closed. I understand that Jython doesn't automatically close > files until the program terminates, so even if you could rely on the ref > counter to close the files in CPython, it wo

Re: Passing contextual information when logging

2008-01-08 Thread Vinay Sajip
On 8 Jan, 09:46, Antoine Pitrou <[EMAIL PROTECTED]> wrote: > One question : why does the exception() method call Logger.error() rather than > Logger.exception() ? exception() is a convenience method which adds the keyword argument exc_info=1 to append traceback information to the log. Both excepti

Re: windows service

2008-01-08 Thread kyosohma
On Jan 7, 6:42 pm, Michael Chesterton <[EMAIL PROTECTED]> wrote: > I'm trying to get a program that uses M2Crypto ThreadingSSLServer to > run in windows as a service. I have a few problem, it doesn't listen > on its port and I don't know how to debug it. > > I used the pipeservice example as a fram

Re: use fileinput to read a specific line

2008-01-08 Thread Martin Marcher
Fredrik Lundh wrote: > Martin Marcher wrote: > >>> i need to read line 4 from a header file >> >> http://docs.python.org/lib/module-linecache.html > > I guess you missed the "using linecache will crash my computer due to > memory loading, because i am working on 2000 files each is 8mb" part. o

Re: use fileinput to read a specific line

2008-01-08 Thread Hrvoje Niksic
Fredrik Lundh <[EMAIL PROTECTED]> writes: > From what I can tell, Java's GC automatically closes file streams, > so Jython will behave pretty much like CPython in most cases. The finalizer does close the reclaimed streams, but since it is triggered by GC, you have to wait for GC to occur for the

Re: Look for a string on a file and get its line number

2008-01-08 Thread Horacius ReX
Hi, thanks for the help. Then I got running the following code; #!/usr/bin/env python import os, sys, re, string, array, linecache, math nlach = 12532 lach_list = sys.argv[1] lach_list_file = open(lach_list,"r") lach_mol2 = sys.argv[2] # name of the lachand mol2 file lach_mol2_file = open(lach_

Converting a bidimensional list in a bidimensional array

2008-01-08 Thread Santiago Romero
Hi :) First of all, I must apologize for my poor english :) I'm starting with python and pygame and for testing (and learning) purposes I wrote an small "Map Editor" for a small game project I'm going to start next month. The tilemap editor is working fine, but reading Guido's Van Rossum PY

Re: Intranet Project - Rad Or Waterfall

2008-01-08 Thread GHUM
> Option 1 - Waterfall I recommend to google "waterfall". First hit after those beatifull pictures will be: http://en.wikipedia.org/wiki/Waterfall_model Within the first paragraph there is: """Ironically, Royce was actually presenting this model as an example of a flawed, non-working model.(

Re: list property fires get on append

2008-01-08 Thread Soviut
On Jan 6, 11:36 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sun, 06 Jan 2008 00:31:13 -0800, Soviut wrote: > > I figured that an append would be treated as a set since I'm adding to > > the list. But what you say makes sense, although I can't say I'm happy > > with the behaviour. Is there any

Re: stupid/style/list question

2008-01-08 Thread Fredrik Lundh
Giampaolo Rodola' wrote: > To flush a list it is better doing "del mylist[:]" or "mylist = []"? > Is there a preferred way? If yes, why? The latter creates a new list object, the former modifies an existing list in place. The latter is shorter, reads better, and is probably a bit faster in mos

copy a numpy array

2008-01-08 Thread jimgardener
hi, (i posted this to numpy discussion grp couple of days back ..but it fails to appear..)since it is needed for my work i would appreciate if anyone can help me with this question i have two ndarrays of 1000 elements each and want to copy all elements from srcarray to destarray srcarray=numpy.a

stupid/style/list question

2008-01-08 Thread Giampaolo Rodola'
I was wondering... To flush a list it is better doing "del mylist[:]" or "mylist = []"? Is there a preferred way? If yes, why? -- http://mail.python.org/mailman/listinfo/python-list

Re: stupid/style/list question

2008-01-08 Thread Tim Chase
> To flush a list it is better doing "del mylist[:]" or "mylist = []"? > Is there a preferred way? If yes, why? It depends on what you want. The former modifies the list in-place while the latter just reassigns the name "mylist" to point to a new list within the local scope as demonstrated by thi

Re: Python's great, in a word

2008-01-08 Thread Carl Banks
On Jan 7, 6:29 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Jan 7, 5:40 pm, Martin Marcher <[EMAIL PROTECTED]> wrote:> [EMAIL > PROTECTED] wrote: > > > The best thing about Python is ___. > > > it's pythonicness. > > I think it sounds better as "its pythonicity". Mixing Greek and Latin suffixes u

Re: I'm searching for Python style guidelines

2008-01-08 Thread MartinRinehart
That's a great list, grflanagan! Thanks. I looked at each and copied to my disk either as a .txt (cut/paste from the browser) for a page or less or as .html (view source, chop off head and non-guideline stuff, save). This is the list plus PEP 8 minus the software. (No disrespect for the software,

Re: copy a numpy array

2008-01-08 Thread Francesco Guerrieri
On Jan 8, 2008 4:32 PM, jimgardener <[EMAIL PROTECTED]> wrote: > hi, > (i posted this to numpy discussion grp couple of days back ..but it > fails to appear..)since it is needed for my work i would appreciate if > anyone can help me with this question > > > i have two ndarrays of 1000 elements each

Re: I'm searching for Python style guidelines

2008-01-08 Thread Martin Vilcans
On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: > 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Anything written somewhere that's thorough? Any code body that should > > serve as a reference? > > PEP 8 > http://www.python.org/dev/peps/pep-0008/ The problem with PEP 8 is that even code

Re: I'm searching for Python style guidelines

2008-01-08 Thread Colin J. Williams
Martin Vilcans wrote: > On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: >> 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: >>> Anything written somewhere that's thorough? Any code body that should >>> serve as a reference? >> PEP 8 >> http://www.python.org/dev/peps/pep-0008/ > > The problem

Re: I'm searching for Python style guidelines

2008-01-08 Thread Neil Cerutti
On Jan 8, 2008 12:35 PM, Martin Vilcans <[EMAIL PROTECTED]> wrote: > On 1/7/08, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > 2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > Anything written somewhere that's thorough? Any code body that should > > > serve as a reference? > > > > PEP 8 > > ht

Re: copy a numpy array

2008-01-08 Thread gsal
I am new to python and everything related to it, and it so happens that I just went through the numpy tutorial last night, it is in http://www.scipy.org/Tentative_NumPy_Tutorial and the answer to your question is in section 3.7 Basically, if you want to make a (deep) copy of it: destarray = src

Python or PowerShell ?

2008-01-08 Thread [EMAIL PROTECTED]
I am all about using the right tool for the right purposes, which is why I have started reading the GettingStarted guide to PowerShell. I am curious if any other pythoneers have ventured into the world of PowerShell. Mostly, I am interested in grabbing perspectives on the differences noticed fro

Re: Pet Store

2008-01-08 Thread George Maggessy
Yeap. It is. I'm looking for something like that app. Smth that I could base my future developments on. On Jan 8, 1:47 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 07 Jan 2008 22:21:53 -0800, George Maggessy wrote: > > I'm an experience Java developer trying to learn Python. I

Re: Open source English dictionary to use programmatically w/ python

2008-01-08 Thread dgoldsmith_89
On Jan 7, 3:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jan 7, 5:10 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > > > > > On Jan 7, 2:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > On Jan 7, 4:37 pm, dgoldsmith_89 <[EMAIL PROTECTED]> wrote: > > > > > Can anyone point

Re: COM server and EXE

2008-01-08 Thread Giles Brown
On 8 Jan, 11:04, Teja <[EMAIL PROTECTED]> wrote: > On Jan 8, 3:33 pm, Teja <[EMAIL PROTECTED]> wrote: > > > > > Hi All, > > > I have a Python COM server. I need to deploy it on various sytems. > > When I run the COM server from > > python its showing an output " Registered : sample.lib" > > > If I

Re: Python or PowerShell ?

2008-01-08 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] writes: > I am all about using the right tool for the right purposes, [...] Which purpose? > I dug up one article from Google that talked about comparison but > that was about it. > > http://www.simple-talk.com/sql/database-administration/comparing-python-and-powers

Re: stupid/style/list question

2008-01-08 Thread Giampaolo Rodola'
On 8 Gen, 16:45, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' wrote: > > To flush a list it is better doing "del mylist[:]" or "mylist = []"? > > Is there a preferred way? If yes, why? > > The latter creates a new list object, the former modifies an existing > list in place. > > The

Newbie question: Classes

2008-01-08 Thread Sam Garson
Hello all Basically, I have created a program using tkinter without using any class structure, simply creating widgets and functions (and finding ways around passing variables from function to function, using global variables etc). The program has become rather large ( lines?) I am trying to now p

Peer To Peer File Sharing...

2008-01-08 Thread Dom Rout
Hello. Well, this is my first post on any USENET group anywhere, so I hope I get it right. Basically, I just want to get some opinions on a plan of mine for a new project. I want to produce a small, peer to peer, file sharing network for the use of myself and some of my friends. The purpose of thi

Re: Python's great, in a word

2008-01-08 Thread James Matthews
We have such nice names so the word Python will be something people like and not something people fear (A massive 12 foot snake) and Pythonic is a behavior pattern we should all follow! In layman's terms it means we should all act like snakes a little more! On Jan 8, 2008 5:13 PM, Carl Banks <[EMA

ZSI and .NET

2008-01-08 Thread Joseph Bernhardt
I am successfully using ZSI to create a web service for our internal use. A request containing a username and password will respond with user information. Sample Request: Jough joughspassword Response for Sample Request: http://www.w3.org/2001/XMLSch

Javascript parser

2008-01-08 Thread Christof Hoeke
hello, is there any Javascript (not just JSON) parser for Python? I saw http://wwwsearch.sourceforge.net/python-spidermonkey/ which seems to be from 2003 and unmaintained and seems to be quite complicated to get to work anyway :( Using Rhino from Jython is not really an option as I'd like to wo

Re: Python or PowerShell ?

2008-01-08 Thread Martin P. Hellwig
Torsten Bronger wrote: > Hallöchen! > > [EMAIL PROTECTED] writes: > >> I am all about using the right tool for the right purposes, [...] > > Which purpose? > >> I dug up one article from Google that talked about comparison but >> that was about it. >> >> http://www.simple-talk.com/sql/database-

Re: Peer To Peer File Sharing...

2008-01-08 Thread James Matthews
Look at the old source code of the Bittorrent client for ideas! On Jan 8, 2008 8:51 PM, Dom Rout <[EMAIL PROTECTED]> wrote: > Hello. > Well, this is my first post on any USENET group anywhere, so I hope I > get it right. Basically, I just want to get some opinions on a plan of > mine for a new pr

Re: Python or PowerShell ?

2008-01-08 Thread kyosohma
On Jan 8, 1:57 pm, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > Torsten Bronger wrote: > > Hallöchen! > > > [EMAIL PROTECTED] writes: > > >> I am all about using the right tool for the right purposes, [...] > > > Which purpose? > > >> I dug up one article from Google that talked about compariso

Re: Look for a string on a file and get its line number

2008-01-08 Thread jcvanelst
On 8 jan, 03:19, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, > > I have to search for a string on a big file. Once this string is > found, I would need to get the number of the line in which the string > is located on the file. Do you know how if this is possible to do in > python ? > > Thanks h

Re: I'm searching for Python style guidelines

2008-01-08 Thread Matthew Woodcraft
Paul McGuire <[EMAIL PROTECTED]> wrote: > While not required by any means, you will also find it handy to follow > *every* entry in the list with a comma, even the last one in the list > (this is legal Python). That is, in your example: > > foo =3D [ > 'too long', > 'too long too', >

Re: I'm searching for Python style guidelines

2008-01-08 Thread Matthew Woodcraft
<[EMAIL PROTECTED]> wrote: > A quick look (thorough analysis still required) shows that OLPC and > PyPy are, indeed, extensive standards. > one-laptop-per-child.html > (olpc),74.3,,http://wiki.laptop.org/go/Python_Style_Guide I think that's mostly PEP 8, with some notes added. -M- -- http://m

Re: Newbie question: Classes

2008-01-08 Thread Daniel Fetchinson
> Basically, I have created a program using tkinter without using any class > structure, simply creating widgets and functions (and finding ways around > passing variables from function to function, using global variables etc). > The program has become rather large ( lines?) I am trying to now put

Re: mod-python on Mac OSX 10.5

2008-01-08 Thread Arnaud Delobelle
On Jan 8, 5:27 am, Gnarlodious <[EMAIL PROTECTED]> wrote: > I am trying to install mod_python on OSX 10.5, Intel version. > > sudo apachectl configtest tells me this: > > httpd: Syntax error on line 114 of /private/etc/apache2/httpd.conf: > Cannot load /usr/libexec/apache2/mod_python.so into server

mod-python on Mac OSX 10.5

2008-01-08 Thread Gnarlodious
I am trying to install mod_python on OSX 10.5, Intel version. sudo apachectl configtest tells me this: httpd: Syntax error on line 114 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_python.so into server: dlopen(/usr/libexec/apache2/mod_python.so, 10): no suitable imag

Re: Modules and descriptors

2008-01-08 Thread Steven Bethard
Chris Leary wrote: > As I understand it, the appeal of properties (and descriptors in > general) in new-style classes is that they provide a way to > "intercept" direct attribute accesses. This lets us write more clear > and concise code that accesses members directly without fear of future > API c

Re: Newbie question: Classes

2008-01-08 Thread kyosohma
On Jan 8, 3:31 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > Basically, I have created a program using tkinter without using any class > > structure, simply creating widgets and functions (and finding ways around > > passing variables from function to function, using global variables etc).

Re: Python or PowerShell ?

2008-01-08 Thread Matimus
On Jan 8, 2:24 pm, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > [EMAIL PROTECTED] writes: > > I am all about using the right tool for the right purposes, [...] > > Which purpose? > > > I dug up one article from Google that talked about comparison but > > that was about it. > > >http:

ANN: matplotlib-0.91.2 - a python graphics package

2008-01-08 Thread [EMAIL PROTECTED]
A new release of matplotlib is posted to the sourceforge download site. You can read the release notes with links at http://matplotlib.sourceforge.net/whats_new.html Download: Downloads: http://sourceforge.net/project/showfiles.php?group_id=80706 Homepage: http://matplotlib.sourceforge.net

Re: stupid/style/list question

2008-01-08 Thread Raymond Hettinger
On Jan 8, 7:34 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > I was wondering... > To flush a list it is better doing "del mylist[:]" or "mylist = []"? > Is there a preferred way? If yes, why? To empty an existing list without replacing it, the choices are "del mylist[:]" and "mylist[:] = [

  1   2   >