Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-18 Thread fumanchu
On Mar 17, 6:25 pm, dundeemt [EMAIL PROTECTED] wrote: I agree - the balance wasn't as good. We can all agree that HowTos and Intros are a necessary part of the conference talks track, but as Robert pointed out some talks should be of a more advanced nature. I enjoy those that stretch my

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-17 Thread fumanchu
On Mar 16, 5:09 pm, [EMAIL PROTECTED] (Aahz) wrote: fumanchu [EMAIL PROTECTED] wrote: This is my third PyCon, and I've found a reasonably-sized cadre of people who come for the hallway conversations plus a Bof or two, having given up on hearing anything new, useful, or inspiring

Re: Pycon disappointment

2008-03-16 Thread fumanchu
On Mar 16, 7:18 am, [EMAIL PROTECTED] (Aahz) wrote: Bruce Eckel [EMAIL PROTECTED] wrote: If the following seems unnecessarily harsh, it was even more harsh for me to discover that the time and money I had spent to get to my favorite conference had been sold to vendors, presenting me as a

Re: Re-raising exceptions with modified message

2007-07-16 Thread fumanchu
On Jul 15, 2:55 am, Christoph Zwerschke [EMAIL PROTECTED] wrote: Here is a simple solution, but it depends on the existence of the args attribute that will eventually be deprecated according to the docs If you don't mind using .args, then the solution is usually as simple as: try:

Re: Database Access using pyodbc. I've a problem

2007-06-16 Thread fumanchu
On Jun 16, 5:35 am, Rajendran [EMAIL PROTECTED] wrote: Hi all, I've installed pyodbc module to access my database (MS Access). I've setup a User level DSN to the database.mdb file. When I run my python code in the command prompt it is retrieving the database contents and displaying it (HTML

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread fumanchu
On Jun 11, 3:34 am, geoffbache [EMAIL PROTECTED] wrote: I have a Python program (on UNIX) whose main job is to listen on a socket, for which I use the SocketServer module. However, I would also like it to be sensitive to signals received, which it isn't if it's listening on the socket.

Re: Cherrypy setup questions

2007-05-23 Thread fumanchu
On May 23, 6:11 am, Brian Blais [EMAIL PROTECTED] wrote: fumanchu wrote: On May 22, 6:38 pm, Brian Blais [EMAIL PROTECTED] wrote: I'd like to start trying out some cherrypy apps, but I've been having some setup problems. I think I need some bone-head simple example to clear my

Re: Cherrypy setup questions

2007-05-23 Thread fumanchu
On May 23, 6:11 am, Brian Blais [EMAIL PROTECTED] wrote: fumanchu wrote: On May 22, 6:38 pm, Brian Blais [EMAIL PROTECTED] wrote: I'd like to start trying out some cherrypy apps, but I've been having some setup problems. I think I need some bone-head simple example to clear my

Re: Cherrypy setup questions

2007-05-22 Thread fumanchu
On May 22, 6:38 pm, Brian Blais [EMAIL PROTECTED] wrote: I'd like to start trying out some cherrypy apps, but I've been having some setup problems. I think I need some bone-head simple example to clear my understanding. :) I'm on a system running Apache, that I don't have root access to.

Re: The smallest and largest values of numeric types

2007-04-17 Thread fumanchu
On Apr 17, 7:12 am, [EMAIL PROTECTED] wrote: How can I determine the smallest and largest values of numeric types (for example int) possible in my system? I think there exists a function for this task but I don't know it. This should work for ints: import sys print sys.maxint For floats,

Re: File DB instead of real database?

2007-04-13 Thread fumanchu
On Apr 13, 9:14 pm, Jia Lu [EMAIL PROTECTED] wrote: I do not want to use a real DB like MySQL ... But I need something to save about more than 1000 articles. Is there any good ways? The latest version of Dejavu includes a filesystem backend. See Folders at

Re: Too slow to read an entire table from Microsoft Access

2007-03-14 Thread fumanchu
On Mar 14, 7:34 pm, lialie [EMAIL PROTECTED] wrote: I read a table with 4500 rows and 12 columns using win32com.client. Reading and updating records are OK, but cost too much time.Especially making a dict as line(***). All follows done may take nearly 90s! Is there any good idea? Thanks.

Re: Database module multithreading

2007-03-10 Thread fumanchu
On Mar 10, 6:14 am, jupiter [EMAIL PROTECTED] wrote: Just one quick question... Which database module should I use when I want to use multi threading as my application requires lots of data from internet I also want this database module to be fast, simple n efficient, in any case multi

Re: is it possible to give an instance a value?

2007-03-06 Thread fumanchu
On Mar 6, 2:45 pm, manstey [EMAIL PROTECTED] wrote: The question is, is it possible for an instance to have a value (say a string, or integer) that can interact with other datatypes and be passed as an argument? The following code of course gives an error: class Test(object): def

Re: message processing/threads

2007-02-17 Thread fumanchu
On Feb 11, 9:30 pm, Jonathan Curran [EMAIL PROTECTED] wrote: I need a program running in the background to process messages (FIFO order) which I would send using soap/xmlrpc/pyro (haven't decided yet). According to my thinking I would need to make this a threaded application. One thread to

Re: Maximum TCP Server Connections

2007-02-10 Thread fumanchu
:// www.aminus.org/blogs/index.php/fumanchu/2006/12/23/ cherrypy_3_has_fastest_wsgi_server_yet#c38647 Note also that many TCP servers use one thread per child socket, in which case you can hit a memory limit. IIRC, each Python thread on Windows uses a 1 MB stack: http://mail.python.org/pipermail/python- win32

Re: Database Programming with Python

2007-02-09 Thread fumanchu
On Feb 9, 7:28 am, [EMAIL PROTECTED] wrote: I wanted to connect Python to Ms-Access database using ADO or ODBC. I have Python 2.5 and on mxODBC site, it has no higher version build than 2.4. Moreoever, mxODBC is required for ADODB. Can anyone guide me on this what should I do to make it work

Re: Database Programming with Python

2007-02-09 Thread fumanchu
On Feb 9, 11:03 am, [EMAIL PROTECTED] wrote: There are no examples of Dejavu that I found yet. I have installed it but don't know how to use or call its functions. Read http://projects.amor.org/docs/dejavu/1.5.0RC1/ to learn how to use Dejavu. It's short and should at least give you an idea

Re: ANN: Dejavu 1.5.0RC1

2007-01-25 Thread fumanchu
On Jan 24, 9:39 pm, Michele Simionato [EMAIL PROTECTED] wrote: On Jan 24, 11:57 pm, Robert Brewer [EMAIL PROTECTED] wrote: The Dejavu Object-Relational Mapper (version 1.5.0RC1) is now available and in the public domain. Get it at http://projects.amor.org/dejavu, or from PyPI:

Re: ANN: Dejavu 1.5.0RC1

2007-01-25 Thread fumanchu
On Jan 25, 10:10 am, olive [EMAIL PROTECTED] wrote: Do you consider a StorageManagers for Oracle ? Yes, and in fact, I already have a ticket for it: http://projects.amor.org/dejavu/ticket/59. I've downloaded Oracle 10.2g XE and played with it a little, but hit some snags right away due to its

Re: confused on python rpc with apache, is it possible?

2007-01-20 Thread fumanchu
krishnakant Mane wrote: can I do xml-rpc using the default libraries that come with every python installer? You can, but others have packaged them up to make it easier. CherryPy includes an xmlrpc tool (and has no dependencies other than standard Python). You can see an example of what your

Re: Conflicting needs for __init__ method

2007-01-15 Thread fumanchu
Steven D'Aprano wrote: class Rational(object): def __init__(self, numerator, denominator): print lots of heavy processing here... # processing ints, floats, strings, special case arguments, # blah blah blah... self.numerator = numerator

Re: Hooking any/all 'calls'

2006-12-27 Thread fumanchu
Kevin Little wrote: In Python 2.4 or 2.5, what is the easiest way to hook any and all callables such that designated code is executed at the very start and end of each call? (Yes, I'm trying to come up with a little debugging tool!:) Is there a single metaclass who's __call__ method can be

Re: Http server

2006-12-19 Thread fumanchu
Gert Cuykens wrote: so far this works code import cherrypy import os.path class Http: def index(self): f = open(os.path.join(os.path.dirname(__file__), '../htm/index.htm')) xml = f.read() f.close() return xml index.exposed = True

Re: Roundtrip SQL data especially datetime

2006-12-17 Thread fumanchu
dyork wrote: Dennis Lee Bieber [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you actually look at what the various DB-API adapters produce when sending to the database engine, floats, bools, etc. are all sent as string representations; about the only source for problems

Re: dealing with special characters in Python and MySQL

2006-12-17 Thread fumanchu
ronrsr wrote: code for storing to database: querystring = update zingers set keywords = '%s', citation = '%s', quotation = %s' where zid = %d % (keywords,citation,quotation,zid) You're missing a single quote in there around the quotation %s. Are you also replacing \\ with r\\

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread fumanchu
dyork wrote: Thanks Gabriel, but when I said round trip I really did mean: convert all the way to string and all the way back again, so your kind advice is not all that helpful. I need string to get to a non-Python object or a Web page. Then you need two adaptation layers: one between your app

Re: Frame hacking

2006-12-13 Thread fumanchu
George Sakkis wrote: Actually I thought about this and it would be more convenient in my case if I could change the signature of f to def f(x,y) so that I can pass positional arguments instead of a keywords (don't ask why). I've tried creating a new code object by tweaking co_varnames,

Re: Mod_python vs. application server like CherryPy?

2006-12-06 Thread fumanchu
Graham Dumpleton wrote: For example, consider an extreme case such as WSGI. Through a goal of WSGI being portability it effectively ignores practically everything that Apache has to offer. Thus although Apache offers support for authentication and authorisation, a WSGI user would have to

Re: Mod_python vs. application server like CherryPy?

2006-12-05 Thread fumanchu
Vincent Delporte wrote: I'm still a newbie when it comes to web applications, so would like some help in choosing a solution to write apps with Python: What's the difference between using running it through mod_python vs. building an application server using Python-based tools like CherryPy,

Re: Detecting recursion loops

2006-12-01 Thread fumanchu
robert wrote: Ben Finney wrote: robert [EMAIL PROTECTED] writes: Carl Banks wrote: 2. Consider whether you're unwittingly trying to cover up a bug. ISTM no matter how problematic the input is, you should at least be able to make progress on it. Are you getting this error because,

Re: Threading

2006-11-30 Thread fumanchu
Gheorghe Postelnicu wrote: I found a recipe on ASPN on how to intercept keyboard interrupts and that is useful if I need to brutally kill the launching process. However, my question regards killing the actual children threads - they are spending lots of time in system calls, so I cannot

Re: Tracing the execution of scripts?

2006-10-27 Thread fumanchu
Stephan Kuhagen wrote: Michael B. Trausch mike$#at^nospam!%trauschus wrote: Basically, is there something that will log every line of Python code executed, in its order of execution, to a text file so that I can see what is (or isn't) happening that I am expecting? Python itself can do

Re: Python component model

2006-10-10 Thread fumanchu
Edward Diener No Spam wrote: OK, here is my idea of what such a component model envisages as a list of items. After this, unless I get some intelligent comments from people who might be interested in what I envision, or something very similar, I will be off to investigate it myself rather than

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread fumanchu
Gregory Piñero wrote: Examples of how frameworks don't meet my needs sometimes: 1. Working with SQL Server (Most frameworks seem to at least make it extra work) I don't know about most frameworks, but there are certainly some that work with SQL Server. My Dejavu ORM does SQL Server and MS

Re: Dumping the state of a deadlocked process

2006-10-07 Thread fumanchu
Dennis Lee Bieber wrote: On 6 Oct 2006 12:59:31 -0700, [EMAIL PROTECTED] declaimed the following in comp.lang.python: I'm currently having some issues with a process getting deadlocked. The problem is that the only way I can seem to find information about where it deadlocks is by making a

Re: Compile AST to bytecode?

2006-09-19 Thread fumanchu
Rob De Almeida wrote: Duncan Booth wrote: I would like to compile an AST to bytecode, so I can eval it later. I'm not sure there are any properly documented functions for converting an AST to a code object, so your best bet may be to examine what a pycodegen class like Expression or

Re: Function metadata (like Java annotations) in Python

2006-09-09 Thread fumanchu
oripel wrote: I'm trying to attach some attributes to functions and methods, similar to Java annotations and .NET attributes. ... Assigning attributes to the function will work, as will assigning keys and values to a dictionary in an attribute. But if there are more decorators in the way,

Re: sysadmin - python programmer

2006-07-19 Thread fumanchu
Dan Stromberg wrote: I've been a sysadmin for about 13 years, but I'm realizing that my favorite part of being a sysadmin are those moments where there's a reason to write some code - preferably in python. What might one do to make the transition from sysadmin to python programmer, aside

Re: Looking for a high performance web server written in Python, and supports CGI/FastCGI

2006-07-07 Thread fumanchu
Jack wrote: I wrote the last posting at late late night and I didn't know what I was typing at that time ;-p I didn't mean the test with CherryPy was not concurrent connections, or the test with lighttpd was all concurrent connections. I actually tried both concurrent (-c in ab command line)

Re: EnhancedObject: Yet Another Python ORM (an RFC)

2006-07-05 Thread fumanchu
[EMAIL PROTECTED] wrote: I have some ideas about a ORM design, but have no time to start its development. So why tell us? What are your ideas? What does your design do that the others don't? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] --

Re: EnhancedObject: Yet Another Python ORM (an RFC)

2006-07-05 Thread fumanchu
[EMAIL PROTECTED] wrote: So why tell us? What are your ideas? What does your design do that the others don't? Basically, the API I exemplificated in the first exemple. My initial idea was to have a way of turn alread designed objects into persistent ones. This is not the goal of SQLObject,

Re: Generate a sequence of random numbers that sum up to 1?

2006-04-23 Thread fumanchu
I'm surprised noone has pursued a course of subtraction rather than division. Say you want 10 numbers: s = 1.0 n = [] for x in xrange(9): ... value = random.random() * s ... n.append(value) ... s -= value ... n.append(s) n [0.727922901516, 0.082128708606867745,

Re: How to find out the next Friday using RelativeDateTime

2006-03-23 Thread fumanchu
a = now() delta = ReltaiveDateTime(days=+6, weekday(mx.DateTime.Friday, 0)) Next Friday: a+delta a: march 23 a+delta: Gives me March 31st and not March 24th Any ideas? Just an off-beat idea: use Python's datetime instead of mx.DateTime, and my recur module:

Re: Help Create Good Data Model

2006-03-12 Thread fumanchu
If you used a Queue, it wouldn't be the container itself; rather, it would be a gatekeeper between the container and consumer code. A minimal example of user-side code would be: class Request: def __init__(self, op, data): self.op = op self.data = data self.reply =

Re: RuntimeError: dictionary changed size during iteration ; Good atomic copy operations?

2006-03-12 Thread fumanchu
You can also *almost* do it with a tracehook that blocks until released by another thread. See http://projects.amor.org/misc/wiki/PyConquer for the tool I'm sporadically working on that does that (in an effort to test all possible execution paths). The only limitation is that trace functions

Re: Help Create Good Data Model

2006-03-11 Thread fumanchu
There's nothing really *broken* jumping out at me. The last three methods (set_value, set_data, and clear_data) probably don't need a mutex, since they will each have their own frame, and the operations are atomic. If that makes no sense, Google for Python GIL ;). If you just returned a value from

Re: Help Create Good Data Model

2006-03-11 Thread fumanchu
I didn't say that right. As long as you are using deepcopy (or any operation which might iterate over the keys or values in self.data), your setter methods need that mutex, *and* it should probably be a threading.Lock, not an RLock, just in case that iteration ends up mutating the dict somehow.

Re: sql using characters like é and ã

2005-12-13 Thread fumanchu
Diez B. Roggisch wrote: Select * from table where name like '%s%%' % José.decode(latin-1).encode(utf-8) Make it easy on yourself and encode the whole statement: conn.execute(query.encode('utf8')) Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] --

Re: sqlstring -- a library to build a SELECT statement

2005-10-20 Thread fumanchu
[EMAIL PROTECTED] wrote: These objects (such as sqlstring.Select), represent complex SQL Statements, but as Python objects. The benefit is that you can, at run-time, build the statement pythonically, without getting bogged down in String Manipulation. The theory is that once in use, things