Re: HTML Parsing

2007-02-11 Thread John Machin
On Feb 11, 6:05 pm, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > "mtuller" typed: > > > I have also tried Beautiful Soup, but had trouble understanding the > > documentation > > As Gabriel has suggested, spend a little more time going through the > documentation of BeautifulSoup. It is pretty easy

irclib problems

2007-02-11 Thread Tina I
I'm playing around with the 'irclib' library working with the first example at http://www.devshed.com/c/a/Python/IRC-on-a-Higher-Level-Concluded/ When copying the example verbatim and running it from a console it works flawlessly. It connects to the server, join the channel and sits there 'for

Re: pygame and python 2.5

2007-02-11 Thread [EMAIL PROTECTED]
On Feb 11, 1:35�am, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 10, 4:07?pm, "Ben Sizer" <[EMAIL PROTECTED]> wrote: > >> On Feb 10, 6:31 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >>> On Feb 9, 11:39?am, "Ben Sizer" <[EMAIL PROTECTED]> wrote: > Hop

Re: pygame and python 2.5

2007-02-11 Thread Steve Holden
[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 really up to them. >>> Right. Get people to commit and then abandon them. N

Re: Regular Expressions

2007-02-11 Thread Steven D'Aprano
On Sun, 11 Feb 2007 07:05:30 +, Steve Holden wrote: > Geoff Hill wrote: >> What's the way to go about learning Python's regular expressions? I feel >> like such an idiot - being so strong in a programming language but knowing >> nothing about RE. >> >> > In fact that's a pretty smart stan

Re: Regular Expressions

2007-02-11 Thread John Machin
On Feb 11, 9:25 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 11 Feb 2007 07:05:30 +, Steve Holden wrote: > > Geoff Hill wrote: > >> What's the way to go about learning Python's regular expressions? I feel > >> like such an idiot - being so strong in a programming language but knowin

Re: pygame and python 2.5

2007-02-11 Thread Steven D'Aprano
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 such issues > are resolved. I realize you're a Windows user, and a Wi

Problem with reimporting modules

2007-02-11 Thread Christoph Zwerschke
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 down to the following behavior of Python. Assume you have a module hello.p

Re: Regular Expressions

2007-02-11 Thread James Stroud
gregarican wrote: > On Feb 10, 6:26 pm, "Geoff Hill" <[EMAIL PROTECTED]> wrote: >> What's the way to go about learning Python's regular expressions? I feel >> like such an idiot - being so strong in a programming language but knowing >> nothing about RE. > > I highly recommend reading the book "Ma

How to access an absolute address through Python?

2007-02-11 Thread volcano
Can it be done, and if yes - how? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access an absolute address through Python?

2007-02-11 Thread Maël Benjamin Mettler
volcano schrieb: > Can it be done, and if yes - how? > Define address. Are you talking about URLs? File paths? Postal addresses? Memory addresses? Whatever addresses? I'm afraid the people on this list can't read your thoughts... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 41, Issue 170

2007-02-11 Thread YySwing.杨
- Original Message - From: <[EMAIL PROTECTED]> To: Sent: Sunday, February 11, 2007 5:10 PM Subject: Python-list Digest, Vol 41, Issue 170 > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail

Re: favourite editor

2007-02-11 Thread Stef Mientki
azrael wrote: > Since i'm new on this forum, and first time meeting a python comunity, > i wanted to ask you for your python editors. > > Im looking for some good python editor, with integrated run function, > without having to set it up manualy like komodo. > I found the pyscripter, and it has al

Re: favourite editor

2007-02-11 Thread Szabolcs Nagy
azrael wrote: > Since i'm new on this forum, and first time meeting a python comunity, > i wanted to ask you for your python editors. > > Im looking for some good python editor, with integrated run function, > without having to set it up manualy like komodo. > I found the pyscripter, and it has al

Re: How to access an absolute address through Python?

2007-02-11 Thread volcano
On Feb 11, 2:21 pm, Maël Benjamin Mettler <[EMAIL PROTECTED]> wrote: > volcano schrieb: > > > Can it be done, and if yes - how? > > Define address. Are you talking about URLs? File paths? Postal > addresses? Memory addresses? Whatever addresses? > I'm afraid the people on this list can't read your

Re: Parsing HTML

2007-02-11 Thread Samuel Karl Peterson
"mtuller" <[EMAIL PROTECTED]> on 10 Feb 2007 15:03:36 -0800 didst step forth and proclaim thus: > Alright. I have tried everything I can find, but am not getting > anywhere. I have a web page that has data like this: [snip] > What is show is only a small section. > > I want to extract the 33,69

Re: How to access an absolute address through Python?

2007-02-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, volcano wrote: > On Feb 11, 2:21 pm, Maël Benjamin Mettler <[EMAIL PROTECTED]> wrote: >> volcano schrieb: >> >> > Can it be done, and if yes - how? >> >> Define address. Are you talking about URLs? File paths? Postal >> addresses? Memory addresses? Whatever addresses? >> I'

Re: How to access an absolute address through Python?

2007-02-11 Thread volcano
On Feb 11, 2:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, volcano wrote: > > On Feb 11, 2:21 pm, Maël Benjamin Mettler <[EMAIL PROTECTED]> wrote: > >> volcano schrieb: > > >> > Can it be done, and if yes - how? > > >> Define address. Are you talking about URL

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

2007-02-11 Thread Samuel Karl Peterson
"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 the best approach: def findOccurances(a_string, word):

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

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: 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

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 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 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,

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

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

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

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: 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: 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: 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: 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 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: 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: 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

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: 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

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: 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: 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: 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

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

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

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

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

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: 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

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: 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

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: 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

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 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: 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 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: 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: 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: 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,

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: 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

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: 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

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

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

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

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: 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: 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

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: 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

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: 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

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: 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: >

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: 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: 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: 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: 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

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 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

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: 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 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

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 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

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: 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: 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: 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: 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: 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

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

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

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

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

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: 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

  1   2   >