Re: Access from one class to methode of other class

2005-05-26 Thread Aaron Bingham
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Thu, 26 May 2005 14:33:45 +0200, VK <"myname"@example.invalid> > declaimed the following in comp.lang.python: > >> Hi, all! >> >> In my programm i have to insert a variable from class 2 to class 1 and I >> get error NameError: global name 'd' is

Re: Strange Execution Times

2005-05-26 Thread Elliot Temple
On May 26, 2005, at 3:22 PM, John Machin wrote: > > Then post your summarised results back to the newsgroup for the > benefit of all -- there's this vague hope that folk actually read > other peoples' posts before firing off questions :-) Here is my new version. It runs in about .65 seconds.

Re: using timeit for a function in a class

2005-05-26 Thread Fredrik Lundh
"flupke" wrote: > ? i think you missed some of the code > ... > s = """ > test = TimeTest() > test.f() > """ > ... > > So the function is being called (as i said, it prints the hello message). timeit is a benchmark utility. it's supposed to call your function enough times to

Re: Python analog of Ruby on Rails?

2005-05-26 Thread Ville Vainio
> "Shane" == Shane Hathaway <[EMAIL PROTECTED]> writes: Shane> BTW, here's the proper response to that religious thread Shane> that keeps invading this list: Shane> python -c 'print sum([ord(c) for c in "HOLYBIBLE"])' Shane> I'm Christian and I think it's funny. ;-) Some bac

Re: Just remember that Python is sexy

2005-05-26 Thread Ville Vainio
> "Greg" == Greg Ewing <[EMAIL PROTECTED]> writes: >> The name index implies it returns something you can use as an index >> to get at the substring. Greg> But that's no fun -- it doesn't involve sex! Greg> How about this: "index" and "sex" both end with "ex", which Greg>

Lanunching Process from Python Script

2005-05-26 Thread Saravanan D
Hello, In windows, I am launching Python process to execute python script in the back ground. This Python script which internally launches another windows exe. Here, how do I redirect output of windows.exe to caller process. (python.exe). I would appreciate, if any one provides sample code for th

Re: Python Challenge 10?

2005-05-26 Thread Tim Peters
[Greg Ewing] > Can someone give me a hint for No. 10? My MindBlaster > card must be acting up -- I can't seem to tune into > the author's brain waves on this one. There are hints on the site; for level 10, http://www.pythonchallenge.com/forums/viewtopic.php?t=20 > I came up with what I thoug

Python Challenge 10?

2005-05-26 Thread Greg Ewing
Can someone give me a hint for No. 10? My MindBlaster card must be acting up -- I can't seem to tune into the author's brain waves on this one. I came up with what I thought was a perfectly good solution, but apparently it's wrong. :-( -- Greg Ewing, Computer Science Dept, University of Canterbu

Re: Pyrex: step in for loop

2005-05-26 Thread Greg Ewing
Luis P. Mendes wrote: > I'm trying to improve speed in a module and substituted the pythonic > 'for in range()' for 'for i from min < i < max:' > > But, I need to define a step for the i variable. How can I do it? If you want maximum clarity, I'd suggest using the for-loop to iterate over a con

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread alex23
Joe: So I gave my girlfriend some flowers. Dave: What, like tulips? John: No, no, he gave her roses. Mike: Were they red roses? Xah: You MORONS, they were JUST _flowers_! Enough with the mother fucking jargon already!! The moral of the story being that when you're not active in a specific domain,

Re: Just remember that Python is sexy

2005-05-26 Thread Greg Ewing
Duncan Booth wrote: > The name index implies it returns something you can use as an index to get > at the substring. But that's no fun -- it doesn't involve sex! How about this: "index" and "sex" both end with "ex", which is short for "exception". (Of course, you could get straight from "index

Re: dirrection for simple record keeping app.

2005-05-26 Thread nephish
wow thanks, i think i am going to check out sqlite. acce$$ is not possible because of the cash. ick. i am interested in learning the code anyway, but just want to learn python instead of javascript right now. i have a simple cgi-script working to display info to the browser (from apache) but the sc

Re: __init__() not called automatically

2005-05-26 Thread Michele Simionato
If you really want, you can customize the object system to automatically call __init__, via a custom metaclass. There is an example in my ACCU lectures (cooperative_init.py): http://www.reportlab.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip Michele Simionato -- http://mail.python.o

Re: Trouble with regexes

2005-05-26 Thread Tim Roberts
Fernando Rodriguez <[EMAIL PROTECTED]> wrote: > >I'm trying to write a regex that matches a \r char if and only if it >is not followed by a \n (I want to translate text files from unix >newlines to windows\dos). > >I tried this, but it doesn't work: >p = re.compile(r'(\r)[^\n]', re.IGNORECASE) > >i

Re: dirrection for simple record keeping app.

2005-05-26 Thread Chris Lambacher
As much as I hate to suggest anything Microsoft, you would probably save yourself a lot of work by using MS Access. That is what it is designed for. That said mySQL is probably a bit of a sledgehammer solution to the problem. If you want a database, you might want to look at SQLite. Is is prett

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread Peter Hansen
Elliot Temple wrote: > Thanks for the link on case sensitivity. I'm curious about the person > who found case sensitivity useful though: what is it useful for? I wasn't that person, but I do find case sensitivity very useful. Mainly it's useful in that it allows me not to spend any time at all

Re: Strange Execution Times

2005-05-26 Thread Peter Hansen
John Machin wrote: > Then post your summarised results back to the newsgroup for the benefit > of all -- there's this vague hope that folk actually read other peoples' > posts before firing off questions :-) +1 QOTW :-) -- http://mail.python.org/mailman/listinfo/python-list

RE: What are OOP's Jargons and Complexities?

2005-05-26 Thread Tony Meyer
[Paul Rubin] > Strong typing means there [are] a lot of variables whose names > are in ALL CAPS. +1 QOTW. =Tony.Meyer -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread Paul Rubin
Roy Smith <[EMAIL PROTECTED]> writes: > I used to have a bunch of comp sci questions I would ask interview victims. > One of them was "what does it mean when a language is strongly typed?" I > once had somebody tell me it meant the language had long variable names, > and thus took a lot of typ

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread Roy Smith
"Xah Lee" <[EMAIL PROTECTED]> wrote: > Joe: lang x is strongly typed > Dave: you mean statically typed? > John: no no, that's weakly typed. > Mike: actually, it is dynamically typed! I used to have a bunch of comp sci questions I would ask interview victims. One of them was "what does it mean wh

Re: __init__() not called automatically

2005-05-26 Thread Sakesun Roykiattisak
Wow.. Andrew Koenig.. I found your name in many c++ books I read. Never know you are hanging around in python python mailing-list. (or perhaps python newsgroup, whatever it is) Thanks for the explanation. Andrew Koenig wrote: >"Sakesun Roykiattisak" <[EMAIL PROTECTED]> wrote in message >news:

Re: What are OOP's Jargons and Complexities?

2005-05-26 Thread Xah Lee
Joe: lang x is strongly typed Dave: you mean statically typed? John: no no, that's weakly typed. Mike: actually, it is dynamically typed! rely on the morons of the IT industry, every mother fucking one of them, to sing and propagate jargons. See also: http://xahlee.org/UnixResource_dir/writ/jargo

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread John Roth
"Elliot Temple" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi I have two questions. ... > Also, why aren't there > multiline comments? Would adding them cause a problem of some sort? As a matter of fact, yes. First, consider that as soon as you have multi-line comments, som

dirrection for simple record keeping app.

2005-05-26 Thread nephish
Hey there, i have been spending some time learning python. i do enjoy it so. Heres the deal. i need some dirrection advice. i have a friend that wants me to set up a customer database for him. Easy stuff like name, phone number, email address. and current status. he also wants to be able to print t

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread Elliot Temple
Thanks for the link on case sensitivity. I'm curious about the person who found case sensitivity useful though: what is it useful for? The way I find multi-line comments useful is to quickly comment out a block of code while debugging. A good development environment can (mostly) solve that one t

Re: Symbol Tables

2005-05-26 Thread Matt
Dave Zhu wrote: > Hello, > > I would like to know more about Python's symbol > tables. How are symbol tables implemented in Python? > Hash tables, lists, or arrays? I would really > appreciate if there is any documentation that you can > provide. Thank you in advance. > > Dave > > > > ___

Re: Problem accessing Python Business Forum

2005-05-26 Thread Neil Hodgson
John: > Every time I attempt to look at the Python Business > Forum (www.python-in-business.org), I encounter an error that starts > like this: > ... Laura Creighton responded about this on python-dev: # The machine is at work, and anybody who wants to fix it # is welcome to. The problem is

Re: overflowerror!!

2005-05-26 Thread John Machin
Will McGugan wrote: > [EMAIL PROTECTED] wrote: > >> I tried that. Still get an Overflowerror: unsigned long is less than >> minimum. >> > > You'll also need to reserve enough space for the 256 ints. Try this.. > > data = array('L', '\0' * 256*4) > > I don't understand. Why not just do the who

Re: using timeit for a function in a class

2005-05-26 Thread flupke
Kent Johnson wrote: > flupke wrote: > >> >> Hi, >> >> i tried to use timeit on a function in a class but it doesn't do what >> i think it should do ie. time :) >> In stead it starts printing line after line of hello time test! >> What am i doing wrong in order to time the f function? > > > Hmm,

Symbol Tables

2005-05-26 Thread Dave Zhu
Hello, I would like to know more about Python's symbol tables. How are symbol tables implemented in Python? Hash tables, lists, or arrays? I would really appreciate if there is any documentation that you can provide. Thank you in advance. Dave __

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread John Machin
Mike Meyer wrote: > Personally, I think anyone who has two variables whose names differ > only in case should be shot. No, let me extend that - anyone who has > two variables whose names would be pronounced the same should be > shot. I've had to debug such code, and it ain't fun. Here's a pair of

Re: using timeit for a function in a class

2005-05-26 Thread flupke
Fredrik Lundh wrote: > "flupke" wrote: > > >>i tried to use timeit on a function in a class but it doesn't do what i >>think it should do ie. time :) >>In stead it starts printing line after line of hello time test! >>What am i doing wrong in order to time the f function? > > > how do you expec

Re: overflowerror!!

2005-05-26 Thread Will McGugan
[EMAIL PROTECTED] wrote: > I tried that. Still get an Overflowerror: unsigned long is less than > minimum. > You'll also need to reserve enough space for the 256 ints. Try this.. data = array('L', '\0' * 256*4) Will -- http://www.willmcgugan.com "".join( [ {'*':'@','^':'.'}.get(c,None) or chr

Re: Pyrex: step in for loop

2005-05-26 Thread Mike Meyer
"Luis P. Mendes" <[EMAIL PROTECTED]> writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > | so it's > | > | for i in range(8, 14, 1): ... > | > | > For what I've read, for i in range is slower than the other for > construct used by Pyrex: > > for i from iMin <= i < iMax

Re: Strange Execution Times

2005-05-26 Thread John Machin
Elliot Temple wrote: [copying Elliot's e-mail reply back to the list because it's educational and scarcely private] > > > > On 5/26/05, John Machin <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > > > I am running two functions in a row that do the same thing. > > > > 1. I

Re: Pyrex: step in for loop

2005-05-26 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 | so it's | | for i in range(8, 14, 1): ... | | http://enigmail.mozdev.org iD8DBQFClkmlHn4UHCY8rB8RAlUqAKCxSEkEKVIcoshTwmL7GQNK6d/j0wCgoC67 jOhuXQpnDt23SEAM9huKTQA= =8XO0 -END PGP SIGNATURE- -- http://mail.python.org/mailman/

ftplib fails when directory name contains spaces

2005-05-26 Thread Manu
Hi, ftplib fails to cwd into a directory which contains spaces in it's name.How do i correct this? Regards Manu -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex: step in for loop

2005-05-26 Thread Mike Meyer
"Luis P. Mendes" <[EMAIL PROTECTED]> writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I'm trying to improve speed in a module and substituted the pythonic > 'for in range()' for 'for i from min < i < max:' > > But, I need to define a step for the i variable. How can I do it?

Re: concurrent access to object file

2005-05-26 Thread Mike Meyer
"Frank Abel" <[EMAIL PROTECTED]> writes: > Hi again! > > I will make the question more simple: > > If two call to the "write" method of a file object "occur simultaneously " > is totally sure that the data of each call is writen successive or exist the > posibility of merge data? Youv'e asked thi

Re: Encryption with Python?

2005-05-26 Thread Paul Rubin
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> writes: > That's all. I see you took up the challenge and indirectly replied to > my last question, and in good spirit I say you earned a little respect > from me, at least for standing up to your words. Now I hope no-one > gives a try to your data

Re: staticmethod and classmethod

2005-05-26 Thread François Pinard
[Bruno Desthuilliers] > C Gillespie a écrit : > > Does anyone know of any examples on how (& where) to use > > staticmethods and classmethods? > Here's an example from a ldap lib [...] I recently had a use case for class methods while converting a PL/I program to Python: a lot of global declarat

Re: overflowerror!!

2005-05-26 Thread [EMAIL PROTECTED]
I tried that. Still get an Overflowerror: unsigned long is less than minimum. -Ashton -- http://mail.python.org/mailman/listinfo/python-list

Re: Self-modifying Code

2005-05-26 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : (snip) > Having said that, here is a good example of self-modifying code: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/68429 > > The RingBuffer class dynamically modifies itself once it is full so that > its behaviour changes. > This is nothing more than

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread Paul McNett
Mike Meyer wrote: > "Elliot Temple" <[EMAIL PROTECTED]> writes: >> Also, why aren't there >>multiline comments? Would adding them cause a problem of some sort? > > Because no one every really asked for them. After all, there are two > formats for multi-line strings, which the interpreter will bui

Problem accessing Python Business Forum

2005-05-26 Thread john67
Every time I attempt to look at the Python Business Forum (www.python-in-business.org), I encounter an error that starts like this: Site Error An error was encountered while publishing this resource. KeyError Sorry, a site error occurred. Traceback (innermost last): Module ZPublisher.Pu

Pyrex: step in for loop

2005-05-26 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm trying to improve speed in a module and substituted the pythonic 'for in range()' for 'for i from min < i < max:' But, I need to define a step for the i variable. How can I do it? for example, how do I iterate through 8 to 14 with s

Re: Encryption with Python?

2005-05-26 Thread TZOTZIOY
On Tue, 24 May 2005 10:16:15 +0200, rumours say that "Anthra Norell" <[EMAIL PROTECTED]> might have written: >Why whack someone over the head who tries to develop an idea of his own. >Such an approach isn't uncommon to earn extra credit in educational >settings. I would never whack someone over t

Re: overflowerror!!

2005-05-26 Thread Will McGugan
[EMAIL PROTECTED] wrote: > Hello, > I am trying to fill in a dword value into an array and i get an > overflowerror > > Here's what iam trying to do. > > from array import * > data = array('B', '\0' * 256) > > val = 0x > > for i in range(256): > data[i] = val > > print data > > Ho

overflowerror!!

2005-05-26 Thread [EMAIL PROTECTED]
Hello, I am trying to fill in a dword value into an array and i get an overflowerror Here's what iam trying to do. from array import * data = array('B', '\0' * 256) val = 0x for i in range(256): data[i] = val print data How do i fill in the val 256 times into the array? -Ashton

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread Mike Meyer
"Elliot Temple" <[EMAIL PROTECTED]> writes: > Hi I have two questions. Could someone explain to me why Python is > case sensitive? I find that annoying. Because it comes from a language background of case sensitive languages (C, shell, etc.). But read what the BDFL has to say about it: http://ma

concurrent access to object file

2005-05-26 Thread Frank Abel
Hi again! I will make the question more simple: If two call to the "write" method of a file object "occur simultaneously " is totally sure that the data of each call is writen successive or exist the posibility of merge data? where I can find information about this? Thank in advance Frank

Re: Access from one class to methode of other class

2005-05-26 Thread VK
Kent Johnson wrote: > VK wrote: > >>> On Thu, 26 May 2005 14:33:45 +0200, VK <"myname"@example.invalid> >>> declaimed the following in comp.lang.python: >>> >>> Hi, all! In my programm i have to insert a variable from class 2 to class 1 and I get error NameError: global name '

Re: using timeit for a function in a class

2005-05-26 Thread Kent Johnson
flupke wrote: > > Hi, > > i tried to use timeit on a function in a class but it doesn't do what i > think it should do ie. time :) > In stead it starts printing line after line of hello time test! > What am i doing wrong in order to time the f function? Hmm, by default Timer.timeit() calls the

Re: staticmethod and classmethod

2005-05-26 Thread Bruno Desthuilliers
C Gillespie a écrit : > Hi, > > Does anyone know of any examples on how (& where) to use staticmethods and > classmethods? > Here's an example from a ldap lib (work in progress, not finished, and all other disclaimers). The class methods are here: # ---

Re: Access from one class to methode of other class

2005-05-26 Thread Kent Johnson
VK wrote: >> On Thu, 26 May 2005 14:33:45 +0200, VK <"myname"@example.invalid> >> declaimed the following in comp.lang.python: >> >> >>> Hi, all! >>> >>> In my programm i have to insert a variable from class 2 to class 1 >>> and I get error NameError: global name 'd' is not defined. How do I >>>

Re: Strange Execution Times

2005-05-26 Thread Elliot Temple
hey FYI i found the problem: i accidentally copied an output file for my test data. so all the passwords were exactly 32 chars long. so when replacing them with new 32 char passwords, it went much much faster, I guess because the list kept the same number of chars in it and didn't have to copy l

Re: "...Learning with Python" ...a property that addition andmultiplication have...

2005-05-26 Thread Steven Bethard
GMane Python wrote: > string repetition can not repeat a value negative times: > 'hello' * -3 is invalid. Well, it's not invalid: py> 'a' * -1 '' py> 'a' * -42 '' but you could definitely say that S * N1 == S * N2 does not imply that N1 == N2 STeVe -- http://mail.python.org/mailman/l

Re: vim configuration for python

2005-05-26 Thread Gary Johnson
In comp.editors DJK <[EMAIL PROTECTED]> wrote: > Does anybody know of any scripts to check python syntax when you type > :make? The problem I had doing this with Python was that the Python interpreter spits out errors in the opposite order from that in which I wanted to traverse them in vim's qu

Re: __init__() not called automatically

2005-05-26 Thread Bruno Desthuilliers
Roy Smith a écrit : > bruno modulix <[EMAIL PROTECTED]> wrote: > >>I've always explicitelly used the (implied) 'this' pseudo-pointer in >>Java, C++ etc. The wart is in all those languages that don't makes it >>mandatory IMHO !-) > > > And the correlary wart in Python is that the first argument

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread Philippe C. Martin
Hi, A1: because some people find it very useful ? I know I do A2: they exist: """ Regards, Philippe Elliot Temple wrote: > Hi I have two questions. Could someone explain to me why Python is > case sensitive? I find that annoying. Also, why aren't there > multiline comments? Would adding

Re: Design problem...need some ideas

2005-05-26 Thread Mudcat
bump Anyone? I don't need code. Just widgets and a compass for the right direction. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe problems with win32com [ EnsureDispatch('ADODB.Connection') ]

2005-05-26 Thread Mudcat
I'm not positive about this, but when using com you need to force it into the compile. In my applications where I use Excel I use this line: python setup.py py2exe --progid "Excel.Application" You may need to do something similar for the db application. -- http://mail.python.org/mailman/listinf

Case Sensitive, Multiline Comments

2005-05-26 Thread Elliot Temple
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some sort? Thanks, Elliot -- http://mail.python.org/mailman/listinfo/python-list

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Scott David Daniels
Don wrote: > I wrote this 'which' function for Linux, but I think if you changed the ':' > character, it would work on Windows (I think its a ';' on Windows, but I > can't remember): Why remember when os.pathsep will do it for you. However, for windows you need a bit more: def which(command):

Re: Q: "...Learning with Python" ...a property that addition and multiplication have...

2005-05-26 Thread Paul Rubin
[EMAIL PROTECTED] writes: > question is, "Can you think of a property that addition and > multiplication have that string concatenation and repetition do not?" > > I thought it was the commutative property but ""*3 is > equivalent to 3*"". Any ideas? Um, string concatenation is not commutative.

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Jp Calderone
On Thu, 26 May 2005 11:53:04 -0700, Don <[EMAIL PROTECTED]> wrote: >Steven Bethard wrote: > >> This has probably been answered before, but my Google skills have failed >> me so far... >> >> Is there an os independent way of checking to see if a particular >> executable is on the path? Basically wh

Re: win32clipboard.GetClipboardData() return string with null characters

2005-05-26 Thread [EMAIL PROTECTED]
It appears to me that some applications put extra garbage data into the clipboard. win32clipboard may have faithfully returning all of them. I use this application to show the clipboard content: import win32clipboard, win32con def getWinClipboardText(): win32clipboard.OpenClipboard() d=

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Trent Mick
> > In Windows, I can read the error file, and get something like: > > "'' is not recognized as an internal or external > > command,\noperable program or batch file.\n" > > and I'm sure I could parse this, but this seems fragile, and clearly os > > dependent. http://starship.python.net/crew/tmick/

Re: "...Learning with Python" ...a property that addition andmultiplication have...

2005-05-26 Thread GMane Python
The inablility to work with negative values. Addition can do the following: 5 + (-4) read as 5 plus the value negative four. Multiplication can do the following: 5 * (-1) read as 5 times the value negative one. String concatination can not subtract the sub-string 'lo' from 'hello'. 'hello' - 'l

Re: os independent way of seeing if an executable is on the path?

2005-05-26 Thread Don
Steven Bethard wrote: > This has probably been answered before, but my Google skills have failed > me so far... > > Is there an os independent way of checking to see if a particular > executable is on the path? Basically what I want to do is run code like: > i, o, e = os.popen3(executable_n

[ANNOUNCE] Twenty-fifth release of PythonCAD now available

2005-05-26 Thread Art Haas
I'm pleased to announce the twenty-fifth development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually exceed feat

Re: Intellisense and the psychology of typing

2005-05-26 Thread Jason Gurtz
On 5/26/2005 12:31, [EMAIL PROTECTED] wrote: > 1) Intellisense is really just another crutch that does more harm than > good? To me I found the intellisense in VS for C++ was somewhat helpful in my earliest stage of learning where I had to look up how many args a function had. After a while, I

Re: converting jpg to pdf

2005-05-26 Thread Larry Bates
You use PIL (Python Imaging Library) if you want simple conversion or ReportLab if you want to combine several along with text, etc. -larry Raghul wrote: > Hi friends > Is it possible to convert jpg to pdf in python. I need a > program to convert jpg format file to pdf. Is there any

Re: urllib2 and SSL

2005-05-26 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > Thanks for the tip... how *does* all of the other Win32 apps handle > SSl w/o installing OpenSSL? Do they bundle it and only use it for > themselves? That seems foolish. Mozilla has its own SSL stack. IE uses one built into wininet, I think. -- http://mail.pytho

Re: [PATCH] add offset argument to mmap

2005-05-26 Thread Fredrik Lundh
Christopher Li wrote: > I am surprised to find out the mmap module in python always > mmap from offset 0. So I just hack up some patch to allow it > accept offset arguments. patches posted to the newsgroup are likely to be ignored or forgotten. patches posted to the patch tracker http://sou

Re: File list from listdir or shell?

2005-05-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Unluckily, to capture the stdout I have to redirect it to a file... > I hoped that this could work ... > lF=sys.stdin.readline(os.system("ls -1 *.py")) hint: look up "os.popen" and "subprocess" in the library reference. -- http://mail.python.org/mailman/listinfo/p

Re: Store doctest verbose results to a variable

2005-05-26 Thread Fredrik Lundh
"mitchell" <[EMAIL PROTECTED]> wrote: > Is it possible to store doctest's verbose output to a variable? > > For example: > > import doctest, my_test_module > a = doctest.testmod(my_test_module) > > The contents of 'a' is the tuple of passed and failed results. I tried > passing verbose mode to

[PATCH] add offset argument to mmap

2005-05-26 Thread Christopher Li
I am surprised to find out the mmap module in python always mmap from offset 0. So I just hack up some patch to allow it accept offset arguments. So here it is. Chris Add optional offset argument to mmap module. Test on linux with Python 2.4. The windows code is totally untested. Signed-Off-b

Majordomo results: {Filename?} HELLO

2005-05-26 Thread majordomo-owner
Warning: This message has had one or more attachments removed The command "Warning:" is invalid. Use the "help topics" command to see a list of valid commands. Discarded 3 line(s) of unrecognized text. Valid commands processed: 0 0 succeeded, 0 stalled, and 0 failed. Use the following c

os independent way of seeing if an executable is on the path?

2005-05-26 Thread Steven Bethard
This has probably been answered before, but my Google skills have failed me so far... Is there an os independent way of checking to see if a particular executable is on the path? Basically what I want to do is run code like: i, o, e = os.popen3(executable_name) but I'd like to give an info

Re: Intellisense and the psychology of typing

2005-05-26 Thread [EMAIL PROTECTED]
my opinion is that if you find it useful, use it. if you don't then don't... either way, its up to you to decide what's useful and what's not. don't ask us. Try it out yourself. -- http://mail.python.org/mailman/listinfo/python-list

Re: Access from one class to methode of other class

2005-05-26 Thread VK
> On Thu, 26 May 2005 14:33:45 +0200, VK <"myname"@example.invalid> > declaimed the following in comp.lang.python: > > >>Hi, all! >> >>In my programm i have to insert a variable from class 2 to class 1 and I >>get error NameError: global name 'd' is not defined. How do I get access >>to d.entry

Re: Access from one class to methode of other class

2005-05-26 Thread Simon Brunning
On 5/26/05, VK <[EMAIL PROTECTED]> wrote: > That is not real code, only dummy describing the problem We realise that. The problem is that there are problems in your dummy in addition to the real problems, and we can't tell them apart. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonl

Store doctest verbose results to a variable

2005-05-26 Thread mitchell
Is it possible to store doctest's verbose output to a variable? For example: import doctest, my_test_module a = doctest.testmod(my_test_module) The contents of 'a' is the tuple of passed and failed results. I tried passing verbose mode to the testmod function, but 'a' is still a tuple. Any

Re: Access from one class to methode of other class

2005-05-26 Thread VK
> VK wrote: > >>Hi, all! >> >>In my programm i have to insert a variable from class 2 to class 1 and I >>get error NameError: global name 'd' is not defined. > > > Looking at your code snippet, I think you have a lot of other errors > before. > > >>class 1: >> self.entry = Entry(self.entryf

Intellisense and the psychology of typing

2005-05-26 Thread andrew . queisser
Yesterday I typed in some C++ code that called a function with two ints. Intellisense (auto-complete) helpfully told me that the first formal parameter was called "frontLight" and the second "ringLight". It occurred to me that I'm getting some semantic help here on top of the obvious type safety. I

Re: Just remember that Python is sexy

2005-05-26 Thread Duncan Booth
Sion Arrowsmith wrote: >>The name index implies it returns something you can use as an index to >>get at the substring. > > Unfortunately, -1 can of course be used as an index. Mind you, it > would be perverse to expect to find the substring at it. > That was my point. The returned index always

Re: Access from one class to methode of other class

2005-05-26 Thread bruno modulix
VK wrote: > Hi, all! > > In my programm i have to insert a variable from class 2 to class 1 and I > get error NameError: global name 'd' is not defined. Looking at your code snippet, I think you have a lot of other errors before. > > class 1: >self.entry = Entry(self.entryframe) NameError

Re: __init__() not called automatically

2005-05-26 Thread John Abel
bruno modulix wrote: >Paul McNett wrote: > > >>Sriek wrote: >> >> >> >(snip) > > >>>Similarly, why do we have to explicitly use the 'self' keyword >>>everytime? >>>This is closer to a wart, IMO, >>> >>> > > > Here's one of the shorter threads discussing 'self'. I remember one lo

Re: Access from one class to methode of other class

2005-05-26 Thread bruno modulix
VK wrote: >> I don't know if your're actually calling the classes '1' and '2', but >> that's a really bad idea! >> >> >>> class 2: >>> def ins(self) >>> d.entry.insert(variable) >> >> >> >> This is probably where you're getting the NameError. d is not defined, >> so calling d.entry will gen

Re: __init__() not called automatically

2005-05-26 Thread Roy Smith
bruno modulix <[EMAIL PROTECTED]> wrote: > I've always explicitelly used the (implied) 'this' pseudo-pointer in > Java, C++ etc. The wart is in all those languages that don't makes it > mandatory IMHO !-) And the correlary wart in Python is that the first argument to a method is not required to b

Re: Python analog of Ruby on Rails?

2005-05-26 Thread Shane Hathaway
George Sakkis wrote: > "Christopher J. Bottaro" wrote: > > >>Cool signature, can anyone do a Python one that I can leech? =) >> >>-- C >> > > > Here's the transliteration in python for your address: > > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) > for p

Re: __init__() not called automatically

2005-05-26 Thread bruno modulix
Paul McNett wrote: > Sriek wrote: > (snip) >> Similarly, why do we have to explicitly use the 'self' keyword >> everytime? > > > This is closer to a wart, IMO, I've always explicitelly used the (implied) 'this' pseudo-pointer in Java, C++ etc. The wart is in all those languages that don't make

Re: Automatically populate and submit HTML Forms

2005-05-26 Thread rbt
Grant Edwards wrote: > On 2005-05-25, rbt <[EMAIL PROTECTED]> wrote: > >>How can I make a python client script connect to a Web server and >>automatically populate form fields and then submit the form? >> >>For example, say I wanted to check and see if 1924 was a leap year... >>how would I popul

Re: Python analog of Ruby on Rails?

2005-05-26 Thread bruno modulix
George Sakkis wrote: > "Christopher J. Bottaro" wrote: > > >>Cool signature, can anyone do a Python one that I can leech? =) >> >>-- C > > > Here's the transliteration in python for your address: > > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) > for p in

Re: Python analog of Ruby on Rails?

2005-05-26 Thread bruno modulix
Christopher J. Bottaro wrote: > bruno modulix wrote: > (snip) > > Cool signature, can anyone do a Python one that I can leech? =) You mean this ?-) python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- bruno desthuilliers python -c

SCF Bundle released

2005-05-26 Thread Philippe C. Martin
Dear all, I am very happy to announce the release of SCFB: a python development toolkit for Smart Cards. SCFB comes with all necessary tools to easily get a Smart Card application running. SCFB also includes the necessary Smart Card and their software interface. SCFB is the tool we use to deve

Re: Improve the performance of a loop

2005-05-26 Thread querypk
Actually slicing the way you suggested improved it to some extent. I did profile on this and I observed that it reduced the number of calls for __get_item__ and improved the timing to some extent. Which was useful to some extent. Thanks again. -- http://mail.python.org/mailman/listinfo/python-li

Re: vim configuration for python

2005-05-26 Thread DJK
Does anybody know of any scripts to check python syntax when you type :make? -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatically populate and submit HTML Forms

2005-05-26 Thread Grant Edwards
On 2005-05-26, Grant Edwards <[EMAIL PROTECTED]> wrote: >> How can I make a python client script connect to a Web server and >> automatically populate form fields and then submit the form? > Just use urllib() and pass the form data to the urlopen() > method. If given data, it will generate a "P

  1   2   >