Leipzig Python User Group - Meeting, February 13, 2007, 8:00pm

2007-02-11 Thread Mike Müller
= Leipzig Python User Group = Next Meeting Tuesday, February 13, 2007 We will meet on February 13 at 8:00 pm at the training center of Python Academy in Leipzig, Germany

[ANN] Initial release of Throxy: throttling HTTP proxy in one Python file

2007-02-11 Thread Johann C. Rocholl
Throxy: throttling HTTP proxy in one Python file * Simulate a slow connection (like dial-up). * Adjustable bandwidth limit for download and upload. * Optionally dump HTTP headers and content for debugging. * Decompress gzip content encoding for debugging. * Multiple connections, without threads

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 to grasp.

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

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: Hopefully in the future, some of

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. Nice. Anyone who

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 stance. That's

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 knowing

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 Windows

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

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 Mastering

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: python-list@python.org 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,

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

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

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,699 (which

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'm afraid the people

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 URLs? File paths?

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

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 one

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

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

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:'})

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. If tw

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' Rintsch My goal is to

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) when I

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 extension. Well,

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

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

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 giving

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

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 really up to them.

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

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 Peters

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

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

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 their

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 e.g.

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 item/item I need to add another child node (in addition to link etc) which is a well-formed XML document (Chemical Markup Language to be precise). So my code looks like: import cElementTree as

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

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 item/item I need to add another child node (in addition to link etc) which is a well-formed XML document (Chemical

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

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

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 for

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 since

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

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 simple

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 the

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,

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

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

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 attributed

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 following

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

Re: compound statement from C test?true-val:false-val

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

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: tr td headers=col1_1 style=width:21% span class=hpPageText LETTER/span/td td headers=col2_1 style=width:13%;

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 have

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

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 programming

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

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 isn't

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

Re: compound statement from C test?true-val:false-val

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

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

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

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

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

Re: compound statement from C test?true-val:false-val

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 better (IMHO):

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 test?true-val:false-val

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 that, as a for fun approach,

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

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

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

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

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 file. for r in

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 =

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) Thank you, this

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 =

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 with

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 probably

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

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.

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

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 not

  1   2   >