Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread John Machin
On Feb 12, 4:24 pm, Samuel Karl Peterson <[EMAIL PROTECTED]> wrote: > C-like way to do it, (warning, untested in python): > > for i in range(8): > for j in range(8): > for offset_i in range(-1,2): > for offset_j in range(-1, 2): > row = i + offset_i >

Re: randomly generate n of each of two types

2007-02-11 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Ah, I see what you mean... you're reminding me that the Original Poster > seems to want a biased set of almost-but-not-quite-randomly chosen > values, so that random_values(1) must return one each of True and False > and never True, True or False, False

Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread bearophileHUGS
James Stroud: > import operator > srch = [(i,j) for i in [-1,0,1] for j in [-1,0,1] if (i,j) != (0,0)] > is_adj = reduce(operator.or_, [ary[row+i][col+j] for (i,j) in srch]]) Or maybe (untested), Python V.2.5: srch = [(i,j) for i in [-1,0,1] for j in [-1,0,1] if (i,j) != (0,0)] is_adj = any(ary[r

Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread James Stroud
Paul Rubin wrote: > "agent-s" <[EMAIL PROTECTED]> writes: > >>Basically I'm programming a board game and I have to use a list of >>lists to represent the board (a list of 8 lists with 8 elements each). >>I have to search the adjacent cells for existing pieces and I was >>wondering how I would go a

Re: randomly generate n of each of two types

2007-02-11 Thread Steven D'Aprano
On Sun, 11 Feb 2007 22:20:24 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> If you want to avoid shuffle, here's an alternative: >> >> def random_values(n, valuelist=[True, False]): >> N = len(valuelist) >> for _ in range(N*n): >> yield valuelist[random

Re: string.replace non-ascii characters

2007-02-11 Thread Steven D'Aprano
On Mon, 12 Feb 2007 03:01:55 -0300, Gabriel Genellina wrote: > En Mon, 12 Feb 2007 02:38:29 -0300, Samuel Karl Peterson > <[EMAIL PROTECTED]> escribió: > > Sorry to steal the thread! This is only related to your signature: > >> "if programmers were paid to remove code instead of adding it, >>

Re: randomly generate n of each of two types

2007-02-11 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > If you want to avoid shuffle, here's an alternative: > > def random_values(n, valuelist=[True, False]): > N = len(valuelist) > for _ in range(N*n): > yield valuelist[random.randrange(0, N)] That is not guaranteed to yield exactly equa

Re: randomly generate n of each of two types

2007-02-11 Thread Steven D'Aprano
On Mon, 12 Feb 2007 00:57:35 +, Alan Isaac wrote: > "Stargaming" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> ... types *= n >> ... shuffle(types) > > This again has the "costs" I referred to: > creating a potentially large sequence, > and shuffling it. (Additionally,

Re: string.replace non-ascii characters

2007-02-11 Thread Gabriel Genellina
En Mon, 12 Feb 2007 02:38:29 -0300, Samuel Karl Peterson <[EMAIL PROTECTED]> escribió: Sorry to steal the thread! This is only related to your signature: > "if programmers were paid to remove code instead of adding it, > software would be much better" -- unknown I just did that last week. Arou

Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread Paul Rubin
"agent-s" <[EMAIL PROTECTED]> writes: > Basically I'm programming a board game and I have to use a list of > lists to represent the board (a list of 8 lists with 8 elements each). > I have to search the adjacent cells for existing pieces and I was > wondering how I would go about doing this efficie

Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread Gabriel Genellina
En Mon, 12 Feb 2007 02:24:54 -0300, Samuel Karl Peterson <[EMAIL PROTECTED]> escribió: > James Stroud <[EMAIL PROTECTED]> on Sun, 11 Feb 2007 16:53:16 -0800 > didst step forth and proclaim thus: > >> agent-s wrote: >> > Basically I'm programming a board game and I have to use a list of >> > list

Re: string.replace non-ascii characters

2007-02-11 Thread Samuel Karl Peterson
Steven Bethard <[EMAIL PROTECTED]> on Sun, 11 Feb 2007 22:23:59 -0700 didst step forth and proclaim thus: > Samuel Karl Peterson wrote: > > Greetings Pythonistas. I have recently discovered a strange anomoly > > with string.replace. It seemingly, randomly does not deal with > > characters of ord

Re: No module named pyExcelerator Error

2007-02-11 Thread Gabriel Genellina
En Mon, 12 Feb 2007 01:46:51 -0300, susan <[EMAIL PROTECTED]> escribió: >> > $ python ./pyExcelerator/setup.py install >> >> Try this instead: >> $ cdpyExcelerator >> $ python ./setup.py install > I still wonder why my way didn't work. I think maybe there's some hard > code of installation dire

message processing/threads

2007-02-11 Thread Jonathan Curran
I've been thinking about this for a bit and wanted some input as to the design of it. The problem is as such: I need a program running in the background to process messages (FIFO order) which I would send using soap/xmlrpc/pyro (haven't decided yet). According to my thinking I would need to mak

Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread Samuel Karl Peterson
James Stroud <[EMAIL PROTECTED]> on Sun, 11 Feb 2007 16:53:16 -0800 didst step forth and proclaim thus: > agent-s wrote: > > Basically I'm programming a board game and I have to use a list of > > lists to represent the board (a list of 8 lists with 8 elements each). > > I have to search the adjace

Re: string.replace non-ascii characters

2007-02-11 Thread Steven Bethard
Samuel Karl Peterson wrote: > Greetings Pythonistas. I have recently discovered a strange anomoly > with string.replace. It seemingly, randomly does not deal with > characters of ordinal value > 127. I ran into this problem while > downloading auction web pages from ebay and trying to replace th

Re: About getattr()

2007-02-11 Thread Samuel Karl Peterson
"Jm lists" <[EMAIL PROTECTED]> on Mon, 12 Feb 2007 12:36:10 +0800 didst step forth and proclaim thus: > Hello, > > Since I can write the statement like: > > >>> print os.path.isdir.__doc__ > Test whether a path is a directory > > Why do I still need the getattr() func as below? > > >>> print g

Re: About getattr()

2007-02-11 Thread Leif K-Brooks
Jm lists wrote: > Since I can write the statement like: > print os.path.isdir.__doc__ > Test whether a path is a directory > > Why do I still need the getattr() func as below? > print getattr(os.path,"isdir").__doc__ > Test whether a path is a directory You don't. getattr() is only us

string.replace non-ascii characters

2007-02-11 Thread Samuel Karl Peterson
Greetings Pythonistas. I have recently discovered a strange anomoly with string.replace. It seemingly, randomly does not deal with characters of ordinal value > 127. I ran into this problem while downloading auction web pages from ebay and trying to replace the "\xa0" (dec 160, nbsp char in iso-

Re: No module named pyExcelerator Error

2007-02-11 Thread susan
On Feb 11, 11:22 pm, Samuel Karl Peterson <[EMAIL PROTECTED]> wrote: > "susan" <[EMAIL PROTECTED]> on 11 Feb 2007 16:55:35 -0800 didst > step forth and proclaim thus: > > > Hi, > > I'm new of Python, and this problem stucked me whole day but can't be > > solved. > > [snip] > > > anybody can tell me

Re: No module named pyExcelerator Error

2007-02-11 Thread susan
On Feb 11, 8:16 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 12, 11:55 am, "susan" <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm new of Python, and this problem stucked me whole day but can't be > > solved. > > > I use python 2.4.3, which is download from cygwin packages. > > Is your Python

Re: Saving PyOpenGl figures as ps

2007-02-11 Thread Mike C. Fletcher
Frank wrote: > Hi, > > I installed pyopengl (opengl for python) on my linux box and > everything works fine. But now I want to save the generated images as, > e.g., ps or eps. How can I do that and how can I adjust the resolution > (if necessary)? This is probably simple but for some reason I can n

standardized us address

2007-02-11 Thread mark
Hi Is there any python module that will convert address to standard US address format: for ex: 314 south chauncey avenue should be: 314 s chauncey ave thanks mark -- http://mail.python.org/mailman/listinfo/python-list

About getattr()

2007-02-11 Thread Jm lists
Hello, Since I can write the statement like: >>> print os.path.isdir.__doc__ Test whether a path is a directory Why do I still need the getattr() func as below? >>> print getattr(os.path,"isdir").__doc__ Test whether a path is a directory Thanks! -- http://mail.python.org/mailman/listinfo/pyt

how to store and still search special characters in Python and MySql

2007-02-11 Thread ronrsr
I have an MySQL database called zingers. The structure is: zid - integer, key, autoincrement keyword - varchar citation - text quotation - text I am having trouble storing text, as typed in latter two fields. Special characters and punctuation all seem not to be stored and retrieved correctly. S

Re: No module named pyExcelerator Error

2007-02-11 Thread Samuel Karl Peterson
"susan" <[EMAIL PROTECTED]> on 11 Feb 2007 16:55:35 -0800 didst step forth and proclaim thus: > Hi, > I'm new of Python, and this problem stucked me whole day but can't be > solved. [snip] > anybody can tell me where's wrong please? Thanks in advance! What are the contents of sys.path from an i

Re: Saving PyOpenGl figures as ps

2007-02-11 Thread Vasily Sulatskov
On Feb 12, 3:11 am, "Frank" <[EMAIL PROTECTED]> wrote: > Hi, > > I installed pyopengl (opengl for python) on my linux box and > everything works fine. But now I want to save the generated images as, > e.g., ps or eps. How can I do that and how can I adjust the resolution > (if necessary)? This is p

Re: Help with Optimization of Python software: real-time audio controller

2007-02-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > So, for a music-based application where it's crucial to have real-time > execution of serial writeouts and audio, as well as keeping a > continual poll on the input from the same portcan this be done > successfully in Python? Does using Tkinter have anything to do w

Re: Help with Optimization of Python software: real-time audio controller

2007-02-11 Thread Vasily Sulatskov
Perhaps boosting priorities for time critical threads will help. I don't know about MacOS but for Win32 something like that helps: thread = win32api.GetCurrentThread() win32process.SetThreadPriority(thread, win32process.THREAD_PRIORITY_TIME_CRITICAL) current_process = win32pr

Re: How to find all the same words in a text?

2007-02-11 Thread Samuel Karl Peterson
[EMAIL PROTECTED] on 11 Feb 2007 08:16:11 -0800 didst step forth and proclaim thus: > More concisely: > > import re > > pattern = re.compile(r'\b324\b') > indices = [ match.start() for match in > pattern.finditer(target_string) ] > print "Indices", indices > print "Count: ", len(indices) > Tha

Re: Read/write 2D data from/to file..?

2007-02-11 Thread Vasily Sulatskov
On Feb 12, 6:47 am, "mech point" <[EMAIL PROTECTED]> wrote: > I was able to read the data from file into a two dimensional array > (lists) > > rows=[map(float,line.split())for line in file("data")] > > but How to write them back into the file. Using matplotlib it will be: import pylab rows = pyla

Re: Read/write 2D data from/to file..?

2007-02-11 Thread Grant Edwards
On 2007-02-12, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-02-12, mech point <[EMAIL PROTECTED]> wrote: >> >> I was able to read the data from file into a two dimensional array >> (lists) >> >> rows=[map(float,line.split())for line in file("data")] >> >> but How to write them back into the f

Help with Optimization of Python software: real-time audio controller

2007-02-11 Thread craiglewiston
I've been working on a Python-based music training application for a few months, and have recently run into what I believe are some basic limitations (or at least constraints) of Python with regards to timing. I'll try and give a decently thorough description, and hopefully some of you can process

Re: Read/write 2D data from/to file..?

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 22:47:30 -0300, mech point <[EMAIL PROTECTED]> escribió: > I was able to read the data from file into a two dimensional array > (lists) > > rows=[map(float,line.split())for line in file("data")] > > but How to write them back into the file. This way uses the same structures

Re: Read/write 2D data from/to file..?

2007-02-11 Thread Grant Edwards
On 2007-02-12, mech point <[EMAIL PROTECTED]> wrote: > > I was able to read the data from file into a two dimensional array > (lists) > > rows=[map(float,line.split())for line in file("data")] > > but How to write them back into the file. for r in rows: file.write(" ".join(map(str,r)) + "\n")

Re: Read/write 2D data from/to file..?

2007-02-11 Thread John Machin
On Feb 12, 12:47 pm, "mech point" <[EMAIL PROTECTED]> wrote: > I was able to read the data from file into a two dimensional array > (lists) > > rows=[map(float,line.split())for line in file("data")] > > but How to write them back into the file. Presuming that it is either mandatory to adopt the sa

Re: compound statement from C "?:"

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 19:16:49 -0300, Holger <[EMAIL PROTECTED]> escribió: >> >> if n == 1: >> >> print "I saw a car" >> >> else: >> >> print "I saw %d cars" % n > > Personally I don't like the if-else approach because of the don't- > repeat-yourself philosophy > >> D'accord. Did I mention t

Read/write 2D data from/to file..?

2007-02-11 Thread mech point
I was able to read the data from file into a two dimensional array (lists) rows=[map(float,line.split())for line in file("data")] but How to write them back into the file. Thank you, srikanth -- http://mail.python.org/mailman/listinfo/python-list

Re: compound statement from C "?:"

2007-02-11 Thread BJörn Lindqvist
On 11 Feb 2007 16:57:07 -0800, Carl Banks <[EMAIL PROTECTED]> wrote: > You don't need any ternary operator to avoid repetition, anyways. You > could factor the common parts out like this: > > if n == 1: > what = "a car" > else: > what = "%d cars" % n > print "I saw %s" % what Or even bett

Re: Generating pdf files in epydoc on Windows

2007-02-11 Thread Duncan Smith
Don Taylor wrote: > Does anyone know what is needed to install to get epydoc to generate pdf > files on Windows. Besides epydoc itself of course. > > Maybe there is a more appropriate forum to ask newbie questions about > epydoc? > As I remember, LaTeX and ghostscript. Duncan -- http://mail.p

Re: No module named pyExcelerator Error

2007-02-11 Thread John Machin
On Feb 12, 11:55 am, "susan" <[EMAIL PROTECTED]> wrote: > Hi, > I'm new of Python, and this problem stucked me whole day but can't be > solved. > > I use python 2.4.3, which is download from cygwin packages. Is your Python installation working properly for you with other things, or is installing p

Re: help please!!

2007-02-11 Thread James Stroud
darren112 wrote: > Hi Im new to python and I desperately need help with this task > This is everything of what I need to do... > > The program to be written in Python obviously.. > > The program should support brute-forcing of the authentication process > for a Telnet server via a dic

Re: randomly generate n of each of two types

2007-02-11 Thread Alan Isaac
"Stargaming" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ... types *= n > ... shuffle(types) This again has the "costs" I referred to: creating a potentially large sequence, and shuffling it. (Additionally, shuffle cannot achieve many of the possible shuffles of a large list

Re: compound statement from C "?:"

2007-02-11 Thread Carl Banks
On Feb 11, 5:16 pm, "Holger" <[EMAIL PROTECTED]> wrote: > Thanks all for good input. > It seems like there's no the-python-way for this one. > > Currently I'm forced to use cygwin - and python in cygwin is still not > 2.5 so I can't use the new inline if-else ternary operator. > > > >> if n == 1: >

No module named pyExcelerator Error

2007-02-11 Thread susan
Hi, I'm new of Python, and this problem stucked me whole day but can't be solved. I use python 2.4.3, which is download from cygwin packages. Then I downloaded pyexcelerator-0.5.3a, unzip it, $ python ./pyExcelerator/setup.py install running install running build running build_py package init fil

Re: searching a list of lists as a two-dimensional array?

2007-02-11 Thread James Stroud
agent-s wrote: > Basically I'm programming a board game and I have to use a list of > lists to represent the board (a list of 8 lists with 8 elements each). > I have to search the adjacent cells for existing pieces and I was > wondering how I would go about doing this efficiently. Thanks > This i

searching a list of lists as a two-dimensional array?

2007-02-11 Thread agent-s
Basically I'm programming a board game and I have to use a list of lists to represent the board (a list of 8 lists with 8 elements each). I have to search the adjacent cells for existing pieces and I was wondering how I would go about doing this efficiently. Thanks -- http://mail.python.org/mailm

Re: Hacking in python

2007-02-11 Thread Marshillboy
On Feb 10, 5:25 pm, "Geoff Hill" <[EMAIL PROTECTED]> wrote: > The word "hack" can be known as a "smart/quick fix" to a problem. Giving the benefit of the doubt here, perhaps Enes Naci saw this article: http://www.hetland.org/python/instant-hacking.php and got some strange idea about confusing prog

New Pythin user looking foe some good examples to study

2007-02-11 Thread Johnny Garcia
I have just discovered Python and am familiarizing myself with the syntax but I have always found that code examples where the best way for me to learn. Can anyone point me to a site with some good open source functioning python applications? I would appreciate any help. Also, does anyo

Re: Database Programming with Python

2007-02-11 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >I wanted to connect Python to Ms-Access database using ADO or ODBC. I >have Python 2.5 and on mxODBC site, it has no higher version build >than 2.4. Moreoever, mxODBC is required for ADODB. >Can anyone guide me on this what should I do to make it work on Python >2.5? I h

Re: Regexps and lists

2007-02-11 Thread John Machin
On Feb 12, 9:08 am, "Paddy" <[EMAIL PROTECTED]> wrote: > I don't know enough to write an R.E. engine so forgive me if I am > being naive. > I have had to atch text involving lists in the past. These are usually > comma separated words such as > "egg,beans,ham,spam,spam" > you can match that with:

Re: Parsing HTML

2007-02-11 Thread Paul McGuire
On Feb 10, 5:03 pm, "mtuller" <[EMAIL PROTECTED]> wrote: > Alright. I have tried everything I can find, but am not getting > anywhere. I have a web page that has data like this: > > > > LETTER > > 33,699 > > 1.0 > > > > What is show is only a small section. > > I want to extract the 33,699 (w

Re: compound statement from C "?:"

2007-02-11 Thread Holger
Thanks all for good input. It seems like there's no the-python-way for this one. Currently I'm forced to use cygwin - and python in cygwin is still not 2.5 so I can't use the new inline if-else ternary operator. > >> if n == 1: > >> print "I saw a car" > >> else: > >> print "I saw %d cars

Saving PyOpenGl figures as ps

2007-02-11 Thread Frank
Hi, I installed pyopengl (opengl for python) on my linux box and everything works fine. But now I want to save the generated images as, e.g., ps or eps. How can I do that and how can I adjust the resolution (if necessary)? This is probably simple but for some reason I can not find out how to do th

Regexps and lists

2007-02-11 Thread Paddy
I don't know enough to write an R.E. engine so forgive me if I am being naive. I have had to atch text involving lists in the past. These are usually comma separated words such as "egg,beans,ham,spam,spam" you can match that with: r"(\w+)(,\w+)*" and when you look at the groups you get the follow

Re: Regular Expressions

2007-02-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: >> That's a little harsh -- regexes have their place, together with pointer >> arithmetic, bit manipulations, reverse polish notation and goto. The >> problem is when people use them inappropriately e.g. using a regex when a >> simple string.find will do. >> >>> A quote att

Re: Problem with reimporting modules

2007-02-11 Thread Christoph Zwerschke
Thanks for the detailed explanations, Gabriel. > At that time, all values in the module namespace are set to > None (for breaking possible cycles, I presume). print_hello now has a > func_globals with all names set to None. (Perhaps the names could have > been deleted instead, so print_hello()

Re: randomly generate n of each of two types

2007-02-11 Thread Stargaming
Alan Isaac schrieb: > I need access to 2*n random choices for two types > subject to a constraint that in the end I have > drawn n of each. I first tried:: > > def random_types(n,typelist=[True,False]): > types = typelist*n > random.shuffle(types) > for next_type in types: > y

MySQLdb binaries (was Re: huge amounts of pure...)

2007-02-11 Thread John J. Lee
Robin Becker <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > John> MySQLdb isn't fully supported for Python 2.5 yet, and there's no > > John> tested Windows executable available, although there's an untested > > John> version from a World of Warcraft guild available. > > As

Re: help please!!

2007-02-11 Thread azrael
Hey yo kiddie, I hope that you are using the web for some time. So you can get the meaning from my post.: LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL,

Re: urllib2 request htaccess page through proxy

2007-02-11 Thread John J. Lee
Alessandro Fachin <[EMAIL PROTECTED]> writes: > I write this simply code that should give me the access to private page with > htaccess using a proxy, i don't known because it's wrong... [...] > i get no access on access.log from apache2 and nothing from the proxy in > tcpdump log. If i use only

Re: Regular Expressions

2007-02-11 Thread John Machin
On Feb 12, 3:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > That's a little harsh -- regexes have their place, together with pointer > > arithmetic, bit manipulations, reverse polish notation and goto. The > > problem is when people use them inappropriately e.g. using a regex when a > >

Re: help please!!

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 16:40:45 -0300, darren112 <[EMAIL PROTECTED]> escribió: > The program should support brute-forcing of the authentication process > for a Telnet server via a dictionary attack. You should first read the Python Tutorial. After you get proficient with the basic programming st

Re: Problem with reimporting modules

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 15:56:16 -0300, Christoph Zwerschke <[EMAIL PROTECTED]> escribió: > Yes I know about reload(), but TurboGears (TurboKid) does not use it and > the docs say that removing modules from sys.module is possible to force > reloading of modules. I don't want to rewrite everything si

Re: help please!!

2007-02-11 Thread Jonathan Curran
On Sunday 11 February 2007 13:40, darren112 wrote: > Hi Im new to python and I desperately need help with this task > This is everything of what I need to do... > > The program to be written in Python obviously.. > > The program should support brute-forcing of the authentication process

Re: help please!!

2007-02-11 Thread azrael
well, this sounds funn. 1) dont expect someone to do your homework. 2) dont expect someone to do dirty homework 3) dont expect someone to do your home work especially when it's something that could make you problems, or the person that is helping you 4) from your message i can "read" that you need

Re: help please!!

2007-02-11 Thread hg
darren112 wrote: > Hi Im new to python and I desperately need help with this task > This is everything of what I need to do... > > The program to be written in Python obviously.. > > The program should support brute-forcing of the authentication process > for a Telnet server via a di

help please!!

2007-02-11 Thread darren112
Hi Im new to python and I desperately need help with this task This is everything of what I need to do... The program to be written in Python obviously.. The program should support brute-forcing of the authentication process for a Telnet server via a dictionary attack. The python pro

Re: Pyhton script

2007-02-11 Thread Jonathan Curran
On Sunday 11 February 2007 11:47, soussou97 wrote: > Hi; > > I would like to automatically delivery, I seek a script in python which > will be excecute from a Windows station to allows via sftp: > > 1- to connect to a Linux server for storing of the files > 2- Next execute on the Linux server, some

Re: Pyhton script

2007-02-11 Thread Jonathan Curran
On Sunday 11 February 2007 11:47, soussou97 wrote: > Hi; > > I would like to automatically delivery, I seek a script in python which > will be excecute from a Windows station to allows via sftp: > > 1- to connect to a Linux server for storing of the files > 2- Next execute on the Linux server, some

Re: Adding an XML fragment as a child node in a pre-existing Element tree

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 15:15:21 -0300, Rajarshi <[EMAIL PROTECTED]> escribió: > Hi, I'm using ElementTree for some RSS processing. The point where I > face a problem is that within an I need to add another > child node (in addition to etc) which is a well-formed XML > document (Chemical Markup La

Re: Problem with reimporting modules

2007-02-11 Thread Christoph Zwerschke
Yes I know about reload(), but TurboGears (TurboKid) does not use it and the docs say that removing modules from sys.module is possible to force reloading of modules. I don't want to rewrite everything since it's a pretty complex thing with modules which are compiled from templates which can de

Adding an XML fragment as a child node in a pre-existing Element tree

2007-02-11 Thread Rajarshi
Hi, I'm using ElementTree for some RSS processing. The point where I face a problem is that within an I need to add another child node (in addition to etc) which is a well-formed XML document (Chemical Markup Language to be precise). So my code looks like: import cElementTree as ET c = ope

Re: Regular Expressions

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 13:35:26 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: >> (Steven?) >> That's a little harsh -- regexes have their place, together with pointer >> arithmetic, bit manipulations, reverse polish notation and goto. The >> problem is when people use them inappropriately

Re: Regular Expressions

2007-02-11 Thread skip
jwz> Some people, when confronted with a problem, think 'I know, I'll jwz> use regular expressions.' Now they have two problems. dbl> So as a newbie, I have to ask So I guess I don't really dbl> understand why they are a "bad idea" to use. Regular expressions are fine in th

Generating pdf files in epydoc on Windows

2007-02-11 Thread Don Taylor
Does anyone know what is needed to install to get epydoc to generate pdf files on Windows. Besides epydoc itself of course. Maybe there is a more appropriate forum to ask newbie questions about epydoc? Thanks, Don. -- http://mail.python.org/mailman/listinfo/python-list

Pyhton script

2007-02-11 Thread soussou97
Hi; I would like to automatically delivery, I seek a script in python which will be excecute from a Windows station to allows via sftp: 1- to connect to a Linux server for storing of the files 2- Next execute on the Linux server, some actions: Copy, gzip, mv etc... 3- to use a config file for

Re: randomly generate n of each of two types

2007-02-11 Thread Paul Rubin
"Alan Isaac" <[EMAIL PROTECTED]> writes: > I need access to 2*n random choices for two types > subject to a constraint that in the end I have > drawn n of each. I first tried:: You mean you basically want to generate 2*n bools of which exactly half are True and half are False? Hmm (untested): f

Re: can't find a way to display and print pdf through python.

2007-02-11 Thread krishnakant Mane
well yes, I need to view reports on line and also print them from within my app. so yes I need to display the pdf in my app and print it as well. regards. Krishnakant -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions

2007-02-11 Thread [EMAIL PROTECTED]
> That's a little harsh -- regexes have their place, together with pointer > arithmetic, bit manipulations, reverse polish notation and goto. The > problem is when people use them inappropriately e.g. using a regex when a > simple string.find will do. > > > A quote attributed variously to > > Tim

Re: pygame and python 2.5

2007-02-11 Thread [EMAIL PROTECTED]
On Feb 11, 5:33?am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 11 Feb 2007 01:08:21 -0800, [EMAIL PROTECTED] wrote: > >> An update is in the works for those > >> using more recent releases, > > > That's good news, although the responsible thing > > to do was not relaease version 2.5 until

Re: pygame and python 2.5

2007-02-11 Thread [EMAIL PROTECTED]
On Feb 11, 4:24 am, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 11, 1:35?am, Steve Holden <[EMAIL PROTECTED]> wrote: > [...] > After all, they have already given freely and generously, and if they > choose > not to give more on top of that, it's rea

randomly generate n of each of two types

2007-02-11 Thread Alan Isaac
I need access to 2*n random choices for two types subject to a constraint that in the end I have drawn n of each. I first tried:: def random_types(n,typelist=[True,False]): types = typelist*n random.shuffle(types) for next_type in types: yield next_type This works but has som

Re: can't find a way to display and print pdf through python.

2007-02-11 Thread Christian Stapfer
krishnakant Mane wrote in message news:[EMAIL PROTECTED] > On 11/02/07, Vishal Bhargava <[EMAIL PROTECTED]> wrote: >> Use Report Lab... > I mentioned in my first email that I am already using reportlab. > but I can only generate pdf out of that. > I want to display it on screen and I also will be

Re: How to find all the same words in a text?

2007-02-11 Thread attn . steven . kuo
On Feb 11, 5:13 am, Samuel Karl Peterson <[EMAIL PROTECTED]> wrote: > "Johny" <[EMAIL PROTECTED]> on 10 Feb 2007 05:29:23 -0800 didst step > forth and proclaim thus: > > > I need to find all the same words in a text . > > What would be the best idea to do that? > > I make no claims of this being t

Re: How to access an absolute address through Python?

2007-02-11 Thread Grant Edwards
On 2007-02-11, volcano <[EMAIL PROTECTED]> wrote: > Can it be done, Yes. > and if yes - how? /proc/kmem -- Grant Edwards grante Yow! Nipples, dimples, at knuckles, NICKLES, visi.com

Re: Problem with reimporting modules

2007-02-11 Thread Dustan
On Feb 11, 5:53 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > I'm currently investigating a problem that can hit you in TurboGears > when Kid template modules are reloaded in the background, because in > certain situations, global variables suddenly are set to None values. > > I tracked it d

Re: How to access an absolute address through Python?

2007-02-11 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > My goal is to sync program with external equipment through a register > > defined as an absolute physical address. I know how to do it from C - > > was curious if it may be done from Python. Can it be done? > > > No. You'd have to use a compiled extensio

Re: gvim: doc string editing

2007-02-11 Thread [EMAIL PROTECTED]
On Feb 11, 7:01 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-02-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, I am using gvim, and am looking for a way to tell gvim to > > automatically wrap long lines into multiple lines ( by > > automatically inserting the newline character)

Re: HTML Parsing

2007-02-11 Thread Fredrik Lundh
John Machin wrote: > One can even use ElementTree, if the HTML is well-formed. See below. > However if it is as ill-formed as the sample (4th "td" element not > closed; I've omitted it below), then the OP would be better off > sticking with Beautiful Soup :-) or get the best of both worlds:

Re: How to access an absolute address through Python?

2007-02-11 Thread volcano
On Feb 11, 3:46 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > volcano wrote: > > On Feb 11, 2:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > [...] > >> What's your goal? What do you expect at the memory address you want to > >> access? > > >> Ciao, > >> Marc 'BlackJack' Rints

Re: gvim: doc string editing

2007-02-11 Thread Neil Cerutti
On 2007-02-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, I am using gvim, and am looking for a way to tell gvim to > automatically wrap long lines into multiple lines ( by > automatically inserting the newline character) when I edit doc > strings. I am sure somebody must have done this. I

gvim: doc string editing

2007-02-11 Thread [EMAIL PROTECTED]
Hi, I am using gvim, and am looking for a way to tell gvim to automatically wrap long lines into multiple lines ( by automatically inserting the newline character) when I edit doc strings. I am sure somebody must have done this. - Suresh -- http://mail.python.org/mailman/listinfo/python-list

urllib2 request htaccess page through proxy

2007-02-11 Thread Alessandro Fachin
I write this simply code that should give me the access to private page with htaccess using a proxy, i don't known because it's wrong... import urllib,urllib2 #input url url="http://localhost/private/file"; #proxy set up proxy_handler = urllib2.ProxyHandler({'http': 'http://myproxy:'}) #h

Re: How to find all the same words in a text?

2007-02-11 Thread Maël Benjamin Mettler
In order to find all the words in a text, you need to tokenize it first. The rest is a matter of calling the count method on the list of tokenized words. For tokenization look here: http://nltk.sourceforge.net/lite/doc/en/words.html A little bit of warning: depending on what exactly you need to do,

Re: How to access an absolute address through Python?

2007-02-11 Thread Steve Holden
volcano wrote: > On Feb 11, 2:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: [...] >> What's your goal? What do you expect at the memory address you want to >> access? >> >> Ciao, >> Marc 'BlackJack' Rintsch > > My goal is to sync program with external equipment through a regi

Re: How to access an absolute address through Python?

2007-02-11 Thread Fred of UrlBit.Us
volcano wrote: > On Feb 11, 2:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: ... > My goal is to sync program with external equipment through a register > defined as an absolute physical address. I know how to do it from C - > was curious if it may be done from Python. Can it be done?

Re: How to find all the same words in a text?

2007-02-11 Thread Neil Cerutti
On 2007-02-10, Johny <[EMAIL PROTECTED]> wrote: > I need to find all the same words in a text . > What would be the best idea to do that? > I used string.find but it does not work properly for the words. > Let suppose I want to find a number 324 in the text > > '45 324 45324' > > there is only o

morpholgy toolbox

2007-02-11 Thread azrael
does any one have any expirience with mmorph module. At first i was unable to run it because some file was missing (instalation problem), but i managed it. but, did anyone manage to save the new mask, or anything created with it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Shed Skin Optimizing Python-to-C++ Compiler 0.0.19

2007-02-11 Thread Michael
Mark Dufour wrote: > This > latest release adds basic support for iterators and generators Oooh, I may try our miniaxon tutorial against shed skin in that case. (ie http://kamaelia.sourceforge.net/MiniAxon/) Great to see you're plowing through this BTW ! Michael. -- Kamaelia Project Lead http

  1   2   >