Re: Logging module gives duplicate log entries

2007-08-22 Thread Peter Otten
Shiao wrote: > Maybe my question wasn't very clear. What I meant is that these four > lines lead in my case to two entries per logged event: > > applog = logging.getLogger() > applog.setLevel(logging.DEBUG) > hdl = logging.FileHandler('/tmp/foo.log') > applog.addHandler(hdl) > > However if I REP

Re: Server-side scripting in python

2007-08-22 Thread olive
On 22 août, 06:03, Nagarajan <[EMAIL PROTECTED]> wrote: > I wanted to explore web programming facet of python. The problem at my > hand is to develop an email web client. I would do that with the help of Django (www.djangoproject.com groups.google.com/group/django-users) for the server side and JQ

creating a dictionary from a dictionary with regex

2007-08-22 Thread james_027
Hi, I am trying to create a dictionary from a dictionary which the help of regex to identify which keys to select. I have something like this but I feel its long and not the fastest solution ... could someone contribute? import re d= {'line2.qty':2, 'line3.qty':1, 'line5.qty':12, 'line2.item':'5

Re: 'REPL' style IDE

2007-08-22 Thread Dick Moores
At 10:50 AM 8/20/2007, beginner wrote: >Hi Everyone, > >I am using the Wing IDE. It works great when developing applications, >but the workflow is like Visual Studio -- after you execute it or >debug it, the python script ends. > >What I want is an interactive interpreting environment. I want the I

Re: for statement on empty iterable

2007-08-22 Thread Diez B. Roggisch
james_027 schrieb: > hi, > >> Oh I see. You have to combine a couple of concepts but for this >> example you'd say: >> >>name = 'james' # 'l' looks too much like the digit 1 >>for i,c in enumerate(name): >> print i, c >>print i >> >> enumerate(name) generates the sequence >>

Re: redirect or cover .bat log

2007-08-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello, > > e.g I need run my my_scripts_setup.bat that contain: > > python myscript_setup.py py2exe > > > Can I cover or redirect log of that process into my wx program? > I'am using Windows XP SP2, and Python 2.5. Who's running the bat, and who's running the wx pr

Re: redirect or cover .bat log

2007-08-22 Thread vedrandekovic
On 22 kol, 09:19, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > Hello, > > > e.g I need run my my_scripts_setup.bat that contain: > > > python myscript_setup.py py2exe > > > Can I cover or redirect log of that process into my wx program? > > I'am using Windows XP

Re: Python Path Dictionary

2007-08-22 Thread bg_ie
On 21 Aug, 21:45, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > > > Hi, > > > > > Do the Python Paths come in the form of a dictionary whe

Re: creating a dictionary from a dictionary with regex

2007-08-22 Thread Marc 'BlackJack' Rintsch
On Wed, 22 Aug 2007 07:13:40 +, james_027 wrote: > I am trying to create a dictionary from a dictionary which the help of > regex to identify which keys to select. I have something like this but > I feel its long and not the fastest solution ... could someone > contribute? > > import re > >

Re: Submit Your Python Scripts

2007-08-22 Thread Hendrik van Rooyen
"Steve Holden" wrote: > Ooh, goody. I just *live* to expose my scripts. Not. What? And miss out on all the wonderful special offers? ;-) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: File Read Cache - How to purge?

2007-08-22 Thread Marc 'BlackJack' Rintsch
On Wed, 22 Aug 2007 06:05:03 +0200, Hrvoje Niksic wrote: > Nick Craig-Wood <[EMAIL PROTECTED]> writes: > >> If you are running linux > 2.6.18 then you can use >> /proc/sys/vm/drop_caches for exactly that purpose. >> >> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html > > That URL claim

threading.RLock not subclassible?

2007-08-22 Thread jerickson arcega
i need RLOCK to use in my computer plsss..send it in me. and i can use the rlock when you give the rlock pl teach me??? pls - Choose the right car based on your needs. Check out Yahoo! Autos new Ca

Re: for statement on empty iterable

2007-08-22 Thread Eric Abrahamsen
Here's another simple method: l = ['j', 'a', 'm', 'e', 's'] counter = 0 for i in l: # Do your code counter += 1 print counter Yrs, Eric > l = ['j', 'a', 'm', 'e', 's'] > > for i in l > # i want to know the nth number of times it has loop thru or > something like counter? > > Thanks

4000 usd every month by the time you can reach or more

2007-08-22 Thread kasim
AGLOCO: The Internet's First Economic Network Today's hottest Internet businesses are all about the power of social networks. Companies like MySpace, Facebook, and YouTube have become worth billions because businesses have realized that these social networks are generating huge advertising and mar

Re: File Read Cache - How to purge?

2007-08-22 Thread Hrvoje Niksic
Steve Holden <[EMAIL PROTECTED]> writes: >> That URL claims that you need to run "sync" before dropping the >> cache, and so do other resources. I wonder if that means that >> dropping the cache is unsafe on a running system. > > Good grief. Just let the operating system do its job, for Pete's >

non-blocking communication with imaplib

2007-08-22 Thread Igor V. Rafienko
Hi, I was wondering if anyone had a suggestion for the following issue. I would like to talk to an IMAP-server, imaplib being the tool of choice, of course. Unfortunately it may happen that the IMAP-server fails to respond to certain commands, and I would like to be able to detect that within a

Re: IDE for Python

2007-08-22 Thread Dick Moores
At 06:55 AM 8/21/2007, limodou wrote: >On 8/21/07, king kikapu <[EMAIL PROTECTED]> wrote: > > On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]> > > wrote: > > > Hello list: > > > > > > I have tried various times to use an IDE for python put have always been > > > disapointed. > > > > >

Dispatching default application for file, cross platform.

2007-08-22 Thread Hendrik van Rooyen
How do I do the equivalent of clicking (in SuSe) or double clicking (in Windows) on a file? In effect I want to tell the OS - take this file and feed it to the application that is registered for it. Not too sure what to Google for. - Hendrik -- http://mail.python.org/mailman/listinfo/python-l

Re: Newbie question about a web server

2007-08-22 Thread Frank Millman
Frank Millman wrote: > Hi all > > I have just started to dabble in writing my own web server. > > I googled for 'python web server', and this is the first hit - > >http://fragments.turtlemeat.com/pythonwebserver.php > [...] > > When responding to the POST data received, it sends a 301 response,

Re: How to optimise this code?

2007-08-22 Thread David N Montgomery
On Wed, 22 Aug 2007 02:39:45 -, "Basilisk96" <[EMAIL PROTECTED]> said: > David, > > If your true design intent is to run X number of test cases, unittest > is the biggest bang for your buck, like shown by Peter's example. You > just subclass unittest.TestCase, and def your test methods in the

Re: redirect or cover .bat log

2007-08-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On 22 kol, 09:19, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] schrieb: >> >> > Hello, >> >> > e.g I need run my my_scripts_setup.bat that contain: >> >> > python myscript_setup.py py2exe >> >> > Can I cover or redirect log of that process into my

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Tim Golden
Hendrik van Rooyen wrote: > How do I do the equivalent of clicking (in SuSe) or double clicking (in > Windows) > on a file? > > In effect I want to tell the OS - take this file and feed it to the > application > that is registered for it. > > Not too sure what to Google for. > > - Hendrik os.

Design philosophy of HTTPServer and BaseHTTPRequestHandler

2007-08-22 Thread tzuchien chiu gmail com
Hello, everyone. Several instances of a same script, which accepts parameters and does a lengthy job, are executed on a remote machine. I want to couple the script with a tiny HTTP server so that I can connect to the machine with a browser and monitor the progress of jobs. The HTTP server of each

ActiveX control in python vs ActiveX control in vb 6 (piece of code)

2007-08-22 Thread vml
Hello, I am trying to mograte from vb 6 to python. I have a very usefull AX control. It can be : -just a bitmap -an active picture where you can plot data and put cursors -a data explorer Those 3 behavior are driven by one property in visual studio when you insert the AX control in a

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Peter Otten
Tim Golden wrote: > Hendrik van Rooyen wrote: >> How do I do the equivalent of clicking (in SuSe) or double clicking (in >> Windows) on a file? >> >> In effect I want to tell the OS - take this file and feed it to the >> application that is registered for it. > os.startfile Unfortunately this i

Re: File Read Cache - How to purge?

2007-08-22 Thread Nick Craig-Wood
Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood <[EMAIL PROTECTED]> writes: > > > If you are running linux > 2.6.18 then you can use > > /proc/sys/vm/drop_caches for exactly that purpose. > > > > http://www.linuxinsight.com/proc_sys_vm_drop_caches.html > > That URL claims that you

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Tim Golden
Peter Otten wrote: > Tim Golden wrote: > >> Hendrik van Rooyen wrote: >>> How do I do the equivalent of clicking (in SuSe) or double clicking (in >>> Windows) on a file? >>> >>> In effect I want to tell the OS - take this file and feed it to the >>> application that is registered for it. > >> os.

Re: Extracting the traceback

2007-08-22 Thread billiejoex
On 22 Ago, 03:11, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 8/21/07, codesite-noreply <[EMAIL PROTECTED]> wrote: > > > > > > > On 22 Ago, 02:09, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > > > On 8/21/07, billiejoex <[EMAIL PROTECTED]> wrote: > > > > > Hi there, > > > > I'm facing a case where

Re: for statement on empty iterable

2007-08-22 Thread Steve Holden
Amit Khemka wrote: > On 8/22/07, james_027 <[EMAIL PROTECTED]> wrote: >> hi Paul, >> >>> That doesn't crash or anything like that, but it also doesn't >>> set the index variable, which can cause confusion in some situations. >> Thanks for your quick answer ... Actually I was thinking how do I >> ac

Re: Free Air Conditioners!!!!!!

2007-08-22 Thread Paul Heslop
"Scott M." wrote: > > Oh my God! How did you know?!! You were so smart to post that here! > about a hundred times at least by now :O( -- Paul (We won't die of devotion) --- Stop and Look http://www.geocities.com/dreamst8me/ -- http:/

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Tommy Nordgren
On 22 aug 2007, at 12.04, Peter Otten wrote: > Tim Golden wrote: > >> Hendrik van Rooyen wrote: >>> How do I do the equivalent of clicking (in SuSe) or double >>> clicking (in >>> Windows) on a file? >>> >>> In effect I want to tell the OS - take this file and feed it to the >>> application tha

Re: Where we need to use Python ?

2007-08-22 Thread Bruno Desthuilliers
Terry Reedy a écrit : > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | And Is it a interpreted language or a programming language > | It comes in which category > > Python is an algorithm programming language. > > The CPython implementation of the langauge compiles Python to p

Re: python 2.5.1 segfault, multithreading & dual core issue?

2007-08-22 Thread Paul Sijben
thanks very much! I am currently compiling python with the patch and will test it over the coming days. Paul Hrvoje Niksic wrote: > Paul Sijben <[EMAIL PROTECTED]> writes: > >> I am running a multi-threaded python application in a dual core >> intel running Ubuntu. > [...] > > Judging from the

Re: File Read Cache - How to purge?

2007-08-22 Thread Hrvoje Niksic
Nick Craig-Wood <[EMAIL PROTECTED]> writes: >> > http://www.linuxinsight.com/proc_sys_vm_drop_caches.html >> >> That URL claims that you need to run "sync" before dropping the cache, >> and so do other resources. I wonder if that means that dropping the >> cache is unsafe on a running syste

Re: Where we need to use Python ?

2007-08-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi > > Iam new to Python > I know Perl, JScript,C,C++,Java > But i want to know where excatly this python come in to picture Somewhere between Perl and Java. > And Is it a interpreted language or a programming language ??? It's obviously a programming language, but

Re: for statement on empty iterable

2007-08-22 Thread Neil Cerutti
On 2007-08-22, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > While it is desireable to not only write working, but also > aesthetically pleasing code, as a beginner you shouldn't worry > too much. The sense of aesthetics develops with time. Important > is to try and grasp the idioms of the language

ANN: eGenix mxODBC Distribution 3.0.1 (mxODBC Database Interface)

2007-08-22 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Database Interface Version 3.0.1 Our commercially supported Python extension providing ODBC database connectivity to Python applications

Re: advice about `correct' use of decorator

2007-08-22 Thread BJörn Lindqvist
On 8/17/07, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > BJörn Lindqvist wrote: > >def is_logued_in(): > >if not user.is_logged_in(): > >raise NotLoggedInError > > > >It costs you one more line, but reduces complexity. And if you are > >worried about that extra line you can put it in a f

Re: Fast socket write

2007-08-22 Thread Greg Copeland
On Aug 21, 9:40 pm, Bikal KC <[EMAIL PROTECTED]> wrote: > Greg Copeland wrote: > > I'm having a brain cramp right now. I can't see to recall the name of > > Is your cramp gone now ? :P I wish. If anyone can remember the name of this module I'd realy appreciate it. Greg -- http://mail.python.

Re: redirect or cover .bat log

2007-08-22 Thread vedrandekovic
On 22 kol, 10:52, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On 22 kol, 09:19, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] schrieb: > > >> > Hello, > > >> > e.g I need run my my_scripts_setup.bat that contain: > > >> > python myscript_setu

Re: Fast socket write

2007-08-22 Thread paul
Greg Copeland schrieb: > On Aug 21, 9:40 pm, Bikal KC <[EMAIL PROTECTED]> wrote: >> Greg Copeland wrote: >>> I'm having a brain cramp right now. I can't see to recall the name of >> Is your cramp gone now ? :P > > > I wish. If anyone can remember the name of this module I'd realy > appreciate i

Re: Fast socket write

2007-08-22 Thread Jean-Paul Calderone
On Wed, 22 Aug 2007 13:01:47 -, Greg Copeland <[EMAIL PROTECTED]> wrote: >On Aug 21, 9:40 pm, Bikal KC <[EMAIL PROTECTED]> wrote: >> Greg Copeland wrote: >> > I'm having a brain cramp right now. I can't see to recall the name of >> >> Is your cramp gone now ? :P > > >I wish. If anyone can rem

Re: redirect or cover .bat log

2007-08-22 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Can I execute one .bat file (without opening .bat window) just execute > commands > and log process redirect with sys.stdout or something in my wx window? > > Is this clear enough? Type "help cmd" in a Windows console, then grab ad-oc options (/C and /A or /U seem g

Re: Design philosophy of HTTPServer and BaseHTTPRequestHandler

2007-08-22 Thread Gabriel Genellina
On 22 ago, 06:50, "tzuchien chiu gmail com" <[EMAIL PROTECTED]> wrote: > Hello, everyone. > > Several instances of a same script, which accepts parameters and does > a lengthy job, are executed on a remote machine. I want to couple the > script with a tiny HTTP server so that I can connect to th

Re: redirect or cover .bat log

2007-08-22 Thread Gabriel Genellina
On 22 ago, 10:04, [EMAIL PROTECTED] wrote: > > > >> > e.g I need run my my_scripts_setup.bat that contain: > > > >> > python myscript_setup.py py2exe > > > >> > Can I cover or redirect log of that process into my wx program? > > >> > I'am using Windows XP SP2, and Python 2.5. Try the subprocess mo

Re: Chaining programs with pipe

2007-08-22 Thread Grant Edwards
On 2007-08-22, Steve Holden <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> On 2007-08-21, avishay <[EMAIL PROTECTED]> wrote: >> >>> I'm trying to chain two programs with a pipe (the output of >>> one feeding the input of the other). I managed to capture the >>> output and feeding the input o

Re: advice about `correct' use of decorator

2007-08-22 Thread Gabriel Genellina
On 22 ago, 10:00, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On 8/17/07, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > > > BJörn Lindqvist wrote: > > >def is_logued_in(): > > >if not user.is_logged_in(): > > >raise NotLoggedInError > > > >It costs you one more line, but reduces comple

Re: How to optimise this code?

2007-08-22 Thread Hyuga
On Aug 22, 4:52 am, "David N Montgomery" <[EMAIL PROTECTED]> wrote: > unittest is the best choice for my needs and works perfectly in Eclipse. > Unfortunately though it (and many other things) does not work under the > application we have to use to run our python scripts. > > This leaves me with 'f

Re: Where we need to use Python ?

2007-08-22 Thread Terry Reedy
|"Bruno Desthuilliers" Terry Reedy a écrit : | |> The CPython implementation of the langauge compiles Python to proprietary |> byte code |Hahem... "proprietary" is certainly not the right term here. a. you are being nitpicky, overly in my opinion b. you failed to suggest a better term, hence ca

Re: libgmail failure

2007-08-22 Thread Jiapj
I met the same problem now, James , do you have resolved this problem ? On Aug 22, 5:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey all, > > I've been using libgmail to send out automated notification emails for > my company's nightly regression testing. Last night these emails > s

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-08-22 Thread Gabriel Genellina
On 21 ago, 21:30, Seun Osewa <[EMAIL PROTECTED]> wrote: > Is it possible to cause this sort of thing to happen on Windows. > Specifically, I'm looking for a way to cause multiple processes to > accept new connections on a bound socket. on UNIX, I can just fork() > after binding the server socket

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Hendrik van Rooyen
"Tim Golden" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > How do I do the equivalent of clicking (in SuSe) or double clicking (in Windows) > > on a file? > > > > In effect I want to tell the OS - take this file and feed it to the application > > that is registered for it. > > > > Not

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Hendrik van Rooyen
"Tim Golden" > Peter Otten wrote: > > Tim Golden wrote: > > > >> Hendrik van Rooyen wrote: > >>> How do I do the equivalent of clicking (in SuSe) or double clicking (in > >>> Windows) on a file? > >>> > >>> In effect I want to tell the OS - take this file and feed it to the > >>> application tha

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Hendrik van Rooyen
"Tommy Nordgren" <[EMAIL PROTECTED]> wrote: > > On 22 aug 2007, at 12.04, Peter Otten wrote: > > > Tim Golden wrote: > > > >> Hendrik van Rooyen wrote: > >>> How do I do the equivalent of clicking (in SuSe) or double > >>> clicking (in > >>> Windows) on a file? > >>> > >>> In effect I want to

Re: Shed Skin Python-to-C++ compiler 0.0.23

2007-08-22 Thread srepmub
> Adding socket support would certainly open the door for many common > classes applications. If I had my pick, I say, sockets and then re. Thanks. Especially sockets should be not too hard to add, but I probably won't work on these directly myself. Let me know if you are interested.. :-) > BTW

Re: Where we need to use Python ?

2007-08-22 Thread Paul Boddie
On 22 Aug, 16:36, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > |"Bruno Desthuilliers" Terry Reedy a écrit : > |Hahem... "proprietary" is certainly not the right term here. [...] > In any case, CPython is owned by PSF (which gives it away). Its bytecode > is an private implementation detail subject

Re: Chaining programs with pipe

2007-08-22 Thread Gabriel Genellina
On 22 ago, 11:08, Grant Edwards <[EMAIL PROTECTED]> wrote: > but I'm a Unix guy who occasionally tries > to ship a Windows version of a Python app: the concept of a Ah, that explains your previous post telling that things on Windows don't work as they "should". They work, but not necesarily as a

instance method questions

2007-08-22 Thread Danny
howdy, I have created an instance method for an object using new.instancemethod. It works great. Now the questions are: 1) how do I dynamically inspect an object to determine if it has an instance method? (there is a class method with the same name) 2) how do I dynamically delete the instance m

Re: Handwriting Recognition

2007-08-22 Thread Rex Turnbull
[EMAIL PROTECTED] schrieb/wrote: >>> import handwriting >>> ... >>> http://docs.python.org/lib/module-handwriting.html >>> ha ha, I kid, I kid. >>> I don't think this is an easy problem to solve. You'd probably want >>> Python to be a wrapper around whatever hand-writing recognition >>> software y

Re: for statement on empty iterable

2007-08-22 Thread J. Cliff Dyer
Neil Cerutti wrote: On 2007-08-22, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: While it is desireable to not only write working, but also aesthetically pleasing code, as a beginner you shouldn't worry too much. The sense of aesthetics develops with time. Important is to try and grasp the idio

Re: chmod g+ Equivalent

2007-08-22 Thread milan_sanremo
On Aug 14, 7:30 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > milan_sanremo wrote: > > On Aug 13, 8:06 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> milan_sanremo wrote: > >>> I've read the documentation on os.chmod() and can implement all the > >>> standard commands, but what is the syntax for

SpreadsheetML writer??

2007-08-22 Thread Ellinghaus, Lance
Does anyone have or know of a module to write out Excel spreadsheets in SpreadsheetML format? Thank you, lance Lance Ellinghaus -- http://mail.python.org/mailman/listinfo/python-list

Re: instance method questions

2007-08-22 Thread Frederick Polgardy
On Aug 22, 10:23 am, Danny <[EMAIL PROTECTED]> wrote: > 1) how do I dynamically inspect an object to determine if it has an instance > method? (there is a class method with the same name) class Foo: def foo(self): pass x = Foo() import types >>> isinstance(x.foo, types.MethodType) T

Eval and raw string ??

2007-08-22 Thread Mark
Eval() doesn't seem to recognize the r'string' format. Is there a way around this. Example: If I input: -> eval("r'C:\tklll\ndfd\bll'") I get the output: Traceback (most recent call last): File "", line 1, in eval("r'C:\tklll\ndfd\bll'") File "", line 1 r'C:klll

Re: IDE for Python

2007-08-22 Thread vdicarlo
> Have you tried SPE? I don't know how it compares to PyDev but SPE is > pretty slick. It has several other tools integrated into it, > including a pretty nice debugger. After trying Eclipse and SPE, I'm back to using VIM and the Winpdb debugger, which is the "pretty nice debugger" in SPE, and w

Re: Server-side scripting in python

2007-08-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Nagarajan <[EMAIL PROTECTED]> wrote: >> >> . >> . >> . >Let me phrase my problem in a finer way. >I have done simple projects in python. >I wanted to explore web programming facet of python. The

Re: Eval and raw string ??

2007-08-22 Thread Frederick Polgardy
On Aug 22, 11:06 am, Mark <[EMAIL PROTECTED]> wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval

Re: Eval and raw string ??

2007-08-22 Thread Peter Otten
Mark wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval("r'C:\tklll\ndfd\bll'") > File "", l

Python for web development ...

2007-08-22 Thread thushianthan15
Hi everyone, I have to do a web based application for my final year project. Since, i am only familiar with basic HTML and Java Script, i am totally new to this one. My friends are using LAMP (P->PHP). But i want to use Python. Is it possible to use Python with Apache and MySQL. Is it possible ?

porting vc++ project to python?

2007-08-22 Thread marco Starglider
hi, i have a very large project in visual studio2005->visual c++ in windowsxp. i'd like to port it, or my next project, over to python. is this possible without rewriting all my code? are there multiple options to do this? my project is so large, that entirely rewriting it is actually no option.

Re: Eval and raw string ??

2007-08-22 Thread Paul McGuire
On Aug 22, 11:06 am, Mark <[EMAIL PROTECTED]> wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval

Re: instance method questions

2007-08-22 Thread Peter Otten
Danny wrote: > I have created an instance method for an object using new.instancemethod. > It works great. Now the questions are: > > 1) how do I dynamically inspect an object to determine if it has an > instance method? (there is a class method with the same name) Why would you want to do that?

Re: Python for web development ...

2007-08-22 Thread marc wyburn
On Aug 22, 5:13 pm, [EMAIL PROTECTED] wrote: > Hi everyone, > > I have to do a web based application for my final year project. Since, > i am only familiar with basic HTML and Java Script, i am totally new > to this one. My friends are using LAMP (P->PHP). But i want to use > Python. Is it possible

Re: IDE for Python

2007-08-22 Thread Chris Mellon
On 8/21/07, Michael L Torrie <[EMAIL PROTECTED]> wrote: > Ricardo Aráoz wrote: > > Hi, > > Do you know if for in-house development a GPL license applies? (Qt4 > > and/or Eric4). > > If your programs are used in-house and never released, then you don't > have to abide by the terms of the GPL.

Re: Python is removing my quotes!

2007-08-22 Thread Thorsten Kampe
* Gary Herron (Tue, 21 Aug 2007 09:09:13 -0700) > Robert Dailey wrote: > > Note: I'm using Python on Windows > > > > I have an application that allows a user to submit a password as a > > command line parameter. The password of choice may contain any > > characters the user wishes, including quotes

Re: Eval and raw string ??

2007-08-22 Thread Matthew Woodcraft
Mark <[EMAIL PROTECTED]> wrote: > Eval() doesn't seem to recognize the r'string' format. Is there a way > around this. > Example: > If I input: -> eval("r'C:\tklll\ndfd\bll'") > I get the output: > > Traceback (most recent call last): > File "", line 1, in > eval("r'C:\tklll\ndfd\bl

Re: libgmail failure

2007-08-22 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hey all, > > I've been using libgmail to send out automated notification emails for > my company's nightly regression testing. Last night these emails > started failing, though the python code has not changed. I updated to > the latest libgmail, but that isn't helping.

What Are These Import/From Statements about?

2007-08-22 Thread W. Watson
Is there a single source that explains these statements? -- from Tkinter import * from Numeric import * import Image import ImageChops import ImageTk import time import binascii import tkMessageBox import tkSimpleDialog from tkFileDialog import asksaveasfilename from tk

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Is there a single source that explains these statements? http://docs.python.org/tut/node8.html -- 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 attempt to interpret it as though it had an underl

MsiLib

2007-08-22 Thread Charlie
Hi, I am trying to figure out how to use msilib to extract the registry information from an MSI file and I really could use a good example of how that is accomplished or even just an example using msilib in general. Does anybody happen to know of an example for this as I wasn't able to fin

Re: porting vc++ project to python?

2007-08-22 Thread Matt McCredie
> i have a very large project in visual studio2005->visual c++ in windowsxp. > i'd like to port it, or my next project, over to python. > is this possible without rewriting all my code? > are there multiple options to do this? > my project is so large, that entirely rewriting it > is actually no o

Problems with dynamic function creation.

2007-08-22 Thread Steven W. Orr
I have some functions I need to create at runtime. The way I'm creating them is by calling a function which returns the string representation. Then I exec the string. Here's the code I use to gen the strings: mkfactfns.py --- import new def mkfactfns( cname ): def auxgen( name, para

Re: Regarding Classes

2007-08-22 Thread O.R.Senthil Kumaran
> > What is the main reason of "self" when it involves classes/functions > > > "self" provides a semi-standard way of addressing the current instance > of a class. It is used in an instance's method. It is not typically > used in functions. Btw, you are free to use any other term as well inste

Error with long running web spider

2007-08-22 Thread Josh Volz
Hi everyone: I have a spider that is relatively long running (somewhere between 12-24 hours). My problem is that I keep having an issue where the program appears to freeze. Once this freezing happens the activity of the program drops to zero. No exception is thrown or caught. The program simpl

Re: Error with long running web spider

2007-08-22 Thread Josh Volz
On Aug 22, 10:58 am, Josh Volz <[EMAIL PROTECTED]> wrote: I'm running this program on Windows XP, using Python 2.5. I'm using Active State Komodo IDE 4.0 as the run environment. Thanks, J. > Hi everyone: > > I have a spider that is relatively long running (somewhere between > 12-24 hours). My

Re: Threads and racing conditions

2007-08-22 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Flavio Preto schrieb: > Hi, > > I have a doubt. Supose that i have the minimun class below: > > class db: > def __init__(self): > self.db = {} > def read(self, key): > return self.db[key] > def write(self, key, value): >

Class destruction

2007-08-22 Thread Robert Dailey
Hi, I'm wondering where the most appropriate location is to cleanup class objects. For example, i have a file handle as an instance attribute in one of my classes and I need to call f.close() on it when the class object falls out of scope. Any ideas? I've tried __del__() but I don't remember this

Re: Free Air Conditioners!!!!!!

2007-08-22 Thread Zentrader
On Aug 21, 10:13 pm, "Scott M." <[EMAIL PROTECTED]> wrote: > Oh my God! How did you know?!! You were so smart to post that here! > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >http://freeairconditioners.blogspot.com/ It's probably a handheld fan made out of a piece of p

How do I express a backslash in a string?

2007-08-22 Thread Tobiah
>>> "'" "'" >>> "\'" "'" >>> "\\'" "\\'" >>> "\\\'" "\\'" >>> This is quite different than any other language that I am used to. Normally, a double backslash takes away the special meaning of the last backslash, and so you are left with a single backslash. How do I express the single backslas

Re: How do I express a backslash in a string?

2007-08-22 Thread Tobiah
Tobiah wrote: "'" > "'" "\'" > "'" "\\'" > "\\'" "\\\'" > "\\'" > > This is quite different than any other language > that I am used to. Normally, a double backslash > takes away the special meaning of the last backslash, > and so you are left with a single backslash.

Re: How do I express a backslash in a string?

2007-08-22 Thread Frederick Polgardy
On Aug 22, 1:19 pm, Tobiah <[EMAIL PROTECTED]> wrote: > >>> "'" > "'" > >>> "\'" > "'" > >>> "\\'" > "\\'" > >>> "\\\'" > "\\'" > > This is quite different than any other language > that I am used to. Normally, a double backslash > takes away the special meaning of the last backslash, > and so you

Re: Free Air Conditioners!!!!!!

2007-08-22 Thread Eric
And $15 shipping to get the "free" paper sent to you! ;^) "Zentrader" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 21, 10:13 pm, "Scott M." <[EMAIL PROTECTED]> wrote: >> Oh my God! How did you know?!! You were so smart to post that here! >> >> <[EMAIL PROTECTED]> wrote

Re: Class destruction

2007-08-22 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert Dailey schrieb: > Hi, > > I'm wondering where the most appropriate location is to cleanup class > objects. For example, i have a file handle as an instance attribute in one > of my classes and I need to call f.close() on it when the class objec

Re: Problems with dynamic function creation.

2007-08-22 Thread Peter Otten
Steven W. Orr wrote: [snip mess] > Everything works just fine (that I know of) except Sometimes you have to just fix the code you have. This however doesn't just smell funny, it's hopeless. Start with clearly stating your goals and then do a rewrite. Should you need help again, remember post a

Impersonate another user temporarily (Unix and Windows)

2007-08-22 Thread billiejoex
Hi there. I'm writing a modification for a FTP server library I'm maintaining. Depending on the system I'd want to temporarily impersonate the logged user to perform actions on filesystem. Something like: try: change_user('user', 'password') os.rmdir('dir') except: print "some error" f

Redo: How to create a function dynamically.

2007-08-22 Thread Steven W. Orr
I have this which works: #! /usr/bin/python strfunc = """ def foo( a ): print 'a = ', a """ exec strfunc globals()['foo'] = foo foo( 'Hello' ) and this which does not: #! /usr/bin/python import new strfunc = """ def foo( a ): print 'a = ', a """ co = compile ( strfunc, '', 'exec' ) exe

Re: redirect or cover .bat log

2007-08-22 Thread vedrandekovic
On 22 kol, 16:01, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 22 ago, 10:04, [EMAIL PROTECTED] wrote: > > > > > > >> > e.g I need run my my_scripts_setup.bat that contain: > > > > >> > python myscript_setup.py py2exe > > > > >> > Can I cover or redirect log of that process into my wx program?

Re: libgmail failure

2007-08-22 Thread james.pingenot
On Aug 22, 10:26 am, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hey all, > > > I've been using libgmail to send out automated notification emails for > > my company's nightly regression testing. Last night these emails > > started failing, though the python code has not

Re: libgmail failure

2007-08-22 Thread [EMAIL PROTECTED]
On Aug 22, 10:26 am, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hey all, > > > I've been using libgmail to send out automated notification emails for > > my company's nightly regression testing. Last night these emails > > started failing, though the python code has not

way to define static method

2007-08-22 Thread Eric CHAO
I think Python uses a very strange way to define static method in a class. Why not make it like this? class MyClass: def my_static_method(self): # self should be None as it's a static method # just ignore self I'm a newcomer so maybe it's quite naive. But I just wonder why it

  1   2   >