Re: equivalent of py2exe in other os

2008-10-13 Thread Astan Chee
Hi, Thanks for all the links and information. It seems that I can't make linux binaries in windows of my python code. What I mean is that I am using windows to develop my python code, but I want it to run in linux and mac. So far py2exe,gui2exe,pyinstaller,freeze,etc seems to all create .exe i

Re: type-checking support in Python?

2008-10-13 Thread Kay Schluehr
On 6 Okt., 16:19, Joe Strout <[EMAIL PROTECTED]> wrote: > I'm just re-learning Python after nearly a decade away.  I've learned   > a good healthy paranoia about my code in that time, and so one thing   > I'd like to add to my Python habits is a way to both (a) make intended   > types clear to the

Re: Deviation from object-relational mapping (pySQLFace)

2008-10-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I have made a simple python module to handle SQL databases: https://fedorahosted.org/pySQLFace/wiki Its goal to separate relational database stuff (SQL) from algorythmic s/algorythmic/algorithmic !-) code (python). A SQLFace is a facade initialized with a configur

Re: File Upload Size

2008-10-13 Thread rodmc
On 13 Oct, 00:10, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Oct 12, 9:34 am, rodmc <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Is there a way to get the size of a file on a remote machine before it > > is uploaded? I would like to write some form of status counter which > > is updated as a fie i

Re: Deviation from object-relational mapping (pySQLFace)

2008-10-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I have made a simple python module to handle SQL databases: https://fedorahosted.org/pySQLFace/wiki Its goal to separate relational database stuff (SQL) from algorythmic code (python). A SQLFace is a facade initialized with a configuration file (XML). It provides calla

ANN: Mock 0.4.0 released

2008-10-13 Thread Fuzzyman
Mock 0.4.0 has just been released, the first release in about ten months (but worth the wait). Mock is a simple library for testing: specifically for mocking, stubbing and patching. * Mock Homepage & Documentation http://www.voidspace.org.uk/python/mock.html * mock.py (module only)

Re: Append a new value to dict

2008-10-13 Thread Mathias Frey
Pat wrote: I know it's not "fair" to compare language features, but it seems to me (a Python newbie) that appending a new key/value to a dict in Python is awfully cumbersome. In Python, this is the best code I could come up with for adding a new key, value to a dict mytable.setdefault( k, [

compile() and comments

2008-10-13 Thread Ed Leafe
I've noticed an odd behavior with compile() and code that does not contain a trailing newline: if the last line is a comment inside of any block, a syntax error is thrown, but if the last line is a non- comment Python statement, there is no error. Here's an example (using 2.5.1 on OS X) >

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Fuzzyman
On Oct 13, 10:11 am, Rafe <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working within an application (making a lot of wrappers), but the > application is not case sensitive. For example, Typing obj.name, > obj.Name, or even object.naMe is all fine (as far as the app is > concerned). The problem is, If

Re: File Upload Size

2008-10-13 Thread Diez B. Roggisch
rodmc wrote: > On 13 Oct, 00:10, Mike Driscoll <[EMAIL PROTECTED]> wrote: >> On Oct 12, 9:34 am, rodmc <[EMAIL PROTECTED]> wrote: >> >> > Hi, >> >> > Is there a way to get the size of a file on a remote machine before it >> > is uploaded? I would like to write some form of status counter which >>

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Diez B. Roggisch
Rafe wrote: > Hi, > > I'm working within an application (making a lot of wrappers), but the > application is not case sensitive. For example, Typing obj.name, > obj.Name, or even object.naMe is all fine (as far as the app is > concerned). The problem is, If someone makes a typo, they may get an >

Re: Append a new value to dict

2008-10-13 Thread Tim Chase
In Python, this is the best code I could come up with for adding a new key, value to a dict mytable.setdefault( k, [] ).append( v ) Naturally, right after writing my post I found that there is an easier way: table[ k ] = v Just to be clear...these do two VERY different things: >>> v1=42

Re: compile() and comments

2008-10-13 Thread Fuzzyman
Hello Ed, It is certainly an odd restriction, but the docs for compile [1] do explicitly state that the input must be newline terminated. When compiling multi-line statements, two caveats apply: line endings must be represented by a single newline character ('\n'), and the input must be termi

Re: Safe eval of insecure strings containing Python data structures?

2008-10-13 Thread lkcl
On Oct 9, 4:32 am, "James Mills" <[EMAIL PROTECTED]> wrote: > On Thu, Oct 9, 2008 at 2:26 PM, Warren DeLano <[EMAIL PROTECTED]> wrote: > > JSON rocks! Thanks everyone. > > Yes it does :) > > > Ben wrote: > > >>More generally, you should never execute (via eval, exec, or whatever) > >>*any* instruc

strip module bug

2008-10-13 Thread Poppy
I'm using versions 2.5.2 and 2.5.1 of python and have encountered a potential bug. Not sure if I'm misunderstanding the usage of the strip function but here's my example. var = "detail.xml" print var.strip(".xml") ### expect to see 'detail', but get 'detai' var = "overview.xml" print var.stri

Re: PyGUI as a standard GUI API for Python?

2008-10-13 Thread lkcl
On Oct 11, 11:17 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > lkcl wrote: > > I got the impression that there is currently no Windows binary > available. Correct? If not, perhaps someone trustworthy will someday > donate one. sorry, terry, you deleted a bit too much context :) so, assuming that

Re: strip module bug

2008-10-13 Thread Peter Otten
Poppy wrote: > > I'm using versions 2.5.2 and 2.5.1 of python and have encountered a > potential bug. Not sure if I'm misunderstanding the usage of the strip > function but here's my example. > > var = "detail.xml" > print var.strip(".xml") ### expect to see 'detail', but get 'detai' > var = "

Re: strip module bug

2008-10-13 Thread bearophileHUGS
Poppy: > var = "detail.xml" > print var.strip(".xml") ### expect to see 'detail', but get 'detai' > var = "overview.xml" > print var.strip(".xml") ### expect and get 'overview' Python V.2.5 is not flawless, but you can't find bugs so easily. I've found only two bugs in about three years of conti

Re: Append a new value to dict

2008-10-13 Thread bearophileHUGS
jdd: > foo = {'bar': 'baz'} > foo.update({'quux': 'blah'}) That creates a new dict, to throw it away. Don't do that. Use the standard and more readable syntax: > foo = {...} > foo['quux'] = 'blah' Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: strip module bug

2008-10-13 Thread Tim Chase
I'm using versions 2.5.2 and 2.5.1 of python and have encountered a potential bug. Not sure if I'm misunderstanding the usage of the strip function but here's my example. var = "detail.xml" print var.strip(".xml") ### expect to see 'detail', but get 'detai' var = "overview.xml" print var.stri

Re: strip module bug

2008-10-13 Thread Steven D'Aprano
On Mon, 13 Oct 2008 08:50:41 -0400, Poppy wrote: > I'm using versions 2.5.2 and 2.5.1 of python and have encountered a > potential bug. Not sure if I'm misunderstanding the usage of the strip > function but here's my example. > > var = "detail.xml" > print var.strip(".xml") ### expect to see 'd

Re: how to set the time of a directory?

2008-10-13 Thread oyster
so, let alone the 'bad' os.utime, is there any way to set the time of directory in windows within official python release? can ctypes be helpful, and how ? I am using totalcommander, which is programmer in delphi, but can set the time of a directory thanx 2008/10/12, [EMAIL PROTECTED] <[EMAIL PR

Re: Append a new value to dict

2008-10-13 Thread Marc 'BlackJack' Rintsch
On Mon, 13 Oct 2008 14:10:43 +0200, Mathias Frey wrote: > However incrementing a non-existing key throws an exception. So you > either have to use a workaround: > > >>> try: > ... counter['B'] += 1 > ... except KeyError: > ... counter['B'] = 1 > > Since this looks ugly somebody invented the

How to set cookie in client machine

2008-10-13 Thread Good Z
Hello, I want to set {name, value} cookie on client machine. My requirement is that when user comes to the website hosted on our server and login into his account, we would like to set user specific information in cookie that will be used later. Is there a generic program that may help me out

Re: how to start thread by group?

2008-10-13 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > En Tue, 07 Oct 2008 13:25:01 -0300, Terry Reedy <[EMAIL PROTECTED]> > escribió: > >> Lawrence D'Oliveiro wrote: >> >>> In message <[EMAIL PROTECTED]>, >>> Gabriel Genellina wrote: >>> Usually it's more efficient to create all the MAX_

Re: Append a new value to dict

2008-10-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : jdd: foo = {'bar': 'baz'} foo.update({'quux': 'blah'}) That creates a new dict, to throw it away. Just to make it clear for the easily confused ones (like me...): bearophile is talking about the dict passed as an argument to foo.update - not about the behaviour

Re: urllib equivalent for HTTP requests

2008-10-13 Thread lkcl
On Oct 8, 7:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > I would like to keep track of that but I realize that py does not have > > a JS engine. :( Anyone with ideas on how to track these items or yep. > What you can't do though is to get the requests that are issued > byJavascript

Question

2008-10-13 Thread Aditi Meher
Hello How to write code to store data into buffer using python? Please Reply -- http://mail.python.org/mailman/listinfo/python-list

IDLE on py3k

2008-10-13 Thread Jonathan Saxton
Being a bit of an old fart, I much prefer to do my text editing on a dark background. I find the paper-emulation paradigm an interesting idea but lacking in ergonomic value. With a bit of jiggering I was able to get the 2.5 version of IDLE to work the way I want, namely a black background with te

Re: compile() and comments

2008-10-13 Thread Ed Leafe
On Oct 13, 2008, at 8:35 AM, Fuzzyman wrote: It is certainly an odd restriction, but the docs for compile [1] do explicitly state that the input must be newline terminated. Understood; what I found odd was that if the last non-newline- terminated statement was *not* a comment, no error was

Re: strip module bug

2008-10-13 Thread Poppy
Thanks Steven and Tim, I understand the strip module a lot more today. Also for some reason I was deciding against using the path functions but now decided to try and thus implemented them. My script is reading one file and writing a new file with a different extension. So based on your suggest

Append a new value to dict

2008-10-13 Thread Pat
I know it's not "fair" to compare language features, but it seems to me (a Python newbie) that appending a new key/value to a dict in Python is awfully cumbersome. In Python, this is the best code I could come up with for adding a new key, value to a dict mytable.setdefault( k, [] ).append(

Re: Question

2008-10-13 Thread Diez B. Roggisch
Aditi Meher wrote: > Hello > > How to write code to store data into buffer using python? > > Please Reply See here: http://www.catb.org/~esr/faqs/smart-questions.html Diez -- http://mail.python.org/mailman/listinfo/python-list

Simultaneous LPT port access

2008-10-13 Thread Gatis
Hello! Question: are my (following) considerations about simultaneous lpt access true? Is "LPT server" needed? What could be possible architecture of such component? === I'm writing program "alarm" that reads LPT input pin (activated by motion sensor). If motion is sensed, prog

Re: parsing javascript

2008-10-13 Thread lkcl
On Oct 12, 2:28 pm, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > On Oct 12, 2008, at 5:25 AM, S.SelvamSivawrote: > > > I have to do a parsing on webpagesand fetch urls.My problem is ,many > > urls i > > need to parse are dynamically loaded usingjavascriptfunction > > (onload()).How to fetch those

Re: Append a new value to dict

2008-10-13 Thread Kirk Strauser
At 2008-10-13T13:14:15Z, [EMAIL PROTECTED] writes: > jdd: >> foo = {'bar': 'baz'} >> foo.update({'quux': 'blah'}) > > That creates a new dict, to throw it away. Don't do that. I use that if I'm changing many values at once, eg: foo.update({ 'quux': 'blah', 'baz' : 'bearophile

Re: Where/how to propose an addition to a standard module?

2008-10-13 Thread pruebauno
On Oct 10, 3:10 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > I would like to propose a new method for the string.Template class. > What's the proper procedure for doing this? I've joined the python- > ideas list, but that seems to be only for proposed language changes, > and my idea doesn't require

Re: Append a new value to dict

2008-10-13 Thread pruebauno
On Oct 13, 9:41 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 13 Oct 2008 14:10:43 +0200, Mathias Frey wrote: > > However incrementing a non-existing key throws an exception. So you > > either have to use a workaround: > > > >>> try: > > ... counter['B'] += 1 > > ... except K

Re: Append a new value to dict

2008-10-13 Thread Pat
Pat wrote: I know it's not "fair" to compare language features, but it seems to me (a Python newbie) that appending a new key/value to a dict in Python is awfully cumbersome. In Python, this is the best code I could come up with for adding a new key, value to a dict mytable.setdefault( k, [

docpicture

2008-10-13 Thread bearophileHUGS
In Python code that processes some geometrical data I want to explain what each variable like w1, w2, h2, h3, etc, means in the geometrical objects. In such situation I don't use longer and more clear variable names because in geometry I'm used to use short vertex/line/length names, finding them mo

Re: Append a new value to dict

2008-10-13 Thread paul
Pat schrieb: I know it's not "fair" to compare language features, but it seems to me (a Python newbie) that appending a new key/value to a dict in Python is awfully cumbersome. In Python, this is the best code I could come up with for adding a new key, value to a dict mytable.setdefault( k,

Making class attributes non-case-sensitive?

2008-10-13 Thread Rafe
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as the app is concerned). The problem is, If someone makes a typo, they may get an unexpected error due accid

Re: class point in python

2008-10-13 Thread Almar Klein
I made a class to store sets of points a few months ago.I don't consider it finished enough to release it somewhere, but I'm happy to share it if you're interested. Send me an e-mail if you are. Almar 2008/10/12 [EMAIL PROTECTED] <[EMAIL PROTECTED]> > i am looking for a python implementation of

Suggestion for the PythonDevelopment for next version

2008-10-13 Thread azrael
You know, sometimes it annoys me to write a for loop in Python. If we use a list a=[1,2,3,4], and want to loop through it, Python offers the next option >>>for i in a: >>> print i >>> 1 2 3 4 I love this. So simple and smooth. But what happens if we need also the position of an object in a list.

Re: subprocess.Popen(..., cwd=...) and Makefile $(PWD) don't play nice

2008-10-13 Thread Miki
> The problem is, he is not printing the name of the current working > directory; he is printing the value of the variable $PWD.  That is > likely set from the environment by the shell he started the Python > program from, but Python does *not* update to reflect changes to > the working directory.

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread Diez B. Roggisch
azrael wrote: > You know, sometimes it annoys me to write a for loop in Python. If we > use a list a=[1,2,3,4], and want to loop through it, Python offers the > next option for i in a: print i > 1 > 2 > 3 > 4 > > I love this. So simple and smooth. But what happens if we need also >

Module or script for backup

2008-10-13 Thread dudeja . rajat
Hi, Is there a module or script already written for creating backup of files ? -- Regrads, Rajat -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread Jean-Paul Calderone
On Mon, 13 Oct 2008 08:56:34 -0700 (PDT), azrael <[EMAIL PROTECTED]> wrote: You know, sometimes it annoys me to write a for loop in Python. If we use a list a=[1,2,3,4], and want to loop through it, Python offers the next option for i in a: print i 1 2 3 4 I love this. So simple and smooth.

Re: Suggestion for s/the PythonDevelopment for next version/azrael

2008-10-13 Thread Bruno Desthuilliers
azrael a écrit : You know, sometimes it annoys me to write a for loop in Python. If we use a list a=[1,2,3,4], and want to loop through it, Python offers the next option for i in a: print i 1 2 3 4 I love this. So simple and smooth. But what happens if we need also the position of an object

Re: PyGUI as a standard GUI API for Python?

2008-10-13 Thread Propad
> the bottom line is: if you want a windows version of pywebkitgtk, i'm > happy to assist and advise anyone of the process- it should be quite > straightforward _if_ you have MSVC and follow the standard procedure, > but i'm not about to spend my own time and effort on providing a win32 > port usin

Re: Split entries from LDAP

2008-10-13 Thread Michael Ströder
Lars wrote: > I'm trying > to create a script that creates a variable list (just a txt file to be > included in bash scripts) with hosts from LDAP. What exactly do you want to do? I'd recommend against passing a custom text format around. Use either LDIF or CSV with decent modules. > The file wil

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread azrael
I know that. enumerate is a great function. But this way it always adds some complexity. I think that it is more better to give a man a better tool then to let him play with a not so good one. People like Python because of his simplicity in comparison with c++. Maybe People would like him even more

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread Diez B. Roggisch
azrael wrote: > I know that. enumerate is a great function. But this way it always > adds some complexity. I think that it is more better to give a man a > better tool then to let him play with a not so good one. People like > Python because of his simplicity in comparison with c++. Maybe People >

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Peter Pearson
On Mon, 13 Oct 2008 04:08:03 -0700 (PDT), Rafe <[EMAIL PROTECTED]> wrote: > Just so I don't hijack my own thread, the issue is 'how to wrap an > object which is not case sensitive'. > > The reason I am stuck dealing with this?... The application's API is > accessed through COM, [snip] > XSI allows

Re: Python on JavaScript VM's (such as V8)?

2008-10-13 Thread lkcl
On Oct 7, 10:15 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Oct 2, 1:06 pm,lkcl<[EMAIL PROTECTED]> wrote: > > > On Sep 3, 10:02 pm, [EMAIL PROTECTED] wrote: > > > > Berco Beute: > > > > > I wonder what it would take to implement Python inJavaScriptso it > > > it's been done. http://pyjamas.sf.ne

Re: PyGUI as a standard GUI API for Python?

2008-10-13 Thread lkcl
> >> You can remove layouts from layouts with the QLayout.removeItem() method. > > yes... it didn't work. a layout within a layout - i think it was a > > QHorizontalLayout within a QGridLayout - didn't want to be removed. > > it's probably a bug. > Was it detached from the layout, but still vis

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread Kirk Strauser
At 2008-10-13T16:11:26Z, azrael <[EMAIL PROTECTED]> writes: > I know that. enumerate is a great function. But this way it always > adds some complexity. I think that it is more better to give a man a > better tool then to let him play with a not so good one. People like > Python because of his sim

Re: Question

2008-10-13 Thread Steven D'Aprano
On Mon, 13 Oct 2008 19:45:46 +0530, Aditi Meher wrote: > Hello > > How to write code to store data into buffer using python? > > Please Reply With a keyboard. Although if you're really keen, you could use a magnetized needle and edit the sectors on the hard disk directly. -- Steven -- http

Re: PIL on windows XP x64 (64-bit)?

2008-10-13 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Berco Beute wrote: > Has anybody here got PIL (the Image lib) working on Windows XP x64 (64- > bit)? There is no version available for that platform from > pythonware.com. Shouldn't your distro maintainers have it in their repositories? -- http://mail.python.org/ma

Question

2008-10-13 Thread Aditi Meher
Hello How to write code to store data into buffer using python? Please reply. -- http://mail.python.org/mailman/listinfo/python-list

RegExp: "wontmatch"-function

2008-10-13 Thread pjacobi . de
Dear All, I'm looking for a function which, given a regexp re and and a string str, returns whether re won't match any string starting with str. (so it would always return False if str is "" or if str itself matches re -- but that are only the easy cases). I have the vague feeling that the inter

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Diez B. Roggisch
Rafe wrote: > Just so I don't hijack my own thread, the issue is 'how to wrap an > object which is not case sensitive'. > > The reason I am stuck dealing with this?... The application's API is > accessed through COM, so I don't know if I can do anything but react > to what I get. The API was writ

Getting windows error while making a backup

2008-10-13 Thread dudeja . rajat
Hi, I've this backup script that having some problems. Please some one suggest what is that I'm missing in it. This backup script deletes the previous backups and then create a new backup by simply renaming the original folder to backup folder and creates a new folder. The folder contains many fi

SIGALRM problem

2008-10-13 Thread Paul Rubin
I'm trying to run a command on a remote host, something like: result = os.popen('ssh otherhost mycommand').read() It is possible that the other host is down, in which case the ssh command hangs, so I want my script to time out if this happens: def timeout(*x): raise IOError, 'timeout

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Rafe
Just so I don't hijack my own thread, the issue is 'how to wrap an object which is not case sensitive'. The reason I am stuck dealing with this?... The application's API is accessed through COM, so I don't know if I can do anything but react to what I get. The API was written while the app (Softim

Re: docpicture

2008-10-13 Thread Steven D'Aprano
On Mon, 13 Oct 2008 08:34:03 -0700, bearophileHUGS wrote: > So in this situation I have sometimes created a quite small image (1 > bit/pixel) that encoded in png image format may require just few hundred > bytes. With Python I encode is binary data string in base64, and I paste > that as a string

Re: Append a new value to dict

2008-10-13 Thread jdd
On Oct 13, 7:21 am, Pat <[EMAIL PROTECTED]> wrote: > Is there a better/easier way to code this in Python than the > obtuse/arcane setdefault code? foo = {'bar': 'baz'} foo.update({'quux': 'blah'}) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python syntax question

2008-10-13 Thread Daniel
On Oct 8, 1:19 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > Sir, > > I was just wondering that the module that you are utilizing (Rpyc) is a > remote process call module for python?  Is this what you are developing with > at this time? > > Thanks, > > David Blubaugh > > -Original Mes

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread azrael
case closed -- http://mail.python.org/mailman/listinfo/python-list

Re: Making class attributes non-case-sensitive?

2008-10-13 Thread Matimus
On Oct 13, 4:08 am, Rafe <[EMAIL PROTECTED]> wrote: > Just so I don't hijack my own thread, the issue is 'how to wrap an > object which is not case sensitive'. > > The reason I am stuck dealing with this?... The application's API is > accessed through COM, so I don't know if I can do anything but r

Re: Question

2008-10-13 Thread Chris Rebert
To be a bit less sarcastic than the other replies, your question is *much* *much* too vague to be answered. Unless you give us more specific information and ask a more precise question, it's impossible help you. See the link someone already replied with for some good advice on how to do that. Also

Re: SIGALRM problem

2008-10-13 Thread Mike Driscoll
On Oct 13, 11:45 am, Paul Rubin wrote: > I'm trying to run a command on a remote host, something like: > >    result = os.popen('ssh otherhost mycommand').read() > > It is possible that the other host is down, in which case the ssh > command hangs, so I want my script to

Re: docpicture

2008-10-13 Thread skip
Steven> I can't imagine Python having direct syntactic support for it, Steven> but I don't see any reason why the standard library couldn't Steven> some day grow a "docpicture" module, complete with a tiny (?) Steven> Tkinter app to display the diagram when requested. Heck, if you

Re: Question

2008-10-13 Thread Bruno Desthuilliers
Aditi Meher a écrit : Hello How to write code to store data into buffer using python? A text/code editor might be useful. -- http://mail.python.org/mailman/listinfo/python-list

Re: docpicture

2008-10-13 Thread Benjamin Kaplan
On Mon, Oct 13, 2008 at 1:43 PM, <[EMAIL PROTECTED]> wrote: > >Steven> I can't imagine Python having direct syntactic support for it, >Steven> but I don't see any reason why the standard library couldn't >Steven> some day grow a "docpicture" module, complete with a tiny (?) >Steven

Re: Safe eval of insecure strings containing Python data structures?

2008-10-13 Thread George Sakkis
On Oct 13, 8:36 am, lkcl <[EMAIL PROTECTED]> wrote: > On Oct 9, 4:32 am, "James Mills" <[EMAIL PROTECTED]> wrote: > > > On Thu, Oct 9, 2008 at 2:26 PM, Warren DeLano <[EMAIL PROTECTED]> wrote: > > > JSON rocks! Thanks everyone. > > > Yes it does :) > > > > Ben wrote: > > > >>More generally, you sh

Re: RegExp: "wontmatch"-function

2008-10-13 Thread Kirk Strauser
At 2008-10-13T16:40:07Z, [EMAIL PROTECTED] writes: def nomatch(value): return not(value == '' or pattern.match(value)) -- Kirk Strauser The Day Companies -- http://mail.python.org/mailman/listinfo/python-list

Re: how to set the time of a directory?

2008-10-13 Thread MRAB
On Oct 13, 2:40 pm, oyster <[EMAIL PROTECTED]> wrote: > so, let alone the 'bad' os.utime, is there any way to set the time of > directory in windows within official python release? can ctypes be > helpful, and how ? > This appears to work: import pywintypes import win32file import time def set_di

Re: SIGALRM problem

2008-10-13 Thread Paul Rubin
Mike Driscoll <[EMAIL PROTECTED]> writes: > http://mail.python.org/pipermail/python-list/2003-August/217530.html > It's old, but it looks ok... Thanks. Maybe I did a dumb thing by overloading IOError and os.popen is actually catching that exception for purposes of its own. I'll try making a new

Re: Upgrading from 2.5 to 2.6

2008-10-13 Thread Matimus
> Python 2.5 and 2.6 can coexist, so there isn't any need for some > kind of upgrade procedure. Installing 2.6 will not affect your > 2.5 installation. That isn't entirely true. In Windows, python files bound to a particular version of python in the registry. So, for example, if you double click o

Re: Mail reader & spam

2008-10-13 Thread Cousin Stanley
> I'm hesitating to change news readers > You might try the python-based XPN news client at http://xpn.altervista.org/index-en.html I've used it for the past few years and like it very much -- Stanley C. Kitching Human Being Phoenix, Arizona -- htt

Re: please solve

2008-10-13 Thread harijay
On Oct 12, 12:15 pm, Raymond Cote <[EMAIL PROTECTED]> wrote: > shweta mani wrote: > > hi folks, > > i have been assigned a project on Python. i need to execute a remote > > shell script file from a windows machine through SSH twisted or > > paramiko. if it is a normal file then directly with the co

Sending multi-part MIME package via HTTP-POST

2008-10-13 Thread [EMAIL PROTECTED]
This has got me somewhat stumped, so I'll throw it up here in hopes that someone has ran into this before. I'm trying to send a MIME package to Esko Backstage. I'm a bit confused as to how to send this to the server in a manner that it'll be able to get and de-code the MIME package in a valid way.

gmpy and counting None

2008-10-13 Thread mmanns
Hi, I just stumbled upon the following issue (I am running Debian): $ python Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> [2, None].count(None) 1 >>> from gmpy import mpz >>> [mpz(2), None].count

Transformation with ``parser`` ast

2008-10-13 Thread Malthe Borch
(Note: repost from python-dev) The ``compiler.ast`` module makes parsing Python source-code and AST manipulation relatively painless and it's straight-forward to implement a transformer class. However, I find that the ``compiler.pycodegen`` module imposes a hard limit on the length of functi

Re: how to start thread by group?

2008-10-13 Thread [EMAIL PROTECTED]
On Oct 13, 6:54 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message <[EMAIL PROTECTED]>, Gabriel > > > > Genellina wrote: > > En Tue, 07 Oct 2008 13:25:01 -0300, Terry Reedy <[EMAIL PROTECTED]> > > escribió: > > >> Lawrence D'Oliveiro wrote: > > >>> In message <[

Re: docpicture

2008-10-13 Thread skip
Benjamin> So, the IDEs will support it. what happens when you run the Benjamin> interpreter from the command line? Probably get ignored. What else would you propose? It's not executable code anyway, just a special comment or portion of a docstring. S -- http://mail.python.org/mailman/l

Re: Quality control in open source development

2008-10-13 Thread Steve Holden
Dave wrote: > With the open source licenses that allow redistribution of modified > code, how do you keep someone unaffiliated with the Python community > from creating his or her own version of python, and declaring it to be > Python 2.6, or maybe Python 2.7 without any approval of anyone at the >

Re: docpicture

2008-10-13 Thread Benjamin Kaplan
On Mon, Oct 13, 2008 at 2:48 PM, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 13, 2008, at 12:09 PM, Benjamin Kaplan wrote: > > Heck, if you go to the point of including a docpicture module, might as >> well >> just support the feature in IDLE... Other IDEs would probably pick up the >> featur

Re: docpicture

2008-10-13 Thread Joe Strout
On Oct 13, 2008, at 2:43 PM, Benjamin Kaplan wrote: I mean what happens when you type help() into the interactive console on the command line? You will see the docstrings, and there will be a whole bunch of random hex characters there. Good point. It might be better put in a specially-tag

Re: PyGUI as a standard GUI API for Python?

2008-10-13 Thread Terry Reedy
lkcl wrote: On Oct 11, 11:17 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: lkcl wrote: I got the impression that there is currently no Windows binary available. Correct? If not, perhaps someone trustworthy will someday donate one. sorry, terry, you deleted a bit too much context :) I was ref

Re: PyGUI as a standard GUI API for Python?

2008-10-13 Thread Terry Reedy
Propad wrote: the bottom line is: if you want a windows version of pywebkitgtk, i'm happy to assist and advise anyone of the process- it should be quite straightforward _if_ you have MSVC and follow the standard procedure, but i'm not about to spend my own time and effort on providing a win32 por

Re: gmpy and counting None

2008-10-13 Thread Mensanator
On Oct 13, 2:43 pm, <[EMAIL PROTECTED]> wrote: > Hi, > > I just stumbled upon the following issue (I am running Debian): > > $ python > Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13) > [GCC 4.3.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> [2, > None].c

Selecting random elements from a list.

2008-10-13 Thread aditya shukla
Hello folks, i have a list say list1=[a,b,c,...z] ie 26 elements i have to take 5 elements from it randomly and save in another list.Please explain how to do this? Aditya -- http://mail.python.org/mailman/listinfo/python-list

documentation: what is "::="?

2008-10-13 Thread Anita Kean
Hello I just downloaded the new python2.6 documentation, full of hopes it would solve some basic mysteries for me. I'm new to python, so please forgive my ignorance. I've two questions. 1) Everywhere in the old and new documentation, the string of characters "::=" is used in "explaining" things

Re: docpicture

2008-10-13 Thread skip
>> Nothing. It's just a doc string containing a bunch of hex codes. Doc >> strings are ignored by the interpreter (AIUI). Benjamin> I mean what happens when you type help() into the interactive Benjamin> console on the command line? You will see the docstrings, and Benjamin>

Re: Selecting random elements from a list.

2008-10-13 Thread Benjamin Kaplan
On Mon, Oct 13, 2008 at 5:29 PM, aditya shukla <[EMAIL PROTECTED]>wrote: > Hello folks, > > i have a list say list1=[a,b,c,...z] ie 26 elements i have to take 5 > elements from it randomly and save in another list.Please explain how to do > this? > > > Aditya > http://docs.python.org/library/ran

Re: documentation: what is "::="?

2008-10-13 Thread Diez B. Roggisch
Anita Kean schrieb: Hello I just downloaded the new python2.6 documentation, full of hopes it would solve some basic mysteries for me. I'm new to python, so please forgive my ignorance. I've two questions. 1) Everywhere in the old and new documentation, the string of characters "::=" is used i

Re: Selecting random elements from a list.

2008-10-13 Thread Timothy Grant
On Mon, Oct 13, 2008 at 2:29 PM, aditya shukla <[EMAIL PROTECTED]> wrote: > Hello folks, > > i have a list say list1=[a,b,c,...z] ie 26 elements i have to take 5 > elements from it randomly and save in another list.Please explain how to do > this? > > > Aditya > > -- > http://mail.python.org/mailma

ANN: PySmell v0.6 released

2008-10-13 Thread Orestis Markou
I'm happy to announce PySmell v0.6, an autocompletion library for Python and Vim (other editors pending). New features include: * Import statement completion * Support for multiple TAGS files (that means external libraries) * Support for analysing Python 2.4-2.5 stdlib. Plus many bugfixes

  1   2   >