Re: apscheduler error

2011-01-07 Thread Alice Bevan–McGregor
Howdy! On 2011-01-07 17:08:28 -0800, linna li said: I tried to use the apscheduler and used the sample code below from the tutorial, but got the error message: Exception in thread APScheduler (most likely raised during interpreter shutdown). What's going on here? I really appreciate any help!

Re: Error invalid syntax while statement

2011-01-07 Thread Garland Fulton
On Fri, Jan 7, 2011 at 8:55 PM, Chris Rebert wrote: > On Fri, Jan 7, 2011 at 9:46 PM, Garland Fulton > wrote: > > > 1 #!/bin/bash/python > > > What is > > wrong with my shebang line? > > Its path is invalid (unless you're using a *very* weird system). > /bin/bash is the bash shell executable

Re: Error invalid syntax while statement

2011-01-07 Thread Chris Rebert
On Fri, Jan 7, 2011 at 9:46 PM, Garland Fulton wrote: >   1 #!/bin/bash/python > What is > wrong with my shebang line? Its path is invalid (unless you're using a *very* weird system). /bin/bash is the bash shell executable; bash is completely unrelated to Python. Further, /bin/bash is a file, n

Re: Error invalid syntax while statement

2011-01-07 Thread Garland Fulton
On Fri, Jan 7, 2011 at 8:28 PM, Ned Deily wrote: > In article > , > Garland Fulton wrote: > > I don't understand what I'm doing wrong i've tried several different > cases > > for what i am doing here. Will someone please point my error out. > > > 15 print("counter: ", counter > > Missi

Re: More Help with python .find fucntion

2011-01-07 Thread Steven D'Aprano
On Fri, 07 Jan 2011 22:43:54 -0600, Keith Anthony wrote: > My previous question asked how to read a file into a strcuture a line at > a time. Figured it out. Now I'm trying to use .find to separate out > the PDF objects. (See code) PROBLEM/QUESTION: My call to lines[i].find > does NOT find all

Re: Error invalid syntax while statement

2011-01-07 Thread Ned Deily
In article , Garland Fulton wrote: > I don't understand what I'm doing wrong i've tried several different cases > for what i am doing here. Will someone please point my error out. > 15 print("counter: ", counter Missing ")" on line 15. -- Ned Deily, n...@acm.org -- http://mail.p

Re: Error invalid syntax while statement

2011-01-07 Thread Chris Rebert
On Fri, Jan 7, 2011 at 9:18 PM, Garland Fulton wrote: > I don't understand what I'm doing wrong i've tried several different cases > for what i am doing here. Will someone please point my error out. > Thank you. > >   1 #!/bin/bash/python This shebang undoubtedly erroneous. >   5     if( 0 > x |

Error invalid syntax while statement

2011-01-07 Thread Garland Fulton
I don't understand what I'm doing wrong i've tried several different cases for what i am doing here. Will someone please point my error out. Thank you. 1 #!/bin/bash/python 2 import math 3 try: 4 x = int(input("Enter your number: ")) 5 if( 0 > x | x > 2147483647): 6 r

Re: More Help with python .find fucntion

2011-01-07 Thread Chris Rebert
On Fri, Jan 7, 2011 at 8:43 PM, Keith Anthony wrote: > My previous question asked how to read a file into a strcuture > a line at a time.  Figured it out.  Now I'm trying to use .find > to separate out the PDF objects.  (See code)  PROBLEM/QUESTION: > My call to lines[i].find does NOT find all ins

More Help with python .find fucntion

2011-01-07 Thread Keith Anthony
My previous question asked how to read a file into a strcuture a line at a time. Figured it out. Now I'm trying to use .find to separate out the PDF objects. (See code) PROBLEM/QUESTION: My call to lines[i].find does NOT find all instances of endobj. Any help available? Any insights? #!/usr/b

Re: apscheduler error

2011-01-07 Thread Adam Tauno Williams
On Fri, 2011-01-07 at 17:08 -0800, linna li wrote: > I tried to use the apscheduler and used the sample code below from the > tutorial, but got the error message: Exception in thread APScheduler > (most likely raised during interpreter shutdown). What's going on > here? I really appreciate any hel

How to read ansic file into a pre-defined class?

2011-01-07 Thread Ying Zu
How to read ansic file into a pre-defined class? I have a series of files written in the following format, 2 # number of classes 100 # number of items for the first class object 0 foo 1 foo ... 99 foo 150 # number of items for the second class object 0 bar 1 bar ...

How to read ansic file into a pre-defined class?

2011-01-07 Thread Ying Zu
How to read ansic file into a pre-defined class? I have a series of files written in the following format, 2 # number of classes 100 # number of items for the first class object 0 foo 1 foo ... 99 foo 150 # number of items for the second class object 0 bar 1 bar ... 1

Re: student question

2011-01-07 Thread John
On Jan 7, 6:47 pm, Corey Richardson wrote: > On 01/07/2011 09:42 PM, John wrote: > > q_file = open(questions_location) #opens the document successfully > for line in q_file: > >            print line > > > # prints document successfully > line > > # prints last line of document > >>

Re: student question

2011-01-07 Thread Corey Richardson
On 01/07/2011 09:42 PM, John wrote: q_file = open(questions_location) #opens the document successfully for line in q_file: > print line > > # prints document successfully line > # prints last line of document for line in q_file: > print line # prints

student question

2011-01-07 Thread John
>>> q_file = open(questions_location) #opens the document successfully >>> for line in q_file: print line # prints document successfully >>> line # prints last line of document >>> for line in q_file: print line # prints nothing ...why does it print nothing? -- ht

Re: Close stdout socket on CGI after fork with subprocess

2011-01-07 Thread Kushal Kumaran
On Fri, Jan 7, 2011 at 8:08 PM, Thibaud Roussillat wrote: > Hi, > > I work with Python 2.4 and CGI. > > I have a CGI which call a Python script in background process and return > result before background task is finished. > > Actually, the browser displays response but it is waiting for end of > b

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
08.01.2011, 02:20, "Steven D'Aprano" : > On Fri, 07 Jan 2011 23:54:24 +0200, kost BebiX wrote: > >>  07.01.2011, 17:47, "Steven D'Aprano" >>  ;: >>>  On Fri, 07 Jan 2011 16:47:55 +0200, kost BebiX wrote:   Well, actually the code you showed doesn't work) >>>  Actually, it does. It just prints

Re: apscheduler error

2011-01-07 Thread Chris Rebert
On Fri, Jan 7, 2011 at 6:09 PM, Steven D'Aprano wrote: > On Fri, 07 Jan 2011 17:08:28 -0800, linna li wrote: >> I tried to use the apscheduler and used the sample code below from the >> tutorial, but got the error message: Exception in thread APScheduler >> (most likely raised during interpreter s

Re: apscheduler error

2011-01-07 Thread Steven D'Aprano
On Fri, 07 Jan 2011 17:08:28 -0800, linna li wrote: > I tried to use the apscheduler and used the sample code below from the > tutorial, but got the error message: Exception in thread APScheduler > (most likely raised during interpreter shutdown). What's going on here? > I really appreciate any he

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-07 Thread Ned Deily
In article , Jason Swails wrote: > MacPorts! They include a nifty little package called python_select that > lets you switch default python versions on-the-fly and organizes everything > for you perfectly. I have python 2.4, 2.5, 2.6, 2.7, 3.2, and the system > default 2.6.1 all installed, and

apscheduler error

2011-01-07 Thread linna li
I tried to use the apscheduler and used the sample code below from the tutorial, but got the error message: Exception in thread APScheduler (most likely raised during interpreter shutdown). What's going on here? I really appreciate any help! from apscheduler.scheduler import Scheduler sched = Sch

Re: Can I have both Python 2.7 and Python 3.1 at the same time on the Mac?

2011-01-07 Thread Jason Swails
MacPorts! They include a nifty little package called python_select that lets you switch default python versions on-the-fly and organizes everything for you perfectly. I have python 2.4, 2.5, 2.6, 2.7, 3.2, and the system default 2.6.1 all installed, and python_select python27 python_select pytho

Re: Rewriting __getattr__

2011-01-07 Thread Steven D'Aprano
On Fri, 07 Jan 2011 23:54:24 +0200, kost BebiX wrote: > 07.01.2011, 17:47, "Steven D'Aprano" > : >> On Fri, 07 Jan 2011 16:47:55 +0200, kost BebiX wrote: >> >>>  Well, actually the code you showed doesn't work) >> >> Actually, it does. It just prints a warning message as well. Look >> carefully: [

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 17:47, "Steven D'Aprano" : > On Fri, 07 Jan 2011 16:47:55 +0200, kost BebiX wrote: > >>  Well, actually the code you showed doesn't work) > > Actually, it does. It just prints a warning message as well. Look > carefully: > >  class A(object): >>  .. def __init__(self): >>  ..   

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 23:48, "Fuzzyman" : > On Jan 7, 3:18 pm, kost BebiX ; wrote: > >>  07.01.2011, 17:14, "Jean-Michel Pichavant" ;: >>>  kost BebiX wrote:  šSorry for top posting, didn't know about that) I'm quote new to posting to mailing lists.  šWell, actually the code you showed doesn'

Re: Streaming templating languages for use as WSGI body.

2011-01-07 Thread Alice Bevan–McGregor
On 2011-01-07 07:17:33 -0800, Michael Ströder said: As I read section 7.2.2 (Length) the Content-length header is only required in HTTP *requests* if the body contains data. According to the text it's not required in HTTP *responses*. You are correct; I mis-read that section in my haste.

os.system and loggers

2011-01-07 Thread Tim
hi, I'm using a 3rd-party python program that uses the python logging facility and also makes calls to os.system. I'm trying to capture its output to a file. In my own code, I've taken control of the loggers that are setup in the other program by removing its StreamHandler and replacing with FileH

Re: Resolve circular reference

2011-01-07 Thread Carl Banks
On Jan 7, 3:58 am, moerchendiser2k3 wrote: > > Force what? > > j refers to i, i refers to Foo, Foo refers to A. Therefore A should be > > alive. > > Oh, sorry. Force the deletion of instance Foo(A) and Bar(B). If you don't want j to keep i alive, you should look at weak referencing. (Look at the

Re: Rewriting __getattr__

2011-01-07 Thread Steven D'Aprano
On Fri, 07 Jan 2011 16:47:55 +0200, kost BebiX wrote: > Well, actually the code you showed doesn't work) Actually, it does. It just prints a warning message as well. Look carefully: class A(object): > .. def __init__(self): > .. self.d = {} > .. def __getattr__(self, key):

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 17:14, "Jean-Michel Pichavant" : > kost BebiX wrote: > >>  Sorry for top posting, didn't know about that) I'm quote new to posting to >> mailing lists. >> >>  Well, actually the code you showed doesn't work) >  class A(object): >>  .. def __init__(self): >>  .. self.d =

Re: Streaming templating languages for use as WSGI body.

2011-01-07 Thread Michael Ströder
Alice Bevan–McGregor wrote: > On 2011-01-06 11:11:27 -0800, Adam Tauno Williams said: >> On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote: >>> On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a Content-Lengt

Re: Rewriting __getattr__

2011-01-07 Thread Jean-Michel Pichavant
kost BebiX wrote: Sorry for top posting, didn't know about that) I'm quote new to posting to mailing lists. Well, actually the code you showed doesn't work) class A(object): .. def __init__(self): .. self.d = {} .. def __getattr__(self, key): .. try: ..

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
07.01.2011, 16:22, "Jean-Michel Pichavant" : > kost BebiX wrote: > >>  You're absolutely right! Now try to do except Keyerror: raise >> AttributeError and it will also fail. But why? >> >>  07.01.2011, 15:45, "Jean-Michel Pichavant" ;: >>>  kost BebiX wrote:   Hi everyone!   I just saw a

Close stdout socket on CGI after fork with subprocess

2011-01-07 Thread Thibaud Roussillat
Hi, I work with Python 2.4 and CGI. I have a CGI which call a Python script in background process and return result before background task is finished. Actually, the browser displays response but it is waiting for end of background task because the socket is not closed. Internet told me that I

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-07 Thread Carl Banks
On Jan 6, 8:32 am, Tim Harig wrote: > 2. Your so-called PEP probably clashes with Python's use of @ for >         decorators. He said it was just for simplicity's sake. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-07 Thread Carl Banks
On Jan 6, 7:28 am, dmitrey wrote: > hi all, > I have th PEP (I'm not sure something like that hadn't been proposed > although): > very often in a Python file header the following lines are present, > like: > from MyModule1 import myFunc1 > import MyModule2 as mm2 > from MyModule3 import myFunc3 as

Re: Rewriting __getattr__

2011-01-07 Thread Jean-Michel Pichavant
kost BebiX wrote: You're absolutely right! Now try to do except Keyerror: raise AttributeError and it will also fail. But why? 07.01.2011, 15:45, "Jean-Michel Pichavant" : kost BebiX wrote: Hi everyone! I just saw a bug (?) in bson.dbref:DBRef.__getattr__ Here's they're code:

VipIMAGE 2011 – ECCOMAS Thematic Conference – 2n d ANNOUNCE and CALL

2011-01-07 Thread tava...@fe.up.pt
-- International ECCOMAS Thematic Conference VipIMAGE 2011 - III ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING 12-14th October

Re: Rewriting __getattr__

2011-01-07 Thread kost BebiX
You're absolutely right! Now try to do except Keyerror: raise AttributeError and it will also fail. But why? 07.01.2011, 15:45, "Jean-Michel Pichavant" : > kost BebiX wrote: > >>  Hi everyone! >>  I just saw a bug (?) in bson.dbref:DBRef.__getattr__ >> >>  Here's they're code: >>  def __getat

Re: Rewriting __getattr__

2011-01-07 Thread Jean-Michel Pichavant
kost BebiX wrote: Hi everyone! I just saw a bug (?) in bson.dbref:DBRef.__getattr__ Here's they're code: def __getattr__(self, key): return self.__kwargs[key] And when you do copy.deepcopy on that object it will raise you KeyError. So here's a small piece of code that reproduces th

Re: [PyQt] Working with PyQt and Pydev

2011-01-07 Thread Fabio Zadrozny
On Thu, Jan 6, 2011 at 9:32 AM, Rohit Coder < passionate_program...@hotmail.com> wrote: > I installed the PyDev plugin into Aptana Stdui 3 Beta. Someone suggested > me to use PyQt for Python GUI app, and so I downloaded and installed PyQt. > But when I open Aptana Studio, I could see a new menu a

Re: Resolve circular reference

2011-01-07 Thread moerchendiser2k3
> Force what? > j refers to i, i refers to Foo, Foo refers to A. Therefore A should be > alive. Oh, sorry. Force the deletion of instance Foo(A) and Bar(B). -- http://mail.python.org/mailman/listinfo/python-list

Re: Resolve circular reference

2011-01-07 Thread moerchendiser2k3
> Force what? > > j refers to i, i refers to Foo, Foo refers to A. Therefore A should be > alive. Oh, sorry. Force the deletion of A. -- http://mail.python.org/mailman/listinfo/python-list