Re: Async IO Server with Blocking DB

2012-04-04 Thread Jean-Paul Calderone
On Apr 3, 6:13 pm, looking for wrote: > Hi > > We are thinking about building a webservice server and considering > python event-driven servers i.e. Gevent/Tornado/ Twisted or some > combination thereof etc. > > We are having doubts about the db io part. Even with connection > pooling and cache, t

Re: How good is security via hashing

2011-06-07 Thread Jean-Paul Calderone
On Jun 7, 6:18 am, Robin Becker wrote: > A python web process is producing files that are given randomized names of > the form > > hh-MMDDhhmmss-.pdf > > where rrr.. is a 128bit random number (encoded as base62). The intent of the > random part is to prevent recipients of one file

Re: How good is security via hashing

2011-06-07 Thread Jean-Paul Calderone
On Jun 7, 7:35 am, Robin Becker wrote: > On 07/06/2011 11:26, Nitin Pawar wrote:> Have you tried using UUID module? > > > Its pretty handy and comes with base64 encoding function which gives > > extremely high quality randon strings > > > ref: > >http://stackoverflow.com/questions/621649/python-an

Re: GIL in alternative implementations

2011-06-07 Thread Jean-Paul Calderone
On Jun 7, 12:03 am, "Gabriel Genellina" wrote: > En Sat, 28 May 2011 14:05:16 -0300, Steven D'Aprano   > escribi : > > > > > > > > > > > On Sat, 28 May 2011 09:39:08 -0700, John Nagle wrote: > > >> Python allows patching code while the code is executing. > > > Can you give an example of what you

Re: Secure ssl connection with wrap_socket

2011-07-05 Thread Jean-Paul Calderone
On Jul 5, 4:52 am, Andrea Di Mario wrote: > Hi, I'm a new python user and I'm writing a small web service with ssl. > I want use a self-signed certificate like in > wiki:http://docs.python.org/dev/library/ssl.html#certificates > I've used wrap_socket, but if i try to use > cert_reqs=ssl.CERT_REQU

Re: Secure ssl connection with wrap_socket

2011-07-06 Thread Jean-Paul Calderone
On Jul 6, 4:44 am, AndDM wrote: > On Jul 5, 4:08 pm, Jean-Paul Calderone > wrote: > > > > > On Jul 5, 4:52 am, Andrea Di Mario wrote: > > > > Hi, I'm a new python user and I'm writing a small web service with ssl. > > > I want us

Re: Howto Deferred

2011-07-14 Thread Jean-Paul Calderone
On Jul 14, 3:07 am, marco wrote: > Hello gals and guys, > > I'm an experienced Python user and I'd like to begin playing with > Twisted. > I started RTFM the tutorial advised on the official site and I found it > really useful and well done. > > Now I'd like to practice a bit by coding a little pr

Re: Checking against NULL will be eliminated?

2011-03-03 Thread Jean-Paul Calderone
On Mar 3, 8:16 am, Neil Cerutti wrote: > On 2011-03-03, Tom Zych wrote: > > > Carl Banks wrote: > >> Perl works deterministically and reliably.  In fact, pretty much every > >> language works deterministically and reliably.  Total non-argument. > > > Well, yes. I think the real issue is, how many

Re: Questions about GIL and web services from a n00b

2011-04-16 Thread Jean-Paul Calderone
On Apr 16, 10:44 am, a...@pythoncraft.com (Aahz) wrote: > In article , > Raymond Hettinger   wrote: > > > > >Threading is really only an answer if you need to share data between > >threads, if you only have limited scaling needs, and are I/O bound > >rather than CPU bound > > Threads are also usefu

Re: Equivalent code to the bool() built-in function

2011-04-19 Thread Jean-Paul Calderone
On Apr 19, 10:23 am, Grant Edwards wrote: > On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes wrote: > > Am 18.04.2011 21:58, schrieb John Nagle: > >> ?? ?? This is typical for languages which backed into a "bool" type, > >> rather than having one designed in. ??The usual result is a boolean > >>

Re: Pickling over a socket

2011-04-19 Thread Jean-Paul Calderone
On Apr 19, 6:27 pm, Roger Alexander wrote: > Thanks everybody, got it working. > >  I appreciate the help! > > Roger. It's too bad none of the other respondents pointed out to you that you _shouldn't do this_! Pickle is not suitable for use over the network like this. Your server accepts arbitr

Re: Why doesn't this asyncore.dispatcher.handle_read() get called?

2011-04-20 Thread Jean-Paul Calderone
On Apr 20, 12:25 pm, Dun Peal wrote: > Hi, > > I'm writing and testing an asyncore-based server. Unfortunately, it > doesn't seem to work. The code below is based on the official docs and > examples, and starts a listening and sending dispatcher, where the > sending dispatcher connects and sends a

Re: When is PEP necessary?

2011-04-23 Thread Jean-Paul Calderone
On Apr 23, 5:09 pm, Daniel Kluev wrote: > On Sat, Apr 23, 2011 at 11:16 PM, Disc Magnet wrote: > > Is PEP necessary to add a new package to the standard library? > > *skip* > > Don't forget that Python is not limited to CPython. Other > implementations need these PEPs to provide compliant package

Re: sockets: bind to external interface

2011-04-25 Thread Jean-Paul Calderone
On Apr 25, 3:49 pm, Chris Angelico wrote: > On Tue, Apr 26, 2011 at 5:37 AM, Hans Georg Schaathun > wrote: > > > Has anyone found a simple solution that can be administered without > > root privileges?  I mean simpler than passing the ip address > > manually :-) > > You can run 'ifconfig' withou

Re: connect SIGINT to custom interrupt handler

2011-05-18 Thread Jean-Paul Calderone
On May 18, 9:28 am, Christoph Scheingraber wrote: > On 2011-05-15, Miki Tebeka wrote: > > > Why not just catch KeyboardInterrupt? > > Would it be possible to continue my program as nothing had happened in > that case (like I did before, setting a flag to tell main() to finish the > running data d

Re: Sanitizing filename strings across platforms

2011-05-31 Thread Jean-Paul Calderone
On May 31, 10:17 pm, Tim Chase wrote: > Scenario: a file-name from potentially untrusted sources may have > odd filenames that need to be sanitized for the underlying OS. > On *nix, this generally just means "don't use '/' or \x00 in your > string", while on Win32, there are a host of verboten cha

[ANN] txaws 0.5.0

2017-12-27 Thread Jean-Paul Calderone
Hello all, I'm pleased to announce the release of txAWS 0.5.0. txAWS is a library for interacting with Amazon Web Services (AWS) using Twisted. You can download the release from PyPI . Since the last release, the following enhancements have been made: Featur

Announcing txAWS 0.2.3.1

2017-01-09 Thread Jean-Paul Calderone
I've just release txAWS 0.2.3.1. txAWS is a library for interacting with Amazon Web Services (AWS) using Twisted. AWSServiceEndpoint's ssl_hostname_verification's parameter now defaults to True instead of False. This affects all txAWS APIs which issue requests to AWS endpoints. For any applicat

[ANN] txkube 0.3.0

2018-08-08 Thread Jean-Paul Calderone
thon.org/pypi> You can contribute to its development on GitHub <https://github.com/LeastAuthority/txkube>. Thanks to Least Authority TFA GmbH <https://leastauthority.com/> for sponsoring this development and to Craig Rodrigues for his efforts on Python 3 porting work. Jean-Paul

Tahoe-LAFS on Python 3 - Call for Porters

2019-09-24 Thread Jean-Paul Calderone
Hello Pythonistas, Earlier this year a number of Tahoe-LAFS community members began an effort to port Tahoe-LAFS from Python 2 to Python 3. Around five people are currently involved in a part-time capacity. We wish to accelerate the effort to ensure a Py

Re: Pickle to source code

2005-10-26 Thread Jean-Paul Calderone
On 26 Oct 2005 06:15:35 -0700, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> I want to convert from pickle format to python source code. That is, >> given an existing pickle, I want to produce a textual representation >> which, when evaluated, yields the original object (as if I had >> unpickled

Re: Help: Quick way to test if value lies within a list of lists of ranges?

2005-10-27 Thread Jean-Paul Calderone
On Thu, 27 Oct 2005 15:48:53 +0100 (BST), Ben O'Steen <[EMAIL PROTECTED]> wrote: >Scenario: >= > >Using PyGame in particular, I am trying to write an application that will >run a scripted timeline of events, eg at 5.5 seconds, play xxx.mp3 and put >the image of a ball on screen, at 7.8 seco

Re: db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB

2005-10-27 Thread Jean-Paul Calderone
On Fri, 28 Oct 2005 00:17:54 +0800, "Neville C. Dempsey" <[EMAIL PROTECTED]> wrote: >Why does this python program fail to read record "600"? > >#!/usr/bin/env python >import bsddb # twiceopen.py > >key="600" >btf=bsddb.db.DB_INIT_THREAD > >list1=bsddb.btopen("twiceopen.tbl",btflags=btf) >l

Re: lambda functions within list comprehensions

2005-10-29 Thread Jean-Paul Calderone
On 29 Oct 2005 14:25:24 -0700, Max Rybinsky <[EMAIL PROTECTED]> wrote: >Hello! > >Please take a look at the example. > a = [(x, y) for x, y in map(None, range(10), range(10))] # Just a list of tuples a >[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, >8), (9, 9)

Re: socket receive file does not match sent file

2005-11-06 Thread Jean-Paul Calderone
On 6 Nov 2005 09:13:03 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I wrote two simple socket program. >one for sending a file and the other for receiving the file. >but when I run it, a curious thing happened. >The received file was samller that the sent file. Your sender does not take

Re: RAW_INPUT

2005-11-07 Thread Jean-Paul Calderone
On Mon, 07 Nov 2005 12:14:15 -0600, A D <[EMAIL PROTECTED]> wrote: >On Mon, 2005-11-07 at 07:57 -0800, john boy wrote: >> I am having trouble with the following example used in a tutorial: >> >> print "Halt !" >> s = raw_input ("Who Goes there? ") >> print "You may pass,", s > >at this print line y

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread Jean-Paul Calderone
On 7 Nov 2005 12:54:40 -0800, vinjvinj <[EMAIL PROTECTED]> wrote: >I have an application which allows multiple users to write models. >These models get distributed on a grid of compute engines. users submit >their models through a web interface. I want to > >1. restrict the user from doing any file

Re: sqlite3 decode error

2005-11-08 Thread Jean-Paul Calderone
On Tue, 08 Nov 2005 16:27:25 -0400, David Pratt <[EMAIL PROTECTED]> wrote: >Recently I have run into an issue with sqlite where I encode strings >going into sqlite3 as utf-8. I guess by default sqlite3 is converting >this to unicode since when I try to decode I get an attribute error >like this: >

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
On 8 Nov 2005 17:27:24 -0800, [EMAIL PROTECTED] wrote: >Is there some command in python so that I can read a key's input and >then use a gotoxy() function to move the cursor on screen? e.g.: >(psuedo-code) > >When the right arrow is pushed, cursor gotoxy(x+1,y) > You can uses curses for this, on

Re: Storing empties

2005-11-08 Thread Jean-Paul Calderone
On Tue, 8 Nov 2005 19:28:36 -0800, Alex Martelli <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: > ... >> >For pickling, object() as a unique "nothing here, NOT EVEN a None" >> >marker (AKA sentinel) works fine. >> >> How does that work? Maybe I'm missing something obvious. >> >>

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
On Tue, 8 Nov 2005 22:33:47 -0500, "Chris F.A. Johnson" <[EMAIL PROTECTED]> wrote: > [snip] > > To read a single keystroke, see Claudio Grondi's post in the > thread "python without OO" from last January. > > Function and cursor keys return more than a single character, so > more w

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Jean-Paul Calderone
On Wed, 09 Nov 2005 17:57:46 +, Steve Holden <[EMAIL PROTECTED]> wrote: >Gerhard Häring wrote: >> Vittorio wrote: >> > [snip] >> >> I think about the only place I wrote a bit about the differences was in >> the pysqlite 2.0 final announcement: >> >> http://lists.initd.org/pipermail/pysqlite/200

Re: web interface

2005-11-09 Thread Jean-Paul Calderone
On Wed, 9 Nov 2005 19:08:28 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >On Mon, 7 Nov 2005, Ajar wrote: > >> I have a stand alone application which does some scientific >> computations. I want to provide a web interface for this app. The app is >> computationally intensive and may take long tim

Re: Python obfuscation

2005-11-09 Thread Jean-Paul Calderone
On 9 Nov 2005 11:34:38 -0800, The Eternal Squire <[EMAIL PROTECTED]> wrote: >Perhaps this could be a PEP: > >1) Add a system path for decryption keys. >2) Add a system path for optional decryptors supplied by user > (to satisfy US Export Control) >3) When importing a module try: import rout

Re: web interface

2005-11-10 Thread Jean-Paul Calderone
On 10 Nov 2005 05:31:29 -0800, Michele Simionato <[EMAIL PROTECTED]> wrote: > > >I have been looking for an example like this for a while, so thanks to >J.P. Calderone. >Unfortunately, this kind of solution is pretty much browser-dependent. >For instance, >I tried it and it worked with Firefox, but

Re: Dynamically Update Class Definitions?

2005-11-11 Thread Jean-Paul Calderone
On Sat, 12 Nov 2005 06:24:57 GMT, Chris Spencer <[EMAIL PROTECTED]> wrote: >Chris Spencer wrote: >> Alex Martelli wrote: > >>> If you're in no hurry, you COULD loop over all of gc.get_objects(), >>> identify all those which are instances of old_class and "somehow" change >>> their classes to new_cl

Re: XUL behavior in Python via XPCOM, Mozilla

2005-11-12 Thread Jean-Paul Calderone
On Sat, 12 Nov 2005 14:25:51 -0600, Terry Hancock <[EMAIL PROTECTED]> wrote: >I recently saw a claim that Mozilla XUL behaviors (normally >scripted in Javascript) can (or perhaps will) be scriptable >in Python. > >Also, "other languages such as Java or Python are supported >through XPCOM", said abo

Re: is parameter an iterable?

2005-11-15 Thread Jean-Paul Calderone
On 15 Nov 2005 11:26:23 -0800, py <[EMAIL PROTECTED]> wrote: >Dan Sommers wrote: >> Just do it. If one of foo's callers passes in a non-iterable, foo will >> raise an exception, and you'll catch it during testing > >That's exactly what I don't want. I don't want an exception, instead I >want to c

Re: Creating (rather) generic plugin framework?

2005-11-16 Thread Jean-Paul Calderone
On Wed, 16 Nov 2005 17:14:27 +0200, Edvard Majakari <[EMAIL PROTECTED]> wrote: >Hi, > >My idea is to create a system working as follows: each module knows >path to plugin directory, and that directory contains modules which >may add hooks to some points in the code. > >Inspired by http://www.python

Re: General question about Python design goals

2005-11-27 Thread Jean-Paul Calderone
On 27 Nov 2005 19:49:26 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >Robert Kern <[EMAIL PROTECTED]> writes: >> Use cases are the primary tool for communicating those practical >> needs. If you can't think of a single use case, what's the point of >> implementing something? Or rather

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Jean-Paul Calderone
On Thu, 08 Dec 2005 22:42:32 +0800, Maurice LING <[EMAIL PROTECTED]> wrote: >Hi, > >I need to look into serialization for python objects, including codes, >recursive types etc etc. Currently, I have no idea exactly what needs to >be serialized, so my scope is to be as wide as possible. > >I underst

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Jean-Paul Calderone
On Fri, 09 Dec 2005 02:17:10 +0800, Maurice LING <[EMAIL PROTECTED]> wrote: > >> Since copy_reg lets you specify arbitrary code to serialize arbitrary >> objects, you shouldn't run into any single object that you cannot >> serialize to a pickle. > > [snip - example of pickling code objects] > > >I

Re: Validating an email address

2005-12-09 Thread Jean-Paul Calderone
On Fri, 9 Dec 2005 11:10:04 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >Hi all, > >A hoary old chestnut this - any advice on how to syntactically validate an >email address? I'd like to support both the display-name-and-angle-bracket >and bare-address forms, and to allow everything that RFC 282

Re: Dectecting dir changes

2005-12-09 Thread Jean-Paul Calderone
On Fri, 09 Dec 2005 16:50:05 +, Steve Holden <[EMAIL PROTECTED]> wrote: >chuck wrote: >> I need to write a daemon for Solaris that monitors a directory for >> incoming FTP transfers. Under certain conditions, when the transfer is >> complete I need to send an email notification, and do other s

Re: Overloading

2005-12-09 Thread Jean-Paul Calderone
On Fri, 09 Dec 2005 18:29:12 +0100, Johannes Reichel <[EMAIL PROTECTED]> wrote: >Hi! > >In C++ you can overload functions and constructors. For example if I have a >class that represents a complex number, than it would be nice if I can >write two seperate constructors > >class Complex: > >def __ini

Re: Dectecting dir changes

2005-12-09 Thread Jean-Paul Calderone
On 9 Dec 2005 09:56:03 -0800, chuck <[EMAIL PROTECTED]> wrote: >Hmmm, that is an interesting idea. I've noticed the new book on >Twisted, thinking about picking it up. > >I assume that this little snippet will handle multiple/concurrent >incoming transfers via threading/sub-process, is scalable, s

Re: Managing import statements

2005-12-10 Thread Jean-Paul Calderone
On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote: >Let's talk about the problem I really want help with. I brought up a >proposal earlier, but it was only half serious. I realize Python is too >sacred to accept such a heretical change. ;-) > >Here's the real problem: m

Re: Managing import statements

2005-12-10 Thread Jean-Paul Calderone
On Sat, 10 Dec 2005 13:40:12 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway >> <[EMAIL PROTECTED]> wrote: >>> How about PyLint / PyChecker? Can I configure one of them to te

Re: Managing import statements

2005-12-10 Thread Jean-Paul Calderone
On Sat, 10 Dec 2005 11:54:47 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote: >>>How about PyLint / PyChecker? Can I configure one of them to tell me >>

Re: Question about tuple lengths

2005-12-14 Thread Jean-Paul Calderone
On Wed, 14 Dec 2005 09:54:31 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > From my interpreter prompt: > > >>> tuple = ("blah") > >>> len(tuple) >4 > >>> tuple2 = ("blah",) > >>> len (tuple2) >1 > >So why is a tuple containing the string "blah" without the comma of >length four? Is t

Re: Threading in python

2005-12-14 Thread Jean-Paul Calderone
On 14 Dec 2005 10:15:08 -0800, Aahz <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: > >>Because of this global interpreter lock does this mean its impossible to >>get speed up with threading on multiple processor systems? I would >>think

Re: Wed Development - Dynamically Generated News Index

2005-12-17 Thread Jean-Paul Calderone
On 17 Dec 2005 23:14:33 -0800, [EMAIL PROTECTED] wrote: >Hi to all, > >I am somewhat somewhat new to Python, but apart from this I am just not >seeing lots of resources on what I am trying to do. I have seen them >in other languages like PHP and ASP. > >I am building a simple MySQL news database,

Re: Wed Development - Dynamically Generated News Index

2005-12-18 Thread Jean-Paul Calderone
On 18 Dec 2005 12:27:55 -0800, [EMAIL PROTECTED] wrote: >Hi Jean-Paul, > >I am a bit lost in you code. Is it possible for you to step through >it? For in depth-assistance, it would probably be best to continue on [EMAIL PROTECTED] You might also want to check out some of the links on

Re: Which Python web framework is most like Ruby on Rails?

2005-12-22 Thread Jean-Paul Calderone
On 21 Dec 2005 13:53:55 -0800, Pierre Quentel <[EMAIL PROTECTED]> wrote: >Just to add some more confusion to the discussion, here is what I've >found about other web frameworks : >CherryPy : BSD >Django : BSD >Jonpy : Python licence >Quixote : CNRI >Skunkweb : GPL or BSD >Snakelets : MIT >Subway :

Re: Python IMAP4 Memory Error

2005-12-23 Thread Jean-Paul Calderone
On Fri, 23 Dec 2005 14:21:27 +1100, Dody Suria Wijaya <[EMAIL PROTECTED]> wrote: >Noah wrote: >> This looks like a bug in your build of Python 2.4.2 for Windows. >> Basically it means that C's malloc() function in the Python interpreter >> failed. >> > >On a second trial, it's also failed on Python

Re: XPath-like filtering for ElementTree

2005-12-26 Thread Jean-Paul Calderone
On 26 Dec 2005 15:42:56 -0800, Gerard Flanagan <[EMAIL PROTECTED]> wrote: >Pseudo-XPath support for ElementTree with the emphasis on 'Pseudo'. > >http://gflanagan.net/site/python/pagliacci/ElementFilter.html > > [snip] > >ns = "xmlns1" >path = r"{%s}To/[EMAIL PROTECTED]'Mrs Jones' and @

Re: python coding contest

2005-12-27 Thread Jean-Paul Calderone
On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <[EMAIL PROTECTED]> wrote: >Shane Hathaway wrote: >> Paul McGuire wrote: >> >> >> Also, here's another cheat version. (No, 7seg.com does not exist.) >> >>import urllib2 >>def seven_seg(x):return urllib2.urlopen('http://7seg.com/'+x).read() >

Re: Simple question on Parameters...

2005-12-28 Thread Jean-Paul Calderone
On 28 Dec 2005 12:37:32 -0800, KraftDiner <[EMAIL PROTECTED]> wrote: >I have defined a method as follows: > >def renderABezierPath(self, path, closePath=True, r=1.0, g=1.0, b=1.0, >a=1.0, fr=0.0, fg=0.0, fb=0.0, fa=.25): > >Now wouldn't it be simpler if it was: > >def renderABezierPath(self, path,

Re: Is this a refrence issue?

2005-12-28 Thread Jean-Paul Calderone
On Wed, 28 Dec 2005 14:40:45 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >KraftDiner wrote: >> I understand that everything in python is a refrence >> >> I have a small problem.. >> >> I have a list and want to make a copy of it and add an element to the >> end of the new list, >>

Re: Is len() restricted to (positive) 32-bit values?

2005-12-29 Thread Jean-Paul Calderone
On 29 Dec 2005 19:14:36 -0800, Josh Taylor <[EMAIL PROTECTED]> wrote: >I have a class that wraps a large file and tries to make it look like a >string w.r.t. slicing. Here, "large file" means on the order of >hundreds of GB. All the slicing/indexing stuff through __getitem__() >works fine, but le

Re: Python as a Server vs Running Under Apache

2006-01-01 Thread Jean-Paul Calderone
On 1 Jan 2006 14:44:07 -0800, mojosam <[EMAIL PROTECTED]> wrote: >I guess I'm a little confused, and this certainly comes from not yet >having tried to do anything with Python on a web server. > >I remarked once to a Python programmer that it appeared to me that if I >had a web page that called a P

Re: Threading for a newbie

2006-01-05 Thread Jean-Paul Calderone
On Thu, 05 Jan 2006 17:15:20 -0500, Koncept <[EMAIL PROTECTED]> wrote: > >Hi. I am fairly new to Python programming and am having some trouble >wrapping my head around threading. > It's pretty much the standard threading model. >This is a very basic example of what I am trying to do, and would >g

Re: Spelling mistakes!

2006-01-06 Thread Jean-Paul Calderone
On 6 Jan 2006 07:57:04 -0800, KraftDiner <[EMAIL PROTECTED]> wrote: >try this: > >class x(object): > def __init__(self): > self.someName = "hello" > def someMethod(self): > self.sumName = "bye" > >find that bug. > [EMAIL PROTECTED]:~$ cat > xobj.py class x(object): def __init

Re: question about mutex.py

2006-01-06 Thread Jean-Paul Calderone
On 6 Jan 2006 14:44:39 -0800, [EMAIL PROTECTED] wrote: >Hi, I was looking at the code in the standard lib's mutex.py, which is >used for queuing function calls. Here is how it lets you acquire a >lock: Did you read the module docstring? Of course, no multi-threading is implied -- hence the fu

Re: Calling foreign functions from Python? ctypes?

2006-01-06 Thread Jean-Paul Calderone
On Sat, 07 Jan 2006 00:55:45 GMT, Neil Hodgson <[EMAIL PROTECTED]> wrote: >Paul Watson: > >> Neil Hodgson wrote: >>>It is unlikely that ctypes will be included in the standard Python >>> build as it allows unsafe memory access making it much easier to crash >>> Python. >> Does extending Python

Re: Failing unittest Test cases

2006-01-10 Thread Jean-Paul Calderone
On 10 Jan 2006 13:49:17 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >[EMAIL PROTECTED] writes: >> Got any ideas how that is to be accomplished short of jiggering the >> names so they sort in the order you want them to run? > >How about with a decorator instead of the testFuncName con

Re: How can I test if an argument is a sequence or a scalar?

2006-01-10 Thread Jean-Paul Calderone
On 10 Jan 2006 15:18:22 -0800, [EMAIL PROTECTED] wrote: >I want to be able to pass a sequence (tuple, or list) of objects to a >function, or only one. Generally it's better to keep your API consistent. If you are going to take sequences, only take sequences. Don't try to make the interface mor

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Jean-Paul Calderone
On Sat, 14 Jan 2006 16:58:55 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >"Giovanni Bajo" <[EMAIL PROTECTED]> writes: >> [EMAIL PROTECTED] wrote: >>> Try... >> for i in bytes: print ord(i) >>> or >> len(bytes) >>> What you see isn't always what you have. Your database is capable of >>> sto

Re: proposal: another file iterator

2006-01-15 Thread Jean-Paul Calderone
On 15 Jan 2006 16:44:24 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >I find pretty often that I want to loop through characters in a file: > > while True: > c = f.read(1) > if not c: break > ... > >or sometimes of some other blocksize instead of 1. It would sure >be eas

Re: Space left on device

2006-01-16 Thread Jean-Paul Calderone
On 16 Jan 2006 07:52:46 -0800, sir_alex <[EMAIL PROTECTED]> wrote: >Is there any function to see how much space is left on a device (such >as a usb key)? I'm trying to fill in an mp3 reader in a little script, >and this information could be very useful! Thanks! If you are on a platform with statvf

Re: magical expanding hash

2006-01-17 Thread Jean-Paul Calderone
On Tue, 17 Jan 2006 16:47:15 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >braver wrote: >> Well, I know some python, but since there are powerful and magical >> features in it, I just wonder whether there're some which address this >> issue better than others. >> > >In python, += is short, of co

Re: Simultaneous connections

2006-01-20 Thread Jean-Paul Calderone
On 20 Jan 2006 06:01:15 -0800, datbenik <[EMAIL PROTECTED]> wrote: >How can i write a program that supports simultaneous multipart >download. So i want to open multiple connections to download one file. >Is this possible. If so, how? http://twistedmatrix.com/ > >-- >http://mail.python.org/mailman

Re: Warning when new attributes are added to classes at run time

2006-07-19 Thread Jean-Paul Calderone
On Wed, 19 Jul 2006 20:42:40 GMT, Matthew Wilson <[EMAIL PROTECTED]> wrote: > >I sometimes inadvertently create a new attribute on an object rather >update a value bound to an existing attribute. For example: > > [snip] Write more unit tests. If you have mistakes like this, they will fail and yo

Re: How to force a thread to stop

2006-07-24 Thread Jean-Paul Calderone
On Mon, 24 Jul 2006 11:22:49 -0700, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Steve Holden wrote: >> Carl J. Van Arsdall wrote: >> [... rant ...] >> >>> So with this whole "hey mr. nice thread, please die for me" concept gets >>> ugly quickly in complex situations and doesn't scale well at

Re: How to force a thread to stop

2006-07-24 Thread Jean-Paul Calderone
On Mon, 24 Jul 2006 13:51:07 -0700, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> On Mon, 24 Jul 2006 11:22:49 -0700, "Carl J. Van Arsdall" <[EMAIL >> PROTECTED]> wrote: >> >>> Steve Ho

Re: micro authoritative dns server

2006-07-24 Thread Jean-Paul Calderone
On 24 Jul 2006 14:45:25 -0700, [EMAIL PROTECTED] wrote: >Hi, > >I'm new in python. I know that there are several classes for writing >dns servers, but I don't understand it > >I just want to know if anyone could help me in writing a code for >minimal authoritative dns server. I would like that anyo

Re: Newbie Q: Class Privacy (or lack of)

2006-07-24 Thread Jean-Paul Calderone
On Tue, 25 Jul 2006 02:49:06 GMT, Steve Jobless <[EMAIL PROTECTED]> wrote: >Hi, > >I just started learning Python. I went through most of the tutorial at >python.org. But I noticed something weird. I'm not talking about the >__private hack. > >Let's say the class is defined as: > > class MyClass:

Re: Stack trace in C

2006-07-25 Thread Jean-Paul Calderone
On Tue, 25 Jul 2006 14:20:41 +0200, Andre Poenitz <[EMAIL PROTECTED]> wrote: > > >Bear with me - I am new to Python. (And redirect me to a more suitable >newsgroup in case this one is not appropriate.) > >I am trying to embed Python into a C++ application and want to get back >a backtrace in case o

Re: How to force a thread to stop

2006-07-25 Thread Jean-Paul Calderone
On 25 Jul 2006 05:51:47 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >[EMAIL PROTECTED] writes: >> Threadicide would not solve the problems you actually have, and it >> tends to create other problems. What is the condition that makes >> you want to kill the thread? Make the victim thr

Re: Python stack trace on blocked running script.

2006-07-25 Thread Jean-Paul Calderone
On Tue, 25 Jul 2006 13:20:18 -0700, Rich Burridge <[EMAIL PROTECTED]> wrote: > >Hi all, > >If this is a frequently asked question, then just slap me silly and point me >in the right direction. > >We are currently experiencing a hanging problem with Orca [1], a >screen reader/magnifier written in Py

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Jean-Paul Calderone
On 26 Jul 2006 08:16:21 -0700, [EMAIL PROTECTED] wrote: > >Jaroslaw Zabiello wrote: >> On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote: >> >> > I have difficulty imagining how a language could be more dynamic than >> > Python... >> >> E.g. try to extends or redefine builtin Python cla

Re: How to force a thread to stop

2006-07-27 Thread Jean-Paul Calderone
On Thu, 27 Jul 2006 07:07:05 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Wed, 26 Jul 2006 17:38:06 -0700, "Carl J. Van Arsdall" ><[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> Well, I guess I'm thinking of an event driven mechanism, kinda like >> setting up signal h

Re: How to force a thread to stop

2006-07-27 Thread Jean-Paul Calderone
On Thu, 27 Jul 2006 02:30:03 -0500, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Hans wrote: >> > Is there a way that the program that created and started a thread also >> > stops >> > it. >> > (My usage is a time-out). >> > >> > E.g. >> > >> > threa

Re: Info on continuations?

2006-08-08 Thread Jean-Paul Calderone
On 8 Aug 2006 08:07:02 -0700, [EMAIL PROTECTED] wrote: > >vasudevram wrote: >> Hi, >> >> I am Googling and will do more, found some stuff, but interested to get >> viewpoints of list members on: >> >> Continuations in Python. >> >> Saw a few URLs which had some info, some of which I understood. But

Re: do people really complain about significant whitespace?

2006-08-09 Thread Jean-Paul Calderone
On Wed, 09 Aug 2006 13:47:03 +0100, Pierre Barbier de Reuille <[EMAIL PROTECTED]> wrote: >Carl Banks wrote: >> Michiel Sikma wrote: >>> Op 8-aug-2006, om 1:49 heeft Ben Finney het volgende geschreven: >>> As others have pointed out, these people really do exist, and they each believe the

Re: start a multi-sockets server (a socket/per thread) with different ports but same host

2006-08-12 Thread Jean-Paul Calderone
On 12 Aug 2006 09:00:02 -0700, zxo102 <[EMAIL PROTECTED]> wrote: >Hi, > I am doing a small project using socket server and thread in python. > This is first time for me to use socket and thread things. > Here is my case. I have 20 socket clients. Each client send a set >of sensor data per seco

Re: self=pickle.load(file)? (Object loads itself)

2006-08-12 Thread Jean-Paul Calderone
On Sat, 12 Aug 2006 18:36:32 +0200, Anton81 <[EMAIL PROTECTED]> wrote: >Hi! > >it seems that > >class Obj: >def __init__(self): >f=file("obj.dat") >self=pickle.load(f) >... > >doesn't work. Can an object load itself with pickle from a file somehow? >What's an

Re: start a multi-sockets server (a socket/per thread) with different ports but same host

2006-08-12 Thread Jean-Paul Calderone
On 12 Aug 2006 10:44:29 -0700, zxo102 <[EMAIL PROTECTED]> wrote: >Jean-Paul, >Thanks a lot. The code is working. The python twisted is new to me too. >Here are my three more questions: >1. Since the code need to be started in a wxpyhon GUI (either by >clicking a button or up with the GUI), do I ha

Re: start a multi-sockets server (a socket/per thread) with different ports but same host

2006-08-13 Thread Jean-Paul Calderone
On 12 Aug 2006 21:59:20 -0700, zxo102 <[EMAIL PROTECTED]> wrote: >Jean-Paul, >I just start to learn Twisted. Here is my simple case: I can find >the data sent by clients in dataReceived but I don't know which >client/which port the data is from. After I know where the data comes >from, I can do

Re: How to tell machines endianism.

2006-08-15 Thread Jean-Paul Calderone
On 15 Aug 2006 10:06:02 -0700, KraftDiner <[EMAIL PROTECTED]> wrote: >How can you tell if the host processor is a big or little endian >machine? > sys.byteorder Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone have a link handy to an RFC 821 compliant email address regex for Python?

2006-08-16 Thread Jean-Paul Calderone
On 16 Aug 2006 16:09:39 -0700, Simon Forman <[EMAIL PROTECTED]> wrote: >fuzzylollipop wrote: >> I want to do email address format validations, without turning to ANTLR >> or pyparsing, anyone know of a regex that is COMPLIANT with RFC 821. >> Most of the ones I have found from google searches are n

Re: socket client server... simple example... not working...

2006-10-04 Thread Jean-Paul Calderone
On 4 Oct 2006 19:31:38 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote: >client: > >import socket >s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >s.connect(("192.168.1.101", 8080)) >print 'Connected' >s.send('ABCD') Here you didn't check the return value of send to determine if all of the

Re: socket client server... simple example... not working...

2006-10-05 Thread Jean-Paul Calderone
On 5 Oct 2006 07:01:50 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote: > [snip] > >Jean-Paul many thanks for this and your effort. >but why is it every time I try to do something with 'stock' python I >need another package? Maybe you are trying to do things that are too complex :) >By the time I'

Re: Restoring override of urllib.URLopener.open_https

2006-10-05 Thread Jean-Paul Calderone
On Fri, 6 Oct 2006 02:22:23 GMT, Bakker A <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >goyatlah wrote: >> >>I think that you need a superclass above the M2Crypto one, and change >>the open_https method back to the urllibs one. >> > >I'm not sure I get your suggestion. What the M2C

Re: PEP 342 misunderstanding

2006-10-08 Thread Jean-Paul Calderone
On 8 Oct 2006 12:33:02 -0700, [EMAIL PROTECTED] wrote: >So I've been reading up on all the new stuff in PEP 342, and trying to >understand its potential. So I'm starting with a few simple examples to >see if they work as expected, and find they dont. > >I'm basically trying to do the following: > >

Re: can regular ol' python do a php include?

2006-10-10 Thread Jean-Paul Calderone
On Tue, 10 Oct 2006 15:00:08 GMT, John Salerno <[EMAIL PROTECTED]> wrote: >Fredrik Lundh wrote: > >> you don't even need anything from the standard library to inserting output >> from one function into given text... >> >> text = "... my page with %(foo)s markers ..." >> >> print text % dict

Re: Newbie: trying to twist my head around twisted (and python)

2006-10-11 Thread Jean-Paul Calderone
On Wed, 11 Oct 2006 17:15:09 +0200, Jan Bakuwel <[EMAIL PROTECTED]> wrote: >Hoi all, > >Please see below a small piece of python code that resembles a >smtpserver using the twisted framework. The code is based on the example >smtp server discussed in Twisted Network Programming Essentials. >The unm

Re: Converting existing module/objects to threads

2006-10-19 Thread Jean-Paul Calderone
On Thu, 19 Oct 2006 14:09:11 -0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >At Thursday 19/10/2006 00:01, [EMAIL PROTECTED] wrote: >> > Consider using the asyncore module instead of threads. >> >>I think that is a good point and I am considering using >>asyncore/asynchat... i'm a little conf

Re: Newbie: trying to twist my head around twisted (and python)

2006-10-20 Thread Jean-Paul Calderone
On Fri, 13 Oct 2006 18:44:35 +0200, Jan Bakuwel <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: > >> The return value of eomReceived is used to determine whether to signal to >> the SMTP client whether the message has been accepted. Regardless of your >>

Re: ZODB and Python 2.5

2006-10-20 Thread Jean-Paul Calderone
On Fri, 20 Oct 2006 14:04:46 -0500, Robert Kern <[EMAIL PROTECTED]> wrote: >Andrew McLean wrote: >> I'm going to have to delay upgrading to Python 2.5 until all the >> libraries I use support it. One key library for me is ZODB. I've Googled >> and can't find any information on the developers' pla

  1   2   3   4   5   6   7   >