Re: Website data-mining.

2007-08-03 Thread Jay Loden
Miki wrote: > Hello, > >> I'm using Python for the first time to make a plug-in for Firefox. >> The goal of this plug-in is to take the source code from a website >> and use the metadata and body text for different kinds of analysis. >> My question is: How can I retrieve data from a website? I'm n

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
Paul Rubin wrote: > Hmm, it's a pain that there's no clean way to get at the current > module. PEP 3130 shows some icky and unreliable ways, e.g. > >func = getattr(sys.modules[__name__], 'f') > > PEP 3130's goal was to add a clean way to do this. Unfortunately it > was rejected. Yes, this

Re: Help: GIS

2007-08-03 Thread zxo102
On 8 3 , 9 34 , [EMAIL PROTECTED] wrote: > On Aug 2, 10:46 pm, zxo102 <[EMAIL PROTECTED]> wrote: > > > Hi, > > I am new in GIS area and need your suggestions for where I can > > start from. I have a python based web application with a database. > > Now I would like to add a GIS map into my a

Re: Website data-mining.

2007-08-03 Thread Miki
Hello, > I'm using Python for the first time to make a plug-in for Firefox. > The goal of this plug-in is to take the source code from a website > and use the metadata and body text for different kinds of analysis. > My question is: How can I retrieve data from a website? I'm not even > sure if th

Re: regexp problem in Python

2007-08-03 Thread Ehsan
" > > > but it returns only 'wmv' and '3gp' instead of "http://www.2shared.com/ > > download/1716611/e2000f22/Jadeed_Mlak14.wmv? > > tsid=20070803-164051-9d637d11" > > > what can I do? what's wrong whit this pattern? thanx for you

Re: Trying to find zip codes/rest example

2007-08-03 Thread Jay Loden
VanL wrote: > Hello, > > A couple months ago there was an example posted in a blog of a rest > interface for validating zip codes. If I recall correctly, the backend > validator was written in python. > > The validator demo page had a single text input; next to the text input > would appear e

Re: Script that Navigates Page needs Javascript Functionality

2007-08-03 Thread 7stud
On Aug 3, 7:58 pm, SMERSH009 <[EMAIL PROTECTED]> wrote: > I have a script that navigates pages and scrapes the HTML source of > the page. > in order to view the results I need I need python to "navigate to" > this Javascript link: > javascript:__doPostBack('ctl00$cpMain$pagerTop','4') This basical

Re: bias in random.normalvariate??

2007-08-03 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I'm a Python newbie and certainly no expert on statistics, but my wife > was taking a statistics course this summer and to illustrate that > sampling random numbers from a distribution and taking an average of > the samples gives you a random number as the result (bigger

Weekly Python Patch/Bug Summary

2007-08-03 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 404 open ( +5) / 3847 closed (+11) / 4251 total (+16) Bugs: 1059 open ( +3) / 6784 closed ( +8) / 7843 total (+11) RFE : 263 open ( +0) / 295 closed ( +1) / 558 total ( +1) New / Reopened Patches __ struni: F

Re: How to pass a reference to the current module

2007-08-03 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I'll point at the difficulty in using getattr for extracting a function > from the current module: > >>> func = getattr(???, 'f') # what should go there? Hmm, it's a pain that there's no clean way to get at the current module. PEP 3130 shows some icky

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Frank Swarbrick
Ian Clark wrote: > Stef Mientki wrote: >> hello, >> >> I discovered that boolean evaluation in Python is done "fast" >> (as soon as the condition is ok, the rest of the expression is ignored). >> >> Is this standard behavior or is there a compiler switch to turn it >> on/off ? > > It's called sho

Re: How to pass a reference to the current module

2007-08-03 Thread Steven D'Aprano
On Fri, 03 Aug 2007 21:06:23 -0700, James Stroud wrote: > Its very close. However, there is the possibiltiy that main.py and > UserDefined1.py are the same module. In such a case I'm guessing that I > need to resort to the gymnastics of frame inspection I mentioned > earlier. I suggest you'r

Re: How to pass a reference to the current module

2007-08-03 Thread Steven D'Aprano
On Fri, 03 Aug 2007 18:45:21 -0700, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> namespace = module.__dict__ >> return namespace[name] > > Am I missing something? It's likely that I just don't understand > the problem, but I don't understand these dictionary ext

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
Paul Rubin wrote: > James Stroud <[EMAIL PROTECTED]> writes: > >> ModuleBehavior >> == >>UserDefined1 Imports FunctionUser >>ThirdParty Contains User Functions (May be ==UserDefined1) >>FunctionU

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
Carsten Haese wrote: > On Fri, 2007-08-03 at 18:31 -0700, James Stroud wrote: >>Carsten Haese wrote: >>You sound like my former thesis adviser. > > > Thanks. I guess. Yes, its a compliment in disguise--just check his CV. >>OK. From an external source, such as configuration file, the user will

Re: bias in random.normalvariate??

2007-08-03 Thread Dan Bishop
On Aug 3, 10:38 pm, [EMAIL PROTECTED] wrote: > I'm a Python newbie and certainly no expert on statistics, but my wife > was taking a statistics course this summer and to illustrate that > sampling random numbers from a distribution and taking an average of > the samples gives you a random number as

Re: Relative-importing *

2007-08-03 Thread rbygscrsepda
Thanks to everybody for replying. (I apologize for the delayed response: my connection's been down for a week.) Yes, I'm importing * for a reason, a good one, I think. I have a set of modules (the number planned to reach about 400) that would be dynamically loaded by my program as needed, and they

bias in random.normalvariate??

2007-08-03 Thread drewlist
I'm a Python newbie and certainly no expert on statistics, but my wife was taking a statistics course this summer and to illustrate that sampling random numbers from a distribution and taking an average of the samples gives you a random number as the result (bigger sample -> smaller variance in the

Re: Website data-mining.

2007-08-03 Thread SMERSH009
On Aug 3, 7:50 pm, Coogan <[EMAIL PROTECTED]> wrote: > Hi-- > > I'm using Python for the first time to make a plug-in for Firefox. > The goal of this plug-in is to take the source code from a website > and use the metadata and body text for different kinds of analysis. > My question is: How can I r

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-03 Thread Danyelle Gragsone
In most of the technical computer newsgroups which I frequent, there is a handful of knowledgeable and helpful but irritable regulars, and often one or two saints who contribute usefully, ignore rudeness and almost never post off topic. Ain't that the truth!! You will find rudeness everywhere yo

Website data-mining.

2007-08-03 Thread Coogan
Hi-- I'm using Python for the first time to make a plug-in for Firefox. The goal of this plug-in is to take the source code from a website and use the metadata and body text for different kinds of analysis. My question is: How can I retrieve data from a website? I'm not even sure if this is possi

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-03 Thread sln
On Thu, 26 Jul 2007 14:56:13 GMT, zentara <[EMAIL PROTECTED]> wrote: >On Wed, 25 Jul 2007 14:45:29 -0500, [EMAIL PROTECTED] wrote: > >>Python is a better language, with php support, anyway, but I am fed up >>with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin >>Perl experience f

Re: downloading files

2007-08-03 Thread Steve Holden
Ehsan wrote: > On Aug 3, 10:10 pm, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >> I'm guessing there are binary files and you are running on Windows, >> which is inserting a carriage return before ebery newline. Try >> >> localFile = open(fileName, 'wb') >> >> to avoid thus behavior. [...

Re: Email

2007-08-03 Thread SMERSH009
On Aug 3, 9:47 am, Rohan <[EMAIL PROTECTED]> wrote: > On Aug 2, 1:06 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > > > Rohan wrote: > > > I was wondering if there could be an arrangement where a file could be > > > attached and send as an email. > > > For ex > > > f = open(add.txt,w) > > > f

Re: PYTHON PROGRAMMING HELP PLSSS !!

2007-08-03 Thread SMERSH009
On Aug 2, 6:24 pm, "Dennis" <[EMAIL PROTECTED]> wrote: > HI All, > i am a 4th year business student and i took web design online course > for fun however i did not see that last 2 chapters were python > programming.This has no relevance to my major nor does it have any > contribution to my degree.

Re: How to pass a reference to the current module

2007-08-03 Thread Carsten Haese
On Fri, 2007-08-03 at 18:31 -0700, James Stroud wrote: > Carsten Haese wrote: > > please describe less abstractly what you're trying to do. > > You sound like my former thesis adviser. Thanks. I guess. > OK. From an external source, such as configuration file, the user will > specify the *name*

Re: Eclipse and Python

2007-08-03 Thread Danyelle Gragsone
Thanks to all! Danyelle On 8/3/07, Lukasz <[EMAIL PROTECTED]> wrote: > Użytkownik Danyelle Gragsone napisał: > > Does anyone have any suggested websites for learning Eclipse the python way? > > > > thanks, > > Danyelle > > http://www.showmedo.com/videos/series?name=PyDevEclipseList > > > -- > Opol

Re: How to pass a reference to the current module

2007-08-03 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > ModuleBehavior >== > UserDefined1 Imports FunctionUser > ThirdParty Contains User Functions (May be ==UserDefined1) > FunctionUser do_something_with

Script that Navigates Page needs Javascript Functionality

2007-08-03 Thread SMERSH009
I have a script that navigates pages and scrapes the HTML source of the page. in order to view the results I need I need python to "navigate to" this Javascript link: javascript:__doPostBack('ctl00$cpMain$pagerTop','4') This basically translates into "go to page 4." I read the posts on this group,

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
Steven D'Aprano wrote: > On Fri, 03 Aug 2007 17:22:40 -0700, James Stroud wrote: > > >>Basically, what I am trying to acomplish is to be able to do this in any >>arbitrary module or __main__: >> >> >>funcname = determined_externally() >>ModuleUser.do_something_with(AModule, funcname) >> >> >>Ide

Re: How to pass a reference to the current module

2007-08-03 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > namespace = module.__dict__ > return namespace[name] Am I missing something? It's likely that I just don't understand the problem, but I don't understand these dictionary extractions for what I thought would be an attribute lookup: Py

Re: How to pass a reference to the current module

2007-08-03 Thread Steven D'Aprano
On Fri, 03 Aug 2007 18:32:54 -0700, James Stroud wrote: > Carsten Haese wrote: >> This seems to confirm my suspicion that the do_something_with function >> doesn't actually need a reference to the module, it only needs a >> reference to the function to call. >> >> Maybe your hurdle is how to obta

Re: How to pass a reference to the current module

2007-08-03 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > > please describe less abstractly what you're trying to do. > You sound like my former thesis adviser. I couldn't understand what you were trying to do either. > OK. From an external source, such as configuration file, the user will > specify the *name*

Re: How to pass a reference to the current module

2007-08-03 Thread Steven D'Aprano
On Fri, 03 Aug 2007 17:22:40 -0700, James Stroud wrote: > Basically, what I am trying to acomplish is to be able to do this in any > arbitrary module or __main__: > > > funcname = determined_externally() > ModuleUser.do_something_with(AModule, funcname) > > > Ideally, it would be nice to leav

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
Carsten Haese wrote: > This seems to confirm my suspicion that the do_something_with function > doesn't actually need a reference to the module, it only needs a > reference to the function to call. > > Maybe your hurdle is how to obtain a reference to a function from the > current module when all

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
Carsten Haese wrote: > please describe less abstractly what you're trying to do. You sound like my former thesis adviser. OK. From an external source, such as configuration file, the user will specify the *name* of a function somehow with the assumption that the function will be coded somewhere

Re: How to pass a reference to the current module

2007-08-03 Thread Carsten Haese
On Fri, 2007-08-03 at 17:53 -0700, James Stroud wrote: > James Stroud wrote: > > Basically, what I am trying to acomplish is to be able to do this in any > > arbitrary module or __main__: > > > > > > funcname = determined_externally() > > ModuleUser.do_something_with(AModule, funcname) > > > >

Re: How to pass a reference to the current module

2007-08-03 Thread Carsten Haese
On Fri, 2007-08-03 at 17:22 -0700, James Stroud wrote: > Hello All, > > Say I have this code: > > > import AModule > import ModuleUser > > ModuleUser.do_something_with(AModule, 'some_function_name') > > > But say the functions are defined in the same module that contains the > above code. I

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
James Stroud wrote: > James Stroud wrote: > >> Basically, what I am trying to acomplish is to be able to do this in >> any arbitrary module or __main__: >> >> >> funcname = determined_externally() >> ModuleUser.do_something_with(AModule, funcname) >> >> >> Ideally, it would be nice to leave out A

Re: How to pass a reference to the current module

2007-08-03 Thread James Stroud
James Stroud wrote: > Basically, what I am trying to acomplish is to be able to do this in any > arbitrary module or __main__: > > > funcname = determined_externally() > ModuleUser.do_something_with(AModule, funcname) > > > Ideally, it would be nice to leave out AModule if the functions were

Re: Emacs + python

2007-08-03 Thread Ben Finney
hg <[EMAIL PROTECTED]> writes: > how about a cscope equivalent ? How about reading what was posted earlier in the thread, and give us a description of what you want instead of a name that people might not recognise? -- \ "The judge asked, 'What do you plead?' I said, 'Insanity, your | `

RE:xlrd question

2007-08-03 Thread JYOUNG79
Hi John, Thanks very much for your reply. And thanks for taking the time to create xlrd... this is a very cool and impressive program!! :-) I ran your code which gave me this: >>> import sys, xlrd; print sys.version; print xlrd.__file__ 2.3.5 (#1, Jan 30 2006, 13:30:29) [GCC 3.3 20030304

Re: Bug in time, part 2

2007-08-03 Thread Paul Boddie
Joshua J. Kugler wrote: > Or could I entitle this, "A Wrinkle in time.py," with apologies to Madeleine > L'Engle. Either I've found a bug (or rather room for improvement) in > time.py, or I *really* need a time module that doesn't assume so much. I'd be inclined to use the datetime module to avoi

How to pass a reference to the current module

2007-08-03 Thread James Stroud
Hello All, Say I have this code: import AModule import ModuleUser ModuleUser.do_something_with(AModule, 'some_function_name') But say the functions are defined in the same module that contains the above code. I can imagine this hack: import AModule import ModuleUser ModuleUser.do_somethin

Re: xlrd question

2007-08-03 Thread John Machin
On Aug 4, 1:22 am, [EMAIL PROTECTED] wrote: > When running 'python setup.py install' to install items for xlrd to work, > does anybody know > what items are > installed and where items are installed at on a Mac (OS 10.4)? I'm assuming > it mainly uses > things out of the xlrd > folder, but was c

Re: __call__ considered harmful or indispensable?

2007-08-03 Thread Skip Montanaro
Terry Reedy udel.edu> writes: > > The bug went something like this: > > > > obj = some.default_class > > ... > > if some_other_rare_condition_met: > > ... several lines ... > > obj = some.other_class() > > Should that have been some.other_class (without the ()s?). Ei

Re: regexp problem in Python

2007-08-03 Thread Dave Hansen
p://www.2shared.com/ > download/1716611/e2000f22/Jadeed_Mlak14.wmv? > tsid=20070803-164051-9d637d11" > > what can I do? what's wrong whit this pattern? thanx for your comments Just a guess, based on too little information: Try "(http.*?\.(wmv| 3gp).*)" Regards, -=Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse/PyDev question.

2007-08-03 Thread hg
king kikapu wrote: > Hi, > this is actually a question to those of us who use Eclipse and Pydev > as their main Python developing environment. As i use Eclipse (3.3 > Europa) only for Python and i have nothing to do with Java, is there a > way to disable/uninstall some Java-specific stuff and make

Re: Eclipse/PyDev question.

2007-08-03 Thread king kikapu
On Aug 3, 5:46 pm, "Danyelle Gragsone" <[EMAIL PROTECTED]> wrote: > I wonder how long before they come out with a python version of > eclipse. I know there is a C/C++ now. > > Danyelle The only problem i see in Eclipse/Pydev solution is that Eclipse is bulky...I was not designed for specific Pyth

Re: downloading files

2007-08-03 Thread Fabio Z Tessitore
Il Fri, 03 Aug 2007 14:32:19 -0700, Ehsan ha scritto: > It works but could you explain more what's wrong with just 'w'? On Unix-like systems newline means '\n' On Window newline means '\r\n' So, when you open a file on Window with 'w' option, Win replace downloaded '\n' with a local '\r\n' an

regexp problem in Python

2007-08-03 Thread Ehsan
I want to find "http://www.2shared.com/download/1716611/e2000f22/ Jadeed_Mlak14.wmv?tsid=20070803-164051-9d637d11" or 3gp instead of wmv in the text file like this : ""some code"" function reportAbuse() { var windowname="abuse"; var url="/ab

Re: downloading files

2007-08-03 Thread Ehsan
lFile = open(fileName, 'w') > >localFile.write(webFile.read()) > >webFile.close() > >localFile.close() > > download('http://www.2shared.com/download/1839752/cd520048/ > > xpersia14.3gp?tsid=20070803-143313-49566ea2', 'xpersia4.3gp&#

Re: Global package variable, is it possible?

2007-08-03 Thread Chris Allen
> Only for knowing more about modules: is there a way to dinamically reload > an already imported module? > > bye > Fabio Yeah you can reload modules with the reload builtin function. -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse/PyDev question.

2007-08-03 Thread Fabio Zadrozny
On 8/3/07, king kikapu <[EMAIL PROTECTED]> wrote: > > Hi, > this is actually a question to those of us who use Eclipse and Pydev > as their main Python developing environment. As i use Eclipse (3.3 > Europa) only for Python and i have nothing to do with Java, is there a > way to disable/uninstall s

amra and py2exe

2007-08-03 Thread vinod
Hi i am having trouble creating exe using py2exe for amara package i saw some posts related to this talking about amara cat file but i dont have any cat file for amara on my machine. the standalone script runs fine. i am using python on windows here is the error i am getting while creating the exe

Re: Eclipse and Python

2007-08-03 Thread Lukasz
Użytkownik Danyelle Gragsone napisał: > Does anyone have any suggested websites for learning Eclipse the python way? > > thanks, > Danyelle http://www.showmedo.com/videos/series?name=PyDevEclipseList -- Opole - Miasto Bez Granic. http://www.opole.pl - tu znajdziesz nowe miejsca, nowe mozliwosci

Re: Global package variable, is it possible?

2007-08-03 Thread Fabio Z Tessitore
Il Fri, 03 Aug 2007 14:16:59 -0400, Carsten Haese ha scritto: > Right idea, wrong execution. Note that the OP said "I'd like to be able > to reload the config file dynamically and have all my modules > automatically receive the new config." You are obviously right ... I haven't read all the post,

ANNOUNCE: Spiff Workflow 0.0.1 (Initial Release)

2007-08-03 Thread Samuel
Introduction Spiff Workflow is a library implementing a framework for workflows. It is based on http://www.workflowpatterns.com and implemented in pure Python. Supported workflow patterns include (at least) the following: 1. Sequence 2. Parallel Split 3. Synchronization 4. Exclusi

libpq.dll for pgdb

2007-08-03 Thread ekzept
the module PGDB which gives Python access to PostgreSql currently wants for a copy of a properly located or proper libpq.dll library, on Windows. anyone know what the current story on this is? thanks, -- jt -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange set of errors

2007-08-03 Thread Kurt Smith
On 8/3/07, Stephen Webb <[EMAIL PROTECTED]> wrote: > Greetings all, > > I've recently begun using Python to do scientific computation, and I wrote > the following script to find approximate eigenvalues for a semi-infinite > matrix: > > > from pylab import * > from numpy import * > from scipy impor

Re: Trying to find zip codes/rest example

2007-08-03 Thread VanL
Terry Reedy wrote: > No, but does the localflavor entry on > http://code.djangoproject.com/browser/django/trunk/docs/add_ons.txt?rev=5118 > help? (found with Google) Thanks, but no. A friend asked for advice about implementing a password-checking interface; I remembered that the method describe

Re: os.listdir path error

2007-08-03 Thread kyosohma
On Aug 3, 2:50 pm, [EMAIL PROTECTED] wrote: > Hello > > Here is my simple listdir example: > > >>> import os > >>> os.listdir("C:\Python24\") # This directory relly exists > > Here is my error: > > WindowsError: [Errno 3] The system cannot find the path specified: 'l/ > *.*' > > Regards, > Vedran

Re: os.listdir path error

2007-08-03 Thread Jerry Hill
On 8/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello > > Here is my simple listdir example: > > >>> import os > >>> os.listdir("C:\Python24\") # This directory relly exists > > Here is my error: > > WindowsError: [Errno 3] The system cannot find the path specified: 'l/ > *.*' That's a

Re: Strange set of errors

2007-08-03 Thread Kurt Smith
Sorry, forgot to "Reply to all." On 8/3/07, Stephen Webb <[EMAIL PROTECTED]> wrote: > Greetings all, <> > Also, I've been having trouble with the plot function in matplotlib. For > example, I enter the following in the terminal: > > >>> from pylab import * > >>> plot([1,2,3]) > [] > I can help

os.listdir path error

2007-08-03 Thread vedrandekovic
Hello Here is my simple listdir example: >>> import os >>> os.listdir("C:\Python24\") # This directory relly exists Here is my error: WindowsError: [Errno 3] The system cannot find the path specified: 'l/ *.*' Regards, Vedran -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse and Python

2007-08-03 Thread kyosohma
On Aug 3, 11:22 am, "Danyelle Gragsone" <[EMAIL PROTECTED]> wrote: > Does anyone have any suggested websites for learning Eclipse the python way? > > thanks, > Danyelle This article is a little old, but it might be helpful to you: http://www.ibm.com/developerworks/library/os-ecant/ I found this

draggable Tkinter.Text widget

2007-08-03 Thread infidel
Inspired by effbot's recent Vroom! editor, I have been toying with my own version. I'd like to make the Text widget "draggable", kind of like how you can drag a PDF document up and down in Adobe Reader. Here's what I have so far: from Tkinter import * class Draggable(Text, object): def __i

Re: downloading files

2007-08-03 Thread kyosohma
localFile.write(webFile.read()) > webFile.close() > localFile.close() > download('http://www.2shared.com/download/1839752/cd520048/ > xpersia14.3gp?tsid=20070803-143313-49566ea2', 'xpersia4.3gp' ) Uhhh...you probably need to change the open() command

Announcing Wing IDE 101 for teaching intro programming courses

2007-08-03 Thread Wingware
Hi, We're pleased to announce the first public beta release of Wing IDE 101, a free scaled back edition of Wing IDE that was designed for teaching introductory programming courses. We are releasing Wing IDE 101 to the general public in the hopes that it may help others teach with or learn Python.

Re: Trying to find zip codes/rest example

2007-08-03 Thread Terry Reedy
"VanL" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | I now cannot find this demo and the associated discussion. Does anybody | remember this demo and where I might be able to find it? No, but does the localflavor entry on http://code.djangoproject.com/browser/django/trunk/docs

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Terry Reedy
"Stef Mientki" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | John Machin wrote: | So now I'm left with just one question: | for bitwise operations I should use &, |, ^ | for boolean operations I should use and, or, xor | but after doing some test I find strange effects: | >>> A =

Re: downloading files

2007-08-03 Thread Carsten Haese
On Fri, 2007-08-03 at 11:48 -0700, Ehsan wrote: > I foundd this code in ASPN Python Cookbook for downloading files in > python but when it finished downloading files the files became > corrupted and didn't open, the files in internet havn't any problem: > > > def download(url,fileName): >

Re: downloading files

2007-08-03 Thread Steve Holden
ebFile.close() > localFile.close() > download('http://www.2shared.com/download/1839752/cd520048/ > xpersia14.3gp?tsid=20070803-143313-49566ea2', 'xpersia4.3gp' ) > I'm guessing there are binary files and you are running on Windows, which is inserting a carria

Re: Global package variable, is it possible?

2007-08-03 Thread Chris Allen
On Aug 3, 10:51 am, Fabio Z Tessitore <[EMAIL PROTECTED]> wrote: > Heve you tried to do something like: > > # module configure.py > value1 = 10 > value2 = 20 > ... > > # other module > from configure import * > > # now I'm able to use value1 value2 etc. > var = value1 * value2 > > bye Thanks for

Re: Global package variable, is it possible?

2007-08-03 Thread Chris Allen
On Aug 3, 11:16 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-08-03 at 17:51 +, Fabio Z Tessitore wrote: > > Heve you tried to do something like: > > > # module configure.py > > value1 = 10 > > value2 = 20 > > ... > > > # other module > > from configure import * > > > # now I'm ab

Re: Global package variable, is it possible?

2007-08-03 Thread Chris Allen
> Hmm. So maybe something like this makes sense: > > __init__py: > ### > _default_cfg_file = 'config.conf' > > import configure > def loadcfg(filename): > configure.cfgfile = filename > try: > reload(pkg_module1) > reload(pkg_module2) > except NameErr

downloading files

2007-08-03 Thread Ehsan
hared.com/download/1839752/cd520048/ xpersia14.3gp?tsid=20070803-143313-49566ea2', 'xpersia4.3gp' ) -- http://mail.python.org/mailman/listinfo/python-list

Re: __call__ considered harmful or indispensable?

2007-08-03 Thread Terry Reedy
Skip Montanaro a écrit : >>> In this case there was a bug. Depending on inputs, sometimes obj >>> initialized to a class, sometimes an instance of that class. (I fixed >>> that too while I was at it.) The problem was that the use of __call__ >>> obscured the underlying bug by making the instanc

RE: File Handling & TRY/EXCEPT

2007-08-03 Thread Alex Popescu
"Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Thanks for your ideas guys, > > I'm unfortunately tied to 2.4 so don't have the full try except > status, but I'm now working with the following code: > > def addApp(self, event): > try: >

►►►Get FREE Satellite TV on your PC ◄◄◄

2007-08-03 Thread Ana James
Watch Satellite TV On Your Computer Without Paying Monthly Fees... FOR FREE? Watch all your favorite shows on your Computer from anywhere in the World! Save 1000's of $$$ over many years on cable and satellite bills. INSTANT DOWNLOAD Plus Free Unlimited Downloads Movies, MP3s Music, etc !!! Mo

Re: Global package variable, is it possible?

2007-08-03 Thread Carsten Haese
On Fri, 2007-08-03 at 17:51 +, Fabio Z Tessitore wrote: > Heve you tried to do something like: > > # module configure.py > value1 = 10 > value2 = 20 > ... > > > # other module > from configure import * > > # now I'm able to use value1 value2 etc. > var = value1 * value2 Right idea, wrong e

Re: i am new to python-Please somebody help

2007-08-03 Thread Zentrader
BTW - on the subject of polite discussions, how about this one as an example of opinions politely expressed. Oh, and does anyone know how to use zip in Python. Yes+1. -- http://mail.python.org/mailman/listinfo/python-list

Strange set of errors

2007-08-03 Thread Stephen Webb
Greetings all, I've recently begun using Python to do scientific computation, and I wrote the following script to find approximate eigenvalues for a semi-infinite matrix: from pylab import * from numpy import * from scipy import * def bandstructure(N,s): b = s/4.0 jmax = 10 + N**2

Re: i am new to python-Please somebody help

2007-08-03 Thread Zentrader
On the discussion of rudeness, we have to include the OP. He/She/it did not even attempt a Google before posting, and posted with a meaningless subject. We'll chalk that up to newness, but some sort of retort was called for IMHO. How else do we learn the conventions that govern rudeness. Person

Re: Global package variable, is it possible?

2007-08-03 Thread Fabio Z Tessitore
Heve you tried to do something like: # module configure.py value1 = 10 value2 = 20 ... # other module from configure import * # now I'm able to use value1 value2 etc. var = value1 * value2 bye -- http://mail.python.org/mailman/listinfo/python-list

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Irmen de Jong
John Machin wrote: > > (you_are_confused and/or > function_returns_bool_but_has__side_effects()) > That above expression should be written more explicitly like: function_result = function_returning_bool_but_with_side_effects() if you_are_confused or function_result: do_something_nice() -

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Neil Cerutti
On 2007-08-03, Ed Leafe <[EMAIL PROTECTED]> wrote: > On Aug 3, 2007, at 11:57 AM, Bruno Desthuilliers wrote: > >> Sorry, I forgot to mention the language did not allow to have else >> & if >> in the same statement. IOW : >> >> if some_condition then >>do_sometehing >> else >>if some_other

Re: Using cursor.callproc with zxJDBC

2007-08-03 Thread Carsten Haese
On Fri, 2007-08-03 at 17:31 +0100, Vaughan V Ashe wrote: > Hi > > We would like to use the store proc. We are using a postgreql > database. what we have working so far is: > > params = [4,4,2] > > curs.callproc("update_job_status",params) > > db.commit() > > #print db > > #print curs.descr

Global package variable, is it possible?

2007-08-03 Thread Chris Allen
Hello fellow pythoneers. I'm stumped on something, and I was hoping maybe someone in here would have an elegant solution to my problem. This is the first time I've played around with packages, so I'm probably misunderstanding something here... Here's what I'd like to do in my package. I want my

Re: Email

2007-08-03 Thread Rohan
On Aug 2, 1:06 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > Rohan wrote: > > I was wondering if there could be an arrangement where a file could be > > attached and send as an email. > > For ex > > f = open(add.txt,w) > > f.write('python') > > f.close() > > > Now I would like to send an email w

Using cursor.callproc with zxJDBC

2007-08-03 Thread Vaughan V Ashe
Hi We would like to use the store proc. We are using a postgreql database. what we have working so far is: params = [4,4,2] curs.callproc("update_job_status",params) db.commit() #print db #print curs.description result = curs.fetchall() if result == 1: print "good one" else: p

Devloper Wanted For Debugging / Optimizing

2007-08-03 Thread Robert Rawlins - Think Blue
Hello Chaps, I've been writing (with your help) a small application over the past couple of months but I'm really struggling to iron out all of the creases and its seems to spring a few memory leaks that I'm unable to find and plug. It's only a small app, around 500 lines of code I would guess,

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Ed Leafe
On Aug 3, 2007, at 11:57 AM, Bruno Desthuilliers wrote: > Sorry, I forgot to mention the language did not allow to have else > & if > in the same statement. IOW : > > if some_condition then >do_sometehing > else >if some_other_condition then > do_something_else >else > if y

Idlelib TreeWidget (UNCLASSIFIED)

2007-08-03 Thread Vines, John (Civ, ARL/CISD)
Classification: UNCLASSIFIED Caveats: NONE Does anyone have any experience using the idlelib TreeWidget module? I am using it to display XML files and would like to include some editing capabilities. Does anyone have any examples I could take a look at? Thanks, John Classification: UNCLA

Re: Efficient Rank Ordering of Nested Lists

2007-08-03 Thread pyscottishguy
On Aug 2, 10:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > A naive approach to rank ordering (handling ties as well) of nested > lists may be accomplished via: > >def rankLists(nestedList): > def rankList(singleList): > sortedList = list(singleList) > sortedL

Eclipse and Python

2007-08-03 Thread Danyelle Gragsone
Does anyone have any suggested websites for learning Eclipse the python way? thanks, Danyelle -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse/PyDev question.

2007-08-03 Thread Danyelle Gragsone
I just found this: http://www.easyeclipse.org/site/distributions/python.html -- http://mail.python.org/mailman/listinfo/python-list

Re: (no) fast boolean evaluation ?

2007-08-03 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Fri, 03 Aug 2007 10:20:59 +0200, Bruno Desthuilliers wrote: > >> Joshua J. Kugler a écrit : >>> On Thursday 02 August 2007 15:19, Evan Klitzke wrote: > I discovered that boolean evaluation in Python is done "fast" > (as soon as the condition is ok, the rest o

Coroutine API

2007-08-03 Thread Calvin Spealman
I was talking to some other people, who all were working on different schedulers and such for coroutines. We decided to work out a common API to give coroutines, and common rules to passing data between them, etc. I am wondering now if there is already work on this, or some schedulers I'm not aware

Re: Replacing _xmlplus.dom.minidom with xml.dom.minidom

2007-08-03 Thread Stefan Behnel
Robert Rawlins - Think Blue wrote: > Just as a heads up, minidom is pretty inefficient and difficult to work with > too. > > On someone else's advice I switched over to ElementTree and have been really > pleased with the results, its much simpler to work with and more efficient > too. /and/ lxml.

  1   2   >