Re: Python web framework choice

2008-08-12 Thread david . lyon
Quoting Mahdi <[EMAIL PROTECTED]>: I need to develop a medium-sized database web application for my company. Given that: I don't know much about building web UI(s) but i have fair knowledge about HTML & My schedule is tight. a recommendation is v v v appreciated. I'm in the same boat a f

Re: Random Problems

2008-08-12 Thread Hrvoje Niksic
"Lanny" <[EMAIL PROTECTED]> writes: > Well the othe day I was making a program to make a list of all the > songs in certian directorys but I got a problem, only one of the > directorys was added to the list. Heres my code: > > import random > import os > import glob If you need recursive traversa

Re: os.system question

2008-08-12 Thread Asun Friere
On Aug 13, 8:58 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Mon, 11 Aug 2008 19:28:13 -0700, Asun Friere wrote: > > > but if I was in a hurry to find out who I was I would be tempted still > > to use the deprecated "os.popen('whoami').read()". > > Is it really deprecated?

Re: Python as a Testing Language - TTCN-3 Comparison

2008-08-12 Thread Kay Schluehr
Bernard Stepien wrote: > 1. TTCN-3 is an international standard that comes among other > things with very precise semantics, thus everyone in the world using it > will talk exactly the same language. This also reduces considerably the > amount of documentation you need for the next of kin af

Re: Checking a file's time stamp -- followup

2008-08-12 Thread Rob Weir
On 13 Aug 2008, Virgil Stokes wrote: > Is it possible to change the time stamp of a file (Win2K platform)? If > yes, how? os.utime, http://docs.python.org/lib/os-file-dir.html. -- -rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Downloading and Installing gasp

2008-08-12 Thread Rob Weir
On 13 Aug 2008, Cyprian Kumwaka wrote: > I am a beginner in Python. Please tell me how to go about in > downloading and installing the module gasp.I am using Python 2.5.2. What OS are you using? Do you have PyGame installed already? -- -rob -- http://mail.python.org/mailman/listinfo/python-lis

Re: Checking a file's time stamp -- followup

2008-08-12 Thread Virgil Stokes
Christian Heimes wrote: William Purcell wrote: Hi all, I am wanting to check to see the last time a file was edited. For example, I have a directory containing two text files, file1.txt and file2.txt. I want to be able to process these files but only if they have been edited since the last

gasp

2008-08-12 Thread kumwaka
I am a beginner in Python. Please tell me how to go about in downloading and installing the module gasp.I am using Python 2.5.2. -- http://mail.python.org/mailman/listinfo/python-list

Downloading and Installing gasp

2008-08-12 Thread Cyprian Kumwaka
I am a beginner in Python. Please tell me how to go about in downloading and installing the module gasp.I am using Python 2.5.2. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python web framework choice

2008-08-12 Thread Kay Schluehr
On 13 Aug., 07:08, Mahdi <[EMAIL PROTECTED]> wrote: > Guys! > > I need to develop a medium-sized database web application for my > company. Given that: > I don't know much about building web UI(s) but i have fair knowledge > about HTML & My schedule is tight. > > a recommendation is v v v appreci

Re: Python as a Testing Language - TTCN-3 Comparison

2008-08-12 Thread Terry Reedy
Bernard Stepien wrote: Finally, no matter what you are doing (python test framework, etc…) there are two important things with TTCN-3 that you don’t have with Python: 1. TTCN-3 is an international standard that comes among other things with very precise semantics, thus everyone in the

Python web framework choice

2008-08-12 Thread Mahdi
Guys! I need to develop a medium-sized database web application for my company. Given that: I don't know much about building web UI(s) but i have fair knowledge about HTML & My schedule is tight. a recommendation is v v v appreciated. thanks! -- http://mail.python.org/mailman/listinfo/pyt

Re: newb loop problem

2008-08-12 Thread Dave
On Aug 13, 12:35 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Dave wrote: > > Hey there, having a bit of problem iterating through lists before i go > > on any further, here is > > a snip of the script. > > -- > > d = "a1 b1 c1 d1 e1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 a4 b4 c4 d4 e4 a5 b5 > > c5 d5 e5"

Re: Random Problems

2008-08-12 Thread Lanny
> 1) You need to either use raw string for your pathnames or use forward > slashes. > This is because backslash is an escape character to Python and if you get > any legal escaped sequence (like \n, \t, etc) it won't work as expected. > > songs = glob.glob(r'C:\Documents and Settings\Admin\My >

Re: Random Problems

2008-08-12 Thread Larry Bates
Lanny wrote: Well the othe day I was making a program to make a list of all the songs in certian directorys but I got a problem, only one of the directorys was added to the list. Heres my code: import random import os import glob songs = glob.glob('C:\Documents and Settings\Admin\My Document

Re: newb loop problem

2008-08-12 Thread Larry Bates
Dave wrote: Hey there, having a bit of problem iterating through lists before i go on any further, here is a snip of the script. -- d = "a1 b1 c1 d1 e1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 a4 b4 c4 d4 e4 a5 b5 c5 d5 e5" inLst = d.split() hitLst = [] hitNum = 0 stopCnt = 6 + hitNum for i in range(hitNu

Random Problems

2008-08-12 Thread Lanny
Well the othe day I was making a program to make a list of all the songs in certian directorys but I got a problem, only one of the directorys was added to the list. Heres my code: import random import os import glob songs = glob.glob('C:\Documents and Settings\Admin\My Documents\LimeWire\Save

Re: formatting number of bytes to human readable format

2008-08-12 Thread [EMAIL PROTECTED]
On Tue, Aug 12, 2008 at 7:31 PM, Rob Weir <[EMAIL PROTECTED]> wrote: > On 13 Aug 2008, rkmr wrote: > > is there any library / function that prints number of bytes in human > > readable format? > > for example > > > > a=XX(1048576) > > print a > > > > should output > > 1 MB > > http://mail.python.

newb loop problem

2008-08-12 Thread Dave
Hey there, having a bit of problem iterating through lists before i go on any further, here is a snip of the script. -- d = "a1 b1 c1 d1 e1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 a4 b4 c4 d4 e4 a5 b5 c5 d5 e5" inLst = d.split() hitLst = [] hitNum = 0 stopCnt = 6 + hitNum for i in range(hitNum,len(inLst),

Wackness

2008-08-12 Thread Brian Hawthorne
p1 = property(lambda self: self.__x) class Foo (object): p1 = p1 p2 = property(lambda self: self.__x) def __init__(self): self.__x = 10 f = Foo() print f.p2 print f.p1 #--- Expecting to see: 10 10 ? Think again! Ouch,

Re: formatting number of bytes to human readable format

2008-08-12 Thread Rob Weir
On 13 Aug 2008, rkmr wrote: > is there any library / function that prints number of bytes in human > readable format? > for example > > a=XX(1048576) > print a > > should output > 1 MB http://mail.python.org/pipermail/python-list/1999-December/018519.html is a good start - just need to change the

Re: Looking out a module for Subversion

2008-08-12 Thread Patrol Sun
Sorry for my wrong information. But the Eclipse is very huge, Ulipad is very small. http://code.google.com/p/ulipad/downloads/list 2008/8/13 Fabio Zadrozny <[EMAIL PROTECTED]> > > On Tue, Aug 12, 2008 at 6:50 AM, Patrol Sun <[EMAIL PROTECTED]> wrote: > >> Eclipse with PyDev extension cannot debug

Re: Manipulating Python Source

2008-08-12 Thread Patrol Sun
This idea recalls Spring's Bean binding to me. Good idea. Is there similar thing? 2008/8/12 Wilson <[EMAIL PROTECTED]> > Hi, > > I'm wondering if there are any tools available or simple methods for > taking a python source file and parsing into some hierarchical format, > like the ConfigParser. I

formatting number of bytes to human readable format

2008-08-12 Thread [EMAIL PROTECTED]
is there any library / function that prints number of bytes in human readable format? for example a=XX(1048576) print a should output 1 MB thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Free software and video codecs

2008-08-12 Thread Ben Finney
[EMAIL PROTECTED] writes: > Do you have a recommendation for how I can convert the quicktime and > flash movies to ogg? That would produce an inferior result, since the Quicktime and Flash movies have (I assume) already been converted to a lossy codec http://en.wikipedia.org/wiki/Lossy_compressio

Re: run a .py script with cmd line args

2008-08-12 Thread Gabriel Genellina
En Tue, 12 Aug 2008 16:34:13 -0300, Mike Driscoll <[EMAIL PROTECTED]> escribió: On Aug 12, 2:20 pm, r <[EMAIL PROTECTED]> wrote: i have a python text editor program(script) that i would like to run when a user clicks on .txt files. how do i run my script from windows, and send the filename to

Re: The Importance of Terminology's Quality

2008-08-12 Thread Arne Vajhøj
Robert Maas, http://tinyurl.com/uh3t wrote: John W Kennedy <[EMAIL PROTECTED]> wrote: JWK> Into the 60s, indeed, there were still machines being made JWK> that had no instruction comparable to the mainframe BASx/BALx JWK> family, or to Intel's CALL. You had to do a subprogram call by JWK> first o

Re: passing a variable argument list to a function

2008-08-12 Thread Christian Heimes
Scott wrote: I suspect there's a simple bit of syntax that I'm missing -- can anyone give me a hand? Yeah. It's so easy and obvious that you are going to bang your head against the wall. :) The single star does not only collect all arguments in a function definition. It also expands a sequenc

Re: Problems returning data from embedded Python

2008-08-12 Thread Cromulent
On 2008-08-13 00:50:11 +0100, "Gabriel Genellina" <[EMAIL PROTECTED]> said: En Tue, 12 Aug 2008 19:48:54 -0300, Cromulent <[EMAIL PROTECTED]> escribi�: On 2008-08-12 05:37:53 +0100, "Gabriel Genellina" <[EMAIL PROTECTED]> said: Yes, forget about PyArg_ParseTuple. It's intended to parse

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Jonathan Gardner
On Aug 12, 9:17 am, Palindrom <[EMAIL PROTECTED]> wrote: > Hi everyone ! > > I'd like to apologize in advance for my bad english, it's not my > mother tongue... > > My girlfriend (who is a newbie in Python, but knows Perl quite well) > asked me this morning why the following code snippets didn't gi

Re: export sites/pages to PDF

2008-08-12 Thread norseman
Nick Craig-Wood wrote: jvdb <[EMAIL PROTECTED]> wrote: My employer is asking for a solution that outputs the content of urls to pdf. It must be the content as seen within the browser. Can someone help me on this? It must be able to export several kind of pages with all kind of content (javas

Python-URL! - weekly Python news and links (Aug 12)

2008-08-12 Thread Gabriel Genellina
QOTW: "... XML Schema ... include[s] 44 built-in types and a complex set of rules for defining additional types, encompassing atomic, simple, complex, primitive, derived, list, union, and anonymous types, as well as two forms of inheritance, twelve 'constraining facets', substitution groups, and v

passing a variable argument list to a function

2008-08-12 Thread Scott
I'm trying to write a function that accepts a variable number of arguments and passes those arguments to another function. Here is an example: def foo(*args): print "I'm going to call bar with the arguments", args bar(args) This doesn't do quite what I want. For example, if I call foo(1,2

Re: Problems returning data from embedded Python

2008-08-12 Thread Gabriel Genellina
En Tue, 12 Aug 2008 19:48:54 -0300, Cromulent <[EMAIL PROTECTED]> escribi�: On 2008-08-12 05:37:53 +0100, "Gabriel Genellina" <[EMAIL PROTECTED]> said: En Mon, 11 Aug 2008 12:58:00 -0300, Cromulent <[EMAIL PROTECTED]> escribi�: Uh? You have a complete API for working with list objec

Re: export sites/pages to PDF

2008-08-12 Thread Nick Craig-Wood
jvdb <[EMAIL PROTECTED]> wrote: > My employer is asking for a solution that outputs the content of urls > to pdf. It must be the content as seen within the browser. > Can someone help me on this? It must be able to export several kind of > pages with all kind of content (javascript, etc.) Soun

Re: Broken examples

2008-08-12 Thread norseman
John Machin wrote: On Aug 12, 10:36 am, norseman <[EMAIL PROTECTED]> wrote: Tim; Finally got a chance to test your snippet. Thank you for it! I took the liberty of flushing it out a bit. ...(snip) Why do you want to save as CSV? Would you be happier with a simple

Re: os.system question

2008-08-12 Thread Wojtek Walczak
Dnia 12 Aug 2008 22:58:22 GMT, Steven D'Aprano napisa�(a): >> but if I was in a hurry to find out who I was I would be tempted still >> to use the deprecated "os.popen('whoami').read()". > > Is it really deprecated? Since when? I'm using Python 2.5 and it doesn't > raise any warnings or mention a

Re: Python + Some sort of Propel + Creole

2008-08-12 Thread Josh Bloom
http://sqlobject.org/ http://www.sqlalchemy.org/ Django's built in ORM is also quite good for web development tasks. -josh On Tue, Aug 12, 2008 at 3:18 PM, Samuel Morhaim <[EMAIL PROTECTED]>wrote: > Hi, I come from an extensive background developing webapps with Symfony... > Symfony uses Prope

Re: os.system question

2008-08-12 Thread Steven D'Aprano
On Mon, 11 Aug 2008 19:28:13 -0700, Asun Friere wrote: > Something like this should work, > from subprocess import Popen, PIPE me = Popen('whoami', stdout=PIPE, shell=True).stdout.read() > > but if I was in a hurry to find out who I was I would be tempted still > to use the deprecated

Re: Problems returning data from embedded Python

2008-08-12 Thread Cromulent
On 2008-08-12 05:37:53 +0100, "Gabriel Genellina" <[EMAIL PROTECTED]> said: En Mon, 11 Aug 2008 12:58:00 -0300, Cromulent <[EMAIL PROTECTED]> escribi�: Uh? You have a complete API for working with list objects, the functions named PyList_* See http://docs.python.org/api/listObjects.ht

Re: os.system question

2008-08-12 Thread Steven D'Aprano
On Tue, 12 Aug 2008 14:42:28 -0700, norseman wrote: > Can we take a moment and look at what is happening here? > > Python developers are creating an unwanted item! > > Let's take a good look: > > 1) import os 9 > 2) name=os.popen('whoami'

Re: __getattr__, __setattr__ and pickle

2008-08-12 Thread Bruno Desthuilliers
mwojc a écrit : Bruno Desthuilliers wrote: (snip) FWIW, you'd be better using a property instead of __getattr__ / __setattr__ if possible. You're probably right again, in this case it's better to use property. Since you seem to have concerns wrt/ execution time, properties might be a litt

Python + Some sort of Propel + Creole

2008-08-12 Thread Samuel Morhaim
Hi, I come from an extensive background developing webapps with Symfony... Symfony uses Propel/Creole a lot. Is there something similar to Propel/Creole for Python? I found a few DB abstraction layers (Creole) but I am not sure which one is the best.. can somebody point me to a good one? Also ca

Re: Wildcards for regexps?

2008-08-12 Thread Aahz
In article <[EMAIL PROTECTED]>, ssecorp <[EMAIL PROTECTED]> wrote: > >If I have an expression like "bob marley" and I want to match >everything with one letter wrong, how would I do? >so "bob narely" and "vob marley" should match etc. difflib -- Aahz ([EMAIL PROTECTED]) <*> htt

Re: os.system question

2008-08-12 Thread norseman
Asun Friere wrote: On Aug 8, 6:07 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: On Aug 6, 8:07 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: >>> import os >>> foo = os.system('whoami') kevin >>> print foo 0 >>> The standard output of the system command 'whoami' is my login name. Yet the value

Re: Broken examples

2008-08-12 Thread John Machin
On Aug 13, 3:48 am, norseman <[EMAIL PROTECTED]> wrote: > Using the Python supplied CSV module now makes handling a variety of > .xls files a real snap. "Variety" of real spread sheet types, yes. The > butchered type that should have been done in Word - probably never. Please explain how the *CSV

Re: updating dictionaries from/to dictionaries

2008-08-12 Thread John Machin
On Aug 13, 5:33 am, Brandon <[EMAIL PROTECTED]> wrote: > On Aug 12, 7:26 am, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Aug 12, 12:26 pm, Brandon <[EMAIL PROTECTED]> wrote: > > > > You are very correct about the Laplace adjustment. However, a more > > > precise statement of my overall pro

Re: __getattr__, __setattr__ and pickle

2008-08-12 Thread mwojc
Bruno Desthuilliers wrote: > mwojc a écrit : >> Hi! >> My class with implemented __getattr__ and __setattr__ methods cannot be >> pickled because of the Error: >> >> == >> ERROR: testPickle (__main__.TestDeffnet2WithBiases) >> --

xmlrpc client through proxy to https server

2008-08-12 Thread Gustavo Rahal
Hi I'm trying to build a xmlrpc client that uses a proxy to connect to a xmlrpc server in https. I've googled and came up with a code snippet that doesn't actually work. What is missing? class ProxiedTransport(xmlrpclib.Transport): def set_proxy(self, proxy): self.proxy = proxy

Re: Why nested scope rules do not apply to inner Class?

2008-08-12 Thread Calvin Spealman
The issue has been brought up several times before. There have been proposals to make nested classes better supported, but they are always shut down. The vote is always against it. Your metaclass example is one thing, but its not really applicable here. I've never seen or would encourage nested cla

Re: Looking out a module for Subversion

2008-08-12 Thread Fabio Zadrozny
On Tue, Aug 12, 2008 at 6:50 AM, Patrol Sun <[EMAIL PROTECTED]> wrote: > Eclipse with PyDev extension cannot debug. Ulipad is able to debug,but it > needs wxpython to support. > That's not really correct... Pydev should be able to debug (there's a video at http://showmedo.com/videos/video?name=Py

Re: Pyserial not getting response every time, input/output errors

2008-08-12 Thread Grant Edwards
On 2008-08-12, Carsten Haese <[EMAIL PROTECTED]> wrote: > Rainy wrote: >> Hello! >> >> I'm having some trouble with pyserial package, I'm sending commands >> and reading responses from a custom pcb, and sometimes I get a proper >> response, at other times I get nothing, and sometimes I get about h

Re: Pyserial not getting response every time, input/output errors

2008-08-12 Thread Rainy
Carsten Haese wrote: > Rainy wrote: > > Hello! > > > > I'm having some trouble with pyserial package, I'm sending commands > > and reading responses from a custom pcb, and sometimes I get a proper > > response, at other times I get nothing, and sometimes I get about half > > of the response strin

Re: Pyserial not getting response every time, input/output errors

2008-08-12 Thread Carsten Haese
Rainy wrote: Hello! I'm having some trouble with pyserial package, I'm sending commands and reading responses from a custom pcb, and sometimes I get a proper response, at other times I get nothing, and sometimes I get about half of the response string with beginning cut off. About half the time

Pyserial not getting response every time, input/output errors

2008-08-12 Thread Rainy
Hello! I'm having some trouble with pyserial package, I'm sending commands and reading responses from a custom pcb, and sometimes I get a proper response, at other times I get nothing, and sometimes I get about half of the response string with beginning cut off. About half the time an empty string

embedded multithreaded DLL

2008-08-12 Thread Robert Langmeier
Hi all, I'm currently writing a DLL which is called from an external third party application in multiple threads. I saw and found some piece of code to save the Python interpreter state. What is not clear to me is, do I have to save the state before any call to Python C/API or only to those that

Re: run a .py script with cmd line args

2008-08-12 Thread Mike Driscoll
On Aug 12, 2:20 pm, r <[EMAIL PROTECTED]> wrote: > i have a python text editor program(script) that i would like to run > when a user clicks on .txt files. > how do i run my script from windows, > and send the filename to my script, so that my script can do: > > if len(sys.argv) > 1: >     try: >  

Re: updating dictionaries from/to dictionaries

2008-08-12 Thread Brandon
On Aug 12, 7:26 am, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 12, 12:26 pm, Brandon <[EMAIL PROTECTED]> wrote: > > > > > You are very correct about the Laplace adjustment. However, a more > > precise statement of my overall problem would involve training and > > testing which utilizes bigram

Re: The Importance of Terminology's Quality

2008-08-12 Thread Robert Maas, http://tinyurl.com/uh3t
John W Kennedy <[EMAIL PROTECTED]> wrote: JWK> Into the 60s, indeed, there were still machines being made JWK> that had no instruction comparable to the mainframe BASx/BALx JWK> family, or to Intel's CALL. You had to do a subprogram call by JWK> first overwriting the last instruction of what you we

run a .py script with cmd line args

2008-08-12 Thread r
i have a python text editor program(script) that i would like to run when a user clicks on .txt files. how do i run my script from windows, and send the filename to my script, so that my script can do: if len(sys.argv) > 1: try: self.LoadFile(sys.argv[1]) # load text into editor

Re: export sites/pages to PDF

2008-08-12 Thread jvdb
Hi Stef! Thanks for your answer, but i forgot to mention that i have to run this on unix/linux. On Aug 12, 9:06 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > jvdb wrote: > > Hi all, > > > My employer is asking for a solution that outputs the content of urls > > to pdf. It must be the content as

Re: export sites/pages to PDF

2008-08-12 Thread Stef Mientki
jvdb wrote: Hi all, My employer is asking for a solution that outputs the content of urls to pdf. It must be the content as seen within the browser. Can someone help me on this? It must be able to export several kind of pages with all kind of content (javascript, etc.) -- http://mail.python.org/

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Demarche Bruno
Thank you both for your reply ! On Tue, Aug 12, 2008 at 8:52 PM, Demarche Bruno <[EMAIL PROTECTED]> wrote: > Thank you Nigel, it's clearer for both of us now. > I think wat confused her is the fact that : > > L = [1,2,3] > def foo(my_list): >my_list.append(4) > > will modify L, while the follo

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Demarche Bruno
Thank you Nigel, it's clearer for both of us now. I think wat confused her is the fact that : L = [1,2,3] def foo(my_list): my_list.append(4) will modify L, while the following: L = [1,2,3] def foo(my_list): my_list = [1,2,3,4] will not. On Tue, Aug 12, 2008 at 6:46 PM, Nigel Rantor <[

export sites/pages to PDF

2008-08-12 Thread jvdb
Hi all, My employer is asking for a solution that outputs the content of urls to pdf. It must be the content as seen within the browser. Can someone help me on this? It must be able to export several kind of pages with all kind of content (javascript, etc.) -- http://mail.python.org/mailman/listin

Re: very rare python expression

2008-08-12 Thread Edward A. Falk
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >"ðÏ" <[EMAIL PROTECTED]> writes: >> I saw a strange python code in pygame project. What does "while >> not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" >> is not HTML strings. > >It parses as "x & 52

Re: Checking a file's time stamp.

2008-08-12 Thread Larry Bates
Christian Heimes wrote: William Purcell wrote: Hi all, I am wanting to check to see the last time a file was edited. For example, I have a directory containing two text files, file1.txt and file2.txt. I want to be able to process these files but only if they have been edited since the last t

Re: Checking a file's time stamp.

2008-08-12 Thread William Purcell
Perfect. Thanks, Christian and Edwin. -Bill On Tue, Aug 12, 2008 at 12:56 PM, <[EMAIL PROTECTED]> wrote: > os.paht.gmtime(path) returns the last modification of path. > check out http://docs.python.org/lib/module-os.path.html > > regards > Edwin > > -Original Message- > From: [EMAIL PROTE

Re: super, object and type?

2008-08-12 Thread Bruno Desthuilliers
ssecorp a écrit : super(object, type) , > super(type, object) , > how can both work? they can't both be the superclass of each other right? or is it some sort of mutually recursive definition? some sort, yes: help(object) Help on class object in module __builtin__: class object |

Re: module import search path strangeness

2008-08-12 Thread Peter Otten
Sion Arrowsmith wrote: > Peter Otten <[EMAIL PROTECTED]> wrote: >>tow wrote: >>> sys.path.append(os.path.join(project_directory, os.pardir)) >>> project_module = __import__(project_name, {}, {}, ['']) >>> sys.path.pop() >>Ouch. > > I presume that "Ouch" is in consideration of what mi

Re: Checking a file's time stamp.

2008-08-12 Thread Edwin . Madari
os.paht.gmtime(path) returns the last modification of path. check out http://docs.python.org/lib/module-os.path.html regards Edwin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of William Purcell Sent: Tuesday, August 12, 2008 1:47 PM To: Python List Subject:

Re: __getattr__, __setattr__ and pickle

2008-08-12 Thread Bruno Desthuilliers
mwojc a écrit : Hi! My class with implemented __getattr__ and __setattr__ methods cannot be pickled because of the Error: == ERROR: testPickle (__main__.TestDeffnet2WithBiases) ---

Re: Checking a file's time stamp.

2008-08-12 Thread Christian Heimes
William Purcell wrote: Hi all, I am wanting to check to see the last time a file was edited. For example, I have a directory containing two text files, file1.txt and file2.txt. I want to be able to process these files but only if they have been edited since the last time they were processed. I

Re: Broken examples

2008-08-12 Thread norseman
Tim Roberts wrote: norseman wrote: Tim; Finally got a chance to test your snippet. Thank you for it! I took the liberty of flushing it out a bit. #!/--- # import os import win32com.client excel = win32com.client.Dispatch( 'Excel.Application' ) excel.Visible=1

Checking a file's time stamp.

2008-08-12 Thread William Purcell
Hi all, I am wanting to check to see the last time a file was edited. For example, I have a directory containing two text files, file1.txt and file2.txt. I want to be able to process these files but only if they have been edited since the last time they were processed. I think that I want to be a

xcompile patch for python 2.5.2?

2008-08-12 Thread Stephen Cattaneo
Hi all, Personally I know nothing of cross compiling so please excuse my ignorance, if this question is silly. A friend of mine is attempting to cross compile python 2.5.2 onto a MIPS64 box. He is asking if there is a cross compile patch for 2.5.2. Do any of you know where He might find such a

Re: module import search path strangeness

2008-08-12 Thread tow
On Aug 12, 4:59 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > tow wrote: > > On Aug 12, 9:56 am, Peter Otten <[EMAIL PROTECTED]> wrote: > >> tow wrote: > > >> > Basically, I had thought that import and imp.find_module used exactly > >> > the same > >> > search path, but the above example shows that

Re: super, object and type?

2008-08-12 Thread Calvin Spealman
object and type both are instances of type. Yes, type is an instance of itself. type inherits object. On Tue, Aug 12, 2008 at 1:14 PM, ssecorp <[EMAIL PROTECTED]> wrote: super(object, type) > , > super(type, object) > , > > > how can both work? > > they can't both be the superclass

Re: Why nested scope rules do not apply to inner Class?

2008-08-12 Thread Calvin Spealman
Please re-evaluate your "need" for nesting classes in the first place. On Tue, Aug 12, 2008 at 1:06 PM, Cousson, Benoit <[EMAIL PROTECTED]> wrote: >> This is a language limitation. >> This is because nested scope is implemented for python function only since >> 2.3 >> allow late binding of free va

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Nigel Rantor
Palindrom wrote: ### Python ### liste = [1,2,3] def foo( my_list ): my_list = [] The above points the my_list reference at a different object. In this case a newly created list. It does not modify the liste object, it points my_list to a completely different object. ### Perl ### @ls

__getattr__, __setattr__ and pickle

2008-08-12 Thread mwojc
Hi! My class with implemented __getattr__ and __setattr__ methods cannot be pickled because of the Error: == ERROR: testPickle (__main__.TestDeffnet2WithBiases) -

super, object and type?

2008-08-12 Thread ssecorp
>>> super(object, type) , > >>> super(type, object) , > >>> how can both work? they can't both be the superclass of each other right? or is it some sort of mutually recursive definition? >>> help(object) Help on class object in module __builtin__: class object | The most base type >>> hel

RE: Why nested scope rules do not apply to inner Class?

2008-08-12 Thread Cousson, Benoit
> This is a language limitation. > This is because nested scope is implemented for python function only since > 2.3 > allow late binding of free variables. the scope in class statment is not a > closure, so there is only two possible scope in it : local and global. That was my understanding as wel

Re: module import search path strangeness

2008-08-12 Thread Sion Arrowsmith
Peter Otten <[EMAIL PROTECTED]> wrote: >tow wrote: >> sys.path.append(os.path.join(project_directory, os.pardir)) >> project_module = __import__(project_name, {}, {}, ['']) >> sys.path.pop() >Ouch. I presume that "Ouch" is in consideration of what might happen if the subject of the __

Re: python interpreter

2008-08-12 Thread Calvin Spealman
The best answer is: Don't do that! That isn't how you test things. Write test scripts, probably using the unittest framework. You'll save yourself time and trouble having easily reproducible tests. Many people suggested reload(), but you should know it is dangerous. It can have results you don't e

Re: Thesaurus / ontology / taxonomy Python library

2008-08-12 Thread Calvin Spealman
Sounds like you might want to read up on RDF On Tue, Aug 12, 2008 at 10:41 AM, Benjamin Michiels <[EMAIL PROTECTED]> wrote: > Hi, > > I am curently looking for a library allowing the creation and management of > a thesaurus. Our requirements are the following: > > - creation of our own thesaurus (

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Palindrom <[EMAIL PROTECTED]> wrote: > Hi everyone ! > > I'd like to apologize in advance for my bad english, it's not my > mother tongue... > > My girlfriend (who is a newbie in Python, but knows Perl quite well) > asked me this morning why the following code s

Re: Python GUI interpreter slower than DOS-version?

2008-08-12 Thread Ben Sizer
On Aug 12, 4:04 pm, ssecorp <[EMAIL PROTECTED]> wrote: > Sometimes when running very intensive computations the Python- > interpreter kind of overheats and stops responding. > > I have gotten the impression that the dos-version is less likely to > crash. Can that be true and if so, why? > > Is ther

How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Palindrom
Hi everyone ! I'd like to apologize in advance for my bad english, it's not my mother tongue... My girlfriend (who is a newbie in Python, but knows Perl quite well) asked me this morning why the following code snippets didn't give the same result : ### Python ### liste = [1,2,3] def foo( my_li

RE: Unable to lookup keys in dictionary

2008-08-12 Thread Matt Fielding (R* New England)
I actually figured out the solution to my problem, of all times, right after I finished sending this mail. It seems P4Python returns a command as a dictionary, also inside of an array. The solution is in the following code: from P4 import P4, P4Exception p4 = P4() p4.port

Re: Unable to lookup keys in dictionary

2008-08-12 Thread Jerry Hill
On Tue, Aug 12, 2008 at 11:27 AM, Matt Fielding (R* New England) <[EMAIL PROTECTED]> wrote: > [{'userName': 'mfielding', 'clientRoot': 'c:\\perforce', 'monitor': > 'enabled', > 'serverRoot': 'H:\\p4root\\', 'serverVersion': 'P4D/NTX64/2007.3/143793 > (2008/01/ > 21)', 'serverDate': '2008/08/12 11:1

RE: Unable to lookup keys in dictionary

2008-08-12 Thread Andreas Tawn
>I am trying to run p4python API on top of python 2.5.2 and am extracting a dictionary from perforce. The following code returns the output that follows it: > > from P4 import P4, P4Exception > p4 = P4() > p4.port = "erased" #deleted > p4.us

Re: module import search path strangeness

2008-08-12 Thread Peter Otten
tow wrote: > On Aug 12, 9:56 am, Peter Otten <[EMAIL PROTECTED]> wrote: >> tow wrote: > >> > Basically, I had thought that import and imp.find_module used exactly >> > the same >> > search path, but the above example shows that at least in this >> > circumstance they >> > don't; import is picking

Cutting and Pasting in Windows IDLE

2008-08-12 Thread Victor Subervi
Hi; A couple of weeks ago I asked how to cut and paste multiple lines in the Windows IDLE interface. I can only paste one line at a time! Frustrating. I want it to work like my Linux interpreter. Why doesn´t it? Please help. Someone wrote this, which did not help at all: Well, I'm not really sure

Re: module import search path strangeness

2008-08-12 Thread tow
On Aug 12, 9:56 am, Peter Otten <[EMAIL PROTECTED]> wrote: > tow wrote: > > Basically, I had thought that import and imp.find_module used exactly > > the same > > search path, but the above example shows that at least in this > > circumstance they > > don't; import is picking up additional search

Unable to lookup keys in dictionary

2008-08-12 Thread Matt Fielding (R* New England)
I am trying to run p4python API on top of python 2.5.2 and am extracting a dictionary from perforce. The following code returns the output that follows it: from P4 import P4, P4Exception p4 = P4() p4.port = "erased" #deleted p4.user = "erased" #deleted

Re: Jason Orendorff's path module

2008-08-12 Thread Alia Khouri
andybak wrote: > Which rather makes me wonder - lot's of people liked this module > or rather disliked os.path. Is there anything salvageable from > the BDFL's objections worthy of a PEP? Funny you should bring this up today.. I was just thinking the same thing (-: and I looked at the pep (http:/

Re: bbfreeze problem

2008-08-12 Thread Ralf Schmitt
Neal Becker wrote: Any ideas on this? bb-freeze test5-coded-pre.py x86_64.egg/bbfreeze/eggutil.py", line 132, in copyDistribution raise RuntimeError("setup.py not found for development egg") RuntimeError: setup.py not found for development egg Can you try the latest bbfreeze version f

Re: python interpreter

2008-08-12 Thread Diez B. Roggisch
Alexandru Mosoi wrote: > I'm using python's interpreter's to run various commands (like a > normal shell). However if sources are modified changes are not > reflected so I have to restart interpreter. Is there any way to avoid > restarting this? Other gave you advice on how to - partially - achi

Re: python interpreter

2008-08-12 Thread Wojtek Walczak
Dnia Tue, 12 Aug 2008 07:58:52 -0700 (PDT), [EMAIL PROTECTED] napisa�(a): >> I'm using python's interpreter's to run various commands (like a >> normal shell). However if sources are modified changes are not >> reflected so I have to restart interpreter. Is there any way to avoid >> restarting this

  1   2   >