Re: How to request data from a lazily-created tree structure ?

2008-06-23 Thread méchoui
On Jun 17, 11:54 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Do you know if there is suchXPathengine that can be applied to a DOM- > > like structure ? > > No. But I toyed with the idea to write one :) > > > One way would be to take anXPathengine from an existing XML engine > > (ElementTr

Re: An idiom for code generation with exec

2008-06-23 Thread Bruno Desthuilliers
eliben a écrit : d = {} execcode in globals(), d return d['foo'] My way: return function(compile(code, '', 'exec'), globals()) With some help from the guys at IRC I came to realize your way doesn't do the same. It creates a function that, when called, creates 'foo' on globals(). This

Re: Ruby doctest

2008-06-23 Thread Duncan Booth
Paddy <[EMAIL PROTECTED]> wrote: > I monitor changes to the Wikipedia doctest page, and so noticed a > change in the Ruby implementation of doctest. > > Scooting around their implementation I found that they have an !!! > special directive that says drop into the interpreter at this point > when

Re: Learning Python in a group

2008-06-23 Thread windstorm
On Jun 23, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 22, 5:43�am, "Jonathan Roberts" <[EMAIL PROTECTED]> > wrote: > > > > > Hi all, > > > I'm looking to learn Python (as my first programming language) and I'm > > pretty sure I'd be more successful doing this with a group of other > >

Python module for working with a sudden motion sensor on Linux

2008-06-23 Thread Chris Ortner
Hi everyone, I am looking for a python module or something similar which makes use of the capabilities of the kernel module applesmc to provide support for the sudden motion sensor in Apple hardware. It should be something like this: http://pypi.python.org/pypi/PyAppleSMS/1.0 Would it make sense

2to3 bug and question

2008-06-23 Thread Helmut Jarausch
Hi, is this the right group to ask / report problems with python3.0 ? The question: Is it possible to tell 2to3 to replace, say, #!/usr/bin/python by #!/usr/local/bin/python3.0 ? Here the bug: While 2to3 keeps the first line #!/usr/bin/python it removes the first line if it was #!/usr/bi

Re: An idiom for code generation with exec

2008-06-23 Thread Maric Michaud
Le Monday 23 June 2008 09:22:29 Bruno Desthuilliers, vous avez écrit : > > With some help from the guys at IRC I came to realize your way doesn't > > do the same. It creates a function that, when called, creates 'foo' on > > globals(). This is not exactly what I need. > > I possibly messed up a cou

Re: how to send a "Multiline" mail with smtplib?

2008-06-23 Thread Evan
On Jun 19, 6:12 pm, Lie <[EMAIL PROTECTED]> wrote: > On Jun 19, 4:02 pm, Justin Ezequiel <[EMAIL PROTECTED]> > wrote: > > > perhaps change html > > > body=MIMEText('hello,\r\n > > ok',_subtype='html',_charset='windows-1255') > > > to plain > > > body=MIMEText('hello,\r\n > > ok',_subtype='plain',_c

[2to3] Bug converting import

2008-06-23 Thread Helmut Jarausch
Hi Given the following two files in the same directory Master.py: -- #!/usr/bin/python import Slave Slave.main() and Slave.py: - def main() : print "Hello World" Invoking Master.py under python-2.5.2 works just fine. 2to3 converts these to Master.py: -- from . impor

Re: pyTTS says, '"SAPI" not supported'

2008-06-23 Thread Tim Golden
weheh wrote: I'm running Python 2.3 and calling pyTTS. I've had it working forever. Today, I ran out of disk space. After deleting some of my personal files, for no apparent reason, pyTTS no longer runs. For the statement tts = pyTTS.Create() I get the error message: ValueE

Re: binary number format ? format character %b or similar.

2008-06-23 Thread Ken Starks
Mensanator wrote: On Jun 22, 4:07�pm, Ken Starks <[EMAIL PROTECTED]> wrote: weheh wrote: I don't know if you found this example: http://www.daniweb.com/code/snippet285.html Thanks for that. The offerings are very similar to the algorithms I wrote myself. It wasn't the solution I was after,rea

Re: inheritance question...

2008-06-23 Thread Eric Brunel
Preamble: when posting a brand new question, you'd better not replying to an existing completely unrelated message. In most viewers, this will cause your message to appear in the thread for the original question and far less people will see it. So better create a brand new thread. On Fri, 2

Re: how to export functions by name for ctype

2008-06-23 Thread Nick Craig-Wood
rych <[EMAIL PROTECTED]> wrote: > I'm on Windows with VS2005 testing ctypes on a very simple dll > I create a test.dll project which exports a function fntest(). I don't > touch anything in the autogenerated source and build it. I can load > the dll but can't access the function by its name fnt

Re: Learning Python in a group

2008-06-23 Thread ubikvist
I guess it's time to choose what a project your group will work at. Personally, I'm working at the project relating to text analysis, but it's rather specific because I use Russian texts. So, maybe we should to choose more 'international' implementation. -Ed -- http://mail.python.org/mailman/listin

Re: listcomprehension, add elements?

2008-06-23 Thread Boris Borcic
John Machin wrote: Instead of sum(a + b for a, b in zip(foo, bar)) why not use sum(foo) + sum(bar) ? or even sum(foo+bar) as may apply. Cheers, BB -- http://mail.python.org/mailman/listinfo/python-list

Re: An idiom for code generation with exec

2008-06-23 Thread Bruno Desthuilliers
Maric Michaud a écrit : Le Monday 23 June 2008 09:22:29 Bruno Desthuilliers, vous avez écrit : With some help from the guys at IRC I came to realize your way doesn't do the same. It creates a function that, when called, creates 'foo' on globals(). This is not exactly what I need. I possibly mes

Sending arrays of a structure as an argument via ctypes

2008-06-23 Thread Knut Saua Mathiesen
Hi there. I am reprogrammed my astar* path finding algorithm in C to make it quicker. I am now trying to make python use this C extension, however I keep getting "Segmentation fault". Some of the C stuff: typedef struct Point { int x; int y; } Point; typedef struct Node {

Re: flock seems very unsafe, python fcntl bug?

2008-06-23 Thread Nick Craig-Wood
Jens Henrik Leonhard Jensen <[EMAIL PROTECTED]> wrote: > Your problem is that open(...,'w') is not locked. > > Use something like: > lockf = open('aaa', 'a') > fnctl.flock(lockf,fnctl.LOCK_EX) > file = open('aaa', 'w') > file.write('asdf') > file.close() > lockf.close() I've not seen that

Re: listcomprehension, add elements?

2008-06-23 Thread Maric Michaud
Le Monday 23 June 2008 11:39:44 Boris Borcic, vous avez écrit : > John Machin wrote: > > Instead of sum(a + b for a, b in zip(foo, bar)) > > why not use sum(foo) + sum(bar) > > ? > > or even sum(foo+bar) as may apply. Because some are better than others : sum(foo+bar) is the worst, it create a s

Re: listcomprehension, add elements?

2008-06-23 Thread John Machin
On Jun 23, 9:16 pm, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le Monday 23 June 2008 11:39:44 Boris Borcic, vous avez écrit : > > > John Machin wrote: > > > Instead of sum(a + b for a, b in zip(foo, bar)) > > > why not use sum(foo) + sum(bar) > > > ? > > > or even sum(foo+bar) as may apply. > > Be

xml to mysql (vice versa ) too

2008-06-23 Thread swapna mudavath
Hi, I need to write a python script to store data which is in XML to MYSQL and even vice versa what should be the approach? i am able to establish a connection,create tables and insert data . but how to read an xml file and store in MYSQL my XML structure is like

Re: Learning Python in a group

2008-06-23 Thread Taygun Kekec
hi guys. I would be glad to join your group because i want to learn deeper python but i am frustrated of isolation too. It would provide stimulation and encourage to study and will boost our desire to learn. So count me in! -- http://mail.python.org/mailman/listinfo/python-list

Re: how to export functions by name for ctype

2008-06-23 Thread rych
On 23 Jun, 10:32, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > rych <[EMAIL PROTECTED]> wrote: > >  I'm on Windows with VS2005 testing ctypes on a very simple dll > >  I create a test.dll project which exports a function fntest(). I don't > >  touch anything in the autogenerated source and build it

Re: listcomprehension, add elements?

2008-06-23 Thread Maric Michaud
Le Monday 23 June 2008 13:51:34 John Machin, vous avez écrit : > On Jun 23, 9:16 pm, Maric Michaud <[EMAIL PROTECTED]> wrote: > > Le Monday 23 June 2008 11:39:44 Boris Borcic, vous avez écrit : > > > John Machin wrote: > > > > Instead of sum(a + b for a, b in zip(foo, bar)) > > > > why not use sum(

Re: py2exe, PyQT, QtWebKit and jpeg problem

2008-06-23 Thread Carbonimax
On Jun 21, 12:21 am, David Boddie <[EMAIL PROTECTED]> wrote: > On Friday 20 June 2008 17:24, Phil Thompson wrote: > > > On Fri, 20 Jun 2008 08:04:57 -0700 (PDT),Carbonimax > > <[EMAIL PROTECTED]> wrote: > >> I have a problem with py2exe and QtWebKit : > >> I make a program with a QtWebKit view. > >

Re: py2exe, PyQT, QtWebKit and jpeg problem

2008-06-23 Thread Carbonimax
On Jun 21, 12:21 am, David Boddie <[EMAIL PROTECTED]> wrote: > On Friday 20 June 2008 17:24, Phil Thompson wrote: > > > On Fri, 20 Jun 2008 08:04:57 -0700 (PDT), Carbonimax > > <[EMAIL PROTECTED]> wrote: > >> I have a problem with py2exe and QtWebKit : > >> I make a program with a QtWebKit view. >

Re: -1/2

2008-06-23 Thread Lie
On Jun 23, 1:32 am, "Serve Lau" <[EMAIL PROTECTED]> wrote: > What is the expected result of -1/2 in python? Operator precedence: Both python 2 and 3 follows the same rule for operator precedence, see: http://www.ibiblio.org/g2swap/byteofpython/read/operator-precedence.html . In -1/2, unary negati

Distutils and unit test files

2008-06-23 Thread Joe Riopel
Hi, I am using Distutils to build and distribute some packages. I do write unit tests, but I am confused as to where to put them and how to run them prior to the package being installed (The modules being tested would not be in my sys.path). I would rather not put the test cases in the same files

Re: Sending arrays of a structure as an argument via ctypes

2008-06-23 Thread bearophileHUGS
Knut Saua Mathiesen: > Any help? :p My faster suggestion is to try ShedSkin, it may help you produce a fast enough extension. If ShedSkin doesn't compile it, its author (Mark) may be quite willing to help. bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Distutils and unit test files

2008-06-23 Thread Cédric Lucantis
Le Monday 23 June 2008 15:38:40 Joe Riopel, vous avez écrit : > Hi, > > I am using Distutils to build and distribute some packages. I do write > unit tests, but I am confused as to where to put them and how to run > them prior to the package being installed (The modules being tested > would not be

Re: Distutils and unit test files

2008-06-23 Thread Joe Riopel
On Mon, Jun 23, 2008 at 9:59 AM, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > Yes a checksuite should be kept separate from the 'real' code. You can run it > locally by setting the PYTHONPATH environment variable : > > PYTHONPATH=/path/to/your/modules python checksuite.py So I could also just appe

[ANN] Virtual Worlds Open Grid Protocols testing library in Python (pyogp)

2008-06-23 Thread Lawson English
A new open source project has been started by Linden Lab, makers of the Second Life™ virtual worlds, and the Second Life Architecture Working Group (AWG) to test LL's proposed virtual worlds Open Grid Protocols (OGP) that will allow any virtual world to support multi-world login, between-world

Re: Distutils and unit test files

2008-06-23 Thread Cédric Lucantis
> On Mon, Jun 23, 2008 at 9:59 AM, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > > Yes a checksuite should be kept separate from the 'real' code. You can > > run it locally by setting the PYTHONPATH environment variable : > > > > PYTHONPATH=/path/to/your/modules python checksuite.py > > So I could

PyOpenGL New Installation

2008-06-23 Thread Colin J. Williams
I have just installed PyOpenGL and get a series of warning messages: Best match: PyOpenGL 3.0.0b3 Downloading http://downloads.sourceforge.net/pyopengl/PyOpenGL-3.0.0b3.zip?modtime=1213363873&big_mirror=0 Processing PyOpenGL-3.0.0b3.zip Running PyOpenGL-3.0.0b3\setup.py -q bdist_egg --dist-di

String question

2008-06-23 Thread Andreu
I want to split a sentence and assign each word to a variable. In Ruby I can do it as: v1,v2,v3,v4,v5 = str1.split Which will be the Python equivalent ? Thanks. Andrew. -- http://mail.python.org/mailman/listinfo/python-list

Re: String question

2008-06-23 Thread Tim Golden
Andreu wrote: I want to split a sentence and assign each word to a variable. In Ruby I can do it as: v1,v2,v3,v4,v5 = str1.split Which will be the Python equivalent ? Thanks. That would be: str1 = "The quick brown fox jumps" v1, v2, v3, v4, v5 = str1.split () TJG -- http://mail.python.org/m

Re: String question

2008-06-23 Thread Andreu
Wow...about ten seconds to get a kind response Thanks Tim. Andrew. Tim Golden wrote: Andreu wrote: I want to split a sentence and assign each word to a variable. In Ruby I can do it as: v1,v2,v3,v4,v5 = str1.split Which will be the Python equivalent ? Thanks. That would be: str1 = "T

learning unit testing in python

2008-06-23 Thread Alex
Hi all. I'd like learn some basic unit testing with python. I red some articles about different testing framework like unittest or nose, but I'm a bit confused: what is the best choice? I'm not a professional developer (I'm a SEO) but I belive that unit testing is a good and pragmatic way to produ

Re: -1/2

2008-06-23 Thread Duncan Booth
Lie <[EMAIL PROTECTED]> wrote: > On Jun 23, 1:32 am, "Serve Lau" <[EMAIL PROTECTED]> wrote: >> What is the expected result of -1/2 in python? > > > Operator precedence: > Both python 2 and 3 follows the same rule for operator precedence, > see: > http://www.ibiblio.org/g2swap/byteofpython/read/o

Re: String question

2008-06-23 Thread cokofreedom
On Jun 23, 4:45 pm, Andreu <[EMAIL PROTECTED]> wrote: > I want to split a sentence and assign each word to a variable. > In Ruby I can do it as: > > v1,v2,v3,v4,v5 = str1.split > > Which will be the Python equivalent ? Thanks. > > Andrew. Well a straight copy would be... >>> example = "Hello, how

Re: Regular expression problem

2008-06-23 Thread MRAB
On Jun 22, 10:13 pm, abranches <[EMAIL PROTECTED]> wrote: > Hello everyone. > > I'm having a problem when extracting data from HTML with regular > expressions. > This is the source code: > > You are ready in the next style="display: inline;">12 span>M 48S > > And I need to get the remaining time. U

Terminating processes on Windows (handles and IDs)

2008-06-23 Thread geoffbache
Hi all, I've always wondered why os.kill isn't supported on Windows. I found a discussion somewhere from 2006 about this so it seems others have wanted it, but still nothing. So I have a half-baked solution involving calling "taskkill" on Windows Vista or "tskill" on Windows XP via the shell. I fe

Passing arguments to subclasses

2008-06-23 Thread John Dann
May I ask a simple newbie question, which I presume is true, but for which I can't readily find confirmation: Let's say I have a parent class with an __init__ method explicitly defined: class ParentClass(object): def __init__(self, keyword1, keyword2): etc and I subclass

Find class attributes creation order

2008-06-23 Thread Marcob
Let's see these simple classes: class base_foo() pass class foo(base_foo): a=1 b={} c="zz" I would like to find class foo attributes creation order. Using __metaclass__ is not of help because special method __new__ receive attrs as a dictionary and so

Re: Passing arguments to subclasses

2008-06-23 Thread Bruno Desthuilliers
John Dann a écrit : May I ask a simple newbie question, which I presume is true, but for which I can't readily find confirmation: Let's say I have a parent class with an __init__ method explicitly defined: class ParentClass(object): def __init__(self, keyword1, keyword2):

Re: Passing arguments to subclasses

2008-06-23 Thread Gary Herron
John Dann wrote: May I ask a simple newbie question, which I presume is true, but for which I can't readily find confirmation: Let's say I have a parent class with an __init__ method explicitly defined: class ParentClass(object): def __init__(self, keyword1, keyword2): e

Going from Tkinter to pyQT

2008-06-23 Thread Alex Bryan
I had a guy on this mailing list tell me that pyQT is much better than Tkinter, and after looking into it a bit I think he is right. However, I can't find much on it. I want to know if there are any good books or online tutorials that would be helpful. I doubt there is one, but if there is

Re: Find class attributes creation order

2008-06-23 Thread Cédric Lucantis
Le Monday 23 June 2008 17:53:07 Marcob, vous avez écrit : > Let's see these simple classes: > > class base_foo() > pass > > class foo(base_foo): > a=1 > b={} > c="zz" > > I would like to find class foo attributes creation order. > Using __metaclass__ is n

Using Python and MS-SQL Server

2008-06-23 Thread hwcowan
Hello, I have programmed before, but I am new to using Python. I am currently using the ArcGIS software which uses Python as its scripting language for automating tasks. The current script that I am working on requires pulling in some information from a Microsoft SQL Server. I was wondering if

IDE on the level of Eclipse or DEVc++?

2008-06-23 Thread cirfu
is there an IDE for python of the same quality as Eclipse or DEVC++? I am currently using the editor that coems iwth python and it is all fine but for bigger projects it would be nice to have some way to easier browse the projectfiles for example. -- http://mail.python.org/mailman/listinfo/python-

Re: Find class attributes creation order

2008-06-23 Thread Marcob
On 23 Giu, 18:08, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > Le Monday 23 June 2008 17:53:07 Marcob, vous avez écrit : > > > Let's see these simple classes: > > >     class base_foo() > >          pass > > >     class foo(base_foo): > >          a=1 > >          b={} > >          c="zz" > > > I w

Re: Find class attributes creation order

2008-06-23 Thread Michele Simionato
On Jun 23, 5:53 pm, Marcob <[EMAIL PROTECTED]> wrote: > Let's see these simple classes: > >     class base_foo() >          pass > >     class foo(base_foo): >          a=1 >          b={} >          c="zz" > > I would like to find class foo attributes creation order. > Using __metaclass__ is not o

Re: IDE on the level of Eclipse or DEVc++?

2008-06-23 Thread Andrii V. Mishkovskyi
2008/6/23 cirfu <[EMAIL PROTECTED]>: > is there an IDE for python of the same quality as Eclipse or DEVC++? > > I am currently using the editor that coems iwth python and it is all > fine but for bigger projects it would be nice to have some way to > easier browse the projectfiles for example. Act

Re: IDE on the level of Eclipse or DEVc++?

2008-06-23 Thread Tim Arnold
"cirfu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > is there an IDE for python of the same quality as Eclipse or DEVC++? > > I am currently using the editor that coems iwth python and it is all > fine but for bigger projects it would be nice to have some way to > easier browse th

Question: How do I format printing in python

2008-06-23 Thread joemacbusiness
Hi All, How do I format printed data in python? I could not find this in the Python Reference Manual: http://docs.python.org/ref/print.html Nor could I find it in Matloff's great tutorial: http://heather.cs.ucdavis.edu/~matloff/Python/PythonIntro.pdf For example, how do I turn this: 512 Jun 5 2

Re: Passing arguments to subclasses

2008-06-23 Thread John Dann
Thanks for the responses - they're much appreciated. And I understand the slight impatience with questions that could possibly be answered without recourse to a forum - I'm usually in the opposite position of fielding many newbie questions in a forum in a completely different field! But don't be t

Using Python to run SSH commands on a remote server

2008-06-23 Thread John Salerno
Generally speaking, what tools would I use to do this? Is there a built-in module for it? I looked at the telnetlib module, but the documentation wasn't really complete enough for me to get a good idea of it. Is Telnet and SSH even the same thing? Basically, I want to write a script that will a

Re: Going from Tkinter to pyQT

2008-06-23 Thread kib2
Alex Bryan a écrit : I had a guy on this mailing list tell me that pyQT is much better than Tkinter, and after looking into it a bit I think he is right. However, I can't find much on it. I want to know if there are any good books or online tutorials that would be helpful. I doubt there is one,

Re: Question: How do I format printing in python

2008-06-23 Thread Saul Spatz
format the strings: http://www.python.org/doc/2.1.3/lib/typesseq-strings.html [EMAIL PROTECTED] wrote: Hi All, How do I format printed data in python? I could not find this in the Python Reference Manual: http://docs.python.org/ref/print.html Nor could I find it in Matloff's great tutorial: h

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread Jean-Paul Calderone
On Mon, 23 Jun 2008 13:30:55 -0400, John Salerno <[EMAIL PROTECTED]> wrote: Generally speaking, what tools would I use to do this? Is there a built-in module for it? I looked at the telnetlib module, but the documentation wasn't really complete enough for me to get a good idea of it. Is Telnet an

Re: Question: How do I format printing in python

2008-06-23 Thread Mensanator
On Jun 23, 12:12 pm, [EMAIL PROTECTED] wrote: > Hi All, > > How do I format printed data in python? > I could not find this in the Python Reference > Manual:http://docs.python.org/ref/print.html > Nor could I find it in Matloff's great > tutorial:http://heather.cs.ucdavis.edu/~matloff/Python/Pyth

installed 3.0, rebind winprompt to 2.5?

2008-06-23 Thread cirfu
i installed python 3.0. now when im laucnhing from the dos prompt in win vista it searches in python3.0 i want to rebind it to 2.5, what do i need to change? -- http://mail.python.org/mailman/listinfo/python-list

Re: Question: How do I format printing in python

2008-06-23 Thread Mensanator
On Jun 23, 12:47 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 23, 12:12 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hi All, > > > How do I format printed data in python? > > I could not find this in the Python Reference > > Manual:http://docs.python.org/ref/print.html > > Nor could I find it

Re: IDE on the level of Eclipse or DEVc++?

2008-06-23 Thread cirfu
i downloaded the extension for eclipse, nice. any opinions of netbeans vs eclipse for python? -- http://mail.python.org/mailman/listinfo/python-list

socket error: connection refused?

2008-06-23 Thread cirfu
The first time i start the shell it always works. But often after closing it and restarting it I get: Two windows pops up and the shell, after clicking the windows the shell just closes by itself. socket error: connection refused IDLE's subprocess didnt make connection. im using python 2.5.1

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread Mark Wooding
John Salerno <[EMAIL PROTECTED]> wrote: > Generally speaking, what tools would I use to do this? Is there a built-in > module for it? There's paramiko (q.g.). I can't personally vouch for it, but it seems popular... It seems to depend on a separate crypto library. > Is Telnet and SSH even th

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread Jeffrey Froman
John Salerno wrote: > Generally speaking, what tools would I use to do this? Is there a built-in > module for it? I've had a very nice experience using the 3rd-party package "paramiko" for ssh communication. There's nothing in the standard library that I know of. > I looked at the telnetlib modu

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread John Salerno
"Jeffrey Froman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Be careful, this procedure sounds potential risky, security-wise ;-) I guess a blanket process might be a tad risky, but don't you want all CGI files to be executable by all? -- http://mail.python.org/mailman/listi

insertion sorts...

2008-06-23 Thread python_newbie
I don't know this list is the right place for newbie questions. I try to implement insertion sort in pyhton. At first code there is no problem. But the second one ( i code it in the same pattern i think ) doesn't work. Any ideas ? def in

Re: Using Python and MS-SQL Server

2008-06-23 Thread Tim Golden
[EMAIL PROTECTED] wrote: I have programmed before, but I am new to using Python. I am currently using the ArcGIS software which uses Python as its scripting language for automating tasks. The current script that I am working on requires pulling in some information from a Microsoft SQL Server.

Re: socket error: connection refused?

2008-06-23 Thread hall . jeff
It's a security conflict. You should be able to run it again and have it work. Our company's cisco does the same thing (even after we approve the app) -- http://mail.python.org/mailman/listinfo/python-list

Re: socket error: connection refused?

2008-06-23 Thread cirfu
On 23 Juni, 20:55, [EMAIL PROTECTED] wrote: > It's a security conflict. You should be able to run it again and have > it work. Our company's cisco does the same thing (even after we > approve the app) doesnt work but i found out i should open the task manager and kill all the python processes, the

Re: learning unit testing in python

2008-06-23 Thread Josh English
A good starting point is Mark Pilgrim's Dive Into Python. http://www.diveintopython.org/unit_testing/index.html Josh On Jun 23, 7:55 am, Alex <[EMAIL PROTECTED]> wrote: > Hi all. > > I'd like learn some basic unit testing with python. > I red some articles about different testing framework like u

Re: installed 3.0, rebind winprompt to 2.5?

2008-06-23 Thread Fuzzyman
On Jun 23, 6:53 pm, cirfu <[EMAIL PROTECTED]> wrote: > i installed python 3.0. now when im laucnhing from the dos prompt in > win vista it searches in python3.0 > > i want to rebind it to 2.5, what do i need to change? Reinstalling 2.5 should work. Michael Foord http://www.ironpythoninaction.com/

Re: learning unit testing in python

2008-06-23 Thread Josip
> Hi all. > > I'd like learn some basic unit testing with python. > I red some articles about different testing framework like unittest or > nose, but I'm a bit confused: what is the best choice? I'm not a > professional developer (I'm a SEO) but I belive that unit testing is a > good and pragmatic

Re: Fast and easy GUI prototyping with Python

2008-06-23 Thread Sebastian "lunar" Wiesner
Michael Torrie <[EMAIL PROTECTED]>: > Pete Kirkham wrote: >> 2008/6/21 Val-Amart <[EMAIL PROTECTED]>: >> >>> Use PyQt. You will gain great portability +all the functionality built >>> in qt. >>> You can try PyGTK also, though i wont recommend it. >>> >> Why would you not recommend it? I've been u

Re: An idiom for code generation with exec

2008-06-23 Thread Fuzzyman
On Jun 21, 7:52 am, Peter Otten <[EMAIL PROTECTED]> wrote: > eliben wrote: > > On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > >> eliben wrote: > >> > Additionally, I've found indentation to be a problem in such > >> > constructs. Is there a workable way to indent the code at the level

Re: installed 3.0, rebind winprompt to 2.5?

2008-06-23 Thread Terry Reedy
cirfu wrote: i installed python 3.0. now when im laucnhing from the dos prompt in win vista it searches in python3.0 i want to rebind it to 2.5, what do i need to change? When you install any Python on Windows with the .msi installer, there is a box something like [x] make this the defa

Re: Going from Tkinter to pyQT

2008-06-23 Thread Sebastian "lunar" Wiesner
Alex Bryan <[EMAIL PROTECTED]>: > I had a guy on this mailing list tell me that pyQT is much better than > Tkinter, and after looking into it a bit I think he is right. However, > I can't find much on it. I want to know if there are any good books or > online tutorials that would be helpful. I dou

tuple.index() and tuple.count()

2008-06-23 Thread hall . jeff
Before the inevitable response comes, let me assure you I've read through the posts from Guido about this. 7 years ago Guido clearly expressed a displeasure with allowing these methods for tuple. Let me lay out (in a fresh way) why I think we should reconsider. 1) It's counterintuitive to exclude

Re: py2exe, PyQT, QtWebKit and jpeg problem

2008-06-23 Thread David Boddie
On Monday 23 June 2008 15:02, Carbonimax wrote: > If I copy the dll in the dist directory, and I use QPluginLoader() and > load(), > it does work in the .py but it doesn't in .exe made with py2exe > > my code : > dll = QPluginLoader(path_to_dll) > res = dll.load() > > res == true in the .py > re

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread Grant Edwards
On 2008-06-23, John Salerno <[EMAIL PROTECTED]> wrote: > Generally speaking, what tools would I use to do this? In shell scripts I use expect to automate ssh stuff, so I would probably give pyexpect or pexpect a try: http://sourceforge.net/projects/pexpect/ > Is there a built-in module for it

Re: tuple.index() and tuple.count()

2008-06-23 Thread hall . jeff
never mind... a coworker pointed me to this http://bugs.python.org/issue1696444 apparently they're there in py3k... -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread Jeffrey Froman
John Salerno wrote: > I guess a blanket process might be a tad risky, but don't you want all CGI > files to be executable by all? Typically, I prefer CGI scripts to be executable only the owner. If the web server runs those scripts as a different user, then that user must also be permitted to exe

Re: 2to3 bug and question

2008-06-23 Thread Christian Heimes
Helmut Jarausch wrote: > Hi, > > is this the right group to ask / report problems with python3.0 ? While the general Python list is the right place to discuss bugs it's not sensible to report them here. Most Python core developers except Martin, me and a few more aren't reading this list at all.

Re: insertion sorts...

2008-06-23 Thread Terry Reedy
python_newbie wrote: I don't know this list is the right place for newbie questions. It is. We get them all the time. There is also a tutor mailing list. > I try to implement insertion sort in pyhton. python > At first code there is no problem. It is pretty straightforward. But the se

Re: 2to3 bug and question

2008-06-23 Thread Terry Reedy
Helmut Jarausch wrote: is this the right group to ask / report problems with python3.0 ? It is certainly a place. Given the number of bogus bug reports on bugs.python.org, asking here is often a good idea. In this and your other post, the problems you report look like probable bugs to me

Re: [2to3] Bug converting import

2008-06-23 Thread Christian Heimes
Helmut Jarausch wrote: > Now, when I invoke Master.py I get > > Traceback (most recent call last): > File "Master.py", line 2, in > from . import Slave > ValueError: Attempted relative import in non-package > > > thanks for looking into it, The cause of the bug is in fixes/fix_import.py pro

Re: Storing value with limits in object

2008-06-23 Thread Lie
On Jun 23, 1:24 am, "Josip" <[EMAIL PROTECTED]> wrote: > > Why not make it a function? > > > function assignLimited(value, vmin, vmax): > >     value = max(vmin, value) > >     value = min(vmax, value) > >     return value > > > a = assignLimited(7, 0, 10) > > > Seems like it solves your problem re

Re: Storing value with limits in object

2008-06-23 Thread Lie
On Jun 23, 1:24 am, "Josip" <[EMAIL PROTECTED]> wrote: > > Why not make it a function? > > > function assignLimited(value, vmin, vmax): > >     value = max(vmin, value) > >     value = min(vmax, value) > >     return value > > > a = assignLimited(7, 0, 10) > > > Seems like it solves your problem re

Re: insertion sorts...

2008-06-23 Thread Matimus
On Jun 23, 11:52 am, python_newbie <[EMAIL PROTECTED]> wrote: > I don't know this list is the right place for newbie questions. I try > to implement insertion sort in pyhton. At first code there is no > problem. But the second one ( i code it in the same pattern i think ) > doesn't work. Any ideas

Re: Using Python to run SSH commands on a remote server

2008-06-23 Thread John Salerno
Jeffrey Froman wrote: Also note that "all .py files on my web server" is not necessarily restricted to CGI scripts -- and therein lies the real gist of my cautionary note. Yeah, I realized that afterwards. Good point. I was assuming all my executable files would be CGI, but that's not a good

Re: learning unit testing in python

2008-06-23 Thread Alex
On 23 Giu, 21:26, "Josip" <[EMAIL PROTECTED]> wrote: > > Hi all. > > > I'd like learn some basic unit testing with python. > > I red some articles about different testing framework like unittest or > > nose, but I'm a bit confused: what is the best choice? I'm not a > > professional developer (I'm

Re: learning unit testing in python

2008-06-23 Thread BJörn Lindqvist
On Mon, Jun 23, 2008 at 2:55 PM, Alex <[EMAIL PROTECTED]> wrote: > Hi all. > > I'd like learn some basic unit testing with python. > I red some articles about different testing framework like unittest or > nose, but I'm a bit confused: what is the best choice? I'm not a > professional developer (I'

regexp: match only if previous matched?

2008-06-23 Thread cirfu
I need to extract prices froma html-document. [0-9]*\$ matches 112$ 45$ etc but also just a $. why that shouldnt really matter and it is unlikely anyway to appear a $sign with no price attahced to it I still want to prevent it. How do I avoid matching "$"? It has to be "nbr$". -- http://mail.pyth

Re: regexp: match only if previous matched?

2008-06-23 Thread Vlastimil Brom
2008/6/24, cirfu <[EMAIL PROTECTED]>: > > I need to extract prices froma html-document. > > [0-9]*\$ matches 112$ 45$ etc but also just a $. why that shouldnt > really matter and it is unlikely anyway to appear a $sign with no > price attahced to it I still want to prevent it. > > How do I avoid ma

Re: String question

2008-06-23 Thread Andreu
Yes, ... don't ask me why, but in fact v1,v2,v3 = str1.split() does not seem to work. My original problem was I forgot about the parenthesis as Tim point out. So I ended up converting to a list as in: v = str1.split() and accessing the elements using v[0] v[1] ect...it is working now. Thanks. A

Re: regexp: match only if previous matched?

2008-06-23 Thread Carl Banks
On Jun 23, 6:02 pm, cirfu <[EMAIL PROTECTED]> wrote: > I need to extract prices froma html-document. > > [0-9]*\$ matches 112$ 45$ etc but also just a $. why that shouldnt > really matter and it is unlikely anyway to appear a $sign with no > price attahced to it I still want to prevent it. > > How

Re: Storing value with limits in object

2008-06-23 Thread Lie
#!/usr/bin/env python ## VERSION 2 ## ## changelog: ## - Uses inheritance from _Limited ## - Added _LimitedLong and llong ## - limit choose between int, long, and float class _Limited(object): def setlimits(self, lim): ''' Set the limits and if value is not within limit, r

Re: Terminating processes on Windows (handles and IDs)

2008-06-23 Thread Val-Amart
On Jun 23, 6:33 pm, geoffbache <[EMAIL PROTECTED]> wrote: > Hi all, > > I've always wondered why os.kill isn't supported on Windows. I found a > discussion somewhere from 2006 about this so it seems others have > wanted it, but still nothing. So I have a half-baked solution > involving calling "tas

  1   2   >