Re: having problems with a multi-conditional while statement

2009-01-07 Thread Hendrik van Rooyen
"Philip Semanchuk" wrote: 8< nice explanation > Change the "and" to an "or" and you'll get the result you expected. Also google for "De Morgan", or "De Morgan's laws" Almost everybody stumbles over this or one of it's corollaries at least once in their careers

Re: why cannot assign to function call

2009-01-07 Thread Hendrik van Rooyen
"Mark Wooding" wrote: > A better analogy. The objects are scattered across the floor. No > object is contained in another. However, we have a plentiful supply of > bits of string, each of which is tied to a Teflon-covered paperweight at > one end and has a blob of Blu-Tack on the other. Inste

Using couchdb to build a EMAIL messaging solution with threaded inline replies

2009-01-07 Thread mobiledreamers
Using couchdb to build a EMAIL messaging solution with threaded inline replies http://pylab.blogspot.com/search/label/couchdb -- http://mail.python.org/mailman/listinfo/python-list

Any news on when some libraries will be ported to Python 3.0?

2009-01-07 Thread Just Another Victim of the Ambient Morality
I'm excited to use Python 3.0 (foolishly, it's the only Python interpreter I have on my system) but there are no libraries for it beyond the kitchen sink. Personally, a good start would be Beautiful Soup and Mechanize. I could also use DB. Has there been any word on Beautiful Soup?

Re: why cannot assign to function call

2009-01-07 Thread Steven D'Aprano
On Wed, 07 Jan 2009 03:49:02 +, Mark Wooding wrote: > Steven D'Aprano wrote: > >> The only tricky thing is that items 1, 2 and 3 can be inside two >> different boxes at the same time. There's no obvious real world analogy >> to that without the boxes being nested. This ability for objects to

Re: Any news on when some libraries will be ported to Python 3.0?

2009-01-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Just Another Victim of the Ambient Morality wrote: > Anyway, I'd love to hear some news about any of these things in > particular or even anything in general. Am I the only one who's psyched for > this version of Python? I ported my APSW SQLite

multiprocessing and SIGINT

2009-01-07 Thread akineko
Hello everyone, I'm trying to use multiprocessing module, which is now available with Python 2.6. It is a nice enhancement and it worked great. However, I have a situation and I couldn't figure out how to deal with. My Python program spawns another process to take care of GUI house- keeping. Whe

Re: Rich Comparisons Gotcha

2009-01-07 Thread Steven D'Aprano
On Wed, 07 Jan 2009 01:23:19 +, Mark Wooding wrote: > A case-sensitive string is /not the same/ as a case-insensitive string. > One's a duck, the other's a goose. I'd claim here that i"abc" =~ "ABC" > must be False, because i"abc" =~ "abc" must be false also! To define it > otherwise leads t

Multiprocessing takes higher execution time

2009-01-07 Thread Sibtey Mehdi
Hi, I use multiprocessing to compare more then one set of files. For comparison each set of files (i.e. Old file1 Vs New file1) I create a process, Process(target=compare, args=(oldFile, newFile)).start() It takes 61 seconds execution time. When I do the same comparison without implement

Re: Extending Python with C or C++

2009-01-07 Thread Thomas Heller
Nick Craig-Wood schrieb: > Ralf Schoenian wrote: >> Ryan wrote: >> > I've been using Python for many years now. It's a wonderful language >> > that I enjoy using everyday. I'm now interested in getting to know >> > more about the guts (C/C++) and extending it. But, extending python >> > still see

Re: Oh! The people of all over the world!

2009-01-07 Thread James Stroud
Obaid R. wrote: So an illegal occupation is NOT a provocation but fighting the occupation IS? By which scales do you judge? I would argue that a person following such backwards logic and who sees these pictures[1] and STILL claims that showing sympathy is difficult has a serious problem. After a

Re: why cannot assign to function call

2009-01-07 Thread Mark Wooding
Steven D'Aprano wrote: > Only in the sense that the behaviour of *real world* objects don't > entirely match the behaviour of Python objects. If you just accept > that Python objects can be in two places at once, an unintuitive > concept I accept but hardly difficult to grasp, then you don't need

Re: Rich Comparisons Gotcha

2009-01-07 Thread Mark Wooding
Steven D'Aprano wrote: > It's only incoherent if you need equality to be an equivalence relation. > If you don't, it is perfectly reasonable to declare that i"abc" equals > "abc". Right! And if you didn't want an equivalence relation, then `==' will suit you fine. The problem is that some ap

Re: Traceback in Logging

2009-01-07 Thread Vinay Sajip
On Jan 6, 10:19 pm, Thorsten Kampe wrote: > I don't think he's interested in the "line number where the logging call > was issued" but where the exception occurred. Well, he does say "all logging" and "every logging". And, as I mentioned earlier, there is already support for tracebacks by using t

string length problem?

2009-01-07 Thread Qian Xu
Hi All, why the code print len(u"»test«") returns 8 instead of 6? Best regards Qian -- http://mail.python.org/mailman/listinfo/python-list

linked list with cycle structure

2009-01-07 Thread David Hláčik
dictionary with cycle structure Hello guys, I have a linked list where *number of elements is unlimited* and **last element points on random (can be first, last, in middle , anywhere) element within linked list** - this is important . My goals is to create an architecture /scheme for **algoritmus

Re: Problem building Python 2.5.2 curses module on HP/UX 11.11

2009-01-07 Thread Martin v. Löwis
> So, given that there are no actual errors during the compile, and the > warnings are probably benign, does anyone know what would cause the > resulting compiled module to NOT have the init function? Can you do nm(1) on the module? It's now called _curses_failed.sl Regards, Martin -- http://mail

[urllib2] 302 -> can't get cookie

2009-01-07 Thread Gilles Ganault
Hello I'm using urllib2 to connect to a web server with POST, and then the server sends a cookie to hold the session ID, but also redirects the user to another page: === HTTP/1.1 302 Found Date: Wed, 07 Jan 2009 11:20:51 GMT Server: Apache Set-Cookie: PHPSESSID=4015f14eb04dc81159253a9533a7c590; p

Re: string length problem?

2009-01-07 Thread Peter Otten
Qian Xu wrote: > why the code > print len(u"»test«") > returns 8 instead of 6? You may have declared an encoding that differs from the one your editor actually uses, e. g. # -*- coding: iso-8859-1 -*- print len(u"»test«") whereas your editor writes UTF-8. Peter -- http://mail.python.org/mai

Re: string length problem?

2009-01-07 Thread Qian Xu
Qian Xu wrote: > Hi All, > > why the code > print len(u"»test«") > returns 8 instead of 6? > > Best regards > Qian I have solved the problem myself. # -*- coding: utf-8 -*- print len(u"»test«") --- or --- s = "»test«" print len(s.decode("utf-8")) --Qian -- http://mail.python.org/mailman/li

Re: why cannot assign to function call

2009-01-07 Thread sturlamolden
On Jan 7, 2:02 am, Steven D'Aprano wrote: > In Python code, there are no references and no dereferencing. The why does CPython keep track of reference counts? > You can't, because Python doesn't have references. In a language with > references, that's easy. Python does not 'pass-by-reference'

Re: pg_result_status() alternative?

2009-01-07 Thread Steve Holden
Qian Xu wrote: > Hi All, > > I am using the pg module (http://www.pygresql.org/pg.html) for database > testing. > > I have got a problem now: > I want to check the result status of postgresql database, which can be done > in php by using pg_result_status() > (http://www.phpbuilder.com/manual/en/f

Re: Multiprocessing takes higher execution time

2009-01-07 Thread Steve Holden
Sibtey Mehdi wrote: > Hi, > > > > I use multiprocessing to compare more then one set of files. > > For comparison each set of files (i.e. Old file1 Vs New file1) I create > a process, > > Process(target=compare, args=(oldFile, newFile)).start() > > It takes 61 seconds execution time. > >

mac osx how to use a specific python environment

2009-01-07 Thread marco kuhn
hi, I would like to use a specific python environment in a script . The script is load as a plugin by a program which offer a python api . The python environment is build in. How can I use the standard python environment. Can i explicit load the env in my python script. Best MArco -- http://mail

Re: pg_result_status() alternative?

2009-01-07 Thread Qian Xu
Steve Holden wrote: > Without knowing the full details of that particular module I would > hazard a guess that any database errors will raise exceptions in Python. > No exceptions means your database operation worked fine. result status is not an exception. It means the information of frontend/bac

Re: Extending Python with C or C++

2009-01-07 Thread Nick Craig-Wood
Thomas Heller wrote: > Nick Craig-Wood schrieb: > > Interesting - I didn't know about h2xml and xml2py before and I've > > done lots of ctypes wrapping! Something to help with the initial > > drudge work of converting the structures would be very helpful. > > > > ( http://pypi.python.org/pypi/c

Defer problem

2009-01-07 Thread wladimir
Hi, I have an problem. I want to fire one callback after n callbacks fired, but when i fire one callback all the chain will be executed. Example: def handle(x): print 'callback ' + str(x) def handle2(x): print 'after callbacks' d1 = defer.Deffered() d2 = defer.Deffered() d3 = def

Re: Defer problem

2009-01-07 Thread Jean-Paul Calderone
On Wed, 7 Jan 2009 04:44:43 -0800 (PST), wladimir wrote: Hi, I have an problem. I want to fire one callback after n callbacks fired, but when i fire one callback all the chain will be executed. Example: def handle(x): print 'callback ' + str(x) def handle2(x): print 'after callbacks'

Re: string length problem?

2009-01-07 Thread John Machin
On Jan 7, 9:40 pm, Qian Xu wrote: > Hi All, > > why the code >   print len(u"»test«") > returns 8 instead of 6? I suggest that you do print repr(u"»test«") and inspect the result. HTH, John -- http://mail.python.org/mailman/listinfo/python-list

Re: ssl module - how can I accept SSLv3 and TLSv1 protocols only?

2009-01-07 Thread Jean-Paul Calderone
On Tue, 6 Jan 2009 19:01:48 -0800 (PST), Giampaolo Rodola' wrote: Hi, I'm trying to add TLS/SSL support to pyftpdlib. Since various defects have been found in the SSLv2 protocol many FTPS servers (i.e. proftpd and vsftpd) decided to support SSLv3 and TLSv1 only and sistematically reject any cli

Re: linked list with cycle structure

2009-01-07 Thread Diez B. Roggisch
David Hláčik wrote: > dictionary with cycle structure > > Hello guys, > > I have a linked list where *number of elements is unlimited* and > **last element points on random (can be first, last, in middle , > anywhere) element within linked list** - this is important . My goals > is to create an

Re: image recogniton?

2009-01-07 Thread Li Han
On 1月7日, 上午4时14分, J Kenneth King wrote: > I'm curious as to what application the solution to this problem is > practical for all of its difficulty? Sorry, I oversimplified the question because of my poor english. It is an analog compass whose value we need to read into the computer every second.

Interpreter & Thread state & Frame structures.

2009-01-07 Thread alessiogiovanni . baroni
Hi to all, there are some fields in the PyInterpreterState and PyThreadState obscures. PyInterpreterState: 1) Why there are the fields *next and *tstate_head? PyThreadState: 1) Why there is the field *next? An object PyFrameObject is a portion of code, with a state. But exactly? Contents of a

Re: How to get millisec/fractional seconds out of a time object ?

2009-01-07 Thread David
On Tue, 6 Jan 2009 13:46:46 -0800, "Chris Rebert" wrote: >The attribute you're looking for is 'microseconds', not 'milliseconds'. > >Cheers, >Chris Thanks Most of the docs are useful but those on timedelta seemed too concise. Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-07 Thread Marc 'BlackJack' Rintsch
On Wed, 07 Jan 2009 03:45:00 -0800, sturlamolden wrote: > On Jan 7, 2:02 am, Steven D'Aprano > wrote: > >> In Python code, there are no references and no dereferencing. > > The why does CPython keep track of reference counts? Show me the *Python* code that does that. Using reference counting

Re: An idea of how to identify Israeli owned software companies

2009-01-07 Thread Terje
Is there a web service/API out there identifying Israel owned software/software companies/web sites/web services? If I am about to buy a piece of software, but don't want to support the Israeli economy, it would have been handy if I could just poll a web service to get the answer. This informat

Re: image recogniton?

2009-01-07 Thread Almar Klein
2009/1/7 Li Han > On 1月7日, 上午4时14分, J Kenneth King wrote: > > I'm curious as to what application the solution to this problem is > > practical for all of its difficulty? > Sorry, I oversimplified the question because of my poor english. It is > an analog compass whose value we need to read into

Re: mac osx how to use a specific python environment

2009-01-07 Thread Philip Semanchuk
On Jan 7, 2009, at 7:27 AM, marco kuhn wrote: hi, I would like to use a specific python environment in a script . The script is load as a plugin by a program which offer a python api . The python environment is build in. How can I use the standard python environment. Can i explicit load the e

Re: image recogniton?

2009-01-07 Thread Joe Strout
Li Han wrote: Sorry, I oversimplified the question because of my poor english. It is an analog compass whose value we need to read into the computer every second. We use a video camera keep shooting it, and the compass and camera are fixed. If you have any choice about it, it would be greatl

Re: Any news on when some libraries will be ported to Python 3.0?

2009-01-07 Thread pruebauno
On Jan 7, 3:48 am, "Just Another Victim of the Ambient Morality" wrote: >     Anyway, I'd love to hear some news about any of these things in > particular or even anything in general.  Am I the only one who's psyched for > this version of Python? >     Thank you... There are many people psyched a

Re: Tkinter - problem closing window

2009-01-07 Thread Djames Suhanko
Wow, nice! But, with join i can't padding with 0. '-'.join(str(random.randint(0, 60)) for dummy in xrange(6)) Then, i has been used: a[i] = "%02d" % int(random.randint(0,60)) I will change int(random.randint(0,60)) for random.randint(0,60), only. Thank you, guys !! ;-) The problem was solved whe

Re: Multiprocessing takes higher execution time

2009-01-07 Thread Grant Edwards
On 2009-01-07, Steve Holden wrote: >> I use multiprocessing to compare more then one set of files. >> >> For comparison each set of files (i.e. Old file1 Vs New file1) >> I create a process, >> >> Process(target=compare, args=(oldFile, newFile)).start() >> >> It takes 61 seconds execution time

How to set a cookie using Cookie Module

2009-01-07 Thread tryg . olson
Hello - This is my first attempt at python cookies. I'm using the Cookie module and trying to set a cookie. Below is my code. The cookie does not get set. What am I doing wrong? print "Cache-Control: max-age=0, must-revalidate, no-store" print "Content-type: text/html" print print """

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread J Kenneth King
Jonathan Gardner writes: > On Jan 6, 12:24 pm, J Kenneth King wrote: >> Jonathan Gardner writes: >> > On Jan 6, 8:18 am, sturlamolden wrote: >> >> On Jan 6, 4:32 pm, mark wrote: >> >> >> > I want to implement a internal DSL in Python. I would like the syntax >> >> > as human readable as possi

Re: What would you like to see in a book about Matplotlib?

2009-01-07 Thread Thomas Guettler
Sandro Tosi schrieb: > Some basic question I'd like to ask are: > > - what are you using matplotlib for? I use the API to create PNGs from data stored in postgres. Webframework: Django. > - what are the (basic) things that, when you were beginning to use > matplotlib, you wanted to see grouped

listdir reports [Error 1006] The volume for a file has been externally altered so that the opened file is no longer valid

2009-01-07 Thread PerOK
os.listdir() keep giving this error: [Error 1006] The volume for a file has been externally altered so that the opened file is no longer valid: 'V:\\ETOPOK_Example_MyTestView\\LD_FuncBlocks_013\\cnh1603087_ui_toolkit_mid p\\test/*.*' The V:\\ETOPOK_Example_MyTestView refer to a ClearCase (CC) dyna

Re: Multiprocessing takes higher execution time

2009-01-07 Thread Nick Craig-Wood
Grant Edwards wrote: > On 2009-01-07, Steve Holden wrote: > > >> I use multiprocessing to compare more then one set of files. > >> > >> For comparison each set of files (i.e. Old file1 Vs New file1) > >> I create a process, > >> > >> Process(target=compare, args=(oldFile, newFile)).start() >

Looking for a generic Python script to turn xml into a dataset/array

2009-01-07 Thread davidgshi
I am looking for a generic Python script to turn xml into a dataset/ array, to be ready to be saved in a .dbf file. The xml contains CDATA section. Regards. David -- http://mail.python.org/mailman/listinfo/python-list

Re: An idea of how to identify Israeli owned software companies

2009-01-07 Thread Steve Holden
Terje wrote: > Is there a web service/API out there identifying Israel owned > software/software companies/web sites/web services? If I am about to buy > a piece of software, but don't want to support the Israeli economy, it > would have been handy if I could just poll a web service to get the > an

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread Kay Schluehr
On 7 Jan., 16:50, J Kenneth King wrote: > Python expressions are not > data types either and hence no macros -- I can't write a python function > that generates python code at compile time. Have you ever considered there are languages providing macros other than Lisp? Macros have nothing to do w

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread Chris Mellon
On Wed, Jan 7, 2009 at 9:50 AM, J Kenneth King wrote: > Jonathan Gardner writes: > >> On Jan 6, 12:24 pm, J Kenneth King wrote: >>> Jonathan Gardner writes: >>> > On Jan 6, 8:18 am, sturlamolden wrote: >>> >> On Jan 6, 4:32 pm, mark wrote: >>> >>> >> > I want to implement a internal DSL in Py

Creating new instances of subclasses.

2009-01-07 Thread J. Cliff Dyer
I want to be able to create an object of a certain subclass, depending on the argument given to the class constructor. I have three fields, and one might need to be a StringField, one an IntegerField, and the last a ListField. But I'd like my class to delegate to the proper subclass automatically

Is it ok to type check a boolean argument?

2009-01-07 Thread Adal Chiriliuc
Hello, Me and my colleagues are having an discussion about the best way to code a function (more Pythonic). Here is the offending function: def find(field, order): if not isinstance(order, bool): raise ValueError("order must be a bool") order_by = "asc" if order else "desc" r

Re: ssl module - how can I accept SSLv3 and TLSv1 protocols only?

2009-01-07 Thread Giampaolo Rodola'
On 7 Gen, 14:21, Jean-Paul Calderone wrote: > On Tue, 6 Jan 2009 19:01:48 -0800 (PST), Giampaolo Rodola' > wrote: > >Hi, > >I'm trying to add TLS/SSL support to pyftpdlib. > >Since various defects have been found in the SSLv2 protocol many FTPS > >servers (i.e. proftpd and vsftpd) decided to sup

Importing modules

2009-01-07 Thread e4me4m
Coming from a scripting background where we used to write everything into one script, I'm now going modular with Python. I place related functions in one module, and other functions in other modules. This all works OK, but I'm a bit confused about importing modules from the standard library. For e

formatted 'time' data in calculations

2009-01-07 Thread Ross
There seems to be no shortage of information around on how to use the time module, for example to use time.ctime() and push it into strftime and get something nice out the other side, but I haven't found anything helpful in going the other way. That is, given some formatted text describing tim

Re: Importing modules

2009-01-07 Thread Diez B. Roggisch
e4m...@gmail.com wrote: > Coming from a scripting background where we used to write everything > into one script, I'm now going modular with Python. I place related > functions in one module, and other functions in other modules. > > This all works OK, but I'm a bit confused about importing modul

Re: listdir reports [Error 1006] The volume for a file has been externally altered so that the opened file is no longer valid

2009-01-07 Thread Chris Rebert
> PS: Why does the listdir() function add '*.*' to the path? Don't know what you're talking about. It doesn't do any globbing or add "*.*" to the path. Its exclusive purpose is to list the contents of a directory, so /in a sense/ it does add "*.*", but then not adding "*.*" would make the function

Re: Importing modules

2009-01-07 Thread Steve Holden
e4m...@gmail.com wrote: > Coming from a scripting background where we used to write everything > into one script, I'm now going modular with Python. I place related > functions in one module, and other functions in other modules. > > This all works OK, but I'm a bit confused about importing module

#python IRC help - my internet provider is banned!

2009-01-07 Thread simonh
Hi. Not sure if anyone can help here, but I'm trying to access #python and have found out that my ISP has a blanket ban (for some reason). Does anyone know how I can contact an operator to join? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it ok to type check a boolean argument?

2009-01-07 Thread Paul McGuire
On Jan 7, 11:24 am, Adal Chiriliuc wrote: > Hello, > > Me and my colleagues are having an discussion about the best way to > code a function (more Pythonic). > > Here is the offending function: > > def find(field, order): > if not isinstance(order, bool): > raise ValueError("order must

Re: formatted 'time' data in calculations

2009-01-07 Thread Diez B. Roggisch
Ross wrote: > There seems to be no shortage of information around on how to use the > time module, for example to use time.ctime() and push it into strftime > and get something nice out the other side, but I haven't found anything > helpful in going the other way. > > That is, given some formatte

Re: formatted 'time' data in calculations

2009-01-07 Thread Chris Rebert
On Wed, Jan 7, 2009 at 9:35 AM, Ross wrote: > There seems to be no shortage of information around on how to use the time > module, for example to use time.ctime() and push it into strftime and get > something nice out the other side, but I haven't found anything helpful in > going the other way. >

Re: formatted 'time' data in calculations

2009-01-07 Thread Stephen Chapman
Here is how I have done adjustments to time in the past. This is mostly Date related but it may help today = datetime.date.today() wkdiff = datetime.timedelta(weeks=1) daydiff = datetime.timedelta(days=1) startdate=(today-wkdiff)-daydiff this will subtract 1 week and 1 day from today. Stephen

Re: Importing modules

2009-01-07 Thread Paul McGuire
...and don't worry about a possible performance issue of importing os (or any other module) multiple times - the Python import manager is smart enough to recognize previously imported modules, and wont import them again. If a module uses the os module, then it should import it - that's just it. A

Re: formatted 'time' data in calculations

2009-01-07 Thread Ross
Thanks Chris and Diez for the quick pointers... Very helpful Ross. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it ok to type check a boolean argument?

2009-01-07 Thread Philip Semanchuk
On Jan 7, 2009, at 12:24 PM, Adal Chiriliuc wrote: Hello, Me and my colleagues are having an discussion about the best way to code a function (more Pythonic). Here is the offending function: def find(field, order): if not isinstance(order, bool): raise ValueError("order must be a

Re: Creating new instances of subclasses.

2009-01-07 Thread Paul McGuire
On Jan 7, 10:38 am, "J. Cliff Dyer" wrote: > I want to be able to create an object of a certain subclass, depending > on the argument given to the class constructor. > > I have three fields, and one might need to be a StringField, one an > IntegerField, and the last a ListField.  But I'd like my c

Re: Importing modules

2009-01-07 Thread Mel
Steve Holden wrote: > e4m...@gmail.com wrote: [ ... ] >> Could someone point me to some docs that explain the Python way of >> loading modules when breaking old, big (everything in one script) into >> more manageable modular scripts? >> > Import each module into every other module that requires i

Re: Creating new instances of subclasses.

2009-01-07 Thread Terry Reedy
J. Cliff Dyer wrote: I want to be able to create an object of a certain subclass, depending on the argument given to the class constructor. I have three fields, and one might need to be a StringField, one an IntegerField, and the last a ListField. But I'd like my class to delegate to the proper

Re: An idea of how to identify Israeli owned software companies

2009-01-07 Thread Mensanator
On Jan 7, 8:45 am, Terje wrote: > Is there a web service/API out there identifying Israel owned > software/software companies/web sites/web services? If I am about to buy > a piece of software, but don't want to support the Israeli economy, it > would have been handy if I could just poll a web ser

socket.error 24: too many open files

2009-01-07 Thread TheDavidFactor
I'm new to python, but have been writing programs in other languages for about 15 years now. As part of my job I develop applications that interface with Asterisk in various ways. As a way of getting my feet wet I decided to try to rewrite an outbound call script that I have in another language int

Re: Is it ok to type check a boolean argument?

2009-01-07 Thread Terry Reedy
Adal Chiriliuc wrote: Me and my colleagues are having an discussion about the best way to code a function (more Pythonic). Here is the offending function: def find(field, order): if not isinstance(order, bool): raise ValueError("order must be a bool") order_by = "asc" if order

[Mechanize.ClientForm] double reading from urllib2.urlopen

2009-01-07 Thread tiktak . hodiki
Hello, folks! I use mechanize.clientform to parse HTML-forms. I preliminary check response and call response.read().find("..."). But when it's taken to ClientForm.ParseResponse, it can't parse because of response.read() is zero-length text. The problem is that ClientForm.ParseResponse is not taken

Re: #python IRC help - my internet provider is banned!

2009-01-07 Thread simonh
On Jan 7, 6:30 pm, "Mildew Spores" wrote: > What? Sounds a bit unlikely unless its Virgin.. > I'd imagine it might be that your isp needs to get itself off a black list. > Brian > > -- > My Hotmail Account > mildew_spo...@hotmail.com > > "simonh" wrote in message > > news:fd0bd7d3-ad1d-43c2-b8e5-

Re: How to get millisec/fractional seconds out of a time object ?

2009-01-07 Thread M.-A. Lemburg
On 2009-01-06 22:34, da...@bag.python.org wrote: > Thanks for help to a beginner. > > script23 > import time > import datetime > start_time = datetime.datetime.now() > time.sleep(0.14) > end_time = datetime.datetime.now() > datetime.timedelta = end

Re: [Mechanize.ClientForm] double reading from urllib2.urlopen

2009-01-07 Thread MRAB
tiktak.hod...@gmail.com wrote: Hello, folks! I use mechanize.clientform to parse HTML-forms. I preliminary check response and call response.read().find("..."). But when it's taken to ClientForm.ParseResponse, it can't parse because of response.read() is zero-length text. The problem is that Clien

Re: FTP example going through a FTP Proxy

2009-01-07 Thread jakecjacobson
On Jan 7, 12:32 pm, jakecjacobson wrote: > Hi, > > I need to write a simple Python script that I can connect to a FTP > server and download files from the server to my local box.  I am > required to go through a FTP Proxy and I don't see any examples on how > to do this.  The FTP proxy doesn't req

Re: formatted 'time' data in calculations

2009-01-07 Thread Scott David Daniels
Ross wrote: There seems to be no shortage of information around on how to use the time module, for example to use time.ctime() and push it into strftime and get something nice out the other side, but I haven't found anything helpful in going the other way. As to a paucity of conversion format

Re: Any news on when some libraries will be ported to Python 3.0?

2009-01-07 Thread Stefan Behnel
Just Another Victim of the Ambient Morality wrote: > I'm excited to use Python 3.0 (foolishly, it's the only Python > interpreter I have on my system) but there are no libraries for it beyond > the kitchen sink. Personally, a good start would be Beautiful Soup and > Mechanize. I could also

State of the art: Tkinter, Tk 8.5, Tix?

2009-01-07 Thread excord80
Does Python work with Tk 8.5? I'm manually installing my own Python 2.6.1 (separate from my system's Python 2.5.2), and am about to install my own Tcl/Tk 8.5 but am unsure how to make them talk to eachother. Should I install Tk first? If I put Tk into my home directory (under "~/opt" most likely),

del behavior

2009-01-07 Thread Eric Snow
I was reading in the documentation about __del__ and have a couple of questions. Here is what I was looking at: http://docs.python.org/reference/datamodel.html#object.__del__ What is globals referring to in the following text from that reference page? "Starting with version 1.5, Python guarante

Re: formatted 'time' data in calculations

2009-01-07 Thread Aaron Hill
I personally use epoch time since its absolute. I have a simple time clock app that uses this method, from that it is easy to convert into human date: [code] def OnButtonIn(self,evt): 'create time stamp with ID/action' 'print to the rightFrame text' if self.punchedIn:

del behavior 2

2009-01-07 Thread Eric Snow
I was reading in the documentation about __del__ and have a couple of questions. Here is what I was looking at: http://docs.python.org/reference/datamodel.html#object.__del__ My second question is about the following: "It is not guaranteed that __del__() methods are called for objects that stil

Re: del behavior

2009-01-07 Thread Chris Rebert
On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: > I was reading in the documentation about __del__ and have a couple of > questions. Here is what I was looking at: > > http://docs.python.org/reference/datamodel.html#object.__del__ > > What is globals referring to in the following text from that

Re: del behavior 2

2009-01-07 Thread MRAB
Eric Snow wrote: I was reading in the documentation about __del__ and have a couple of questions. Here is what I was looking at: http://docs.python.org/reference/datamodel.html#object.__del__ My second question is about the following: "It is not guaranteed that __del__() methods are called fo

Re: del behavior 2

2009-01-07 Thread Chris Rebert
On Wed, Jan 7, 2009 at 11:42 AM, Eric Snow wrote: > I was reading in the documentation about __del__ and have a couple of > questions. Here is what I was looking at: > > http://docs.python.org/reference/datamodel.html#object.__del__ > > My second question is about the following: > > "It is not gu

Re: del behavior

2009-01-07 Thread Eric Snow
On Jan 7, 12:48 pm, "Chris Rebert" wrote: > On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: > > I was reading in the documentation about __del__ and have a couple of > > questions.  Here is what I was looking at: > > >http://docs.python.org/reference/datamodel.html#object.__del__ > > > What is

Re: del behavior

2009-01-07 Thread Eric Snow
On Jan 7, 12:55 pm, Eric Snow wrote: > On Jan 7, 12:48 pm, "Chris Rebert" wrote: > > > > > On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: > > > I was reading in the documentation about __del__ and have a couple of > > > questions.  Here is what I was looking at: > > > >http://docs.python.org/

Re: del behavior 2

2009-01-07 Thread Martin v. Löwis
> I understand that and have seen it too. That's fine. But how do any > of you deal with things that are left open because you did not get a > chance to close them? How do you clean up after the fact? Do you > simply keep track externally the things that need to be cleaned up if > __del__ doesn

Re: del behavior 2

2009-01-07 Thread Eric Snow
On Jan 7, 12:57 pm, "Chris Rebert" wrote: > On Wed, Jan 7, 2009 at 11:42 AM, Eric Snow wrote: > > I was reading in the documentation about __del__ and have a couple of > > questions.  Here is what I was looking at: > > >http://docs.python.org/reference/datamodel.html#object.__del__ > > > My secon

Re: del behavior 2

2009-01-07 Thread Eric Snow
On Jan 7, 1:03 pm, Eric Snow wrote: > On Jan 7, 12:57 pm, "Chris Rebert" wrote: > > > > > On Wed, Jan 7, 2009 at 11:42 AM, Eric Snow wrote: > > > I was reading in the documentation about __del__ and have a couple of > > > questions.  Here is what I was looking at: > > > >http://docs.python.org/r

Re: del behavior

2009-01-07 Thread MRAB
Chris Rebert wrote: On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: I was reading in the documentation about __del__ and have a couple of questions. Here is what I was looking at: http://docs.python.org/reference/datamodel.html#object.__del__ What is globals referring to in the following t

Re: del behavior

2009-01-07 Thread Chris Rebert
On Wed, Jan 7, 2009 at 11:55 AM, Eric Snow wrote: > On Jan 7, 12:48 pm, "Chris Rebert" wrote: >> On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: >> > I was reading in the documentation about __del__ and have a couple of >> > questions. Here is what I was looking at: >> >> >http://docs.python.

Re: del behavior

2009-01-07 Thread Chris Rebert
On Wed, Jan 7, 2009 at 12:05 PM, MRAB wrote: > Chris Rebert wrote: >> >> On Wed, Jan 7, 2009 at 11:39 AM, Eric Snow wrote: >>> >>> I was reading in the documentation about __del__ and have a couple of >>> questions. Here is what I was looking at: >>> >>> http://docs.python.org/reference/datamode

Re: State of the art: Tkinter, Tk 8.5, Tix?

2009-01-07 Thread Roger
On Jan 7, 2:31 pm, excord80 wrote: > Does Python work with Tk 8.5? I'm manually installing my own Python > 2.6.1 (separate from my system's Python 2.5.2), and am about to > install my own Tcl/Tk 8.5 but am unsure how to make them talk to > eachother. Should I install Tk first? If I put Tk into my

Re: compiling python2.5 on linux under wine

2009-01-07 Thread Luke Kenneth Casson Leighton
On Sat, Jan 3, 2009 at 9:22 PM, Luke Kenneth Casson Leighton wrote: > hey, has anyone investigated compiling python2.5 using winegcc, under wine? some people might find this kind of thing amusing. it's considered in very obtuse circles to be "progress"... :) l...@gonzalez:/mnt/src/python2.5-2

How to store passwords?

2009-01-07 Thread Oltmans
I'm writing a program in which I will ask users to enter user name and password once only. It's a console based program that will run on Windows XP. Actually, I'm trying to provide the similar functionality as "Remember me" thing in browsers. For that, I will need to store user name and passwords o

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread J Kenneth King
Kay Schluehr writes: > On 7 Jan., 16:50, J Kenneth King wrote: > >> Python expressions are not >> data types either and hence no macros -- I can't write a python function >> that generates python code at compile time. > > Have you ever considered there are languages providing macros other > than

Re: why cannot assign to function call

2009-01-07 Thread Dan Esch
Wait a sec... I think I get this... In essence, the implication of immutability for Python is that there is only one "parrot", one "spam,"in fact one anything. (This seems like it must hold for data primitives - does it hold for complex objects as well? It seems it must...) In addition there is o

  1   2   3   >