Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-15 Thread r0g
On 12/11/10 01:25, Roy Smith wrote: In article, r0g wrote: On 11/11/10 14:22, Stef Mientki wrote: I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? PHP is mostly a one-trick pony. It's meant to be run as a web scripting language with Apache (or, I sup

Re: How to test if a module exists?

2010-11-11 Thread r0g
On 11/11/10 21:53, Lawrence D'Oliveiro wrote: In message, MRAB wrote: ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line continuation backslash" and _all_ the subsequent ones arrived with an _unobfuscated_ email address. You mean from this one on

Re: Class extension confusion :(

2010-11-11 Thread r0g
On 11/11/10 19:34, r0g wrote: On 11/11/10 09:34, Peter Otten wrote: r0g wrote: If I understand correctly it may also be possible (and more efficient) to use setattr() to inject the parameters I want into the class as class attributes before use, rather than assigning them to data attributes

Re: How to test if a module exists?

2010-11-11 Thread r0g
On 11/11/10 20:26, Lawrence D'Oliveiro wrote: In message, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what membe

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread r0g
On 11/11/10 18:01, Steve Holden wrote: On 11/11/2010 9:22 AM, Stef Mientki wrote: hello, finally got Python running at my server. Now I would like to replace the PHP server scripts with Python ( for easier maintenance). But I can't find how th get to PHP's equivalent of $_Post and $_Cookie ?

Re: udp sockets with python

2010-11-11 Thread r0g
On 11/11/10 16:03, Jean-Paul Calderone wrote: On Nov 10, 9:23 pm, Tim Roberts wrote: Mag Gam wrote: I am measuring the round trip time using tcpdump. The C version is giving me around 80 microseconds (average) and the python is giving me close to 300 microseconds (average). If you need the

Re: How do I skip over multiple words in a file?

2010-11-11 Thread r0g
On 11/11/10 15:07, chad wrote: Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem like this? If your files are not too big

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread r0g
On 11/11/10 14:22, Stef Mientki wrote: hello, finally got Python running at my server. Now I would like to replace the PHP server scripts with Python ( for easier maintenance). But I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? Google finds lots of links, but I can't fin

Re: How to test if a module exists?

2010-11-11 Thread r0g
On 11/11/10 11:28, Mark Wooding wrote: r0g writes: Really? I get a metric butt-ton of spam every day to this address. I'm sure I get sent a lot of spam (though I don't know for sure -- see below). But I don't think much of it comes from Usenet harvesters any more. Righ

Re: Class extension confusion :(

2010-11-11 Thread r0g
On 11/11/10 09:34, Peter Otten wrote: r0g wrote: Question B) The only reason I can think of so far is that I don't have a clear picture of how those names came to end up in that scope, it seems very convenient but I'm worried it's black magic of some sort! Could anyone explain

Re: Class extension confusion :(

2010-11-11 Thread r0g
On 10/11/10 09:52, Peter Otten wrote: class PlainAJAXRequestHandler(BaseHTTPRequestHandler): def __init__(self, api_call, paths, *args, **kw): BaseHTTPRequestHandler.__init__(self, *args, **kw) self.api_call = api_call self.paths = paths Hmm, the plot thickens!

Re: Looping through files in a directory

2010-11-10 Thread r0g
On 11/11/10 06:23, Chris Rebert wrote: On Wed, Nov 10, 2010 at 10:11 PM, r0g wrote: On 11/11/10 00:17, Steve Holden wrote: On 11/10/2010 5:46 PM, Matty Sarro wrote: Short story - I have a few thousand files in a directory I need to parse through. Is there a simple way to loop through files

Re: Looping through files in a directory

2010-11-10 Thread r0g
On 11/11/10 00:17, Steve Holden wrote: On 11/10/2010 5:46 PM, Matty Sarro wrote: Short story - I have a few thousand files in a directory I need to parse through. Is there a simple way to loop through files? I'd like to avoid writing a python script that can parse 1 file, and have to call it a f

Re: DTD Parsing

2010-11-10 Thread r0g
On 10/11/10 23:18, Christian Heimes wrote: Am 10.11.2010 04:36, schrieb Asun Friere: Yes but configuration files are not necessarily meant to be edited by humans either! Yeah, you are right. I'm sorry but every time I read XML and configuration in one sentence, I see the horror of TomCat or Sh

Re: Questions: While And List Comprehension

2010-11-10 Thread r0g
On 10/11/10 22:56, Emile van Sebille wrote: On 11/10/2010 4:36 AM Felipe Vinturini said... Hi Folks, I am quite new to python and I don't have a lot of experience with it yet. I have two simple questions: 1. Is there a way to limit the number of times a list comprehension will execute? E.g. I

Re: DTD Parsing

2010-11-10 Thread r0g
On 10/11/10 20:38, Ian wrote: On Nov 10, 1:05 am, r0g wrote: That's five whole lines of code. Why go to all that trouble when you can just do this: import config Heh, mainly because I figure the config module will have a lot more options than I have use for right now and therefor

Re: Curses Programming

2010-11-10 Thread r0g
On 10/11/10 14:42, alexander wrote: Hi, all Here is the test. Plz help. / ***/ If you use the new image search of Google, you will

Re: How to test if a module exists?

2010-11-10 Thread r0g
On 10/11/10 12:45, Mark Wooding wrote: r0g writes: You use your main address on USENET rather than a junk one!? Obfuscated or not that's either brave or foolhardy! I use my real email address. I also have an aggressive spam filter. But I don't think that much of my comes f

Re: Class extension confusion :(

2010-11-10 Thread r0g
On 10/11/10 09:52, Peter Otten wrote: r0g wrote: I have a subclass of BaseHHTPRequestHandler which uses a dictonary "paths" and a function "api_call" which are defined in the main namespace of the module. I'd rather I was able to pass these object to the construct

Re: How to test if a module exists?

2010-11-10 Thread r0g
On 10/11/10 09:50, Lawrence D'Oliveiro wrote: In message, Jon Dufresne wrote: On Mon, Nov 8, 2010 at 11:35 PM, Lawrence D'Oliveiro ... I see that you published my unobfuscated e-mail address on USENET for all to see. I obfuscated it for a reason, to keep the spammers away. I'm assuming this w

Re: DTD Parsing

2010-11-10 Thread r0g
On 10/11/10 07:36, Ian Kelly wrote: On 11/9/2010 11:14 PM, r0g wrote: Me too when possible, TBH if I only needed strings and there was no pressing security issue I'd just do this... config = {} for line in (open("config.txt", 'r')): if len(line) > 0 and

Re: DTD Parsing

2010-11-09 Thread r0g
On 10/11/10 03:36, Asun Friere wrote: On Nov 10, 2:02 pm, Christian Heimes wrote: Am 10.11.2010 03:44, schrieb Felipe Bastos Nunes: I'd like to know too. I work with java and jdom, but I'm doing personal things in python, and plan to go full python in the next 2 years. Xml is my first option

Class extension confusion :(

2010-11-09 Thread r0g
I have a subclass of BaseHHTPRequestHandler which uses a dictonary "paths" and a function "api_call" which are defined in the main namespace of the module. I'd rather I was able to pass these object to the constructor and store them as data attributes "self.paths" and "self.api_call" but I'm no

Re: Expected bahaviour of os.chroot and os.getcwd

2010-09-14 Thread r0g
On 14/09/10 11:19, Nobody wrote: On Mon, 13 Sep 2010 19:04:53 +0100, r0g wrote: i.e. So do I always have to change directory after changing into a chroot? You don't *have* to change the directory, but not doing so probably defeats the point of performing a chroot(). Thanks for the

Expected bahaviour of os.chroot and os.getcwd

2010-09-13 Thread r0g
Hi CLP! Not been here for ages, I hope everyone is doing well :) I just want to check if this is the intended behaviour (2.2 to 2.7)... import os print os.getcwd() os.chroot("/home/r0g/whatever/") print os.getcwd() os.chdir("/") print os.getcwd() /home/r0g/AAA_BACKED_

Re: Offline windows registry access on *nix platforms.

2010-02-26 Thread r0g
r0g wrote: > Hi Everybody, > > I do a fair bit of programming in Python and I have to say I find perl a > little intimidating right now as I don't have a lot of experience with > it however its the only language I have found that seemed to have a > library for what

Offline windows registry access on *nix platforms.

2010-02-26 Thread r0g
Hi Everybody, I do a fair bit of programming in Python and I have to say I find perl a little intimidating right now as I don't have a lot of experience with it however its the only language I have found that seemed to have a library for what I need right now: Win32::Registry (or maybe Win32::TieR

Re: Arrrrgh! Another module broken

2010-01-17 Thread r0g
Jive Dadson wrote: > Matt Newville wrote: >> On Jan 17, 7:25 pm, Jive Dadson wrote: >>> I just found another module that broke when I went to 2.6. > >>> Gnuplot. Apparently one of its routines has a parameter >>> named "with." That used to be okay, and now it's not. >> >> This was fixed in versi

Re: remote evaluation of Python code typed in html webpage frame

2010-01-16 Thread r0g
Anand Vaidya wrote: > On Jan 16, 12:26 am, r0g wrote: >>>> Diez >> The Web2py framework works a bit like that, although it's not quite as >> simplistic as what you describe. May be worth a look though. >> >> Roger. > > > Hi r0g, > > we

Re: force URLencoding script

2010-01-15 Thread r0g
João wrote: > On Jan 15, 2:38 pm, r0g wrote: >> João wrote: >>> On Jan 14, 5:58 pm, r0g wrote: >>>> João wrote: >>>>> On Jan 12, 10:07 pm, r0g wrote: >>>>>> João wrote: >>>>> for the following data, >>>>&g

Re: Simple distributed example for learning purposes?

2010-01-15 Thread r0g
Tim Golden wrote: > On 15/01/2010 15:43, r0g wrote: >> Distributed password cracking? It's really simple yet potentially >> engaging and could be a good segway into teaching them about >> computability and security. All you need is a bunch of password hashes >> an

Re: A simple-to-use sound file writer

2010-01-15 Thread r0g
Steve Holden wrote: > r0g wrote: >> I think those guys owe you an apology really, but I wouldn't hold your >> breath! >> > Well as you can now see at least one of "those guys" doesn't mind > admitting (and apologizing) when he is wrong. > >

Re: remote evaluation of Python code typed in html webpage frame

2010-01-15 Thread r0g
dmitrey wrote: > Thank you for the link, but I meant what is appropriate soft to be > installed on my server to do things like that. > Also, for my purposes it's better to have some text with possibility > of reexecuting after some minor code changes than python interpreter > command prompt. > Rega

Re: webscrapping ringcentral.com using mechanize

2010-01-15 Thread r0g
shrini wrote: > Hi, > >> You wouldn't be trying to crack their customers account logins would >> you? Coz it would be highly illegal if you were. > > I am a valid customer of ringcentral.com > > We have multiple accounts and need to automate some actions in > ringcentral site. > > still no clue

Re: Simple distributed example for learning purposes?

2010-01-15 Thread r0g
Tim Golden wrote: > Nobody wrote: >> On Sat, 26 Dec 2009 20:06:02 +, Tim Golden wrote: >> >>> I'm trying to come up with something which will illustrate >>> the usefulness of a distributed processing model. Since I >>> may not be using the term "distributed" exactly, my >>> criteria are: >>> >>

Re: Ignore leading '>>>' and ellipsis?

2010-01-15 Thread r0g
Javier Collado wrote: > Hello, > > I think that's exactly what the cpaste magic function does. Type > 'cpaste?' in your IPython session for more information. > > Best regards, > Javier > > 2010/1/14 Reckoner : >> Hi, >> >> I am studying some examples in a tutorial where there are a lot of >>

Re: force URLencoding script

2010-01-15 Thread r0g
João wrote: > On Jan 14, 5:58 pm, r0g wrote: >> João wrote: >>> On Jan 12, 10:07 pm, r0g wrote: >>>> João wrote: >>> for the following data, >>> authentication = "UID=somestring&" >>> message = 'PROBLEM severity Hig

Re: A simple-to-use sound file writer

2010-01-15 Thread r0g
Alf P. Steinbach wrote: > But maybe you're simply not able to understand the algorithm, trivial as > it is. > > So, a Python implementation (note, this program takes some time to run!): > > > > # Generating a sine wave as a sum of square waves of various amplitudes Pwned! Good one Alf :) I t

Re: maintain 2 versions of python on my computer

2010-01-14 Thread r0g
luis wrote: > Hi > > I am not an expert in programming and using Python for its simplicity > > I have 2 versions of python installed on my computer (windos xp) to > begin the transition from version 2.4 to 2.6 or 3. maintaining the > operability of my old scripts > > Is there any way to indicate

Re: force URLencoding script

2010-01-14 Thread r0g
João wrote: > On Jan 12, 10:07 pm, r0g wrote: >> João wrote: > > for the following data, > authentication = "UID=somestring&" > message = 'PROBLEM severity High: OperatorX Plat1(locationY) global > Succ. : 94.47%' > dest_number = &#x

Re: os.system function

2010-01-13 Thread r0g
Lie Ryan wrote: > On 01/13/10 04:59, r0g wrote: >> so you may want to look into pythons core GUI library, TKL. > > I know Tk and Tcl has been close since their childhood; did they get > married too? Whoops... yes Tk/Tcl, it seems they had become one in my head only! :

Re: force URLencoding script

2010-01-12 Thread r0g
João wrote: > On Jan 12, 8:05 pm, r0g wrote: >> João wrote: >>> Someone please? >> Haven't seen your original post yet mate, usenet can be flaky like that, >> might have been a good idea to quote your original post! >> >> Roger. > > Thank

Re: force URLencoding script

2010-01-12 Thread r0g
João wrote: > Someone please? Haven't seen your original post yet mate, usenet can be flaky like that, might have been a good idea to quote your original post! Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system function

2010-01-12 Thread r0g
Zabin wrote: > Hey everyone! > > I am a new python programmer. I am trying to get the general file > functionality with options of save and save as working. These save > functions save a folder with multiple files. Upon using the os.system > copy function- if my destination directory has files wit

Re: Fundamental Function Question (beginner)

2010-01-11 Thread r0g
r0g wrote: > Scott wrote: >> When creating a function is there any difference between putting >> everything under the "def" or not? >> >> Here I created a function called CscoPortNum to convert the network >> port number field in a Cisco syslog string fr

Re: Fundamental Function Question (beginner)

2010-01-11 Thread r0g
Scott wrote: > When creating a function is there any difference between putting > everything under the "def" or not? > > Here I created a function called CscoPortNum to convert the network > port number field in a Cisco syslog string from a an ascii name back > into its numeric form if required. D

Re: Accessing python from a network share in windows 7

2010-01-08 Thread r0g
aj wrote: > On Jan 7, 3:51 pm, MRAB wrote: >> aj wrote: > It works without any issue on win7 if I copy python to my local drive. > Also, accessing python from the same network share works fine on win > XP. So I am suspecting some security policy of win7 that is causing > problem while accessing it

Re: Recommended "new" way for config files

2010-01-08 Thread r0g
Chris Rebert wrote: > On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: > >>> The .ini file is the simpliest solution, at least from the user point of >>> view, no need to learn any python syntax. >> I am speaking from the point of view of a python programmer, and I find the >> .ini restrictions not

Re: Do I have to use threads?

2010-01-08 Thread r0g
Marco Salden wrote: > On Jan 6, 5:36 am, Philip Semanchuk wrote: >> On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: >> >>> Hello people, >>> I have 5 directories corresponding 5 different urls .I want to >>> download >>> images from those urls and place them in the respective >>> directorie

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
r0g wrote: > Steven D'Aprano wrote: >> On Wed, 06 Jan 2010 23:58:21 +, r0g wrote: >> >>> Steven D'Aprano wrote: >>>> On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: >>>> >>>>> Grant Edwards wrote: >>>>>&

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread r0g
alex23 wrote: > r0g wrote: >> Well I think sometimes, for the sake of expediency and overall >> pleasantness, it's better to let the smaller things go: and if you just >> can't let them go then at least try and issue corrections in a friendly >> manner rath

Re: GUI for multiplatform multimedia project

2010-01-06 Thread r0g
Philip Semanchuk wrote: > > On Jan 6, 2010, at 4:53 PM, > wrote: > >> Hi everyone, >> >> I posted that question on a python-forum, but got answer, so I ask here. >> >> I'm working on an artistic project and I'm looking for the best >> cross-platform GUI solution. The problem is that it's gonna

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Steven D'Aprano wrote: > On Wed, 06 Jan 2010 23:58:21 +0000, r0g wrote: > >> Steven D'Aprano wrote: >>> On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: >>> >>>> Grant Edwards wrote: >>>>> On 2010-01-06, r0g wrote: >> See?

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread r0g
Ben Finney wrote: > r0g writes: > >> Ben Finney wrote: >>> People sometimes get upset — on an immediate, irrational level — >>> when their assertions are challenged. There's no denying that >>> emotions entangle our discourse, and our interpretati

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread r0g
Ben Finney wrote: > In fairness, the “No” was in response, not to an explicit question, but > to an assertion. > > Every assertion expressed, though, implies the question “is this > assertion true?”. It was that question that was answered “No” (followed > by an explanation of why the assertion was

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Steven D'Aprano wrote: > On Wed, 06 Jan 2010 22:46:33 +0000, r0g wrote: > >> Grant Edwards wrote: >>> On 2010-01-06, r0g wrote: >>> >>>> NO! It's a rude way to start a sentence don't you think? >>> No. When somebody asks a

Re: Mencoder and creating videos

2010-01-06 Thread r0g
Emile van Sebille wrote: > On 1/6/2010 12:44 PM aditya shukla said... >> Hello Guys, >> >> I have a multiprocessing script which downloads images from 5 urls to 5 >> directories(usinf multiprocess in python 2.6).The download is for 5 >> mins.My aim is to create a video for every minute for each dir

Re: TypeError

2010-01-06 Thread r0g
MRAB wrote: > Victor Subervi wrote: >> Hi; >> I get this error: >> >> /var/www/html/angrynates.com/christians/cart/simplemail/mail.py >> >> 153 >> 154 ''' >> 155 commitSale() >> 156 myMail() >> 157 print ''' >> commitSale = >>

Re: File transfer with python

2010-01-06 Thread r0g
Valentin de Pablo Fouce wrote: > Hi there, > > I hope this is the rigth place, if not please, tell me which is the > right dicussion place. I apologize in such case. > > Ok, I am trying to do a very quick application (is "home based" so is > not a big deal...). My intention is to transfer files f

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Grant Edwards wrote: > On 2010-01-06, r0g wrote: > >> NO! It's a rude way to start a sentence don't you think? > > No. When somebody asks a yes/no question, answering yes or no > seems quite polite to me. Following the yes/no answer with an > explanation of t

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Ben Finney wrote: > r0g writes: > >> NO! It's a rude way to start a sentence don't you think? > > Shouting is usually rude, yes. > >> Just because you're correcting someone doesn't mean you have to be >> combative and try and make them

Re: creating tar file and streaming it over HTTP?

2010-01-06 Thread r0g
pbienst wrote: > I would like to bundle up a number of files in a tar file and send it > over a HTTP connection, but I would like to do this without creating > the tar file on disk first. > Stringio lets you treat a strings as a files... http://docs.python.org/library/stringio.html Roger. -- h

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Lie Ryan wrote: > On 1/6/2010 1:48 AM, r0g wrote: >> Steven D'Aprano wrote: >>> On Tue, 05 Jan 2010 13:06:20 +, r0g wrote: >>>> If >>>> that's the case how can you expect it to validate anything at all in >>>> production? >>

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Steven D'Aprano wrote: > On Wed, 06 Jan 2010 09:39:08 +1100, Ben Finney wrote: > >> r0g writes: >> >>> Of course I'm now guilty of pedantry too :/ I might have let it slip >>> had you not started your reply with the word "No", that just p*

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Steven D'Aprano wrote: > On Tue, 05 Jan 2010 13:06:20 +0000, r0g wrote: >> Well maybe I didn't quite get it then, could you explain a bit further? >> >> My understanding was that asserts aren't executed at all if python is >> started with the -O or

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Ben Finney wrote: > r0g writes: > >> Paul Rudin wrote: >>> Doesn't python just return a single result? (I know it can be a >>> tuple and assignment statements will unpack a tuple for you.) >> Yes, it returns a tuple if you return more than one val

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Dave Angel wrote: > > > r0g wrote: >> >> >> Maybe, although I recently learned on here that one can't rely on assert >> statements in production code, their intended use is to aid debugging >> and testing really. >> >> > Ho

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Paul Rudin wrote: > r0g writes: > >> Steven D'Aprano wrote: >>> On Tue, 05 Jan 2010 02:31:34 +, r0g wrote: >>> >>>> A pattern I have used a few times is that of returning an explicit >>>> success/failure code alongside whatev

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Chris Rebert wrote: > > On Tue, Jan 5, 2010 at 1:07 AM, r0g wrote: >> Lie Ryan wrote: >>> I have been looking at Haskell recently and the way the pure functional >>> language handled exceptions and I/O gives me a new distinct "insight" >>> that

Re: A null program - what is it doing?

2010-01-05 Thread r0g
Gib Bogle wrote: > No doubt a dumb question from a noob: > > The following program (a cut down version of some test code) uses no > CPU, and does not terminate: > > import sys > from PyQt4.QtCore import * > > if __name__=="__main__": > app = QCoreApplication(sys.argv) > sys.exit(app.exec

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Steven D'Aprano wrote: > On Tue, 05 Jan 2010 02:31:34 +0000, r0g wrote: > >> A pattern I have used a few times is that of returning an explicit >> success/failure code alongside whatever the function normally returns. > > That doesn't work for languages th

Re: Exception as the primary error handling mechanism?

2010-01-05 Thread r0g
Lie Ryan wrote: > On 1/5/2010 1:31 PM, r0g wrote: >> Michi wrote: >>> On Jan 4, 1:30 pm, Steven D'Aprano >>> wrote: >> A pattern I have used a few times is that of returning an explicit >> success/failure code alongside whatever the function norma

Re: TypeError: can only concatenate list (not "tuple") to list

2010-01-04 Thread r0g
Steven D'Aprano wrote: > On Tue, 05 Jan 2010 00:52:56 +0000, r0g wrote: > >> I'd be strongly inclined to think the result would be the sequence on >> the left with the data from the second sequence appended to it. What's >> wrong with a little duck typi

Re: Exception as the primary error handling mechanism?

2010-01-04 Thread r0g
Michi wrote: > On Jan 4, 1:30 pm, Steven D'Aprano > wrote: >> In some, limited, cases you might be able to use the magic return value >> strategy, but this invariably leads to lost programmer productivity, more >> complex code, lowered readability and usability, and more defects, >> because progr

Off Topic ( was Re: Significant whitespace)

2010-01-04 Thread r0g
Steve Holden wrote: > r0g wrote: >> David Robinow wrote: >>> On Sun, Jan 3, 2010 at 10:42 PM, Roy Smith wrote: >>>> In article , >>>> David Robinow wrote: >>>> >>>>> On Sun, Jan 3, 2010 at 8:09 PM, Tim Roberts wrote: >&g

Re: TypeError: can only concatenate list (not "tuple") to list

2010-01-04 Thread r0g
Gabriel Genellina wrote: > En Mon, 04 Jan 2010 04:58:54 -0300, Chris Rebert > escribió: >> On Sun, Jan 3, 2010 at 11:51 PM, Gabriel Genellina >> wrote: > >>> py> [1,2,3] + (4,5) >>> Traceback (most recent call last): >>> File "", line 1, in >>> TypeError: can only concatenate list (not "tuple"

Re: Question about an application

2010-01-03 Thread r0g
rieh25 wrote: > Thanks, I had forgotten about it. I'll investigate if there are ways to > automate using it to run programs in several computers at the same time. > > > Rodrick Brown wrote: >> Take a look at ssh >> There are. Take a look at paramiko if you want to interface with SSH within pyth

Re: Significant whitespace

2010-01-03 Thread r0g
David Robinow wrote: > On Sun, Jan 3, 2010 at 10:42 PM, Roy Smith wrote: >> In article , >> David Robinow wrote: >> >>> On Sun, Jan 3, 2010 at 8:09 PM, Tim Roberts wrote: More than "not required", it was "not relevant". This led to one of the most infamous programming blunders in the

Re: twenty years ago Guido created Python

2010-01-03 Thread r0g
n00m wrote: > Ok, let me evolve a bit my thought. > Guido is Eropean Culture. > Now say what was invented by Japanese, by Chinese? > Nothing. > Barbaric cultures, they are animals inborn animals. > Russian Sikorsky built choppers for Eisenhower. > Look at letter "S" on them -- its his name > What y

Re: Python-list Digest, Vol 75, Issue 226

2009-12-23 Thread r0g
Gabriel Genellina wrote: > En Tue, 22 Dec 2009 16:30:58 -0300, r0g > escribió: >> Gabriel Genellina wrote: >>> En Mon, 21 Dec 2009 16:30:13 -0300, Pulkit Agrawal >>> escribió: >>> >>>> I am writing a script wherein I need to merge files into exi

Re: Line indexing in Python

2009-12-22 Thread r0g
Steve Holden wrote: > r0g wrote: >> seafoid wrote: >>> Hi Guys, >>> >>> When python reads in a file, can lines be referred to via an index? >>> >>> Example: >>> >>> for line in file: >>> if line[0] == '0&#

Re: Python-list Digest, Vol 75, Issue 226

2009-12-22 Thread r0g
Gabriel Genellina wrote: > En Mon, 21 Dec 2009 16:30:13 -0300, Pulkit Agrawal > escribió: > >> I am writing a script wherein I need to merge files into existing tar.gz >> files. Currently, I am using tarfile module. I extract the tar.gz to a >> tempdir and copy the new file there and re-compress

Re: How to validate the __init__ parameters

2009-12-22 Thread r0g
Bruno Desthuilliers wrote: > Steve Holden a écrit : > (snip) >> What's the exact reason for requiring that a creator argument be of a >> specific type? So operations on the instances don't go wrong? Well, why >> not just admit that we don't have control over everything, and just *let >> things go w

Re: How to validate the __init__ parameters

2009-12-21 Thread r0g
Steven D'Aprano wrote: > On Mon, 21 Dec 2009 21:49:11 +0000, r0g wrote: > >> I use assertions myself e.g. >> >>>>> foo = "123456" >>>>> assert len(foo) <= 5 >> Traceback (most recent call last): >> File "&quo

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread r0g
J Kenneth King wrote: > c) This has nothing to do with programming languages. A programmer that > lacks critical thinking is a bad programmer. The language they use has > no bearing on such human facilities. The language may well have a bearing on the quality of the programs generated though,

Re: numpy performance and random numbers

2009-12-21 Thread r0g
sturlamolden wrote: > On 19 Des, 16:20, Carl Johan Rehn wrote: > >> How about mulit-core or (perhaps more exciting) GPU and CUDA? I must >> admit that I am extremely interested in trying the CUDA-alternative. >> >> Obviously, cuBLAS is not an option here, so what is the safest route >> for a novi

Re: Line indexing in Python

2009-12-21 Thread r0g
seafoid wrote: > Hi Guys, > > When python reads in a file, can lines be referred to via an index? > > Example: > > for line in file: > if line[0] == '0': > a.write(line) > > This works, however, I am unsure if line[0] refers only to the first line or > the first character in all l

Re: How to validate the __init__ parameters

2009-12-21 Thread r0g
Denis Doria wrote: > Hi; > > I'm checking the best way to validate attributes inside a class. Of > course I can use property to check it, but I really want to do it > inside the __init__: > > class A: > def __init__(self, foo, bar): > self.foo = foo #check if foo is correct >

Re: share dictionary between processes

2009-12-18 Thread r0g
blumenkraft wrote: > Hi, > > I want to share dictionary between two distinct processes. > > > Something like this: > > first.py > import magic_share_module > > def create_dictionary(): > return {"a": 1} > > magic_share_module.share("shared_dictionary", > creator.create_dictionary) > while

Re: webscrapping ringcentral.com using mechanize

2009-12-18 Thread r0g
shrini wrote: > Hi, > > I am trying to scrap the website 'http://service.ringcentral.com' > > It has a form with three input boxes. > > When trying to get the form with mechanize, it is throwing the > following error. > > mechanize._mechanize.FormNotFoundError: no form matching name 'login' >

Re: ftplib timeout in Python 2.4

2009-12-17 Thread r0g
Nico Grubert wrote: >> I don't know of one so you may need a workaround. What platforms do you >> need to support? > > Suse Linux Enterprise 10, 64 Bit with Python 2.4.4. > I need the Python 2.4.4 for a running application Server (Zope). OK, then one approach would be to use signals.alarm(timeo

Re: ftplib timeout in Python 2.4

2009-12-17 Thread r0g
Nico Grubert wrote: > Hi there, > > The ftplib has a timeout parameter in Python 2.6 and above. > Is there a way to set a timeout in Python 2.4? > > Regards > Nico I don't know of one so you may need a workaround. What platforms do you need to support? Roger. -- http://mail.python.org/mailman

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread r0g
pdlem...@earthlink.net wrote: > I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". > On my desktop I dual boot with XP - Ubuntu and have Python on both. > Unfortunately all my Python programs are written on Windows XP and > I heavily rely on WConio for console I/O. > Called Apple tech

Re: regex help

2009-12-16 Thread r0g
Gabriel Rossetti wrote: > Hello everyone, > > I'm going nuts with some regex, could someone please show me what I'm > doing wrong? > > I have an XMPP msg : > > > > Does someone know what is wrong with my expression? Thank you, Gabriel Gabriel, trying to debug a long regex in situ can be a

Re: Wrapping paper, anyone ?

2009-12-16 Thread r0g
bartc wrote: > > "simon" wrote in message > news:a50b1c21-287b-498d-a8c3-51a3a2f94...@k9g2000vbl.googlegroups.com... >> #!/usr/bin/env python >> >> from math import * >> >> from random import * >> >> import cairo >> from cairo import Context > > What's cairo? > > A vector graphics library.

Re: Wrapping paper, anyone ?

2009-12-16 Thread r0g
simon wrote: > On Dec 17, 12:36 am, r0g wrote: >> Peter Otten wrote: >>> simon wrote: >>> Nice :) >>> --- stars.py2009-12-16 10:52:49.553505036 +0100 >>> +++ stars_fixed.py 2009-12-16 10:53:32.545786454 +0100 >>> @@ -48,7 +48,9 @

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread r0g
J Kenneth King wrote: > Steven D'Aprano writes: > >> On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: >> >>> Hear, hear! >> That's all very well, but some languages and techniques encourage the >> programmer to write bad code. > > That's just BS. > > Bad code doesn't just write itself

Re: Wrapping paper, anyone ?

2009-12-16 Thread r0g
Peter Otten wrote: > simon wrote: > > Nice :) > > --- stars.py2009-12-16 10:52:49.553505036 +0100 > +++ stars_fixed.py 2009-12-16 10:53:32.545786454 +0100 > @@ -48,7 +48,9 @@ > def __init__(self): > self.calls = [] > > -__getattr__ = ScribeCall > +def __getattr__(s

Re: pyZui - anyone know about this?

2009-12-16 Thread r0g
David Roberts wrote: > PyZUI 0.1 has been released: > > http://da.vidr.cc/projects/pyzui/ > Cool, thanks :) Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread r0g
r0g wrote: > Gabriel Genellina wrote: >> En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi >> escribió: >> >>> I've googled, found where cookies are supposed to be, the folders and >>> files >>> don't exist. I've opened my latest a

  1   2   >