Re: removing cgi fieldstorage keys

2006-04-18 Thread Tim Roberts
Kun <[EMAIL PROTECTED]> wrote: > >i don't know what happened but all of a sudden, my cgi.fieldstorage has >two extra keys, 'x' and 'y', does anyone know how i can remove them in >python? If this is coming from a web site that you created, then you darned well better figure out where they're comi

Re: CGI scripts

2006-04-18 Thread Tim Roberts
"Jay" <[EMAIL PROTECTED]> wrote: > >Can I use Python for CGI scripts. It is telling me to use Perl and I >don't know any > >To be honest I don't really no what CGI scripts are (soz) > >I have purchased a domain name of my ISP PIPEX and 100MB space According to the Pipex web page, if you got their

Re: multiline comments

2006-04-18 Thread Edward Elliott
Ben Finney wrote: > Indeed. Using revision control means never needing to comment out > blocks of code. Typing (* and *) on a few line will always be quicker, easier, and less confusing than any rcs diffs/restores. Once you delete the code you can no longer see it or add pieces back in without

Re: difference between class and static methods?

2006-04-18 Thread Petr Prikryl
"John Salerno" wrote... [...] > So a class method is specifically for using the class name itself as an > object in the method? If that's the case, then it makes some sense now. > I guess the reason I didn't get it before is that this is a feature of > dynamic languages, right? And something that

Re: multiline comments

2006-04-18 Thread Edward Elliott
Ben Finney wrote: > And/or switch to an editor that can perform editing operations on a > range of lines. I'm not unsympathetic to this point of view, as I would feel hamstrung without my vim. It's more that I object to the paternalism of telling people they have to use such an editor. There a

Re: multiline comments

2006-04-18 Thread Edward Elliott
Atanas Banov wrote: > want to comment block of code? use tripple-quotes. does not nest? ahhh, > maybe it's time to get rid of that block you commented out a month ago > "just in case the new code doesnt work". > > that gives you incentive to tidy up. don't be a code slob... don't > leave a mess fo

Re: Uniquifying a list?

2006-04-18 Thread Rene Pijlman
Tim Chase: >Is there an obvious/pythonic way to remove duplicates from a >list (resulting order doesn't matter, Use a set. http://www.python.org/doc/lib/types-set.html -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

win32com Excel bug?

2006-04-18 Thread cfriedalek
I'm driving Excel from python, largely successfully. Now I'm trying to add errorbars to XY scatter plots. Keep getting a com_error. Can't track down the problem. I modified a simple example to duplicate the problem. Thanks to Mathieu Fenniak http://www.stompstompstomp.com/weblog/entries/67/ for th

Re: multiline comments

2006-04-18 Thread Ben Finney
"Atanas Banov" <[EMAIL PROTECTED]> writes: > Edward Elliott wrote: > > Saying coders shouldn't use multiline comments to disable code > > misses the point. Coders will comment out code regardless of the > > existence of multiline comemnts. There has to be a better > > argument for leaving them o

Re: multiline comments

2006-04-18 Thread Atanas Banov
Edward Elliott wrote: > At the risk of flogging a dead horse, I'm wondering why Python doesn't have > any multiline comments. One can abuse triple-quotes for that purpose, but > that's obviously not what it's for and doesn't nest properly. ... > Saying coders shouldn't use multiline comments to d

Re: multiline comments

2006-04-18 Thread Ben Finney
James Stroud <[EMAIL PROTECTED]> writes: > Edward Elliott wrote: > > At the risk of flogging a dead horse, I'm wondering why Python > > doesn't have any multiline comments. [...] > > > > Using an editor to throw #s in front of every line has > > limitations. Your editor has to support it and you

local greediness ???

2006-04-18 Thread [EMAIL PROTECTED]
hi, all. I need to process a file with the following format: $ cat sample [(some text)2.3(more text)4.5(more text here)] [(aa bb ccc)-1.2(kdk)12.0(xxxyyy)] [(xxx)11.0(bbb\))8.9(end here)] ... my goal here is for each line, extract every '(.*)' (including the round brackets, put them in a list,

Re: temporary scope change

2006-04-18 Thread Edward Elliott
Michael Spencer wrote: > Just replace: > for y in list2: > with: > if True: Of course. I knew it would be blindingly obvious. Sometimes you just can't shake the blinders off though. Thanks. > Note that neither the `if` nor the `for` statement actually creates a > new scope. Good cat

Re: freakin out over C++ module in python

2006-04-18 Thread nephish
pyconstruct looks cool. i dont know if the classes are using the plain berkely-ish code. i couldn't find anything in it that pointed to send() recv(), & such. i found other stuff like SetSocketOpt() and so on like this : long CClientSocket::ConnectToServer(LPCTSTR serverAddr, UINT port) {

Re: multiline comments

2006-04-18 Thread James Stroud
Edward Elliott wrote: > At the risk of flogging a dead horse, I'm wondering why Python doesn't > have any multiline comments. One can abuse triple-quotes for that > purpose, but that's obviously not what it's for and doesn't nest > properly. ML has a very elegant system for nested comments wit

Re: temporary scope change

2006-04-18 Thread Michael Spencer
Edward Elliott wrote: ... > > for x in list1: > i += 1 > # for y in list2: > print x * i > > and have the print line execute as part of the for x block. In other > words, I want the block with print to be in the scope of the for x loop. > But instead it raises a SyntaxError bec

Re: Missing interfaces in Python...

2006-04-18 Thread Alex Martelli
Roy Smith <[EMAIL PROTECTED]> wrote: > Peter Maas <[EMAIL PROTECTED]> wrote: > > He probably means that with interfaces one could test compliance > > with the interface as a whole instead of testing each member and > > each signature as a single piece. > > All interfaces (as implemented by Java)

Re: 2.5 excitement

2006-04-18 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: ... > Heh. Since we're just finally turning in our 100% first draft of Python > for Dummies, I tend to think more in terms of what a Python newbie will Funny timing coincidence: your 1st draft of Python for Dummies going in now, my 2nd edition of Python in a Nut

mailing list for indian college student software developers

2006-04-18 Thread bruce
hi yeah.. i know this is off topic, but there might be someone who might be able to help... i'm trying to find a mialing list focused on indian students who are in indian colleges (india) studying software programming... searching google hasn't really helped.. any thoughts/ideas/etc... thank

Re: Missing interfaces in Python...

2006-04-18 Thread Jonathan Daugherty
# All interfaces (as implemented by Java) prove is that your class has # a bunch of methods with the right names and signatures. It doesn't # prove that those methods do the right things. I don't think anyone is suggesting that interfaces do (or should) prove that the implemented methods actually

Activating Batch Files from Python

2006-04-18 Thread Jeff Groves
I'm writing a launcher that should do the following: 1. Activate a .bat file to set environmental variables. 2. Start 3 programs, using said environmental variables as arguments. However, I can't get the environmental variables to stick because all of Pythons' system start/open functions split of

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-18 Thread Biggmatt
>>I'm afraid that the only *proven* way to protect code from >>reverse-engineering is to not distribute it *at all*. ain't that the truth. A hex editor would stop the "PyRun_SimpleString(secret_code)" Even if you encrypt your string they have to run at some point. A couple clicks in decent disa

removing cgi fieldstorage keys

2006-04-18 Thread Kun
i don't know what happened but all of a sudden, my cgi.fieldstorage has two extra keys, 'x' and 'y', does anyone know how i can remove them in python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python web-hosting?

2006-04-18 Thread John Salerno
walterbyrd wrote: > I emailed them, they say they have mod_python. > Hi. I was just wondering if you been able to use mod_python at Dollar Hosting. I'm having some trouble with it. The handlers don't seem to be set up correctly and I've been in contact with the administrators, but they aren't

Re: Starting value with raw_input

2006-04-18 Thread Steve Bergman
Kinda ugly, and I lifted it from an old post, but this should work: import readline readline.set_startup_hook(lambda: readline.insert_text('supercalifragilisticexpialidocious')) try: new_value = raw_input() finally: readline.set_startup_hook(None) -- http://mail.python.org/mailman/listinfo/p

Re: pywin32 : scheduled weakup from standby/hiberate ?

2006-04-18 Thread Jesse Hager
robert wrote: > On Windows the task scheduler tool can program (the BIOS?) to weak up > the machine from standby/hibernate at certain pre-configured times. Can > this be done directly through the (py)win32 API? > > robert What you need is a Waitable Timer. The APIs to manipulate these are: wi

Re: piping question

2006-04-18 Thread Biggmatt
Thanks. I would have wasted a good day trying to figure that out. I found a work around. I'll just run the output in a terminal. -- http://mail.python.org/mailman/listinfo/python-list

Re: test for None

2006-04-18 Thread BartlebyScrivener
>> Have you followed the tutorial through, running and understanding each >> example, to get the basics of Python covered? Could be high time to try that again. At first it was way too much, so I've been doing Dive Into Python and some others. But I will try the Tutorial again, at least up to clas

Re: Quick Problem

2006-04-18 Thread [EMAIL PROTECTED]
Thank you. That worked perfectly, I understand why it was not working before because the variables were assigned within the function definition only. And replying to John Machin, admin is the name of the account I created on windows. The default administrator account in XP is called simply 'adminis

Re: Quick Problem

2006-04-18 Thread John Machin
On 19/04/2006 12:05 PM, [EMAIL PROTECTED] wrote: > Traceback (most recent call last): > File "C:\Documents and Settings\admin\Desktop\test\test.py", line 59, "admin"? I strongly suggest you set up another user ID without administrator privileges, and use that for the 99% of things that don't

temporary scope change

2006-04-18 Thread Edward Elliott
The only time I miss block delimiters in Python is when I want to temporarily change the scope of a block. Suppose I have this code: for x in list1: i += 1 for y in list2: print x * i Ignore the semantics for the moment (yes the code is suboptimal). Say I need to disable th

multiline comments

2006-04-18 Thread Edward Elliott
At the risk of flogging a dead horse, I'm wondering why Python doesn't have any multiline comments. One can abuse triple-quotes for that purpose, but that's obviously not what it's for and doesn't nest properly. ML has a very elegant system for nested comments with (* and *). Using an editor

Re: Quick Problem

2006-04-18 Thread Lars Yencken
Hello, On Tue, 18 Apr 2006 19:05:06 -0700, [EMAIL PROTECTED] wrote: > Here is my code: > > cw = 0 #Computer wins total > uw = 0 # User wins total > > def win(who): > if who == 1: > cw = cw + 1# computer win > elif who == 2: > uw = uw + 1# user win > Try addi

Re: Writing backwards compatible code - when?

2006-04-18 Thread John Machin
On 19/04/2006 5:40 AM, Bob Greschke wrote: > Is there a list of all of the Python commands and modules that tell when > (what version) they were added to Python? I was hoping the new Essential > Reference would have it, but it doesn't. > Possibly because it was deemed to be not essential :-)

Quick Problem

2006-04-18 Thread [EMAIL PROTECTED]
I am learning how to program and I only started about a month ago so the answer to this is probably quite obvious. I'm running accross a problem when writing a rock, paper, scissor program. Although I can write such program in 5 minutes I want to write a program into which I will implement many oth

Re: test for None

2006-04-18 Thread Ben Finney
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > How do you test for a function that returns nothing, A function returns a single value (which may be a container for other values). By default, with no 'return' statement, it returns the None object. What is it you're trying to do? > and why doe

Re: Writing backwards compatible code - when?

2006-04-18 Thread Dan Sommers
On Tue, 18 Apr 2006 13:40:11 -0600, "Bob Greschke" <[EMAIL PROTECTED]> wrote: > Is there a list of all of the Python commands and modules that tell > when (what version) they were added to Python? I was hoping the new > Essential Reference would have it, but it doesn't. I thought it was more coh

Re: scanning for numerals / letters

2006-04-18 Thread Dale Strickland-Clark
What about this? import re if not form.get('date'): print "Tsk! No date entered." raise Exception if re.search('[a-zA-Z]', form.get('date')): print "Tsk! No fancy date words." raise Exception date = form.get('date') if not form.get('purchases'): print "Ts

Re: test for None

2006-04-18 Thread BartlebyScrivener
I think I was trying for something like this, where the intervening for iterates over a function that may or may not produce nothing: x = None for x in []: print x if x is None: print "x is still none because nothing happened" Thanks, rick -- http://m

Re: scanning for numerals / letters

2006-04-18 Thread Steve Bergman
Something like this should work: == for c in form.get('date'): if c in string.letters: print "ERROR: You have to enter a date with numbers." == You have to import the string module. 'letters' is one of the attributes defined in that module. Other attributes

Re: Uniquifying a list?

2006-04-18 Thread John Machin
On 19/04/2006 1:31 AM, Tim Chase wrote: > Is there an obvious/pythonic way to remove duplicates from a list > (resulting order doesn't matter, or can be sorted postfacto)? Google is your friend: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 -- http://mail.python.org/mailman/li

Re: test for None

2006-04-18 Thread Erik Max Francis
BartlebyScrivener wrote: > How do you test for a function that returns nothing, and why doesn't > this work? Shouldn't X have to be either None or not? > x = None for x in []: > ... if x is None: > ... print "X is None" > ... else: > ... print "X is not None" > ..

test for None

2006-04-18 Thread BartlebyScrivener
How do you test for a function that returns nothing, and why doesn't this work? Shouldn't X have to be either None or not? >>>x = None >>> for x in []: ... if x is None: ... print "X is None" ... else: ... print "X is not None" ... Thanks, rick -- h

Re: locale, format monetary values

2006-04-18 Thread Rares Vernica
That's it. Thanks a lot! There is no example on the locale.format in the docs so I was confused. Regards, Ray deelan wrote: > Rares Vernica wrote: >> Hi, >> >> Can I use locale to format monetary values? If yes, how? If no, is >> there something I can use? >> >> E.g., >> I have 1 and I want

Re: extracting a substring

2006-04-18 Thread Dale Strickland-Clark
You don't need a regex for this, as long as the prefix and suffix are fixed lengths, the following will do: >> "a53bc_531.txt"[6:-4] '531' >>> "a53bc_2285.txt"[6:-4] '2285' [EMAIL PROTECTED] wrote: > Hi, > I have a bunch of strings like > a53bc_531.txt > a53bc_2285.txt > ... > a53bc_359.txt >

Re: extracting a substring

2006-04-18 Thread Felipe Almeida Lessa
Em Ter, 2006-04-18 às 17:25 -0700, [EMAIL PROTECTED] escreveu: > Hi, > I have a bunch of strings like > a53bc_531.txt > a53bc_2285.txt > ... > a53bc_359.txt > > and I want to extract the numbers 531, 2285, ...,359. Some ways: 1) Regular expressions, as you said: >>> from re import compile >>> fi

Re: how to use socks5 proxy in pycurl?

2006-04-18 Thread Ju Hui
No one use this function? -- http://mail.python.org/mailman/listinfo/python-list

Re: extracting a substring

2006-04-18 Thread Gary Herron
[EMAIL PROTECTED] wrote: >Hi, >I have a bunch of strings like >a53bc_531.txt >a53bc_2285.txt >... >a53bc_359.txt > >and I want to extract the numbers 531, 2285, ...,359. > >One thing for sure is that these numbers are the ONLY part that is >changing; all the other characters are always fixed. > >I

scanning for numerals / letters

2006-04-18 Thread Kun
I have the following if statement that checks if a form is empty: if form.has_key("date") and form["date"].value != "": date=form['date'].value else: print "ERROR: No date entered!" raise Exception I would also like to add another if statement checking if 'da

extracting a substring

2006-04-18 Thread [EMAIL PROTECTED]
Hi, I have a bunch of strings like a53bc_531.txt a53bc_2285.txt ... a53bc_359.txt and I want to extract the numbers 531, 2285, ...,359. One thing for sure is that these numbers are the ONLY part that is changing; all the other characters are always fixed. I know I should use regular expressions,

Re: Uniquifying a list?

2006-04-18 Thread Ben Finney
Tim Chase <[EMAIL PROTECTED]> writes: > Is there an obvious/pythonic way to remove duplicates from a > list (resulting order doesn't matter, or can be sorted > postfacto)? My first-pass hack was something of the form > > >>> myList = [3,1,4,1,5,9,2,6,5,3,5] > >>> uniq = dict([k,None for k in

Re: Simple DAV server?

2006-04-18 Thread Ivan Voras
robert wrote: > For testing purposes I'm looking for a simple DAV server - best a python > thing serving a folder tree. Don't want to install/change/setup the > complex apache dav .. > You can try this one: http://ivoras.sharanet.org/projects/pandav.html It's been a while since I last updated

Re: Uniquifying a list?

2006-04-18 Thread Edward Elliott
You could do >>> uniq = [x for x in set(myList)] but that's not really any different than what you already have. This almost works: >>> uniq = [x for x in myList if x not in uniq] except the r-val uniq isn't updated after each iteration. Personally I think list(set(myList)) is as optimal as

Re: Uniquifying a list?

2006-04-18 Thread Felipe Almeida Lessa
Em Ter, 2006-04-18 às 10:31 -0500, Tim Chase escreveu: > Is there an obvious/pythonic way to remove duplicates from a > list (resulting order doesn't matter, or can be sorted > postfacto)? My first-pass hack was something of the form > > >>> myList = [3,1,4,1,5,9,2,6,5,3,5] > >>> uniq = dict(

Re: indirect import of standard module

2006-04-18 Thread Ben Finney
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > >> More accurately, it *does* import it twice, into two separate > >> namespaces; > > If it's in two different namespaces, how can they have the same id > number? That "two different namespaces" might be a bit inaccurate. There is only one objec

Re: indirect import of standard module

2006-04-18 Thread BartlebyScrivener
Thank you for the elucidation. I'm just getting into Classes, but I wanted to get modules down first. Much appreciated. rick -- http://mail.python.org/mailman/listinfo/python-list

Starting value with raw_input

2006-04-18 Thread David Hirschfield
Does the raw_input built-in function allow giving an initial value that the user can edit? Perhaps by using the readline module? I want to do something so that I can provide the user a default value they can edit as they wish at the prompt: result = raw_input("Enter value: ") Somehow outpu

Uniquifying a list?

2006-04-18 Thread Tim Chase
Is there an obvious/pythonic way to remove duplicates from a list (resulting order doesn't matter, or can be sorted postfacto)? My first-pass hack was something of the form >>> myList = [3,1,4,1,5,9,2,6,5,3,5] >>> uniq = dict([k,None for k in myList).keys() or alternatively >>> uniq = list

Re: indirect import of standard module

2006-04-18 Thread alisonken1
Although 'namespace' may be a misnomer, module interfaces are 'exposed' to the module that imports it - it's not imported a second time into the new 'namespace'. The confusion comes about thinking that modules and classes are related. When a module is first imported, an instance is created for th

Re: indirect import of standard module

2006-04-18 Thread BartlebyScrivener
>> More accurately, it *does* import it twice, into two separate >> namespaces; If it's in two different namespaces, how can they have the same id number? rick -- http://mail.python.org/mailman/listinfo/python-list

Re: indirect import of standard module

2006-04-18 Thread alisonken1
Actually, it does not "execute the code only the first time", more accurately, it "initializes the code only the first time". But you are correct, it exposes the os.* module into the current namespace so you don't have to go to convoluted lengths to get to it. -- http://mail.python.org/mailman/l

RE: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-18 Thread Delaney, Timothy (Tim)
Aahz wrote: >> Indeed, I think the inclusion of ctypes is far and away the most >> exciting thing in 2.5. > > Really? More than pysqlite? My personal fave is the "with" statement. It makes a lot of code so much more elegant - esp. for things which are getting built-in context managers (e.g. fil

Re: indirect import of standard module

2006-04-18 Thread Ben Finney
"alisonken1" <[EMAIL PROTECTED]> writes: > Unless you override some of os.* functions in foo, you want to > import os into foo and bar separately. > > Python does not reimport the module a second time (create a second > instance of os) More accurately, it *does* import it twice, into two separat

Re: semi-[OT]: adding a reply-to line to these mails?

2006-04-18 Thread Ben Finney
Wildemar Wildenburger <[EMAIL PROTECTED]> writes: > I've noticed that I replied to individual posters' private addresses > several times now ... That's a much preferable, and much more easily corrected, error than the alternative: replying to the entire group what was intended only for the indiv

Re: datetime question

2006-04-18 Thread Scott David Daniels
Jorge Godoy wrote: > Philippe Martin wrote: > >> I need to get the date and time under Windows and Linux but need the >> information visible to the user (cannot find my words) not the sytem >> information (ex: a PC setup on greenwich but the date/time displayed are >> relative to some other place.

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-18 Thread Chris Lambacher
At least on windows. PySqlite is statically linked with the sqlite library. This can be done because it is quite small. -Chris On Tue, Apr 18, 2006 at 06:51:24PM +, Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Aahz wrote: > > On that front, I think that pysqlite is much more importan

Re: Better way to sift parts of URL . . .

2006-04-18 Thread Paul McGuire
"Ben Wilson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am working on a script that splits a URL into a page and a url. The > examples below are the conditions I expect a user to pass to the > script. In all cases, "http://www.example.org/test/"; is the URL, and > the page comp

Re: Better way to sift parts of URL . . .

2006-04-18 Thread Ben Wilson
Sorry. I'm writing a python script that retrieves source contents of a wiki page, edits, and re-posts changed content. The wiki breaks pages into groups and pages (e.g. ThisGroup/ThisPage). The sections that are camel cased (or otherwise contain title case) are the group and page for a given page.

Re: Updated PEP 359: The make statement

2006-04-18 Thread Steven Bethard
Steven Bethard wrote: > I've updated PEP 359 with a bunch of the recent suggestions. The > patch is available at: > http://bugs.python.org/1472459 > and I've pasted the full text below. > > I've tried to be more explicit about the goals -- the make statement > is mostly syntactic sugar for::

http request with cookie sending

2006-04-18 Thread itay_k
Hi, I want to send a cookie on some http request (with urllib2), so I created a Cookie but I cant associate it with CookieJar object. for example: import Cookie import cookielib, urllib2 C = Cookie.SimpleCookie() C["a"] = "b" cj = cookielib.CookieJar() cj.set_cookie(C) in the last line I got:

Re: Writing backwards compatible code - when?

2006-04-18 Thread Scott David Daniels
Bob Greschke wrote: > Is there a list of all of the Python commands and modules that tell when > (what version) they were added to Python? I was hoping the new Essential > Reference would have it, but it doesn't. Here's a reference that stops at 2.3: http://rgruet.free.fr/PQR2.3.html --S

Re: Better way to sift parts of URL . . .

2006-04-18 Thread skip
Ben> I am working on a script that splits a URL into a page and a Ben> url. I couldn't tell quite what you mean to accomplish from your example. (In particular, I don't know what you mean by "default_group", as it's never defined, and I don't know why the desired output of examples 1 and

Re: datetime question

2006-04-18 Thread Philippe Martin
Thanks, yes, I guess the question is ... what date/time is it looking at ? and is it the same under various OSs ? Philippe Jorge Godoy wrote: > Philippe Martin wrote: > >> Hi, >> >> I need to get the date and time under Windows and Linux but need the >> information visible to the user (canno

Re: indirect import of standard module

2006-04-18 Thread BartlebyScrivener
You're right! When running bar.py, id(os) and id(foo.os) give the same number! Cool. I'll go read about INSTANCES and pointers. Thank you very much, rick -- http://mail.python.org/mailman/listinfo/python-list

Re: difference between class and static methods?

2006-04-18 Thread John Salerno
Marc 'BlackJack' Rintsch wrote: > If you call `B.from_file('spam.xyz')` now, the `from_file()` method > inherited from class `A` is called but with `B` as the first argument so > it returns an instance of `B`. > > A staticmethod is just a function attached to a class without any "magic". So a cl

Telnet Server Lib

2006-04-18 Thread [EMAIL PROTECTED]
I have been working on a project for some time now, that has various types of admistrating including a CGI web interface, In a previous version I implemented a Psuedo-Telnet Server if you will, bassicly all it did was print text to the client, and expect back data, it did not work with any of the p

Re: difference between class and static methods?

2006-04-18 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, John Salerno wrote: > I've been reading up on them, but I don't quite understand how they > differ in practice. I know how each is implemented, and from C# I > already know what a static method is. But I won't assume that it's the > same in Python. And on top of that, bo

Re: Better way to sift parts of URL . . .

2006-04-18 Thread Ben Wilson
Here is what I came up with: def siftUrl(s): s = s.split('//')[1] bits = s.split('/') if '' in bits: bits.remove('') if len(bits) > 1: group = bits[-2] page = bits[-1] group.strip('/') page.strip('/') else

Re: indirect import of standard module

2006-04-18 Thread alisonken1
Unless you override some of os.* functions in foo, you want to import os into foo and bar separately. Python does not reimport the module a second time (create a second instance of os), it only creates a pointer to the first instance that's loaded. -- http://mail.python.org/mailman/listinfo/pyth

Better way to sift parts of URL . . .

2006-04-18 Thread Ben Wilson
I am working on a script that splits a URL into a page and a url. The examples below are the conditions I expect a user to pass to the script. In all cases, "http://www.example.org/test/"; is the URL, and the page comprises parts that have upper case letters (note, 5 & 6 are the same as earlier exa

urllib2.ProxyHandler

2006-04-18 Thread rx
I'm trying to hide my IP with the following code: import urllib2 proxy=[urllib2.ProxyHandler({'http':'24.232.167.22:80'})] opener=urllib2.build_opener(proxy) f=opener.open('http://www.whatismyipaddress.com') print f.read() But that didn't work - my real IP showed up. Then I made the following re

Re: Speed abilities

2006-04-18 Thread Harry George
"Coyoteboy" <[EMAIL PROTECTED]> writes: > Ive read a few comments, the usual about it being slower,sometimes vastly > slower than a C++ written item but I was wondering if its 'slow' > incomparison with what I need. I'm looking at taking two arrays of 12 bytes > over an ethernet connection, com

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Jon Ribbens <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, Aahz wrote: >> >> On that front, I think that pysqlite is much more important because >> it finally gets rid of the excuse for using Berkeley for simple >> database purposes. > >Apologies if I'm

Re: Java Developer Exploring Python

2006-04-18 Thread Carl J. Van Arsdall
Jarek Zgoda wrote: > [EMAIL PROTECTED] napisał(a): > > >> Is Python actively developed and supported on Linux? Would it be a >> viable option for cross-platform application development? >> > > Yeas and yeas. Yeas. (That's how we pronounce "yes" here, in Poland, > East Europe). > > >> Can

Mouse control in OS X

2006-04-18 Thread Mateo
Hi, I'd like to be able to use python to control the mouse cursor in OS X. ( i.e. programmatically move it around, click things, etc...) Anyone know the best way to do it on a Mac? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Java Developer Exploring Python

2006-04-18 Thread Jarek Zgoda
[EMAIL PROTECTED] napisał(a): > Is Python actively developed and supported on Linux? Would it be a > viable option for cross-platform application development? Yeas and yeas. Yeas. (That's how we pronounce "yes" here, in Poland, East Europe). > Can anyone recommend an open source IDE for Python t

Re: Missing interfaces in Python...

2006-04-18 Thread Roy Smith
Peter Maas <[EMAIL PROTECTED]> wrote: > He probably means that with interfaces one could test compliance > with the interface as a whole instead of testing each member and > each signature as a single piece. All interfaces (as implemented by Java) prove is that your class has a bunch of methods w

Re: Writing backwards compatible code - when?

2006-04-18 Thread Bob Greschke
Is there a list of all of the Python commands and modules that tell when (what version) they were added to Python? I was hoping the new Essential Reference would have it, but it doesn't. Thanks! Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Queue can result in nested monitor deadlock

2006-04-18 Thread Jonathan Amsterdam
No redesign necessary. I simply make M be the Queue's mutex, via the LQueue class I posted. I am making the modest suggestion that this feature be documented and exposed in the Queue class. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Any Python lullabies?

2006-04-18 Thread Jarek Zgoda
Christos Georgiou napisał(a): > Since there have been python limmericks, are there any Python lullabies that > I can sing to my newborn son (actually, born yesterday)? I tried to murmur > some select parts from the tutorial, but he somehow wasn't very interested > :) Your son is too small to und

Re: 2.5a1 import of .dlls

2006-04-18 Thread Thomas Heller
[EMAIL PROTECTED] wrote: > I've re-built an extension module (as a .dll) using the 2.5a1 release. > Unexpectedly, I'm not able to simply import it (not the way I can when > building it for 2.3). Using imp.load_dynamic() the import succeeds. > import minx # Implemented in a .dll - fails >

Re: Missing interfaces in Python...

2006-04-18 Thread olsongt
Rene Pijlman wrote: > [EMAIL PROTECTED]: > >If it looks like a duck, and quacks like a duck, then for all practical > >purposes it supports the 'duck' interface. > > The problem with that of course, is that there's much more to being a duck > than being called 'duck'. > > public interface JarFile

Re: datetime question

2006-04-18 Thread Jorge Godoy
Philippe Martin wrote: > Hi, > > I need to get the date and time under Windows and Linux but need the > information visible to the user (cannot find my words) not the sytem > information (ex: a PC setup on greenwich but the date/time displayed are > relative to some other place. Something like t

Re: Missing interfaces in Python...

2006-04-18 Thread Peter Maas
Roy Smith schrieb: > Python is a very dynamic language. Java is a very static language. What is the difference between "static" and "very static"? Is Java more static than Fortran I? ;) Peter Maas, Aachen -- http://mail.python.org/mailman/listinfo/python-list

2.5a1 import of .dlls

2006-04-18 Thread sven . nystrom
I've re-built an extension module (as a .dll) using the 2.5a1 release. Unexpectedly, I'm not able to simply import it (not the way I can when building it for 2.3). Using imp.load_dynamic() the import succeeds. >>> import minx # Implemented in a .dll - fails Traceback (most recent call last):

Re: Missing interfaces in Python...

2006-04-18 Thread Peter Maas
Fredrik Lundh schrieb: > Jonathan Daugherty wrote_ > >> # In Python, you would simply call the functions you need. No need to >> # make things that rigidly defined. >> >> Except when you need to handle exceptions when those methods don't >> exist. I think interfaces can definitely be useful. > >

difference between class and static methods?

2006-04-18 Thread John Salerno
I've been reading up on them, but I don't quite understand how they differ in practice. I know how each is implemented, and from C# I already know what a static method is. But I won't assume that it's the same in Python. And on top of that, both the class and static methods of Python seem to do

datetime question

2006-04-18 Thread Philippe Martin
Hi, I need to get the date and time under Windows and Linux but need the information visible to the user (cannot find my words) not the sytem information (ex: a PC setup on greenwich but the date/time displayed are relative to some other place. Regards, Philippe -- http://mail.python.org/mailm

Re: Missing interfaces in Python...

2006-04-18 Thread Mark True
This is quite possibly one of the funniest examples of how Duck Typing can break down that I have ever seen!On 4/18/06, Rene Pijlman < [EMAIL PROTECTED]> wrote: [EMAIL PROTECTED]:>If it looks like a duck, and quacks like a duck, then for all practical>purposes it supports the 'duck' interface.The p

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-18 Thread Fredrik Lundh
Jon Ribbens wrote: > Apologies if I'm being obtuse, but how does including the pysqlite > wrapper module change anything? You still need to download and install > SQLite I'm pretty sure the distributors will do this for you, just as they've included zlib, dbm, tcl/tk, openssl, and many other stan

  1   2   >