Re: Unicode File Names

2008-10-17 Thread Martin v. Lo
> Step 4: Either wait for Python 2.7 or apply the patch to your own copy > of zipfile ... Actually, this is released in Python 2.6, see r62724. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: baffling memory usage

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Redfern wrote: > My python code runs nicely when launched manually from a login shell, ps > shows its using 11MB or so of memory. > > However, when I try to launch the same code from a startup script, it > uses over 22MB and the system grinds to a halt. Specifi

Re: crossplatform standalone python apps

2008-10-17 Thread Martin v. Löwis
> I like to create a cross-platform standalone python application, like > Mac OS *.app dirs. The idea is to distribute a zip file containing > everything (the python interpreter and all) so that a user just unzips > it and runs it. I don't think this can possibly work. If the zipfile contains the

Re: Sending multi-part MIME package via HTTP-POST

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > On Oct 15, 2:42 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: > >> In message >> <[EMAIL PROTECTED]>, >> >> [EMAIL PROTECTED] wrote: >> > ... but I'm getting a very vague server error message ... >> >> Which

Re: Hi, I am getting the following errorTypeError: sort() takes no keyword arguments

2008-10-17 Thread Peter Otten
gaurav kashyap wrote: > Hi all, > I am using python version 2.3.in a program , > I have called the sort function.Wherein, > a.sort(reverse=True) > is giving the following error: > > TypeError: sort() takes no keyword arguments. > > It works in python 2.4,What can be the alternative in python 2.3

Re: xor: how come so slow?

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Michele wrote: > class Encoder(object): > def create_random_block(self, data, seed, blocksize): > number_of_blocks = int(len(data)/blocksize) > random.seed(seed) > random_block = ['0'] * blocksize > for index in range(number_of_bl

Re: docpicture

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Pete Forman wrote: > Maybe someone would like to play with the data URL scheme (RFC 2397) > to meet the OP's desire to embed the image. AFAIK a downside is that > MS are only starting to support that in IE8. Firefox, Konqueror and Safari already support it. So it'

Re: Hi, I am getting the following errorTypeError: sort() takes no keyword arguments

2008-10-17 Thread Duncan Booth
Aidan <[EMAIL PROTECTED]> wrote: > gaurav kashyap wrote: >> Hi all, >> I am using python version 2.3.in a program , >> I have called the sort function.Wherein, >> a.sort(reverse=True) >> is giving the following error: >> >> TypeError: sort() takes no keyword arguments. >> >> It works in python 2

messages from pylint - need some reasoning

2008-10-17 Thread GHUM
Hello, I am pylinting some software of mine. Now pylint throws messages, and I know of pylint --help-msg to get some more text. What is missing out are explanation, WHY some things are bad, so I am searching for explanations and ways to improve my code: Example: 1st) "to many local variables" I

__metaclass__ and deepcopy issue

2008-10-17 Thread Wouter DW
I read the article on http://www.python.org/download/releases/2.2/descrintro/#metaclasses and started using autoprop. But now I have a problem I can't seem to solve myself. class autoprop(type): def __init__(cls, name, bases, dict): super(autoprop, cls).__init__(name, bases, dict) props

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-17 Thread Damien Wyart
* Carl Banks <[EMAIL PROTECTED]> in comp.lang.python: > The python-mode.el on Subversion (python-mode's Subversion on source > forge, not the ancient version of python-mode in the Python > repository) has a fix for this issue. It doesn't look like there's any > way to browse the subversion any more

Re: xor: how come so slow?

2008-10-17 Thread Steven D'Aprano
On Fri, 17 Oct 2008 20:51:37 +1300, Lawrence D'Oliveiro wrote: > Is piece really meant to be random? If so, your create_random_block > function isn't achieving much--xoring random data together isn't going > to produce anything more exciting than less random data than you started > with. Hmmm...

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-17 Thread Damien Wyart
* Carl Banks <[EMAIL PROTECTED]> in comp.lang.python: > The python-mode.el on Subversion (python-mode's Subversion on source > forge, not the ancient version of python-mode in the Python > repository) has a fix for this issue. Btw, I have not found a reference to this fix in the subversion history

Re: xor: how come so slow?

2008-10-17 Thread Paul Rubin
Michele <[EMAIL PROTECTED]> writes: > I suppose that ord() and char() are the main problems yes > How should I decrease the execution time? See http://nightsong.com/phr/crypto/p3.py which deals with the same problem by using the array module to do the xor's 32 bits at a time. -- http://mail.py

Re: ImportError in python 2.5 in C API DLL

2008-10-17 Thread Henrik
On Oct 17, 1:05 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Would really appreciate any assistance. > > You should change your project to create a .pyd file instead of a .dll > file. > > Regards, > Martin Ha-ha! Just rename the DLL to .pyd H -- http://mail.python.org/mailman/listinfo/py

Re: Getting windows error while making a backup

2008-10-17 Thread Tim Golden
[EMAIL PROTECTED] wrote: 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.

Re: Unicode File Names

2008-10-17 Thread John Machin
On Oct 17, 6:32 pm, "Martin v. Lo"wis" <[EMAIL PROTECTED]> wrote: > > Step 4: Either wait for Python 2.7 or apply the patch to your own copy > > of zipfile ... > > Actually, this is released in Python 2.6, see r62724. Hi Martin, That's good. I was lead astray by the fact that the 2.6 docs still c

Re: messages from pylint - need some reasoning

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 00:59:16 -0700, GHUM wrote: > Example: > 1st) "to many local variables" > I searched big G, and found: many local variables make it harder to > refactor, as all those variables will have to be passed to the > factored-out function. Even worse when the local variables are mutabl

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Ross Ridge
Helmut Jarausch <[EMAIL PROTECTED]> wrote: ># but this ugly one (to be done for each output file) >sys.stdout._encoding='latin1' Is this writable "_encoding" attribute, with a leading underscore (_), documented anywhere? Does it actually work? Would it happen to be supported in 2.5 or 2.6? The

Re: IDE Question

2008-10-17 Thread Propad
> On Oct 15, 2:19 pm, "Steve Phillips" <[EMAIL PROTECTED]> wrote: > > > Hi All, > > I am just wondering what seems to be the most popular IDE. > Hello, I also purhcased my copy of Wing IDE six months ago, after having used Idle, Scite and Leo quite extensively. I gave PyDev two tries, one in the be

"Right Job For Every One"

2008-10-17 Thread delhi institute of management & services
Delhi Institute of Management & Services Dear friends, We are extremely happy to welcome you to the world of Management... We are in the process of preparing some 5 minutes revision Q & A type lessons for management students. They are in no way, a replacement for the classroom lectures, textbooks

Re: Python equivalent to SharePoint?

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Paul Boddie wrote: > On 15 Okt, 22:50, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: > >> In message >> <[EMAIL PROTECTED]>, Paul >> Boddie wrote: >> >> > ... any absence of steep licensing costs isn't necessarily >> > an advantage in the

Re: urllib accept-language doesn't have any effect

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Martin Bachwerk wrote: > It does indeed give me a swedish version.. of www.google.de :) That's the > beauty about Google that they have all languages for all domains > available. > > However if I try it with www.gizmodo.com (a tech blog in several > languages) I s

Re: default value in __init__

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > We already get people asking why code like this doesn't return 3: > fns = [ lambda: x for x in range(10) ] fns[3]() > 9 > > ... making this change to default arguments would mean the > solution usually proposed to the function scopi

Re: no mistake but i didnt get what i want (with python module pymssql send information to the mssql)

2008-10-17 Thread Peter Otten
[EMAIL PROTECTED] wrote: > the code is below: > import pymssql > conn = pymssql.connect(host = "121.198.126.233",user = "",password > = "",database = "test") > print "connecting success" > cursor = conn.cursor() > cursor.execute("insert into bbs_test values(%s,%s,%s,%s,%s)", > ("1","nju","

no mistake but i didnt get what i want (with python module pymssql send information to the mssql)

2008-10-17 Thread gdyren
the code is below: import pymssql conn = pymssql.connect(host = "121.198.126.233",user = "",password = "",database = "test") print "connecting success" cursor = conn.cursor() cursor.execute("insert into bbs_test values(%s,%s,%s,%s,%s)", ("1","nju","9:13","ustc","test")) cursor.close() conn.

Re: no mistake but i didnt get what i want (with python module pymssql send information to the mssql)

2008-10-17 Thread gdyren
On 10月17日, 下午6时41分, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > the code is below: > > import pymssql > > conn = pymssql.connect(host = "121.198.126.233",user = "",password > > = "",database = "test") > > print "connecting success" > > cursor = conn.cursor() > > cu

Re: no mistake but i didnt get what i want (with python module pymssql send information to the mssql)

2008-10-17 Thread gdyren
On 10月17日, 下午6时41分, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > the code is below: > > import pymssql > > conn = pymssql.connect(host = "121.198.126.233",user = "",password > > = "",database = "test") > > print "connecting success" > > cursor = conn.cursor() > > cu

Re: xor: how come so slow?

2008-10-17 Thread Steven D'Aprano
On Fri, 17 Oct 2008 22:45:19 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> On Fri, 17 Oct 2008 20:51:37 +1300, Lawrence D'Oliveiro wrote: >> >>> ... why do you say that xoring random data with other random data >> produces less randomness than

[ctypes-user]I want to write python wrapper for functions in so, any suggestion?

2008-10-17 Thread xiaotianqio
Hi,all I used ctypes in a project, I found some boresome for find out function name in "so"(compiled by g++) and the types, so I want to write some code which can automatically generate a wrap python function for function in "so". what I want to ask is any idea to be included in or good way to

Re: no mistake but i didnt get what i want (with python module pymssql send information to the mssql)

2008-10-17 Thread Peter Otten
[EMAIL PROTECTED] wrote: > On 10月17日, 下午6时41分, Peter Otten <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > the code is below: >> > import pymssql >> > conn = pymssql.connect(host = "121.198.126.233",user = "",password >> > = "",database = "test") >> > print "connecting success"

Re: default value in __init__

2008-10-17 Thread Steven D'Aprano
On Fri, 17 Oct 2008 23:04:52 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > >> We already get people asking why code like this doesn't return 3: >> > fns = [ lambda: x for x in range(10) ] fns[3]() >> 9 >> >> ... making this change to default argum

Looking for bondage webcam?

2008-10-17 Thread fernandena
View explicit live Webcams, meet for amateur scenes! http://puntyhouse.byethost11.com/altcam.htm -- http://mail.python.org/mailman/listinfo/python-list

Installing multiple python versions - CentOs Linux

2008-10-17 Thread Brendan
The current CentOs Linux distro includes python 2.4.3. I need to install a more recent version but I am worried about breaking CentOs python dependencies. Is it safe to install python 2.6 using pup? -- http://mail.python.org/mailman/listinfo/python-list

Re: xor: how come so slow?

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > On Fri, 17 Oct 2008 20:51:37 +1300, Lawrence D'Oliveiro wrote: > >> ... why do you say that xoring random data with other random data > produces less randomness than you started with? blocksize <= number_of_blocks * blocksize -- http://mai

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-17 Thread Sebastian Wiesner
At Thu, 16 Oct 2008 18:21:38 +0200 wrote Bruno Desthuilliers <[EMAIL PROTECTED]>: >> It doesn't look like there's >> any way to browse the subversion any more, though. > > Doh :( > > Is there any way to get this version then ??? svn co https://python-mode.svn.sourceforge.net/svnroot/python-mode/

Python certification

2008-10-17 Thread srinivasan srinivas
Hi, I m planning to do certification in Python?? Is therr any good certification available in Python like Sun certification for java?? Thanks, Sirni Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -- http://mail.python.or

Re: Ooo 3.0 Python user macros

2008-10-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Lawrence D'Oliveiro wrote: > The provided example macros seem to work: under the "Tools -> Macros -> > Organize Macros -> Python..." menu, there is an entry named > "OpenOffice.org Macros", and I can run the macros that are listed in > there. So that suggests the ba

Re: messages from pylint - need some reasoning

2008-10-17 Thread Ben Finney
GHUM <[EMAIL PROTECTED]> writes: > Who can give me some hints to improve my code In addition to the responses you've already had, I would highly recommend you get ahold of the book “Code Complete”, which gives excellent, reasoned advice on how to perform the line-by-line craft of programming. Re

Re: Python certification

2008-10-17 Thread Ben Finney
srinivasan srinivas <[EMAIL PROTECTED]> writes: > I m planning to do certification in Python?? Why the question marks? Are you asking us whether this is true? > Is therr any good certification available in Python like Sun > certification for java?? You'll need to tell us what you want to use th

Re: Installing multiple python versions - CentOs Linux

2008-10-17 Thread Diez B. Roggisch
Brendan schrieb: The current CentOs Linux distro includes python 2.4.3. I need to install a more recent version but I am worried about breaking CentOs python dependencies. Is it safe to install python 2.6 using pup? It should be, yes. Usually, Distros make sure it doesn't break anything - and

Re: Installing multiple python versions - CentOs Linux

2008-10-17 Thread Michele Simionato
On Oct 17, 2:51 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Brendan schrieb: > > > The current CentOs Linux distro includes python 2.4.3. I need to > > install a more recent version but I am worried about breaking CentOs > > python dependencies. Is it safe to install python 2.6 using pup? >

Earn upto $10 To $50 per day easily without Investment

2008-10-17 Thread sanisha
Earn upto $10 To $50 per day easily without Investment For more surveys visit your Home Page After registration. Take 7 Surveys after login & get $27 Immediately. Currently $1.25 Per Friend that Registers for Free! The $500 october Monthly Bonus Cash Prize starts today! You will get $1 for co

Re: xor: how come so slow?

2008-10-17 Thread Sion Arrowsmith
[I think these attributions are right] Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Fri, 17 Oct 2008 22:45:19 +1300, Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, Steven D'Aprano >> wrote: >>> ... why do you say that xoring random data with other random data >>> produces less ran

Re: Dictionary of Dicts question

2008-10-17 Thread MRAB
On Oct 16, 11:03 pm, John Townsend <[EMAIL PROTECTED]> wrote: > Here are some sample lines. > > Text file 1 contains: > > DescribeImage   AllAdjustments.psd      0.66812636  0.046   0.426   > 0.06475 0.06475 0.005875 > DescribeImage   All_Options_Multi.psd   0.552750021219  0.046   0.355875  

Re: Installing multiple python versions - CentOs Linux

2008-10-17 Thread Brendan
> If you install from sources, the safest path is to run > > $ sudo make altinstall (will add the version number to the executable) > > and NOT > > $ sudo make install Ah, that is perfect. Thank-you! -- http://mail.python.org/mailman/listinfo/python-list

Re: crossplatform standalone python apps

2008-10-17 Thread Philip Semanchuk
On Oct 17, 2008, at 2:59 AM, Gabriel Rossetti wrote: Hello everyone, I like to create a cross-platform standalone python application, like Mac OS *.app dirs. The idea is to distribute a zip file containing everything (the python interpreter and all) so that a user just unzips it and runs

Re: Dictionary of Dicts question

2008-10-17 Thread bearophileHUGS
MRAB: > for line in open(path): > fields = line.split("\t") > data[tuple(fields[ : 2])] = fields[2 : ] Keeping the key as a string may have some memory/performance advantages (not tested): for line in open(path): fields = line.split("\t") data[fields[0] + fields[1]] = map(float, i

Re: Python certification

2008-10-17 Thread Christian Heimes
srinivasan srinivas wrote: Hi, I m planning to do certification in Python?? Is therr any good certification available in Python like Sun certification for java?? The topic has been discussed on the internal Python Software Foundation list multiple times but w/o a definite answer. Christian

Re: IDE Question

2008-10-17 Thread Fabio Zadrozny
> Although PyDev > looked promissing and the main annoyances from the first try (like an > intelisense that needed half a minute) had been solved, I was still > missing some things, like a realy good integration of the python shell > into it. That's been done: http://pydev.sourceforge.net/console.

Interface to Matlab

2008-10-17 Thread Claire Mouton
Hi, I would like to call Python functions from Matalab. How could I find an interface from Matlab to Python? Cheers, Claire -- http://mail.python.org/mailman/listinfo/python-list

Convertimg a Sequence of Images to an AVI File

2008-10-17 Thread W. eWatson
I have a file of images shot at a frame rate of 1/30th of a second. They are 640 by 480 bytes followed immediately by up to 200 smaller images 128x128 pixels. The software I'm using will convert this into a mov file. I'd like to simply take the large images out of the file and make an avi file f

Re: Python HTML parser chokes on UTF-8 input

2008-10-17 Thread John Nagle
Johannes Bauer wrote: Hello group, I'm trying to use a htmllib.HTMLParser derivate class to parse a website which I fetched via httplib.HTTPConnection().request().getresponse().read(). Now the problem is: As soon as I pass the htmllib.HTMLParser UTF-8 code, it chokes. The code is something like

Normalizing arguments

2008-10-17 Thread Dan Ellis
Given some function, f(a, b, c=3), what would be the best way to go about writing a function, g(f, *args, **kwargs), that would return a normalized tuple of arguments that f would receive when calling f(*args, **kwargs)? By normalized, I mean that the result would always be (a, b, c) regardless of

Parsing a file with iterators

2008-10-17 Thread Luis Zarrabeitia
I need to parse a file, text file. The format is something like that: TYPE1 metadata data line 1 data line 2 ... data line N TYPE2 metadata data line 1 ... TYPE3 metadata ... And so on. The type and metadata determine how to parse the following data lines. When the parser fails to parse one of t

Re: Finding the instance reference of an object

2008-10-17 Thread Joe Strout
On Oct 16, 2008, at 11:23 PM, Dennis Lee Bieber wrote: On Thu, 16 Oct 2008 21:19:28 -0600, Joe Strout <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: Now that IS mysterious. Doesn't calling a function add a frame to a stack? And doesn't that necessitate copying in values for

Re: Dictionary of Dicts question

2008-10-17 Thread George Sakkis
On Oct 16, 5:05 pm, John Townsend <[EMAIL PROTECTED]> wrote: > Joe had a good point! Let me describe what problem I'm trying to solve and > the list can recommend some suggestions. > > I have two text files. Each file contains data like this: > > Test file 1234 4567 8975 > > I want to compare the

'Hidden Features of Python'

2008-10-17 Thread coldpizza
Having read through the link below I finally managed to grasp some concepts that I only read about in the docs but never got to really understand. Maybe it will be helpful for people like myself who are not yet fully comfortable with some of Python's `hidden' features. http://stackoverflow.com/que

Re: Normalizing arguments

2008-10-17 Thread Steve Holden
Dan Ellis wrote: > Given some function, f(a, b, c=3), what would be the best way to go > about writing a function, g(f, *args, **kwargs), that would return a > normalized tuple of arguments that f would receive when calling > f(*args, **kwargs)? By normalized, I mean that the result would always >

Re: 'Hidden Features of Python'

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 10:00 AM, coldpizza wrote: http://stackoverflow.com/questions/101268/hidden-features-of-python Thanks, there are a lot of useful nuggets there. However, can anybody explain the "Main messages" one? It doesn't include any explanatory text at all, just a code snippet:

Need advice on python importing

2008-10-17 Thread Matthew Wilson
I started with a module with a bunch of classes that represent database tables. A lot of these classes have methods that use other classes inside, sort of like this: class C(object): @classmethod def c1(cls, a): return a class D(object): def d1(self, a

Re: Parsing a file with iterators

2008-10-17 Thread Eddie Corns
Luis Zarrabeitia <[EMAIL PROTECTED]> writes: >I need to parse a file, text file. The format is something like that: >TYPE1 metadata >data line 1 >data line 2 >... >data line N >TYPE2 metadata >data line 1 >... >TYPE3 metadata >... >And so on. The type and metadata determine how to parse the fol

Re: 'Hidden Features of Python'

2008-10-17 Thread coldpizza
If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR +click on 'this' should do the trick. In ipython you can do 'import this' and then type 'this??' Or if you are *not* lazy, you could try locating the file in the Python tree. > import this > # btw look at this module's source :)

properties access by name

2008-10-17 Thread Митя
I use rwproperty (http://pypi.python.org/pypi/rwproperty/1.0) and so I have properties in my class. Also I have a list of names of properties wich I am to set. How can I access my properties by name in such way that when I want to set a property, setter will be called, and and when I want to read i

Spring Python 0.7.1 has been released

2008-10-17 Thread Goldfish
Spring Python, the python version of the Spring Framework, has just released version 0.7.1. This patch includes integration with S3, Spring's new service used to distribute binaries. Key Features of Spring Python include: * Inversion Of Control - The idea is to decouple two classes at the inte

Log Exception with Backtrace

2008-10-17 Thread Heston James - Cold Beans
Afternoon Guys, I'm currently logging exceptions within my applications like so: try: #do something except Exception, error: # Log the exception. self.logger.error("Exception Occurred: (%s)" % str(error)) This is quite fine, however, sometimes I get very vague error

Re: Parsing a file with iterators

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 11:42:05 -0400, Luis Zarrabeitia wrote: > I need to parse a file, text file. The format is something like that: > > TYPE1 metadata > data line 1 > data line 2 > ... > data line N > TYPE2 metadata > data line 1 > ... > TYPE3 metadata > ... > […] > because when the parser iterat

Python logging and ThreadingTCPServer

2008-10-17 Thread Daniel
Hello, I building an application that consists of several sockets components. I would like to use logging in them, but I've noticed some issues with the logs getting mangled. This mangling seems to happen when different threads attempt to access the same log file. For example, if a client and a

Re: 'Hidden Features of Python'

2008-10-17 Thread Kurt Smith
On Fri, Oct 17, 2008 at 11:48 AM, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 10:35 AM, coldpizza wrote: > >> If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR >> +click on 'this' should do the trick. >> In ipython you can do 'import this' and then type 'this??' O

Re: Normalizing arguments

2008-10-17 Thread Dan Ellis
On Oct 17, 5:13 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > You'd get a lot further a lot faster by looking at the documentation for > the inspect module instead. Yeah, I've looked at that already, but it only gives (in a nicer way) the information I already have from the function object and it

Re: Interface to Matlab

2008-10-17 Thread Daniel
On Oct 17, 8:48 am, Claire Mouton <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to call Python functions from Matalab. > How could I find an interface from Matlab to Python? > > Cheers, > Claire Hey, Have you looked at http://www.scipy.org/ and http://matplotlib.sourceforge.net/ They do an a

Re: 'Hidden Features of Python'

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 10:35 AM, coldpizza wrote: If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR +click on 'this' should do the trick. In ipython you can do 'import this' and then type 'this??' Or if you are *not* lazy, you could try locating the file in the Python tree. Oh!

inserting Unicode character in dictionary - Python

2008-10-17 Thread gita ziabari
Hello All, The following code does not work for unicode characters: keyword = dict() kw = 'генских' keyword.setdefault(key, []).append (kw) It works fine for inserting ASCII character. Any suggestion? Thanks, Gita -- http://mail.python.org/mailman/listinfo/python-list

Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The line in question is: for line in fileinput.i

Re: properties access by name

2008-10-17 Thread Chris Rebert
Since rwproperty appears to use descriptors just like regular property(), you'd do it the same way as for any normal attribute, namely: #for reading print foo.y #is the same as print getattr(foo, "y") #for writing foo.x = 1 #is the same as setattr(foo, "x", 1) Cheers, Chris -- Follow the path

Re: Normalizing arguments

2008-10-17 Thread Chris Rebert
On Fri, Oct 17, 2008 at 8:37 AM, Dan Ellis <[EMAIL PROTECTED]> wrote: > Given some function, f(a, b, c=3), what would be the best way to go > about writing a function, g(f, *args, **kwargs), that would return a > normalized tuple of arguments that f would receive when calling > f(*args, **kwargs)?

Re: [ANN] Data Plotting Library DISLIN 9.4

2008-10-17 Thread M�ta-MCI (MVP)
Merci beaucoup. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 13:07:38 -0400, gita ziabari wrote: > The following code does not work for unicode characters: > > keyword = dict() > kw = 'генских' > keyword.setdefault(key, []).append (kw) > > It works fine for inserting ASCII character. Any suggestion? What do you mean by "does not work"

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Chris Rebert
On Fri, Oct 17, 2008 at 10:07 AM, Robocop <[EMAIL PROTECTED]> wrote: > I have a simple little script that reads in postscript code, appends > it, then writes it to a new postscript file. Everything worked fine a > month ago, but after rearranging my directory tree a bit my script > fails to find t

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Philip Semanchuk
On Oct 17, 2008, at 1:07 PM, Robocop wrote: I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 11:24 AM, Marc 'BlackJack' Rintsch wrote: kw = 'генских' What do you mean by "does not work"? And you are aware that the above snipped doesn't involve any unicode characters!? You have a byte string there -- type `str` not `unicode`. Just checking my understanding he

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
On Oct 17, 10:27 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 10:07 AM, Robocop <[EMAIL PROTECTED]> wrote: > > I have a simple little script that reads in postscript code, appends > > it, then writes it to a new postscript file.  Everything worked fine a > > month ago, bu

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
On Oct 17, 10:27 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 10:07 AM, Robocop <[EMAIL PROTECTED]> wrote: > > I have a simple little script that reads in postscript code, appends > > it, then writes it to a new postscript file.  Everything worked fine a > > month ago, bu

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Christian Heimes
Robocop wrote: I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The line in question is: for li

Re: Normalizing arguments

2008-10-17 Thread Dan Ellis
On Oct 17, 6:17 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > Why do you want/need this magical g() function considering that, as > you yourself point out, Python already performs this normalization for > you? A caching idea I'm playing around with. @cache def some_query(arg1, arg2): # May

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Robocop
I'm kind of an idiot, i just realized the problem. Sorry for wasting your time, and thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list

Re: properties access by name

2008-10-17 Thread Rob Williscroft
=?KOI8-R?B?7cnU0Q==?= wrote in news:f1a77a69-2997-4f53-9a46- [EMAIL PROTECTED] in comp.lang.python: > > class Film(object): > def __init__(self, title): > self.__title = title > > @getproperty > def title(self): > return self.__title > @setproperty > def title

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { >     call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

Re: How to transfer data structure or class from Python to C/C++?

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { > call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

Re: default value in __init__

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 6:56 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 17 Oct 2008 23:04:52 +1300, Lawrence D'Oliveiro wrote: > > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > > >> We already get people asking why code like this doesn't return 3: > > > fns = [ lambd

Re: Log Exception with Backtrace

2008-10-17 Thread Chris Rebert
On Fri, Oct 17, 2008 at 9:40 AM, Heston James - Cold Beans <[EMAIL PROTECTED]> wrote: > Afternoon Guys, > > I'm currently logging exceptions within my applications like so: > > try: > #do something > except Exception, error: > # Log the exception. > self.logger.error("Exception Occu

Re: Trying to install module, No module named scipy_distutils.core (but i have scipy)

2008-10-17 Thread Robert Kern
process wrote: trying to install PyKF-0.1 (Kalman Filters) http://pykf.sourceforge.net/ I have Numpy, Scipy, Matplotlib installed an have successfully installed other packages using them. $ setup.py Traceback (most recent call last): File "./setup.py", line 2, in from scipy_distutils.

Re: Normalizing arguments

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 12:37 pm, Dan Ellis <[EMAIL PROTECTED]> wrote: > On Oct 17, 6:17 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > > > Why do you want/need this magical g() function considering that, as > > you yourself point out, Python already performs this normalization for > > you? > > A caching idea

Re: Interface to Matlab

2008-10-17 Thread Robert Kern
Claire Mouton wrote: Hi, I would like to call Python functions from Matalab. How could I find an interface from Matlab to Python? http://mlabwrap.sourceforge.net/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: Finding the instance reference of an object

2008-10-17 Thread Aaron "Castironpi" Brady
On Oct 17, 10:56 am, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 16, 2008, at 11:23 PM, Dennis Lee Bieber wrote: snip > >    But, it seems, you are the only one arguing that "the semantics are > > all the same"... Doesn't that suggest that they aren't the same? > > No, it suggests to me that the

Re: properties access by name

2008-10-17 Thread Дмитрий Гордеев
Thanks! that works now! On Fri, Oct 17, 2008 at 9:11 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > Since rwproperty appears to use descriptors just like regular > property(), you'd do it the same way as for any normal attribute, > namely: > > #for reading > print foo.y > #is the same as > print ge

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Marc 'BlackJack' Rintsch
On Fri, 17 Oct 2008 11:32:36 -0600, Joe Strout wrote: > On Oct 17, 2008, at 11:24 AM, Marc 'BlackJack' Rintsch wrote: > >>> kw = 'генских' >>> >> What do you mean by "does not work"? And you are aware that the above >> snipped doesn't involve any unicode characters!? You have a byte >> string t

Re: Finding the instance reference of an object

2008-10-17 Thread Benjamin Kaplan
On Fri, Oct 17, 2008 at 3:03 PM, Aaron Castironpi Brady < [EMAIL PROTECTED]> wrote: > On Oct 17, 10:56 am, Joe Strout <[EMAIL PROTECTED]> wrote: > > On Oct 16, 2008, at 11:23 PM, Dennis Lee Bieber wrote: > snip > > >But, it seems, you are the only one arguing that "the semantics are > > > all

Re: Finding the instance reference of an object

2008-10-17 Thread Joe Strout
On Oct 17, 2008, at 1:03 PM, Aaron Castironpi Brady wrote: I'm not fluent in Java so you'll have to be the judge. In Python: b= 0 f( b ) No matter what, b == 0. C doesn't guarantee this. It does, unless f's parameter has been declared a reference parameter. (In C++, you'd do this with '

Re: inserting Unicode character in dictionary - Python

2008-10-17 Thread Joe Strout
Thanks for the answers. That clears things up quite a bit. What if your source file is set to utf-8? Do you then have a proper UTF-8 string, but the problem is that none of the standard Python library methods know how to properly interpret UTF-8? Well, the decode method knows how to decode t

  1   2   >