Re: "Locate" command in Python

2006-04-09 Thread BartlebyScrivener
How about one of these that works on Windows XP? I know there's no files.cache, but I wonder if your script could be combined with another function that would generate a list of paths on a Windows XP machine. Anyway, thanks for the script. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 31, Issue 94

2006-04-09 Thread Gary Robinson
> I can't see anything >> called a T2100. I have 3 X2100 servers which are opterons. Right I meant X2100's, sorry. > Python cannot use psyco on opterons at all - > 32 bit mode or otherwise. Are you sure? I'm not saying I have reason to believe differently, but I just want to be sure. The Ps

Re: how to pipe to variable of a "here document"

2006-04-09 Thread Burton Samograd
[EMAIL PROTECTED] writes: > I need to execute sql command using a "here document" like in unix. > > os.popen("osql", "w").write("""\ > select * from table > go > """) > > how can i pipe these result of the select into a variable? popen doesn't work that way. you can only open them read or writ

ANN: python-ldap-2.2.0

2006-04-09 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. p

Re: Python 3.0 or Python 3000?

2006-04-09 Thread Steven Bethard
John Salerno wrote: > Is 'Python 3000' just a code name for version 3.0, or will it really be > called that when it's released? Actually, there's an official response these days in `PEP 3000`_: """ Naming Python 3000, Python 3.0 and Py3K are all names for the same thing. The project is called

Re: how relevant is C today?

2006-04-09 Thread Ray
John Salerno wrote: > > At which level in the 'python challenge' did > > you get stuck - and why? > > Ugh, don't remind me! :) > > I'm stuck on level 12, which is yet another image processing puzzle. I'm > getting tired of those, and I think it's really a shame that there is a This is EXACTLY why

Re: Python 2.5 licensing: stop this change

2006-04-09 Thread Steve Holden
Robert Kern wrote: > Francisco Reyes wrote: > >>Shane Hathaway writes: >> >> >>>I must saay that i am fully in favor of this change. The ppython >>>developerrs need to eat too. Iis no one ellse aware off the perils oof >>>ooutright open source llicenssing? >> >>I disagree with the change. I th

Re: Python 3.0 or Python 3000?

2006-04-09 Thread John Salerno
Tim Peters wrote: > [John Salerno] >> Is 'Python 3000' just a code name for version 3.0, or will it really be >> called that when it's released? > > The smart money is on changing the name to Ecstasy, to leverage > marketing publicity from the hallucinogenic club drug of the same > name. "class"

how to pipe to variable of a "here document"

2006-04-09 Thread eight02645999
hi I need to execute sql command using a "here document" like in unix. os.popen("osql", "w").write("""\ select * from table go """) how can i pipe these result of the select into a variable? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter problem on Mac OS X

2006-04-09 Thread James Stroud
Andrew Trevorrow wrote: > Our app uses embedded Python to allow users to run arbitrary scripts. > Scripts that import Tkinter run fine on Windows, but on Mac OS X there > is a serious problem. After a script does "root = Tk()" our app's menus > are permanently changed in the following way: > > -

Re: Python 3.0 or Python 3000?

2006-04-09 Thread Ray
Dennis Lee Bieber wrote: > Or... just to save "3000" as a "time way down the road"... The next > major version of Python will be: Python PI (and each build will add > another digit... "3.1, 3.14, 3.141, ...") I like this idea a lot. This way, people ALWAYS know what the next release's name w

Re: can't pass command-line arguments

2006-04-09 Thread BartlebyScrivener
Duh! Headsmack. Thanks. But also, I discovered something else. If I name the script findmyfiles.py and run it from the command line while in the directory where it is stored (on windows), I must run it as: findmyfiles.py d:/notes notes*.* I was used to being able to run scripts by just typing th

Re: "Locate" command in Python

2006-04-09 Thread Adonis
mwt wrote: > Is there a function in python that does what "locate" does in a bash > shell? > > I know I could do it by using os.popen('locate'), but I'm curious if > there's a Python "native" way to go about it. Only needs to work in > Unix, but would be interesting if it was cross-platform. > >

Re: can't pass command-line arguments

2006-04-09 Thread Felipe Almeida Lessa
Em Dom, 2006-04-09 às 19:41 -0700, BartlebyScrivener escreveu: > for path in all_files(sysargv[1], sysargv[2]): Instead of sysargv, use sys.argv. -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

Re: "definitive" source on advanced python?

2006-04-09 Thread vdrab
wow, this looks nice. thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

can't pass command-line arguments

2006-04-09 Thread BartlebyScrivener
I'm still new at this. I can't get this to work as a script. If I just manually insert the values for sys.argv[1] and sys.argv[2] it works fine, but I can't pass the variables from the command line. What am I doing wrong? On windows xp, python 2.4.3 Thank you import os import fnmatch import sys

Re: a unicode question?

2006-04-09 Thread zdwang
Mr. John Machin This question come form the flow codes. I use the PyXml to build a DOM tree. from xml.dom.ext.reader import HtmlLib doc = HtmlLib.FromHtmlUrl('http://stock.business.sohu.com/q/nbcg.php?code=600028') title_elem = doc.documentElement.getElementsByTagName("TITLE")[0] title_string = t

Re: "definitive" source on advanced python?

2006-04-09 Thread shalabh . chaturvedi
You might find http://www.cafepy.com/article/python_types_and_objects/ and http://www.cafepy.com/article/python_attributes_and_methods/ useful. These articles assume you know Python, and describe some of the mechanisms behind Python new-style objects - including descriptors (but not decorators). -

Re: a unicode question?

2006-04-09 Thread zdwang
Mr. John Machin, Thank you very much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing files on server through CGI

2006-04-09 Thread amaltasb
this cgi script write different files, request 1 will write 1.html, 2 will write 2.html and so on. Its not updating the current file. For example create.py processes a form and write user.html file and every user is unique. so if 10 users fill up the form at the same time and click submit button, c

Re: Python 3.0 or Python 3000?

2006-04-09 Thread Tim Peters
[John Salerno] > Is 'Python 3000' just a code name for version 3.0, or will it really be > called that when it's released? The smart money is on changing the name to Ecstasy, to leverage marketing publicity from the hallucinogenic club drug of the same name. "class" will be renamed to "rave", and

Re: how relevant is C today?

2006-04-09 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "gregarican" <[EMAIL PROTECTED]> wrote: > Here are a few languages I recommend most programmers should at least > have a peek at: > > 1) Smalltalk - The original object oriented programming language. > Influenced anything from Mac/Windows GUI to Java language. Ter

Re: I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-09 Thread Ju Hui
thanks, I will try pycurl. -- http://mail.python.org/mailman/listinfo/python-list

"Locate" command in Python

2006-04-09 Thread mwt
Is there a function in python that does what "locate" does in a bash shell? I know I could do it by using os.popen('locate'), but I'm curious if there's a Python "native" way to go about it. Only needs to work in Unix, but would be interesting if it was cross-platform. Thanks. -- http://mail.p

Re: a unicode question?

2006-04-09 Thread John Machin
What do you mean by "ansi string"? Here is a superficially not-unreasonable answer to your more specific question: # >>> s1 = u'\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) ' # >>> s2 = '\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) ' # >>> s3 = s1.encode('latin1') # >>> s2 == s3 # True But what are you

Re: how relevant is C today?

2006-04-09 Thread gregarican
Here are a few languages I recommend most programmers should at least have a peek at: 1) Smalltalk - The original object oriented programming language. Influenced anything from Mac/Windows GUI to Java language. Terse, clean syntax. IDE rolled into an operating system rolled into a set of core libr

Re: More pythonic circle?

2006-04-09 Thread John Machin
[Pythor] Sure, I tested it. === I don't think that word means what you think it means :-) [Pythor] On the other hand, I'm not having any trouble producing a whole circle, while you seem to think I'm only producing half a circle. The code that limits itself to a 5x5 box is only expected to produce

Tkinter problem on Mac OS X

2006-04-09 Thread Andrew Trevorrow
Our app uses embedded Python to allow users to run arbitrary scripts. Scripts that import Tkinter run fine on Windows, but on Mac OS X there is a serious problem. After a script does "root = Tk()" our app's menus are permanently changed in the following way: - The top item in the application menu

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Steven D'Aprano wrote: > On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > > > it's more important > > to respect community standards than to stick to some silly preference > > you have. > > What happens when the community standard is a silly preference? I object > to the suggestion that "c

a unicode question?

2006-04-09 Thread zdwang
Hello, There is a unicode string, I want to change it to ansi string. but it raise an exception. Could you help me? ## I want to change s1 to s2. s1 = u'\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) ' s2 = '\xd6\xd0\xb9\xfa\xca\xaf\xbb\xaf(600028) ' -- http://mail.python.org/mailman

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Felipe Almeida Lessa wrote: > Em Dom, 2006-04-09 às 08:52 -0700, Carl Banks escreveu: > > You've made the unfortunate mistake of indenting it with tabs, which > > do > > not show up on some newsreaders. I see the tabs in Google; people > > using Microsoft Outlook do not. > > He does not need to k

Python 3.0 or Python 3000?

2006-04-09 Thread John Salerno
Is 'Python 3000' just a code name for version 3.0, or will it really be called that when it's released? -- http://mail.python.org/mailman/listinfo/python-list

Re: More pythonic circle?

2006-04-09 Thread Pythor
John Machin wrote: > [Michael Tobis] > Also, with this code, you are using radius for the dimensions of the > enclosing box, as well as the radius of the circle, so it's guaranteed > to not to actually produce a whole circle. Recall what python does with > negative indices! > > [Pythor] > I'm not s

Re: More pythonic circle?

2006-04-09 Thread Scott David Daniels
Pythor wrote: > I wrote the following code for a personal project. I need a function > that will plot a filled circle in a two dimensional array. I found > Bresenham's algorithm, and produced this code. Please tell me there's > a better way to do this. > > import numpy > > def circle(field=Non

Re: More pythonic circle?

2006-04-09 Thread John Machin
[Michael Tobis] Also, with this code, you are using radius for the dimensions of the enclosing box, as well as the radius of the circle, so it's guaranteed to not to actually produce a whole circle. Recall what python does with negative indices! [Pythor] I'm not sure what you mean here. It produc

Re: More pythonic circle?

2006-04-09 Thread John Machin
It's also possible to write microprocessor assembly language in any other language. The following code generates the OP's list of points with nothing more complicated than integer addition/subtraction inside the loop. It also does the right thing if the radius is not an integer, and avoids the OP's

[EMAIL PROTECTED]

2006-04-09 Thread Ahava321
please put me on your mailing list -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Felipe Almeida Lessa
Em Dom, 2006-04-09 às 08:52 -0700, Carl Banks escreveu: > You've made the unfortunate mistake of indenting it with tabs, which > do > not show up on some newsreaders. I see the tabs in Google; people > using Microsoft Outlook do not. He does not need to know that some poor designed newsreaders m

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Roy Smith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > > > it's more important > > to respect community standards than to stick to some silly preference > > you have. > > What happens when the community standard is a silly preference? I object > to t

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Steven D'Aprano
On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > it's more important > to respect community standards than to stick to some silly preference > you have. What happens when the community standard is a silly preference? I object to the suggestion that "community standards" (that is, a standar

Re: Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread blackno666
Just found a solution to the problem: when using wx.EVT_SPINCTRL instead of wx.EVT_SPIN_UP, wx.EVT_SPIN_DOWN or wx.EVT_SPIN the program behaves correctly. wxWidget documentation for wxSpinCtrl states that "You may also use the wxSpinButton event macros, however the corresponding events will not b

Re: Best Python web-hosting?

2006-04-09 Thread John Salerno
walterbyrd wrote: > I don't need that much web space. I don't need Zope/Plone. > > But, I want a site that offers more than just CGI. And I would like > support for recent Python releases. > > Price is an issue, that's one reason I've been reluctant to use python > for web-sites, hosting seems to

Re: how relevant is C today?

2006-04-09 Thread John Salerno
Mirco Wahab wrote: > At which level in the 'python challenge' did > you get stuck - and why? Ugh, don't remind me! :) I'm stuck on level 12, which is yet another image processing puzzle. I'm getting tired of those, and I think it's really a shame that there is a reliance on image puzzles rathe

ANN: Speedometer 2.4 - bandwidth and download monitor

2006-04-09 Thread Ian Ward
Announcing Speedometer 2.4 -- Speedometer home page: http://excess.org/speedometer/ Download: http://excess.org/speedometer/speedometer.py New in this release: - New -z option treats files that don't exist as zero length so speedometer

Re: Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread blackno666
Yes, it "works". However buggy. When the slider is set to 0 and the up button is pressed in the SpinCtrl, the value in the SpinCtrl will be 1, but the slider will not move. There's also a discrepancy between the value displayed in the SpinCtrl and the value output by print self.spin.GetValue().

Re: Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread Peter Hansen
blackno666 wrote: > I am new to Python/wxPython and am experiencing first problems. I have > a dialog which includes a SpinCtrl and a Slider. I want the Slider to > affect the SpinCtrl and vice versa > (http://wiki.wxpython.org/index.cgi/ChallengeDemos#Part1). > > The code I wrote does, however, n

Re: Creating an event loop

2006-04-09 Thread Peter Hansen
Fabian Steiner wrote: > I am currently wondering how to write something like an "event loop". > For example, if I want to write a function that checks whether a file > was added or removed in a directory I would think of a "while 1: ..." > construct that checks the mtime of the directory. Is this t

Re: Tkinter

2006-04-09 Thread Jay
Brill, Thanks for the help -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing files on server through CGI

2006-04-09 Thread Christoph Haas
On Sun, Apr 09, 2006 at 12:35:21AM -0700, [EMAIL PROTECTED] wrote: > I have a CGI script on server which process a form and writes its > content on a file like > fp = open(fname, 'w') > fp.write('Cool > list%s%s > > Its working fine, but will it work if the script recieves thousands of > request s

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
yep -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
Hi Jim, Thanks, I'll sign up for the mailinglist, but to finish the story here: - I only have one version of Python installed - From the Python interpreter I can import the mod_python module just fine - At starup the Apache log states: [Sun Apr 09 22:16:38 2006] [notice] Apache/2.0.55 (Win32) mod

Re: How to determine if a line of python code is a continuation of the line above it

2006-04-09 Thread Leif K-Brooks
Sandra-24 wrote: > I'm not sure how complex this is, I've been brainstorming a little, and > I've come up with: from tokenize import generate_tokens, NL, NEWLINE from cStringIO import StringIO def code_lines(source): """Takes Python source code (as either a string or file-like object) a

Re: Receiving emails with attachments

2006-04-09 Thread tomer . ha
Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Automated Graph Plotting in Python

2006-04-09 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > 1. Which is the best graph plotting utility in python or linux. matplotlib (provided it does the type of graphs you need, which is likely) 'as -- http://mail.python.org/mailman/listinfo/python-list

Re: "The World's Most Maintainable Programming Language"

2006-04-09 Thread Thomas Nelson
I thought the paragraph about provability was interesting. Presumably the author refers to proofs in the spirit of "A Discipline of Programming" from Djikstra, 1976. Unfortunately, I don't think anyone has writting much about this since the 70s. I'd be interested to learn if anyone's tried to wr

Re: efficiency of range() and xrange() in for loops

2006-04-09 Thread Fredrik Lundh
Alan Morgan wrote: > >How would xrange(100).remove(1) work? > > One way is by first converting the xrange to a list. If we think of > the xrange as an efficient and space lean way to store certain types > of lists then it isn't unreasonable to return a regular list when > the conditions no longer

Re: wxStyledTextCtrl - Dead?

2006-04-09 Thread blackno666
The wxPython Demo (http://prdownloads.sourceforge.net/wxpython/wxPython-demo-2.6.3.2.tar.gz) still contains the wxStyledTextCtrl: wx.stc.StyledTextCtrl The demo is probably also a good example of how to use wxStyledTextCtrl. Basic information can be found on http://www.yellowbrain.com/stc/init_r

Re: Calling Web Services from Python

2006-04-09 Thread m.banaouas
Can you tell us more about SOAPpy bug ? Is it about authentication ? Ivan Zuzak a écrit : >... > I need a package/tool that generates web service proxies that will do > all the low-level HTTP work. (Someting like the WSDL.EXE tool in .NET > Framework) The ZSI and SOAPy packages [1] that i found

Re: how relevant is C today?

2006-04-09 Thread David Rasmussen
Mirco Wahab wrote: > > I would say, from my own experience, that you wouldn't > use all C++ features in all C++ projects. Most people > I know would write C programs 'camouflaged' as C++, > that is: write clean & simple C - and use some C++ > features e.g, class bound methods for interfaces - > bu

Re: [Newbie] Referring to a global variable inside a function

2006-04-09 Thread Ernesto García García
>>How would you do this? > > def line_action(line, match_dictionary): > global count # make it a module-global variable, not a function-local > count = count + 1 > > OK, I had put it on the global block. Thanks, Ernesto -- http://mail.python.org/mailman/listinfo/python-lis

Re: Mysterious EOFError

2006-04-09 Thread Rex Eastbourne
Thanks. Do you know of a solution to this? I tried the following, which I found on this newsgroup: # lines = open(sys.argv[1]).readlines() # sys.stdin = open('/dev/tty') a = raw_input('Prompt: ') # sys.stdin = os.fdopen(3) a = raw_input('Prompt: ') #==

Re: 32-bit python on Opteron, Solaris 10?

2006-04-09 Thread Olivier P
Gary Robinson wrote: > I'm in the market for a server to run some python code which is > optimized via psyco. > > Sun T2100 servers come with Solaris 10, which comes with python > pre-installed. You can always install a 32bits version of Linux or Solaris on the X2100 yourself. The X2100 is even

Re: how relevant is C today?

2006-04-09 Thread Mirco Wahab
Hi Scott your summary looks very concise and good to read. I'd like to make some minor additions, > C can express neither exceptions nor coroutines (nor their fancy cousin, > continuations), which could be and were expressed in assembly. Nor does > C provide memory management. A few library fu

Problems with current value of wx.SpinCtrl and EVT_SPIN

2006-04-09 Thread blackno666
Hello, I am new to Python/wxPython and am experiencing first problems. I have a dialog which includes a SpinCtrl and a Slider. I want the Slider to affect the SpinCtrl and vice versa (http://wiki.wxpython.org/index.cgi/ChallengeDemos#Part1). The code I wrote does, however, not work correctly. The

Re: Best Python web-hosting?

2006-04-09 Thread Steve
http://www.python-hosting.com/ I haven't used them myself, but recent research that I did made them look like good candidates. -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-09 Thread Mirco Wahab
Hi John > It's just that I obessively like to learn new things, > and I keep moving on to new subjects once I've 'learned' > something well enough. Ha! So learn 'Perl' then - you'll never ever get over this point ... ;-)) And if you, against all odds, think you master it now - zon, a new P

Notification bubbles via dbus in Gnome on Ubuntu.

2006-04-09 Thread Neil Woolford
I'd like to be able to pop up a notification bubble like the ones used by Ubuntu for 'updates available' etc. In particular I'd like to be able to use them to warn users of other machines that I have started a background session for maintenance and not to worry if the computer seems to be doing th

Re: Best Python web-hosting?

2006-04-09 Thread tellarite
http://www.westhost.com/ You get a virtual private server with them, so you can install whatever you want. cheap too. -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE on Fedora Core 5

2006-04-09 Thread David H Wild
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > I have just installed FC5 on a new computer. I can access Python by > > typing "Python" in a terminal window, but I can't find any way of > > getting to IDLE. > > > > Can anyone help? > $ yum provides idle > can help,

Best Python web-hosting?

2006-04-09 Thread walterbyrd
I don't need that much web space. I don't need Zope/Plone. But, I want a site that offers more than just CGI. And I would like support for recent Python releases. Price is an issue, that's one reason I've been reluctant to use python for web-sites, hosting seems to be more expensive than with php

Re: Receiving emails with attachments

2006-04-09 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Gerard, > > I tried to run your code but my interpreter couldn't locate the > maildocument module. Is it included in Python standart library or > should I install it from other place? > > Thanks, > Tomer Sorry Tomer, I was just suggesting you read it through as an exam

Re: More pythonic circle?

2006-04-09 Thread Pythor
Fredrik Lundh wrote: > "Pythor" wrote: > > > > You aren't getting any benefit from numpy or python here. Are you > > > aiming for speed or legibility? > > > > > Speed will be a necessity, eventually. I was just really aiming for > > something that works, and that I am capable of writing. > > any

Creating an event loop

2006-04-09 Thread Fabian Steiner
Hello! I am currently wondering how to write something like an "event loop". For example, if I want to write a function that checks whether a file was added or removed in a directory I would think of a "while 1: ..." construct that checks the mtime of the directory. Is this the right way to achiev

Re: Receiving emails with attachments

2006-04-09 Thread Tim Williams (gmail)
On 8 Apr 2006 13:24:20 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: want to develop a script which will receive emails with attachmentsfrom my POP3 account, perform certain actions on it and email it back to someone else.However, I'm not familiar with any Python library which does it. Coul

How Relevant is C Today? I still need it for Writing!

2006-04-09 Thread Casey Hawthorne
How Relevant is C Today? I still need it for Writing! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-09 Thread John Salerno
Martin v. Löwis wrote: > As for *learning* the languages: never learn a language without a > specific inducement. If you know you are going to write a Python > extension, an Apache module, or a Linux kernel module in the > near future, start learning C today. If you don't know what you > want to u

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread John Salerno
Clodoaldo Pinto wrote: > Duncan Smith wrote: >> But as you use conversions to float in order to avoid integer division >> in your code examples, it might be best to explain what's going on, even >> if you do have to explain the relevant types. >> > > I changed the comments in the first program tha

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Carl Banks wrote: > Having said that, this decorator will not affect calling overhead at > all. The decorator is applied when the module is loaded, not when the > decorated function is called. to be precise, the decorator is applied when the "def" statement is exe- cuted (that is, when the decor

Re: Receiving emails with attachments

2006-04-09 Thread tomer . ha
Gerard, I tried to run your code but my interpreter couldn't locate the maildocument module. Is it included in Python standart library or should I install it from other place? Thanks, Tomer -- http://mail.python.org/mailman/listinfo/python-list

Re: I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-09 Thread Fuzzyman
Ju Hui wrote: > I wanna use urllib2 to get a page with a socks 5 proxy,who can give me > a sample code ? > > example, > the proxy server is :123.123.123.123 > and the port is :1080 > and the username/password is : user/pass > I want to open http://www.google.com > > how to write this kind of scri

Re: Tkinter

2006-04-09 Thread Fredrik Lundh
"Jay" wrote: > Now I just get this error message. > > AttributeError: 'int' object has no attribute 'image' > > But the picture appears so I am almost their. > > ---START--- > > from Tkinter import * > > class App: > def __init__(self, root): > self.MainFrame = Canvas(root) > s

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Chance Ginger
First, thanks for the tip of 'tabs'. I keep forgetting Outlook has some interesting rules about displaying text. Thanks for the comment about happening at load time. That resolved the problem (in my thinking)! I don't believe I have an issue at all... Peace, CG. On Sun, 09 Apr 2006 08:52:18 -070

Re: how relevant is C today?

2006-04-09 Thread Scott David Daniels
Sandra-24 wrote: > C/C++ is used for a lot of things and not going anywhere. > > I recommend you learn it not because you should create applications in > C or C++, but because it will increase your skills and value as a > programmer. I recommend you even spend a few weeks with an assembly > langua

Re: More pythonic circle?

2006-04-09 Thread Fredrik Lundh
"Pythor" wrote: > > You aren't getting any benefit from numpy or python here. Are you > > aiming for speed or legibility? > > > Speed will be a necessity, eventually. I was just really aiming for > something that works, and that I am capable of writing. any special reason you cannot use an exis

Re: More pythonic circle?

2006-04-09 Thread Pythor
Steven D'Aprano wrote: > No, "minimum number of space characters" means "you don't use enough > spaces", not "your variable names are too short" *wink* > Hmm. Guess I can't read too well. > Within a single line, a good guideline is to leave a single space on > either side of pluses and minuses (

Re: More pythonic circle?

2006-04-09 Thread Pythor
Michael Tobis wrote: > Proving yet again that it's possible to write Fortran in any language. > Ouch... > You aren't getting any benefit from numpy or python here. Are you > aiming for speed or legibility? > Speed will be a necessity, eventually. I was just really aiming for something that work

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Chance Ginger wrote: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > > > Chance Ginger" wrote: > > > >> If I define a decorator like: > >> > >> def t(x) : > >> def I(x) : return x > >> return I > > > > ... you get a syntax error. > > > > It isn't a syntax error...I tried it before I p

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread Jim Gallacher
cyberco wrote: > Thanks Jim, I indeed did not look in the mailinglist archive (you have > to subscribe for that and Google didn't cache it yet). > > The problem was indeed the missing .DLL's. After adding them to my > 'PATH' variable apache was at least able to start. Unfortunately things > still

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Chance Ginger wrote: > It isn't a syntax error...I tried it before I posted. In fact > def t(x) : > def I(x) : return x > return I > > is correct. tabs don't make it through all channels. don't use tabs for indentation when you post to newsgroups or mailing lists. and @(Y) is not valid Python s

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Jorge Godoy
Chance Ginger <[EMAIL PROTECTED]> writes: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > >> Chance Ginger" wrote: >> >>> If I define a decorator like: >>> >>> def t(x) : >>> def I(x) : return x >>> return I >> >> ... you get a syntax error. >> > > It isn't a syntax error...I tried

I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-09 Thread Ju Hui
I wanna use urllib2 to get a page with a socks 5 proxy,who can give me a sample code ? example, the proxy server is :123.123.123.123 and the port is :1080 and the username/password is : user/pass I want to open http://www.google.com how to write this kind of script? thanks. -- http://mail.pyt

Re: how to print without blank?

2006-04-09 Thread Ju Hui
thank you all. IT's very helpful to me. >>> import sys >>> def no_space_before(x): ... sys.stdout.softspace = 0 ... return x ... >>> for x in range(3): ... print no_space_before(x), ... 012 -- http://mail.python.org/mailman/listinfo/python-list

Re: how to print without blank?

2006-04-09 Thread Rick Zantow
Steven D'Aprano <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Sat, 08 Apr 2006 22:54:17 -0700, Ju Hui wrote: > >> I want to print 3 numbers without blank. > [snip] >> how to print >> 012 >> ? > > Method one: accumulate your numbers into a single string, then print > it in one go. >

Re: Round

2006-04-09 Thread HeidiWeber
thank you very much to you i wish you a nice sunday... cu Heidi -- http://mail.python.org/mailman/listinfo/python-list

Re: fnmatch on filename (without specific extension)

2006-04-09 Thread kepioo
i agree with you, it is better to find by ourself. i managed to do it, but i left the code at work. i used the re module , using a re.match("Results Log") and a re.search(date) with a function to find the date og the day with the appropriate format. Is it ok to use re for file names? or fnmatch i

Re: Automated Graph Plotting in Python

2006-04-09 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > My python program spits lot of data. I take that data and plot graphs > using OfficeOrg spredsheet. I want to automate this task as this takes > so much of time. I have some questions. > > 1. Which is the best graph plotting utility in python or linux. Can I > write a co

Re: Tkinter

2006-04-09 Thread Jay
Now I just get this error message. AttributeError: 'int' object has no attribute 'image' But the picture appears so I am almost their. ---START--- from Tkinter import * class App: def __init__(self, root): self.MainFrame = Canvas(root) self.MainFrame.pack(fill=BOTH, expand=

Re: Round

2006-04-09 Thread Ravi Teja
No! That is NOT correct Python. For one thing, you do not declare the types in dynamically typed languages. Secondly, if you want floating point division, you need to enter atleast one of the numbers as float. For example 10.0/6 or 10./6 or float(10)/6 You will find the following helpful. http://

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Clodoaldo Pinto
Frank Millman wrote: > > We know that Python is in the process of changing the division > operator. The main reason for the change is that the current approach > is not intuitive to a newcomer (whether experienced or not). > > Why not think to the future, and do it like this. Instruct the reader >

Re: Programming Tutorial for absolute beginners

2006-04-09 Thread Clodoaldo Pinto
Duncan Smith wrote: > > But as you use conversions to float in order to avoid integer division > in your code examples, it might be best to explain what's going on, even > if you do have to explain the relevant types. > I changed the comments in the first program that uses float() to: # The raw_i

  1   2   >