Re: High Order Messages in Python

2005-10-22 Thread [EMAIL PROTECTED]
Hum... I thnk you dont get the ideia: I'm not talking abou High Order Functions. What ho call "High Order Methods is some like "connecting" some 'generic' methods created to do things like this: claimants.where.retired?.do.receive_benefit 50 The 2nd and 3rd links that in the first post is the m

Re: best way to replace first word in string?

2005-10-22 Thread [EMAIL PROTECTED]
interesting. seems that "if ' ' in source:" is a highly optimized code as it is even faster than "if str.find(' ') != -1:' when I assume they end up in the same C loops ? Ron Adam wrote: > Guess again... Is this the results below what you were expecting? > > Notice the join adds a space to the en

Re: IDE recommendation please

2005-10-22 Thread [EMAIL PROTECTED]
I am an even worse dinosaur, I use ion3 and console vim. Alex Martelli wrote: > On the Mac, I think the XCode integration you get with PyObjC is > probably best. I know there are plugins for Eclipse but haven't tried > any personally, so it's hard to make suggestions (I'm a dinosaur, and I > pref

execution order in list/generator expression

2005-10-23 Thread [EMAIL PROTECTED]
Hi, I am wondering how this is evaluated. a=(x for x in [1,2,3,4]) p=[4,5] c=[x for x in p if x in list(a)] c is [] but if I expand a first, like a = list(a) c is [4] So it seems that the "if" part don't get expanded ? -- http://mail.python.org/mailman/listinfo/python-list

Re: execution order in list/generator expression

2005-10-23 Thread [EMAIL PROTECTED]
Ah, no wonder. I test with p=[5,4]. thanks. so basically, I still need to expand it first given this behaviour. Robert Kern wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I am wondering how this is evaluated. > > > > a=(x for x in [1,2,3,4]) > > p=[4,5]

Re: Syntax across languages

2005-10-23 Thread [EMAIL PROTECTED]
just curious, how can this identity function be used ? In haskell, because all functions are curried, I can sort of visualize/understand how id is used. Not quite understand how it can be used in python. beza1e1 wrote: > >>> id("blub") > -1210548288 > > This is not identity in a mathematical view.

Re: High Order Messages in Python

2005-10-23 Thread [EMAIL PROTECTED]
could someone enlighten me what is the advantage of block over named function ? One thing that I can see a difference may be lexical scope ? vdrab wrote: > On a (somewhat) related note, > I've always wondered whether it is possible to emulate ruby blocks > using a python generator '+ alpha'. In m

Re: High Order Messages in Python

2005-10-23 Thread [EMAIL PROTECTED]
counting that out(regardless whether it is (dis)advantage or not), what else a block can do but not a named function ? Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > could someone enlighten me what is the advantage of block over named > > func

Re: An interesting question about "print '\a'"

2005-10-23 Thread [EMAIL PROTECTED]
I thought that is just a "terminal" thing(extend ASCII that interpreted by the terminal)? If you have a terminal attached to a host, shouldn't this be making sound on the terminal rather than the server ? This not alsa or output to the server device, but straightly sending '\a' back to the client m

testing '192.168.1.4' is in '192.168.1.0/24' ?

2005-10-23 Thread [EMAIL PROTECTED]
Hi, Is there standard library modules handling this ? currently I need to turn it into a long integer and do the shift and compare. -- http://mail.python.org/mailman/listinfo/python-list

Re: testing '192.168.1.4' is in '192.168.1.0/24' ?

2005-10-24 Thread [EMAIL PROTECTED]
thanks, that is basically what I am doing and since it is a recipe, I would assume there is no standard library module for it. Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > Is there standard library modules handling this ? currently I need to > > turn it into a long integer a

Re: High Order Messages in Python

2005-10-24 Thread [EMAIL PROTECTED]
thanks. Seems that my programs are very simple and don't need these feature yet. Kent Johnson wrote: > [EMAIL PROTECTED] wrote: > > counting that out(regardless whether it is (dis)advantage or not), what > > else a block can do but not a named function ? > > My limited

Re: newbie question about SocketServer

2005-10-24 Thread [EMAIL PROTECTED]
After further playing - it seems that the server_close() just takes time to execute. I have found that if I wait a while (1-3 seconds) the second connection will fail as well. Locking is already built into my handler class - so I'll just use it to prevent further connections until server_close()

Re: Python variables are bound to types when used?

2005-10-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > the page was written before the "type/class unification" in Python 2.2, > at a time where the word "type" had a stricter meaning (referring to C- > level types, not user-level classes). Gotcha. Thanks. That writeup is definitely on my required reading list for new Python p

XML Tree Discovery (script, tool, __?)

2005-10-24 Thread [EMAIL PROTECTED]
Hi all, Finally diving into XML programmatically. Does anyone have a best practice recommendation for programmatically discovering the structure of an arbitrary XML document via Python? It seems like it is a common wheel I'd be re-inventing. Thanks and cheers EP -- http://mail.python.org/ma

Re: XML Tree Discovery (script, tool, __?)

2005-10-24 Thread [EMAIL PROTECTED]
The output I was contemplating was a DOM "DNA" - that is the DOM without the instances of the elements or their data, a bare tree, a prototype tree based on what is in the document (rather than what is legal to include in the document). Just enough data that for an arbitrary element I would know:

Newbie question: string replace

2005-10-25 Thread [EMAIL PROTECTED]
I have a config file with the following contents: service A = { params { dir = "c:\test", username = "test", password = "test" } } I want to find username and replace the value with another value. I don't know what the username value in advance though. How to do it in python? --

Re: XML Tree Discovery (script, tool, __?)

2005-10-25 Thread [EMAIL PROTECTED]
just namespace + tag -- http://mail.python.org/mailman/listinfo/python-list

How to statically link Python with ncurses and readline?

2005-10-25 Thread [EMAIL PROTECTED]
Hi I'm trying to build a Python package that I can use on different Linux setups, for this purpose it would be nice to weld external dependencies (libraries) into Python itself. So far I've succeeded in getting Tcl/Tk statically linked in, with the help of Modules/Setup.local, but the same procedur

Re: Newbie question: string replace

2005-10-25 Thread [EMAIL PROTECTED]
So how to overwrite the config file directly in script.py instead of running script.py with two params? A XML file or ConfigParser is appealing but this is part of a legacy system...:( -- http://mail.python.org/mailman/listinfo/python-list

Re: How to statically link Python with ncurses and readline?

2005-10-25 Thread [EMAIL PROTECTED]
Well, I implied that _curses.so and readline.so disappeared as one would expect, dependencies on libncurses.so and libreadline.so instead showing up in Python itself. It's very strange that this happens with ncurses and readline, when both db and Tcl/Tk got linked in with no fuss. Anyway, I built s

Re: How to statically link Python with ncurses and readline?

2005-10-25 Thread [EMAIL PROTECTED]
What do you mean? A static-only build does somehow exclude that I had static libraries before? -- http://mail.python.org/mailman/listinfo/python-list

replace words

2005-10-26 Thread [EMAIL PROTECTED]
What is the way for replacing in a string from . to . the sentence? for example: "been .taken. it may be .left. there, even if the .live coals were not. cleared" I want to do this-> replace(\.(.*)\.,\.start (1) end\.) result: "been .start taken end. it may be .start left end. there, even if the .

Re: Looping Problem (Generating files - only the last record generates a file)

2005-10-26 Thread [EMAIL PROTECTED]
You have only indented the first line in the for-loop, so for each line in the file you split the line into town and latlong. Then after you have split the last line in the file you write a new file with the last result in the for-loop. What you want is probably something like this: #! python H

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread [EMAIL PROTECTED]
Tim Golden wrote: > As it happens, (and I suspect I'll have to don my flameproof suit here), > I prefer the Windows command line to bash/readline for day-to-day use, > including in Python. Why? Because it does what I can't for the life of > me get readline to do: you can type the first few letters

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread [EMAIL PROTECTED]
oops, stand corrected. As I don't use the feature more than ctrl-r and up/down arrow. Tim Golden wrote: > Thanks to both of you. But that much I already knew. It's not > that I have *no* knowledge about readline: I did at least > read the manuals when I got stuck! But as far as I can tell > from m

64 bit python binaries (or builds) for Xeon and Opteron architectures on Windows platforms

2005-10-26 Thread [EMAIL PROTECTED]
Does anyone have any information about 64 bit python support for Xeon and Opteron architectures on Windows platforms? If anyone has built the python runtime on either of these platforms before I would be really interested. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

python in the news

2005-10-26 Thread [EMAIL PROTECTED]
http://software.itmanagersjournal.com/software/05/10/25/1631220.shtml... -- http://mail.python.org/mailman/listinfo/python-list

Re: help with sending data out the parallel port

2005-10-27 Thread [EMAIL PROTECTED]
You don't want to use Python for that task. You're much better off using the Microsoft DDK (driver development kit). -- http://mail.python.org/mailman/listinfo/python-list

Re: NEWBIE

2005-10-27 Thread [EMAIL PROTECTED]
Check out http://www.freenetpages.co.uk/hp/alan.gauld. His tutorial is great, covering basic programming using pythion examples. -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file

2005-10-28 Thread [EMAIL PROTECTED]
I'm now down to: f = open("filename", "rb") s = f.read() sub = "\x00\x00\x01\x00" count = s.count(sub) print count Which is quite fast. The only problems is that the file might be huge. I really have no need for reading the entire file into a string as I am doing here. All I want is to count occu

Re: Scanning a file

2005-10-28 Thread [EMAIL PROTECTED]
First of all, this isn't a text file, it is a binary file. Secondly, substrings can overlap. In the sequence 0010010 the substring 0010 occurs twice. /David -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: string replace

2005-10-28 Thread [EMAIL PROTECTED]
Now it works: rex = re.compile(r'(^.*username *=[^"]*")([^"]*)(".*$)') for line in fileinput.input(FILE, inplace=1): m = rex.match(line) if m is not None: line = "%s%s%s\n" % (m.group(1), new_name, m.group(3)) print line But there is an extra line break after each line in F

Re: Newbie question: string replace

2005-10-28 Thread [EMAIL PROTECTED]
hm...Is there a way to get rid of the newline in "print"? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question: string replace

2005-10-28 Thread [EMAIL PROTECTED]
Got it, thanks all! -- http://mail.python.org/mailman/listinfo/python-list

Automatic binding of **kwargs to variables

2005-10-28 Thread [EMAIL PROTECTED]
Hi all, I have a very long list of parameters coming from a web form to my method foo(self, **kwargs) I would like to avoid manually binding the variables to the values coming through the **kwargs dictionary, just to keep the code cleaner, I'd like to bind them automatically I was adviced agains

Re: Generic utility class for passing data

2005-10-28 Thread [EMAIL PROTECTED]
just curious, since python don't care what object is being passing around and the receiving function has to 'decode' it(be it tuple or dict or whatever). What is the advantage of dummy class ? Alex Martelli wrote: > Gordon Airporte <[EMAIL PROTECTED]> wrote: > > &g

Re: Generic utility class for passing data

2005-10-28 Thread [EMAIL PROTECTED]
wrote: > [EMAIL PROTECTED] wrote: > > just curious, since python don't care what object is being passing > > around and the receiving function has to 'decode' it(be it tuple or > > dict or whatever). What is the advantage of dummy class ? > > The convenie

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
Mike Meyer wrote: [snip] >for name, value in kwargs.items(): >if name in ('a', 'list', 'of', 'valid', 'keywords'): > exec "%s = %s" % (name, value) >else: > raise ValueError, "Unrecognized keyword " + name > > Others will probably tell you that you really sho

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
Thanks everybody for their reply. I'll see what solution is best for my case and maybe follow up here. Thanks again, Lorenzo -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
What do u think of the following? I could keep the form schema as expected_form1_kwargs in a separate module and import * and wrap the kwargs check done in the for loop in a function for use in the whole site. The elif part is useful for checkboxes which are not passed by the browser if they're no

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
FormEncode. [EMAIL PROTECTED] wrote: > What do u think of the following? I could keep the form schema as > expected_form1_kwargs in a separate module and import * and wrap the > kwargs check done in the for loop in a function for use in the whole > site. > > The elif part is use

Re: dreaming in Python

2005-10-29 Thread [EMAIL PROTECTED]
The Eternal Squire wrote: > All, > > I have to tell all of you this, at least for some laughs. Honestly, I > had the silliest dream involving the language last night. I dreamt > that it was a decade into the future and that Grand Central Station in > NYC was installing a cement and steel "compute

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > Do you mean this instead? > > elif name in expected_form1_kwargs and name not in kwargs: > > What you wrote doesn't do what you think it does... it actually tests > for whether True or False is a key in kwargs, depending on whether "name > in expected_form1_kwargs" ret

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
inguish between "not there" and None. Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >... > > def foo(**kwargs): > > expected_form1_kwargs = ["arg1", "arg2"] > > > > for name in expected_f

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > I find this style of coding repulsive when compared to: > > def foo(arg1=None, arg2=None): > print dict(arg1=arg1, arg2=arg2) > > I don't understand what added value all of those extra, contorted lines > are supposed to bring to the party. Hi Alex, the thing is that I

Need Python Pro for Help!! Plzz

2005-10-30 Thread [EMAIL PROTECTED]
Need python Pro at [EMAIL PROTECTED] , if u wanna help, plz reply to that address. We are python beginners. need a real good Python Programmer for Help. TIA!! -- * Posted with NewsLeecher v3.0 Beta 7 * http://www.newsleecher.com/?usenet -- http://mail.python.org/mailman/listinfo/python-list

Arguments for button command via Tkinter?

2005-10-31 Thread [EMAIL PROTECTED]
Recently, I have been needing to do this alot and I can never find a way around it, the main reason I want to do this is because for example in the application I am making right now, it creates a grid of buttons in a loop and they all have the same purpose so they need to call the same method, with

Re: Arguments for button command via Tkinter?

2005-10-31 Thread [EMAIL PROTECTED]
And yet the stupidity continues, right after I post this I finnally find an answer in a google search, It appears the way I seen it is to create a class for each button and have it call the method within that. If anyone else has any other ideas please tell. -- http://mail.python.org/mailman/listi

Python -- CGI -- Take SQL database, make it download in CSV

2005-10-31 Thread [EMAIL PROTECTED]
I currently have a cgi-bin which I use to authenticate users against a SQL database, which holds info about them, and their login info. I would like to have the 'admin' section take part of the table and put it in CSV and allow them to download it, somehow making it so that the 'members' cannot do

Re: Arguments for button command via Tkinter?

2005-10-31 Thread [EMAIL PROTECTED]
Yah, thats how i learned how to do it, thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's edu corner: the Journey of Foreign Characters thru Internet

2005-11-02 Thread [EMAIL PROTECTED]
Something I don't quite understand, if people think it is troll, just ignore it. What I see is that people are feeding it by commenting about either him or his post. I saw a number of threads ended up that way(like the rather long one about Microsoft). And if anyone wants to take the responsibibli

Re: how to check for unix password

2005-11-02 Thread [EMAIL PROTECTED]
plain text equivalent(better use SSL) then compute and compare. However, if this is web page, I believe it would be better to use the apache2 module which has relatively good integration with the authentication system. [EMAIL PROTECTED] wrote: > hi > i created a login page that authenticate th

About the Python Expert

2005-11-02 Thread [EMAIL PROTECTED]
Hey, i didnt say i need an expert. wel i did... anyways, i m just saying that Fan is not a good python programmer, he doesnt know enough python to help those who have joined his group, i know its askin a lot, and i m not askin for a private tutor, just someone(s), to pop into the group, see the

How can I setup proxy of urllib2 properly

2005-11-02 Thread [EMAIL PROTECTED]
I got some source code form python's help document. the below: proxy_handler = urllib2.ProxyHandler({'http': 'http://www.example.com:3128/'}) proxy_auth_handler = urllib2.HTTPBasicAuthHandler() proxy_auth_handler.add_password('realm', 'host', 'username', 'password')

Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread [EMAIL PROTECTED]
C ? Tor Erik Sønvisen wrote: > Hi > > I need a time and space efficient way of storing up to 6 million bits. Time > efficency is more important then space efficency as I'm going to do searches > through the bit-set. > > regards tores -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's edu corner: the Journey of Foreign Characters thru Internet

2005-11-02 Thread [EMAIL PROTECTED]
would reduce the length of it, much more effective that what I have seen. this would be my last post about this subject. Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > And if anyone wants to take the responsibiblity to warn the general > > public that it is troll so inno

Re: Threading

2005-11-02 Thread [EMAIL PROTECTED]
How do you use threads? With threading.Thread objects? Then this recipe might help, it did it for me. For further assistance please post your code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading

2005-11-02 Thread [EMAIL PROTECTED]
Ooops, forgot this link to the recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65448 -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I run python interactively?

2005-11-02 Thread [EMAIL PROTECTED]
try something like -> s = raw_input("Please Press a button...") #s is the string they type. Although i believe i remember a PEP that said they were removing raw_input so perhaps print "Please Press A button..." s = sys.stdin.readline() would be better, note the above requires yo

strtok equvialent ?

2005-11-03 Thread [EMAIL PROTECTED]
Hi, are there a strtok equivalent in python ? str.split() only takes single seperator. -- http://mail.python.org/mailman/listinfo/python-list

Re: strtok equvialent ?

2005-11-03 Thread [EMAIL PROTECTED]
thanks. Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > are there a strtok equivalent in python ? str.split() only takes single > > seperator. > > use a regular expression split with a character group: > > >>> s = "breakfast=spam+egg-b

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread [EMAIL PROTECTED]
How about, Google use python extensively ? This I believe is a very strong argument for any concern about python. However, policy in organisations can be very funny and many of them may be set long time ago which even though may no longer be relavent are still "policy". I would suggest focus on w

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread [EMAIL PROTECTED]
chine with AMD inside. Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > How about, Google use python extensively ? This I believe is a very > > strong argument for any concern about python. > > I must admit to feeling very good when I read th

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread [EMAIL PROTECTED]
chine with AMD inside. Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > How about, Google use python extensively ? This I believe is a very > > strong argument for any concern about python. > > I must admit to feeling very good when I read th

Can Anyone Help me on this

2005-11-03 Thread [EMAIL PROTECTED]
i m trying to reverse the order in which the strings are stored in list then pop it into another list what m i doin worng?? here's the code: list1 = [] list2 = [] list1.extend('123456789') print list1 for a in list1: list2 = list1.pop() print list2 -- * Posted with NewsLeecher v3.0 Bet

Re: Web automation (was: Pressing a Webpage Button)

2005-11-03 Thread [EMAIL PROTECTED]
the doc is already in the code ### from cPAMIE import PAMIE ie=PAMIE() ie.Navigate(www.google.com) # Set the text - arguments - value to set, textbox name, formname ie.SetTextBox('Python","q","f") ie.ClickButton("btnG,&quo

Re: Web automation (was: Pressing a Webpage Button)

2005-11-03 Thread [EMAIL PROTECTED]
Twill or Pamie looks good, if your looking for a solution using Python. If you are looking for Cross- browser solution for testing there is also selenium that does that. The have some code for use in Python. There is also WATIR in RUBY and SAMIE in PERL It depends on your enviroment and needs.

Re: Web automation (was: Pressing a Webpage Button)

2005-11-03 Thread [EMAIL PROTECTED]
Twill or Pamie looks good, if your looking for a solution using Python. If you are looking for Cross- browser solution for testing there is also selenium that does that. The have some code for use in Python. There is also WATIR in RUBY and SAMIE in PERL It depends on your enviroment and needs.

Re: Can Anyone Help me on this

2005-11-03 Thread [EMAIL PROTECTED]
Thanks Guys, Wow, i didnt knew that there was alist reverse function. thx. also. i need a good documentation of the os and sys modules as well as builtin functions of python. the standard python documentation doesnt work for me. can u recommend something? -- * Posted with NewsLeecher v3.0 Beta

Re: Can Anyone Help me on this

2005-11-03 Thread [EMAIL PROTECTED]
Thx Alex. -- * Posted with NewsLeecher v3.0 Beta 7 * http://www.newsleecher.com/?usenet -- http://mail.python.org/mailman/listinfo/python-list

I need Motivation

2005-11-03 Thread [EMAIL PROTECTED]
I m not a python Expert or anythin i need help, i m losin my motivation to continue with python can anyone inspire me again.??? -- * Posted with NewsLeecher v3.0 Beta 7 * http://www.newsleecher.com/?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: I need Motivation

2005-11-03 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I m not a python Expert or anythin > i need help, i m losin my motivation to continue with python > can anyone inspire me again.??? Why continue then ? -- http://mail.python.org/mailman/listinfo/python-list

Re: I need Motivation

2005-11-03 Thread [EMAIL PROTECTED]
Martin P. Hellwig wrote: > [EMAIL PROTECTED] wrote: > > I m not a python Expert or anythin > > i need help, i m losin my motivation to continue with python > > can anyone inspire me again.??? > > Ooh that is easy, start learning other programming languages, you'll

I Need Motivation Part 2

2005-11-04 Thread [EMAIL PROTECTED]
i m currently in a network (LAN). i started python because i heard that it has great ability for networking programs and/or scripts, but i m losing my motivation with python because there are sooo many modules, that i cant just learn them all, this deters from c or c++ in which there are only a

Re: I Need Motivation Part 2

2005-11-04 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > i m currently in a network (LAN). i started python because i heard > that it has great ability for networking programs and/or scripts, but > i m losing my motivation with python because there are sooo many > modules, that i cant just learn them all, this d

Fork() and exec() dont work

2005-11-04 Thread [EMAIL PROTECTED]
i m using Windows XP, and by tomorrow i will have have fedora core installed too. the problem is, when i use these "fork() and exec()" my windows doesnt do anything, python gives an error about the module, the kind of error when u know u r wrong. is it because these commands work on linux? if

Re: Fork() and exec() dont work

2005-11-04 Thread [EMAIL PROTECTED]
""" fork( ) Fork a child process. Return 0 in the child, the child's process id in the parent. Availability: (!!!) Unix (!!!). """ -- http://mail.python.org/mailman/listinfo/python-list

Re: help converting some perl code to python

2005-11-04 Thread [EMAIL PROTECTED]
The '..' operator is the flip-flop operator in perl. (It is rarely used.) It is exactly the same as the 'range' type operator. It returns false until the first condition is met, then it returns true until the last condition met, then it returns false. You could create a flip-flop with a python clo

Re: Not Equal to Each Other?

2005-11-04 Thread [EMAIL PROTECTED]
> will I have to write that out for each number? Not if you know how to use the 'for' statement. It will allow you to iterate through the rows or columns or whatnot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > It would still be easier to respond to your posts if you didn't > top-post, though (i.e., if you didn't put your comments BEFORE what > you're commenting on -- that puts the "conversation" in a weirdly > distorted order, unless one give up on quoting what you're commenting >

Re: How can I do this in Python?

2005-11-04 Thread [EMAIL PROTECTED]
I strongly suggest using redirect as David Wahler suggested. A note, Mozilla type browsers don't do an excellent job sending referer. You can't really trust that header anymore. If you want to go back after login, either: (1) Render the login page INSTEAD of the normal content at the same url. Fo

Re: pycrypto rsa inverse of p modulo q

2005-11-04 Thread [EMAIL PROTECTED]
jt wrote: > Looking up into Crypto.PublicKey.RSA, I see there is a computed value > named "u" for which I can't see the use. The value of "u" is the > inverse of p modulo q, in the code: > obj.u = pubkey.inverse(obj.p, obj.q) > Can someone tell me where this value could be used in the RSA sche

GMPY: divm() memory leak revisited

2005-11-04 Thread [EMAIL PROTECTED]
Since the following discussion took place (unresolved), I've kept it in the back of my mind as

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread [EMAIL PROTECTED]
Jorge Godoy wrote: > I'm more of the type that wouldn't read on if I have no context to what I'm > reading... Specially if there's a mix of top posts with bottom posts... > That just means different people have different reading style. Just like some find one-liner easier to read, some find step

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread [EMAIL PROTECTED]
Björn Lindström wrote: > Anyway, if you keep more than a pageful of the previous message, you're > probably not cutting it hard enough. Just keep what's needed to keep the > context. > Sometimes it is easy(like this). Sometimes, it is not easy and cutting in any part of the original message would

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread [EMAIL PROTECTED]
Chris F.A. Johnson wrote: >If I want to read that way, I just tell my newsreader not to >display the quoted material (actually it displays the first line of >each block). > >Or I press TAB to jump to the next original material. My news reader is through Google, web browser. So ther

Re: Getting Python Accepted in my Organisation

2005-11-04 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > It would still be easier to respond to your posts if you didn't > top-post, though (i.e., if you didn't put your comments BEFORE what > you're commenting on -- that puts the "conversation" in a weirdly > distorted order, unless one give up on quoting what you're commenting >

Re: GMPY: divm() memory leak revisited

2005-11-04 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Since the following discussion took place (unresolved), > > <http://groups.google.com/group/comp.lang.python/browse_frm/thread/c3bd08ef3e4c478a/2b54deb522c9b9d9?lnk=st&q=divm()+memory+leak+group:comp.lang.python+author:mensanator&rnum=1&hl=en#2b

Using Which Version of Linux

2005-11-05 Thread [EMAIL PROTECTED]
ok, i m going to use Linux for my Python Programs, mainly because i need to see what will these fork() and exec() do. So, can anyone tell me which flavour of linux i should use, some say that Debian is more programmer friendly, or shold i use fedora, or Solaris. Because these three are the only

Re: Using Which Version of Linux

2005-11-05 Thread [EMAIL PROTECTED]
aring with debian. However, you get newer things in fedora, in general. Fedora has the advantage that it works better with commercial stuff like Oracle/Sybase. I had problem making Sybase installed under debian(the reason why I tried fedora). [EMAIL PROTECTED] wrote: > ok, i m going to use Linu

Converting a List into a String

2005-11-05 Thread [EMAIL PROTECTED]
I have a List list = ['f', 'e', 'd', 'c', 'b', 'a'] How can i convert it into a string so the output is fedcba i used for a in list: print a, the output is f e d c b a How can i remove the spaces b/w each letter? -- * Posted with NewsLeecher v3.0 Beta 7 * http://www.newsleecher.co

Re: Converting a List into a String

2005-11-05 Thread [EMAIL PROTECTED]
''.join['h','i'] [EMAIL PROTECTED] wrote: > I have a List > > list = ['f', 'e', 'd', 'c', 'b', 'a'] > > How can i convert it into a string so the output is > > fedcba > > i used

Re: Modify HTML data

2005-11-05 Thread [EMAIL PROTECTED]
Swarna wrote: > Hi all, > > Can anyone help me with this ? > > I am using scp in python to copy a html file on remote server, to my > local machine. Now, i need to update this html file in my local machine > ( by adding a new Hyperlink to the existing table od hyperlinks ) and > copy it back (over

Distributed Cache Server?

2005-11-05 Thread [EMAIL PROTECTED]
Does anyone know if a "distributed caching system" has been developed for use with Python? I've seen mention of memcached, but was really after something natively python. Yes, "distributed caching system" is a bit of a general term, but am really just talking about something as simple as key + val

So, Which Version is Suitable for Beginners

2005-11-06 Thread [EMAIL PROTECTED]
I m actually a Novice in Python as well as Linux, When i look up things on the internet about Linux Flavours, They are written so complex that it is difficult for me to understand, i am asking if anyone here know of a Linux Distribution that is for beginners (I am a new user of linux, therefore

socket receive file does not match sent file

2005-11-06 Thread [EMAIL PROTECTED]
I wrote two simple socket program. one for sending a file and the other for receiving the file. but when I run it, a curious thing happened. The received file was samller that the sent file. $ cat receivefile.py #!/usr/local/bin/python # -*- coding: utf-8 -*- import socket import time import stri

Re: GMPY: divm() memory leak revisited

2005-11-06 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ... > > Unfortunately, I don't have any means of testing this theory. > > Yep -- I reproduced the memory leak you mentioned, and easily fixed it > (exactly as you suggest) in the current

Re: socket receive file does not match sent file

2005-11-06 Thread [EMAIL PROTECTED]
when I test the two program in the same OS, i mean from a redhat 9 OS to a redhat 9 OS, It's ok. receivefile match sent file. But when I run receiver on a Redhat 9, and send file from a windows XP, the received file's size is randomized. May be that's where the problem is. -- http://mail.pyt

Re: how to present Python's OO feature in design?

2005-11-06 Thread [EMAIL PROTECTED]
aum wrote: > On Sun, 06 Nov 2005 19:06:49 -0800, pcmanlin wrote: > > > As I know java has many UML tools to design for its OO feature, is > > there any tools or good concept for Python project Modeling? > > Just code the bloody thing! > > One of Python's strengths is its rapid design/programming/t

<    1   2   3   4   5   6   7   8   9   10   >