Re: application and web app technologies

2006-01-02 Thread Van
problem nicely, with a fast XML page parser. So prioritize you needs: Labor, Standards, Functionality, Training, etc. Then evaluate you stacks based on your priorities. The last time I was involved with university operations we had unit record gear. Good Luck, Van -- http://mail.python.org/mailman

Re: Trying to find zip codes/rest example

2007-08-04 Thread Van Lindberg
Jay Loden wrote: > I don't remember the demo, but a little creative googling turned up > > http://bitworking.org/news/132/REST-Tips-URI-space-is-infinite > > Which matches the description above perfectly, so I assume it's what you were > after :-) That is exactly what I was trying to find! I bow

Re: sending a handmade SOAP request

2008-01-31 Thread Van Gale
On Thu, 31 Jan 2008 11:03:26 -0800, Bernard wrote: > Hey y'all, > > Is there a way to POST a handmade SOAP request *without* using any > libraries like SOAPpy? Yes, it's quite easy to SOAP by hand. I use Oren Tirosh's ElementBuilder class (on top of lxml instead of ElementTree) to build the SO

Re: Problem with os.chdir()

2009-03-11 Thread van Asselt
Hello, In order to prevent this type of problems, I alway do the following: import path path = something path = os.path.normpath(path) os.chdir(path) This prevents a lot of problems for me. Regards, Henk "Tim Golden" wrote in message news:mailman.1646.1236751732.11746.python-l...@python.org

Re: Command parsing... best module to use?

2009-11-07 Thread van Asselt
Hello Colin, I have been using 'cmdloop.py' from Crutcher Dunnavant in a few programs See http://py-cmdloop.googlecode.com/svn/trunk/cmdloop.py Regards, Henk - "Collin D" wrote in message news:94dbc92b-0682-4995-b358-0c615c95a...@x6g2000prc.googlegroups.com... > Hey ev

Re: Conditional decoration

2012-06-18 Thread Emile van Sebille
On 6/18/2012 3:16 PM Roy Smith said... Is there any way to conditionally apply a decorator to a function? For example, in django, I want to be able to control, via a run-time config flag, if a view gets decorated with @login_required(). @login_required() def my_view(request): pass class

Re: emded revision control in Python application?

2012-06-22 Thread Emile van Sebille
On 6/22/2012 8:58 AM duncan smith said... Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in JSON format contained in a few directories You don't say what your target platform is, but on linux

Re: emded revision control in Python application?

2012-06-22 Thread Emile van Sebille
On 6/22/2012 11:19 AM duncan smith said... On 22/06/12 17:42, Emile van Sebille wrote: On 6/22/2012 8:58 AM duncan smith said... Hello, I have an application that would benefit from collaborative working. Over time users construct a "data environment" which is a number of files in J

moving methods from class to instance of other class

2012-06-28 Thread lars van gemerden
Hi all, I have some trouble with the following question: Let say i have the following classes: class A(object): def __init__(self): self.name = 'a' def do(self): print 'A.do: self.name =', self.name class B(object): def __init__(self): self.name = 'b' The q

Re: moving methods from class to instance of other class

2012-06-28 Thread lars van gemerden
On Jun 28, 9:22 am, Benjamin Kaplan wrote: > On Wed, Jun 27, 2012 at 11:59 PM, lars van gemerden > > > > > > > > > > wrote: > > Hi all, > > > I have some trouble with the following question: Let say i have the > > following cl

Re: Which way is best to execute a Python script in Excel?

2012-07-05 Thread Emile van Sebille
On 7/5/2012 12:22 AM Maurizio Spadaccino said... Hi all I'm new to Python but soon after a few days of studying its features I find it my favourite mean of programming scripts to allow for data storing and mining. My idea would be to inplement python scripts from inside an excel sheet that would

Re: Re: code review

2012-07-06 Thread lars van gemerden
On Sunday, July 1, 2012 5:48:40 PM UTC+2, Evan Driscoll wrote: > On 7/1/2012 4:54, Alister wrote: > > On Sat, 30 Jun 2012 23:45:25 -0500, Evan Driscoll wrote: > >> If I had seen that in a program, I'd have assumed it was a bug. > > > > You would? > > I have only been using python for 6 - 12 months

Re: Which way is best to execute a Python script in Excel?

2012-07-06 Thread Emile van Sebille
On 7/6/2012 1:31 AM Maurizio Spadaccino said... Could you provide me a more detailed 'how-to' tutorial on implementing a VBA macro that calls a script or a function from python, or tell me where on the web I can find it? The OReilly chapter seems a bit hard for me at this stage? I'm not goin

Re: Which way is best to execute a Python script in Excel?

2012-07-07 Thread Emile van Sebille
On 7/7/2012 2:05 AM Maurizio Spadaccino said... Thanks again Emile, I'll try out some examples. I found this one: http://showmedo.com/videotutorials/video?name=2190050&fromSeriesID=219 quite enlightning. One last doubt is: say the python code gets used by more Excel Users (different pc), can I

Re: select module missing/corrupt

2012-07-07 Thread Emile van Sebille
On 7/7/2012 5:03 AM John Pote said... We are using a virtual web server running some version of Unix. It has Python versions 2.4,2.6 and 3.1 pre-installed. (BTW the intention is to use Python for a CGI script.) When my script imports subprocess I get the traceback File "/usr/lib/python2.6/subpr

Re: Python Interview Questions

2012-07-09 Thread Emile van Sebille
On 7/9/2012 2:22 PM Peter said... One of my favourite questions when interviewing - and it was 100% reliable :-) - "what are your hobbies?" If the answer included programming then they were hired, if not, then they went to the "B" list. In my experience, anybody who is really interested in pr

Re: What's wrong with this code?

2012-07-23 Thread Emile van Sebille
On 7/23/2012 7:50 AM Stone Li said... I'm totally confused by this code: Code: a = None b = None c = None d = None x = [[a,b], [c,d]] e,f = x[1] print e,f This prints the first None,None c = 1 d = 2 print e,f And nothing has happened to e

Re: Python and Outlook, sendinf an image in the body of email

2012-07-23 Thread Emile van Sebille
On 7/23/2012 11:33 AM bruceg113...@gmail.com said... I tried something similar to the example at http://stackoverflow.com/questions/4312687/how-to-embed-images-in-email . Problem is, this line is not understood: mail.BodyFormat = OlBodyFormat.olFormatHTML If I read the example properl

Re: Generating valid identifiers

2012-07-26 Thread Emile van Sebille
On 7/26/2012 5:26 AM Laszlo Nagy said... I have a program that creates various database objects in PostgreSQL. There is a DOM, and for each element in the DOM, a database object is created (schema, table, field, index and tablespace). I do not want this program to generate very long identifiers.

Re: Python Error

2012-07-29 Thread Emile van Sebille
On 7/29/2012 5:30 AM subhabangal...@gmail.com said... On Sunday, July 29, 2012 2:57:18 PM UTC+5:30, (unknown) wrote: Dear Group, I was trying to convert the list to a set, with the following code: set1=set(list1) Thanks for the answer. But my list does not contain another list that is the issu

Re: Is Python a commercial proposition ?

2012-07-30 Thread Emile van Sebille
On 7/29/2012 5:12 PM Rodrick Brown said... Until the GIL is fixed I doubt anyone will seriously look at Python as an option for large enterprise standalone application development. See openERP -- http://www.openerp.com/ -- they've been actively converting SAP accounts and have recently absorbe

Re: Linux shell to python

2012-07-30 Thread Emile van Sebille
On 7/30/2012 3:56 PM Dan Stromberg said... On Mon, Jul 30, 2012 at 9:26 PM, Barry Scott And of course you can write list comprehensions on as many lines as it take to make the code maintainable. Sigh, and I'm also not keen on multi-line list comprehensions, specifically because I thi

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Emile van Sebille
On 8/6/2012 10:14 AM Tom P said... On 08/06/2012 06:18 PM, Nobody wrote: On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: consider a nested loop algorithm - for i in range(100): for j in range(100): do_something(i,j) Now, suppose I don't want to use i = 0 and j = 0 as initial

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Emile van Sebille
On 8/6/2012 12:22 PM Grant Edwards said... On 2012-08-06, Tom P wrote: ah, that looks good - I guess it works in 2.x as well? I don't know. Let me test that for you... Yes, it works in 2.x as well. :) And from the docs, all the way back to 2.3! 9.7. itertools Functions creati

Re: [newbie] String to binary conversion

2012-08-06 Thread Emile van Sebille
On 8/6/2012 1:46 PM Mok-Kong Shen said... If I have a string "abcd" then, with 8-bit encoding of each character, there is a corresponding 32-bit binary integer. How could I best obtain that integer and from that integer backwards again obtain the original string? Thanks in advance. It's easy t

Installing Python 3.2.3 on Win 7

2012-08-16 Thread Johan van Zyl
Hi I installed Python 3.2.3 successfully on my work laptop (XP) but cannot seem to do it on my home PC (Win7) I click the button to install and the window just disappears o the screen. So how do I in fact install Python 3.2.3 on Win 7? -- Johan van Zyl PMB - Box 21673, Mayors Walk, 3208

Re: Installing Python 3.2.3 on Win 7

2012-08-16 Thread Johan van Zyl
rk laptop (XP) but >> cannot seem to do it on my home PC (Win7) >> I click the button to install and the window just disappears o the screen. >> So how do I in fact install Python 3.2.3 on Win 7? >> >> -- >> Johan van Zyl >> PMB - Box 21673, Mayors Wal

Re: Running Python web apps on shared ASO servers?

2012-08-16 Thread Emile van Sebille
On 8/16/2012 7:01 AM Gilles said... On Sun, 12 Aug 2012 02:03:33 +0200, Gilles wrote: Does it mean that ASO only supports writing Python web apps as long-running processes (CGI, FCGI, WSGI, SCGI) instead of embedded Python à la PHP? I need to get the big picture about the different solutions

Re: Python 2.7 import socket urllib fails to load, module not found

2012-08-17 Thread Emile van Sebille
On 8/17/2012 12:20 PM wdt...@comcast.net said... Just installed python 2.7 and using with web2py. When running python from command line to bring up web2py server, get errors that python socket and urllib modules cannot be found, can't be loaded. This is not a web2py issue. So, on my system

Re: Python 2.7 import socket urllib fails to load, module not found

2012-08-17 Thread Emile van Sebille
On 8/17/2012 1:41 PM wdt...@comcast.net said... From cmd prompt - I get this: Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. import urllib Traceback (most recent call last): File "",

Re: Python 2.7 import socket urllib fails to load, module not found

2012-08-17 Thread Emile van Sebille
On 8/17/2012 2:22 PM wdt...@comcast.net said... Done - tail end of the python path had a missing bit...gr... thanks so much Well it's bizarre - now it doesn't. did an import sys from within interpreter, then did import socket. Worked the first time. Restarted and it happened again. Th

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 6:31 AM Ganesh Reddy K said... But, python compilation is not successfully done and showing a failure log. Below is the capture of the same. Please see failure log shown in the bottom of this mail. How to solve the failure modules mentioned in the log ( bsddb185, dl , imageop, su

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 10:20 AM Walter Hurry said... On Mon, 20 Aug 2012 19:12:05 +0200, Kwpolska wrote: >Do you really need to compile python2.6? RHEL has packages for python, >and it's better s/better/sometimes easier > to use pre-compiled packages rather than compile them yourself. I concu

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 11:37 AM Walter Hurry said... On Mon, 20 Aug 2012 11:02:25 -0700, Emile van Sebille wrote: On 8/20/2012 10:20 AM Walter Hurry said... I concur, but FYI the version of Python with RHEL5 is 2.4. Still, OP should stick with that unless there is a pressing reason. Hence, the 2.6

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Piet van Oostrum
w could Python reliably supply this? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I display unicode value stored in a string variable using ord()

2012-08-20 Thread Piet van Oostrum
beta? Being a beta release, is it certain that this release has been compiled with the same optimization level as 3.2? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 1:55 PM Walter Hurry said... On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote: Package dependencies. If the OP intends to install a package that doesn't support other than 2.6, you install 2.6. It would be a pretty poor third party package which specified Pytho

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 9:34 PM John Nagle said... After a thread of clueless replies, s/clueless/unread Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Emile van Sebille
On 8/24/2012 3:03 PM Terry Reedy said... On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper

Re: "convert" string to bytes without changing data (encoding)

2012-08-29 Thread Piet van Oostrum
Ross Ridge writes: > > But it is in fact only stored in one particular way, as a series of bytes. > No, it can be stored in different ways. Certainly in Python 3.3 and beyond. And in 3.2 also, depending on wide/narrow build. -- Piet van Oostrum WWW: http://pietvanoostrum.com

Re: "convert" string to bytes without changing data (encoding)

2012-08-29 Thread Piet van Oostrum
n Type "help", "copyright", "credits" or "license" for more information. >>> x = input() abcd123 >>> x 'abcd123' >>> type(x) >>> y = sys.stdin.readline() abcd123 >>> y 'abcd123\n' >>>

Re: [Twisted-Python] Twisted 12.2.0 released

2012-09-02 Thread Laurens Van Houtven
Congratulations to the entire team, particularly Ashwini, and thank you for an awesome release manager job well done, Ashwini :) On Sat, Sep 1, 2012 at 3:47 PM, Ashwini Oruganti wrote: > On behalf of Twisted Matrix Laboratories, I am honored to announce the > release of Twisted 12.2. > > Highli

Re: Time Bound Input in python

2012-09-03 Thread Emile van Sebille
On 9/3/2012 3:01 AM Vikas Kumar Choudhary said... Hi I though of taking time bound input from user in python using "input" command. it waits fro infinite time , but I want to limit the time after that user input should expire with none. Please help. Googling yields http://stackoverflow.com/q

Re: Error 32 - Broken Pipe . Please Help!!

2012-09-04 Thread Emile van Sebille
On 9/4/2012 10:08 AM Sreenath k said... Error: Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner self.run() File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/monitor.py", line

Re: How to print something only if it exists?

2012-09-06 Thread Emile van Sebille
On 9/6/2012 10:59 AM tinn...@isbd.co.uk said... I want to print a series of list elements some of which may not exist, e.g. I have a line:- print day, fld[1], balance, fld[2] fld[2] doesn't always exist (fld is the result of a split) so the print fails when it isn't set. I know I could s

Re: What’s the differences between these two pieces of code ?

2012-09-09 Thread Piet van Oostrum
pectively in Python shell ,I get the same effect . > Who can tell me why ? The first one gives a syntax error (IndentationError: expected an indented block) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: SAP MM Cupertino, CA

2012-09-10 Thread Emile van Sebille
On 9/10/2012 7:58 AM Ramchandra Apte said... On Monday, 10 September 2012 18:51:10 UTC+5:30, Suresh Kumar wrote: delete the original message. Marking this as abusive in Google Groups - this seems like spam. Please explain what does this have to do with Python. Please learn to trim -- your

Re: Guides for communicating with business accounting systems

2012-09-13 Thread Emile van Sebille
On 9/13/2012 8:02 AM Ben Finney said... Howdy all, What material should a team of programmers read before designing a database model and export format for sending commerce transactions to a business accounting system? The only standard I'm aware of is the EDI specification which I first encou

Re: Passing arguments to & executing, a python script on a remote machine from a python script on local machine (using ssh ?)

2012-09-20 Thread Emile van Sebille
On 9/19/2012 12:50 PM ashish said... Hi c.l.p folks Here is my situation 1. I have two machines. Lets call them 'local' & 'remote'. Both run ubuntu & both have python installed 2. I have a python script, local.py, running on 'local' which needs to pass arguments ( 3/4 string arguments, contai

Re: Passing arguments to & executing, a python script on a remote machine from a python script on local machine (using ssh ?)

2012-09-20 Thread Piet van Oostrum
other level of interpretation. The following works: os.system('''ssh remoteuser@remote "python remote.py 'arg 1' 'arg 2' 'arg 3'"''') -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to & executing, a python script on a remote machine from a python script on local machine (using ssh ?)

2012-09-20 Thread Piet van Oostrum
e obvious call: subprocess.call(["ssh", "remoteuser@remote", "python", "remote.py", "arg 1", "arg 2", "arg 3"]) won't work because ssh will break up the "arg n" strings. You need to use "'arg n'&

Re: technologies synergistic with Python

2012-09-22 Thread Emile van Sebille
On 9/21/2012 2:59 PM Ethan Furman said... ...if my dream job is one that consists mostly of Python, and might allow telecommuting? Hi Ethan, I have an open position in my two man office I've tried to fill a couple times without success that is predominately python and would allow for telecom

Re: One of my joomla webpages has been hacked. Please help.

2012-09-26 Thread Emile van Sebille
On 9/26/2012 6:06 PM Wayne Werner said... On Sun, 23 Sep 2012, Dwight Hutto wrote: We're the borg. Oh, so you *are* a robot. That does explain your posts ;) Damn. Now I'll forever more hear Stephen Hawkin's voice as I read the repeated contexts. Maybe that'll help. EMile -- http://m

Re: test

2012-09-27 Thread Emile van Sebille
On 9/27/2012 2:58 PM Rikishi42 said... Inboxes? What is this, usenet or email ? Yes. Both. Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Should one always add super().__init__() to the __init__?

2012-09-29 Thread Piet van Oostrum
at > you know the parent class expects... but that implies knowing the > parent, so it's kinda moot. It is not necesarily calling the parent class. It calls the initializer of the next class in the MRO order and what class that is depends on the actual multiple inheritance

Re: how to insert random error in a programming

2012-10-15 Thread Emile van Sebille
Debashish Saha wrote: how to insert random error in a programming? Make the changes late in the day then leave for the weekend? Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Emile van Sebille
someone wrote: How to initialize my array directly using variables ? It could also be that I wanted: test11 = 1 test12 = 1.5 test13 = 2 test21 = 0 test22 = 5 Dx = numpy.matrix('test11 test12 test13; test21 test22 -0.5; 0 -0.5 1.5') Etc... for many variables... Appreciate ANY help, thank you

use of exec()

2012-10-18 Thread lars van gemerden
I am trying to implement a way to let users give a limited possibility to define functions in text, that wille be stored and executed at a later time. I use exec() to transform the text to a function. The code is as follows: class code(str): def __call__(self, *args): try:

Re: use of exec()

2012-10-18 Thread lars van gemerden
On Thursday, October 18, 2012 1:49:35 PM UTC+2, Chris Angelico wrote: > On Thu, Oct 18, 2012 at 10:41 PM, lars van gemerden > > wrote: > > > NameError: name 'function' is not defined > > > > > > which seems an odd error, but i think some global v

Re: use of exec()

2012-10-18 Thread lars van gemerden
On Thursday, October 18, 2012 4:29:45 PM UTC+2, Chris Angelico wrote: > On Fri, Oct 19, 2012 at 1:07 AM, lars van gemerden > wrote: > > > Thanks, Chris, > > > > > > That works like a charm (after replacig "return ns.function" with "return &

Re: Python does not take up available physical memory

2012-10-19 Thread Emile van Sebille
On 10/19/2012 10:08 AM, Pradipto Banerjee wrote: Hi, I am trying to read a file into memory. The size of the file is around 1 GB. I have a 3GB memory PC and the Windows Task Manager shows 2.3 GB available physical memory when I was trying to read the file. I tried to read the file as follows:

Re: use of exec()

2012-10-19 Thread lars van gemerden
On Thursday, October 18, 2012 5:16:50 PM UTC+2, Chris Angelico wrote: > On Fri, Oct 19, 2012 at 2:00 AM, lars van gemerden > wrote: > > > I get your point, since in this case having the custom code option makes > > the system a whole lot less complex and flexible, i

Re: use of exec()

2012-10-20 Thread lars van gemerden
On Saturday, October 20, 2012 4:00:55 AM UTC+2, Chris Angelico wrote: > On Sat, Oct 20, 2012 at 10:43 AM, lars van gemerden > > wrote: > > > Do you have any ideas about to what extend the "lambda" version of the code > > (custom code is only the 'bod

Re: get each pair from a string.

2012-10-21 Thread Emile van Sebille
On 10/21/2012 11:33 AM, Vincent Davis wrote: I am looking for a good way to get every pair from a string. For example, input: x = 'apple' output 'ap' 'pp' 'pl' 'le' I am not seeing a obvious way to do this without multiple for loops, but maybe there is not :-) In the end I am going to what to ge

Re: get each pair from a string.

2012-10-21 Thread Emile van Sebille
On 10/21/2012 11:51 AM, Ian Kelly wrote: On Sun, Oct 21, 2012 at 12:33 PM, Vincent Davis wrote: I am looking for a good way to get every pair from a string. For example, input: x = 'apple' output 'ap' 'pp' 'pl' 'le' I am not seeing a obvious way to do this without multiple for loops, but maybe

Re: get each pair from a string.

2012-10-21 Thread Emile van Sebille
On 10/21/2012 12:06 PM, Ian Kelly wrote: On Sun, Oct 21, 2012 at 12:58 PM, Vincent Davis wrote: x = 'apple' for f in range(len(x)-1): print(x[f:f+2]) @Ian, Thanks for that I was just looking in to that. I wonder which is faster I have a large set of strings to process. I'll try some timin

Re: get each pair from a string.

2012-10-22 Thread Emile van Sebille
On 10/21/2012 9:19 PM, Ian Foote wrote: On 22/10/12 09:03, Emile van Sebille wrote: So, as OP's a self confessed newbie asking about slicing, why provide an example requiring knowledge of tee, enumerate, next and izip? Because not only the newbie will read the thread? I for on

Re: Fast forward-backward (write-read)

2012-10-24 Thread Emile van Sebille
On 10/23/2012 4:35 PM, emile wrote: So, let's see, at that point in time (building backward) you've got probably somewhere close to 400-500Gb in memory. My guess -- probably not so fast. Thrashing is sure to be a factor on all but machines I'll never have a chance to work on. I went looking

Re: simple string format question

2012-10-24 Thread Piet van Oostrum
Adrien writes: > print "{:.3g}".format(2.356) # this rounds up But: >>> print "{:.3g}".format(12.356) 12.4 >>> print "{:.3g}".format(123.356) 123 -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simpler way to modify all arguments in a function before using the arguments?

2012-11-15 Thread Emile van Sebille
brucegoodst...@gmail.com wrote: Using a decorator works when named arguments are not used. When named arguments are used, unexpected keyword error is reported. Is there a simple fix? Extend def wrapper(*args) to handle *kwargs as well Emile Code: - from functools import wraps def fix

Re: Compare list entry from csv files

2012-11-26 Thread Emile van Sebille
Anatoli Hristov wrote: I understand, but in my case I have for sure the field "Name" in the second file that contains at least the first or the last name on it... So probably it should be possible:) The Name "Billgatesmicrosoft" contains the word "Gates" so logically I might find a solution for i

deepcopy questions

2012-11-27 Thread lars van gemerden
Hi, I get a very strange result when using deepcopy. The following code: def __deepcopy__(self, memo): independent = self.independent() if independent is self: out = type(self)() out.__dict__ = copy.deepcopy(self.__dict__, memo) print self._

Re: deepcopy questions

2012-11-28 Thread lars van gemerden
On Wednesday, November 28, 2012 12:59:38 AM UTC+1, lars van gemerden wrote: > Hi, > > > > I get a very strange result when using deepcopy. The following code: > > > > def __deepcopy__(self, memo): > > independent = self.independent() &g

weird isinstance/issubclass behavior?

2012-11-29 Thread lars van gemerden
Hi, I have encountered some strange behavior of isinstance(/issubclass): depending on the import path used for classes i get different output, while the classes i compare are in the same file. Basically if i import a class as: from mod1.mod2 import A or: from mod0.mod1.mod2 import A

Re: weird isinstance/issubclass behavior?

2012-11-29 Thread lars van gemerden
On Thursday, November 29, 2012 3:59:37 PM UTC+1, lars van gemerden wrote: > Hi, > > > > I have encountered some strange behavior of isinstance(/issubclass): > depending on the import path used for classes i get different output, while > the classes i compare

Re: ANN: eGenix mx Base Distribution 3.2.5 (mxDateTime, mxTextTools, etc.)

2012-12-01 Thread Piet van Oostrum
en Source Python extensions providing > important and useful services > for Python programmers. > > This announcement is also available on our web-site for online reading: > http://www.egenix.com/company/news/eGenix-mx-Base-Distribution-3.2.5-GA.

modify image and save with exif data

2012-12-16 Thread jwe . van . dijk
I want to resize an image but retain the exif data I now have: import Image img = Image.open('photo.jpg') img.thumbnail((800, 800), Image.ANTIALIAS) img.save('photo800.jpg', 'JPEG') The saved image photo800.jpg has no exif info anymore. I would so much like to have it retained in particular the e

Re: modify image and save with exif data

2012-12-17 Thread jwe . van . dijk
On Sunday, 16 December 2012 20:43:12 UTC+1, jwe.va...@gmail.com wrote: > I want to resize an image but retain the exif data > > I now have: > > import Image > > > > img = Image.open('photo.jpg') > > img.thumbnail((800, 800), Image.ANTIALIAS) > > img.save('photo800.jpg', 'JPEG') > > > > T

Re: [Twisted-Python] Twisted 12.3.0 released

2012-12-26 Thread Laurens Van Houtven
Yay! Thanks for an awesome Christmas present Thomas :) On Wed, Dec 26, 2012 at 2:21 PM, Thomas Hervé wrote: > On behalf of Twisted Matrix Laboratories, I am pleased to announce, in > extremis, the release of Twisted 12.3. > > 161 tickets are closed by this release, with the following highlights

Re: ANN: PyDTLS

2013-01-08 Thread Guido van Rossum
> http://pypi.python.org/pypi/Dtls/0.1.0";>Dtls 0.1.0 - > Datagram Transport Layer Security for Python. (07-Jan-13) > -- > http://mail.python.org/mailman/listinfo/python-announce-list > > Support the Python Software Foundation: > http://www.python.org/psf/donations/ > -- --Guido van Rossum (python.org/~guido) -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyDTLS

2013-01-08 Thread Guido van Rossum
be separate specifications for the transport and protocol interfaces used with datagrams. > Implementing DTLS as a tulip transport sounds interesting. Is the > tulip package available somewhere so that I can try it out? Absolutely -- it is very much in flux, but you can check out the l

Re: ANN: PyDTLS

2013-01-09 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 11:38 PM, rbit wrote: > On Tue, Jan 8, 2013 at 9:09 PM, Guido van Rossum wrote: >> But don't you have to deal with that when doing synchronous I/O as >> well? It's a datagram protocol after all. > > No: when dealing with blocking sockets, th

Re: How to call ltm function using rpy package in python

2013-01-11 Thread Piet van Oostrum
o you must copy the Python object to the R world. I don't know if this will work in rpy, but it does work in rpy2. Rpy2 has much better possibilities than rpy. But just try it: r['=']('dat', dat) r.ltm(r('dat~z1')) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

strace of python shows nonsense

2013-01-14 Thread Joep van Delft
Hi there, I am puzzled at how I borked my installation. Python loads slow on my machine, and I decided to use strace and /usr/bin/time to see what is actually happening. # sync && echo 3 > /proc/sys/vm/drop_caches $ /usr/bin/time python2 -c "" 0.19user 0.04system 0:01.22elapsed 19%CPU (0avgtex

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-16 Thread Piet van Oostrum
x47kUmj6Oq13JuEq34T+DVmsUCFVundQnRp c/vVEqQot7Rvj9UmSvTi4WKt/qxiAnyZf3gXOdrXvxfVTGzD5I/Xg+By+a4C2JwB A5RGvZP3fyfhkCnnhFDpfws5lc20FA6ryQIDAQAB -END RSA PUBLIC KEY- """ pk = pubkey.split('\n') pk = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A' + ''.join(pk[1:

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Piet van Oostrum
Piet van Oostrum wrote: > Converting to X.501 isn't difficult (assuming this is a 2048 bit key): > Get rid of the 'RSA' in header and trailer > Prepend X.501 header 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A' to the data > Reformat the lines to 64 characters. This so

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-17 Thread Piet van Oostrum
M2Crypto doesn't have methods to do this, so you would need to use one of the python ASN.1 libraries (or write that part yourself). -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread Piet van Oostrum
by the browser in a new request. The image should be at /home/nikos/public_html/data/images/mail.png P.S. I don't understand what you mean by "addon domain". -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Piet van Oostrum
ed > > and the python scipt is on: > > /home/nikos/public_html/cafebar-idea.gr/cgi-bin/counter.py > > So if a python script can open any file the user has access too then we need > a "python way" of opening this file. So why don't you put the image at /home

Re: Uniquely identifying each & every html template

2013-01-21 Thread Piet van Oostrum
n attribute to some tag. If that can't be done the problem cannot be solved and it makes no sense keeping asking the same question over and over again. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

finding abc's

2013-01-25 Thread lars van gemerden
Hi all, i was writing a function to determine the common base class of a number classes: def common_base(classes): if not len(classes): return None common = set(classes.pop().mro()) for cls in classes: common.intersection_update(cls.mro()) while len(common) > 1:

Re: finding abc's

2013-01-25 Thread lars van gemerden
On Friday, January 25, 2013 8:04:32 PM UTC+1, Ian wrote: > On Fri, Jan 25, 2013 at 10:40 AM, lars van gemerden > > wrote: > > > Hi all, > > > > > > i was writing a function to determine the common base class of a number > > classes: > > &g

Re: finding abc's

2013-01-25 Thread lars van gemerden
On Friday, January 25, 2013 8:08:18 PM UTC+1, Peter Otten wrote: > lars van gemerden wrote: > > > > > Hi all, > > > > > > i was writing a function to determine the common base class of a number > > > classes: > > > > &g

Re: finding abc's

2013-01-25 Thread lars van gemerden
for future reference, i decided to go with 2 functions: def common_bases(classes): if not len(classes): return None common = set(classes.pop().mro()) for cls in classes: common.intersection_update(cls.mro()) #all subclasses in common return [cls for cls in co

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-27 Thread Emile van Sebille
On 1/25/2012 9:14 PM Steven D'Aprano said... In the same way that a native English speaker would never make the mistake of using "organ" to refer to an unnamed mechanical device, so she would never use "gadget" to refer to an unnamed body part. My wife introduced me to the term "picnic gadget"

Re: runtime error

2012-01-28 Thread Emile van Sebille
On 1/27/2012 10:38 AM nikos spanakis said... Hi I just minstalled python 3.1 on my windons XP SP3 but on the start up I get the following error message: You don't say what you specifically installed, but for windows you may find activestates distribution a good fit. See http://www.activest

Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-08 Thread Case Van Horsen
On Tue, Feb 7, 2012 at 9:37 PM, Alec Taylor wrote: > Thanks all for your replies. > > I have now installed MSVC8 and YASM. I assume you installed Visual Studio. I've omitted the commands to use the SDK compiler below. > > I was able to successfully run configure.bat and make.bat (including > make.

Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-08 Thread Case Van Horsen
at DLL. Only the innvocation of setup.py should need to refer to the MPIR library locations. I don't use pip so I'm not sure how to get pip to install the resulting DLL, etc. > > On Wed, Feb 8, 2012 at 9:48 PM, Case Van Horsen wrote: >> On Tue, Feb 7, 2012 at 9:37 PM, Alec

Postpone evaluation of argument

2012-02-10 Thread Righard van Roy
Hello, I want to add an item to a list, except if the evaluation of that item results in an exception. I could do that like this: def r(x): if x > 3: raise(ValueError) try: list.append(r(1)) except: pass try: list.append(r(5)) except: pass This looks rather clumbsy t

Re: list of properties

2012-02-16 Thread Emile van Sebille
On 2/16/2012 9:19 AM Emmanuel Mayssat said... Hello, Is there a way to list 'properties' ? dir(thingy) from PyQt4.QtCore import * class LObject(QObject): def __init__(self, parent=None): super(LObject, self).__init__(parent) self.arg1 = 'toto' def getArg2(self

  1   2   3   4   5   6   7   8   9   10   >