Re: Difference between 'is' and '=='

2006-03-27 Thread Antoon Pardon
Op 2006-03-27, Donn Cave schreef <[EMAIL PROTECTED]>: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > ... >> So - your conclusion is basically right: use is on (complex) objects, not on >> numbers and strings and other built-ins. The exception from the rule is >

Re: Obtaining the remote ip address

2006-03-27 Thread Alvin A. Delagon
Thanks a lot Justin! ^_^ -- http://mail.python.org/mailman/listinfo/python-list

Re: Nevow LivePage tutorial

2006-03-27 Thread Tim Parkin
Mir Nazim wrote: > I really appriciate the help a lot, the but the problems is that i have > already real those. What i was looking for was some kind of detailed > tutorial, that explains the basic ideas about live page and > formhandling etc. > (my be it the time some nevow know guy got onto it)

embed notepad into a frame widget

2006-03-27 Thread Matt
all, trying to load an application (notepad for instance) and have it sit inside a Python application window. When the main window maximises or minimises, the (notepad) app follows. I am pretty sure I need to use a frame widget under tkinter (win32) but not exactly sure how to do it. I can ma

Re: Obtaining the remote ip address

2006-03-27 Thread Ben Finney
"Alvin A. Delagon" <[EMAIL PROTECTED]> writes: > I have a python cgi script running behind a CGI server which is also > built using python using CGIHTTPServer module. How can my cgi script > obtain the remote ip address? The CGI specification lists a number of environment variables that are set

Re: tkinter question

2006-03-27 Thread Eric Brunel
On 27 Mar 2006 15:15:05 -0800, <[EMAIL PROTECTED]> wrote: > Hi > > I have a tkinter question. In the following script the window will not > display until the script has finished executing. It appears at the same > time as the output "script finished". How can I make it appear > immediately, with t

Re: Difference between 'is' and '=='

2006-03-27 Thread alex23
Felipe Almeida Lessa wrote: > I said [constants defined in your code] can (maybe "should"?) be used with > "is", and > AFAICT I'm right as well: > >>> b = a > >>> b is a > True You should _never_ use 'is' to check for equivalence of value. Yes, due to the implementation of CPython the behaviour y

Re: Nevow LivePage tutorial

2006-03-27 Thread Mir Nazim
I really appriciate the help a lot, the but the problems is that i have already real those. What i was looking for was some kind of detailed tutorial, that explains the basic ideas about live page and formhandling etc. (my be it the time some nevow know guy got onto it) -- http://mail.python.org

Re: CGI redirection: let us discuss it further

2006-03-27 Thread Sybren Stuvel
Dennis Lee Bieber enlightened us with: > I suspect the desired function may be browser specific, since it > sounds like one would need to "pop" a history record to remove the > "redirect" page from the list... That's only if you think from the browser's point of view. An internal redirect goes unn

Re: Obtaining the remote ip address

2006-03-27 Thread Justin Ezequiel
os.environ['REMOTE_ADDR'] os.environ['REMOTE_HOST'] -- http://mail.python.org/mailman/listinfo/python-list

How to inplement Session in CGI

2006-03-27 Thread Sullivan WxPyQtKinter
Python disappointly failed to provide a convinient cgi session management module. Not willing to use external modules, I would like to implement a simplest Session object on my own. The basic problem is: how could a python CGI program understand several requests are in the same session? Definately

Re: __slots__

2006-03-27 Thread Klaas
David wrote: > 3. What is a simple example of a Pythonic use of __slots__ that does NOT > involved the creation of **many** instances. mu. Your question presupposes the existence of such an example. -Mike -- http://mail.python.org/mailman/listinfo/python-list

Obtaining the remote ip address

2006-03-27 Thread Alvin A. Delagon
One quick question: I have a python cgi script running behind a CGI server which is also built using python using CGIHTTPServer module. How can my cgi script obtain the remote ip address? -- http://mail.python.org/mailman/listinfo/python-list

How do clients(web browser) close a python CGI program that is not responding?

2006-03-27 Thread Sullivan WxPyQtKinter
Hi,there. Sometimes a python CGI script tries to output great quantities of HTML responce or in other cases, it just falls into a dead loop. How could my client close that CGI script running on the server? I tried to use the STOP button in the web browser button, but it does not work. In addition,

To my clients force to terminate a python CGI program?

2006-03-27 Thread Sullivan WxPyQtKinter
Hi,there. Sometimes a python CGI script tries to output great quantities of HTML responce or in other cases, it just falls into a dead loop. How could my client close that CGI script running on the server? I tried to use the STOP button in the web browser button, but it does not work. In addition,

Re: doctest, unittest, or if __name__='__main__'

2006-03-27 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I have noticed some distinctly funny and confused feelings I get when > using the unittest module, stuff that feels clunky and odd about how it > is set-up, however I thought that this was just due to *my personal* > lack of understanding of the d

Re: Plone or TurboGears for Intranet

2006-03-27 Thread m . wanstall
Forgot to mention the ease of deployment using Apache (well basically LAMP) would be a big bonus, just because I trust and am familiar with Apache. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner's question: executing scripts under Win XP pro

2006-03-27 Thread Roger Upole
"Jean-Claude Garreau" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I'm a beginner with python 2.4. I use it on Win XP Pro. I have no problems > with the GUI IDLE, but > when I copy the instructions in a script file, say 'test.py' and double click > on the file, I have ju

Plone or TurboGears for Intranet

2006-03-27 Thread m . wanstall
Hi all, Just wondering which technology would best suit the development of custom intranets in general, things that may be industry specific would need to be included (say for an industrial design company the addition of internal memos and even extrememly business specific apps such as simple inve

Re: what is the the best way to express following:

2006-03-27 Thread Felipe Almeida Lessa
Em Seg, 2006-03-27 às 18:43 -0800, James Stroud escreveu: > Here is a suggestion > > todo = {(int, long):abc, (str,):afg, (tuple, list):ijk} > todo[type(key)]() Maybe... todo = {(int, long): abc, basestr: afg, (tuple, list): ijk} (y for x,y in todo.iteritems() if isinstance(key, x)).next()() Fo

how to capture os.execvp into variable

2006-03-27 Thread s99999999s2003
hi i am using this code to run a ps command in unix def run(program, *args): pid = os.fork() if not pid: os.execvp(program, (program,) + args) return os.wait()[0] run("ps", "-eo pid,ppid,args") It runs fine, but i wish to store the results into a variablehow can i do thi

Re: doctest, unittest, or if __name__='__main__'

2006-03-27 Thread Benji York
Terry Hancock wrote: > When you get > into stickier stuff like graphics and web programming, the > formal structure of pyunit can be easier to adapt than > something which is intrinsically based on string processing. As pointed out earlier in this thread, Zope 3 has embraced doctests in a big way

Re: what is the the best way to express following:

2006-03-27 Thread James Stroud
AndyL wrote: > James Stroud wrote: > >> Here is a suggestion >> >> todo = {(int, long):abc, (str,):afg, (tuple, list):ijk} >> todo[type(key)]() > > > > Is not that a shortcut? I have got "KeyError" exception ... No, I hit send too soon, mixing ideas in my head. Paul McGuire's answer is the wa

Re: instantiate a class with a variable

2006-03-27 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > >>> class Foo: > ... pass > ... > >>> foo_name = 'foo' Dang. As Cameron Laird points out, this should be >>> foo_name = 'Foo' each time. Moral of the story: if the example already works, and then you cut and paste into the messag

Re: Difference between 'is' and '=='

2006-03-27 Thread Felipe Almeida Lessa
Em Seg, 2006-03-27 às 21:05 -0500, Dan Sommers escreveu: > Right off the top of my head, I can't think of a way to make "a = b; a > is b" return False. Sorry for being so --quiet. I will try to be more --verbose. I can think of two types of constants: 1) Those defined in the language, like True,

Re: what is the the best way to express following:

2006-03-27 Thread AndyL
Paul McGuire wrote: > "AndyL" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >>if type(key).__name__ == "int" or type(key).__name__ == "long": >> abc() >>elif type(key).__name__ == "str": >> efg() >>elif type(key).__name__ == "tuple" or type(key).__name__ == "list": >> i

Re: what is the the best way to express following:

2006-03-27 Thread AndyL
James Stroud wrote: > Here is a suggestion > > todo = {(int, long):abc, (str,):afg, (tuple, list):ijk} > todo[type(key)]() Is not that a shortcut? I have got "KeyError" exception ... -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the the best way to express following:

2006-03-27 Thread James Stroud
AndyL wrote: > if type(key).__name__ == "int" or type(key).__name__ == "long": > abc() > elif type(key).__name__ == "str": > efg() > elif type(key).__name__ == "tuple" or type(key).__name__ == "list": > ijk() > > > In other words I need to determinie intiger type or string or []/() in

Re: what is the the best way to express following:

2006-03-27 Thread Paul McGuire
"AndyL" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > if type(key).__name__ == "int" or type(key).__name__ == "long": > abc() > elif type(key).__name__ == "str": > efg() > elif type(key).__name__ == "tuple" or type(key).__name__ == "list": > ijk() > > > In other words

Re: detecting drives for windows and linux

2006-03-27 Thread Alex Martelli
Florian Diesch <[EMAIL PROTECTED]> wrote: ... > >> are and want to do it anyway?) Linux puts the whole file system > >> (including mounted iPods, ISOs and NTFS drives) in one hierarchy. > > > > Yes, but you may still want to distinguish (because, for example, hard > > linking doesn't work acros

what is the the best way to express following:

2006-03-27 Thread AndyL
if type(key).__name__ == "int" or type(key).__name__ == "long": abc() elif type(key).__name__ == "str": efg() elif type(key).__name__ == "tuple" or type(key).__name__ == "list": ijk() In other words I need to determinie intiger type or string or []/() in elegant way, possibly with

Re: doctest, unittest, or if __name__='__main__'

2006-03-27 Thread [EMAIL PROTECTED]
Hi there Christopher, I was wondering if you (or anyone reading this ) could quickly summarize the ways in which unittest is unpythonic, or point me to somewhere which discusses this. Is this 'consensus opinion' or mainly your own opinion? Is there a summary somewhere (in addition to the Zen of

Re: instantiate a class with a variable

2006-03-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: >"John" <[EMAIL PROTECTED]> writes: >> class foo: >> def method(self): >> pass >> >> x='foo' >> >> Can I use variable x value to create an instance of my class? > >You seem to be asking "is it possible to call an obj

Re: Difference between 'is' and '=='

2006-03-27 Thread Dan Sommers
On Mon, 27 Mar 2006 11:08:36 -0300, Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: > Em Seg, 2006-03-27 às 08:23 -0500, Dan Sommers escreveu: >> On Mon, 27 Mar 2006 14:52:46 +0200, >> Joel Hedlund <[EMAIL PROTECTED]> wrote: >> >> > ... According to PEP8 (python programming style guidelines) you

Leo Outliner Python/Tkinter Tcl/Tk Issues

2006-03-27 Thread aditya . siram
Hi all, I recently found the Leo Outliner Tool (http://webpages.charter.net/edreamleo/front.html)written in Python and installed it on my Windows PC at work and my Debian and Ubuntu PC's at home. On my Linux installs, however, the application is jumpy. When scrolling down a long document in Leo, th

freeze.py and GTK apps

2006-03-27 Thread kristian . hermansen
After freezing a PYGTK app, I am unable to run it. It this a common problem, because I could not find any documentation on it at all. I tried freezing this example, which gets by the make as well, but running it results in a failure. This is on Ubuntu Linux: http://www.moeraki.com/pygtktutorial/

Re: instantiate a class with a variable

2006-03-27 Thread Ben Finney
"John" <[EMAIL PROTECTED]> writes: > class foo: > def method(self): > pass > > x='foo' > > Can I use variable x value to create an instance of my class? You seem to be asking "is it possible to call an object whose name is stored in a string". The answer is yes:: >>> class Foo:

instantiate a class with a variable

2006-03-27 Thread John
Hi, is it possible to instantiate a class with a variable. example class foo: def method(self): pass x='foo' Can I use variable x value to create an instance of my class? Thanks, John -- http://mail.python.org/mailman/listinfo/python-list

Re: New-style Python icons

2006-03-27 Thread Robin Becker
Steven Bethard wrote: > Robin Becker wrote: >> Steven Bethard wrote: >> ... > > Can you see an icon with a blue and yellow plus on your desktop? ;) > > STeVe no -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Caching my DB

2006-03-27 Thread Siah
Helpful Hints Ivan. Thanks for the points. Sia -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with looping, i suppose

2006-03-27 Thread John Salerno
[EMAIL PROTECTED] wrote: > Ok I felt a little bad for my quick answer, these just seem like > homework problems. NP. I appreciate your help. These are just little exercises I found online, just to give me a reason to use Python. :) -- http://mail.python.org/mailman/listinfo/python-list

tkinter question

2006-03-27 Thread linuxnooby
Hi I have a tkinter question. In the following script the window will not display until the script has finished executing. It appears at the same time as the output "script finished". How can I make it appear immediately, with the output "script finished" appearing 5 seconds later. cheers Dave

Re: Difference between 'is' and '=='

2006-03-27 Thread Rene Pijlman
Terry Reedy: >The Python specification allows but does not require such behind-the-scenes >implementation optimization hacks. As released, CPython 2.4 caches -5 to >99, I believe. In 2.5, the upper limit was increased to 256. The limits >are in a pair of #define statements in the int object s

Re: pysqlite

2006-03-27 Thread Ben Finney
Kent Johnson <[EMAIL PROTECTED]> writes: > Kent Johnson wrote: >> I sent pysqlite-2.0.4.win32-py2.4.exe > > Well tried, anyway, someone between OP and me is blocking zip and > exe attachements. Good thing too. Please don't send files as attachments in email; it enables the malware propagation sys

Re: "For" loop and list comprehension similarity

2006-03-27 Thread Terry Reedy
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: >> Do you think this discussion is a proof that the following principle >> got violated, or do you think that "loop with condition" is not such an >> atomic thing to be subject to this: "There sh

Re: Difference between 'is' and '=='

2006-03-27 Thread Erik Max Francis
Terry Reedy wrote: > The Python specification allows but does not require such behind-the-scenes > implementation optimization hacks. As released, CPython 2.4 caches -5 to > 99, I believe. In 2.5, the upper limit was increased to 256. The limits > are in a pair of #define statements in the i

Re: ANN: uuid-0.1 Released

2006-03-27 Thread Ben Finney
"Jürgen Urner" <[EMAIL PROTECTED]> writes: > uuid is a python module to generate RFC 4122 compatible UUIDs > > Somehow this module was missing in python, so I took over the > struggle with the C sources and all those quirky bits and bytes. I strongly encourage you to look at this patch for uuid t

Re: Difference between 'is' and '=='

2006-03-27 Thread Terry Reedy
"Clemens Hepper" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's strange: python seem to cache constants from 0 to 99: The Python specification allows but does not require such behind-the-scenes implementation optimization hacks. As released, CPython 2.4 caches -5 to 99, I

Re: Accessing func_name from inside a function

2006-03-27 Thread Eyal Lotem
Scott David Daniels wrote: > Eyal Lotem wrote: >> By the way, the "real" problem here is referencing by name, rather than >> using "true" references. Which is the result of using a textual language. >> The "real" solution would be to store real-references to the function and >> only present the na

Re: Problems writing to file

2006-03-27 Thread Bernard Lebel
Hello everyone! I seem to have found the problem! In my program, I have "print" commands. These print commands are turned off only when the "noprint" command line argument is supplied. When the Linux service launched the program, it was not using the "noprint" argument. When I started using it,

Getting Python to show ATL & MFC Dialogs

2006-03-27 Thread solid . snake . 84
In my ATL Class, I have a function with the body STDMETHODIMP CSimpleObj::Show() { AFX_MANAGE_STATE(AfxGetStaticModuleState()) // TODO: Add your implementation code here CSimpleDialog myDialog; int result = myDialog.DoModal(); MessageBox(NULL,TEXT("Live From Python"),

Re: object references

2006-03-27 Thread DrConti
Hi Bruno, hi folks! thank you very much for your advices. I didn't know about the property function. I learned also quite a lot now about "references". Ok everything is a reference but you can't get a reference of a reference... I saw a lot of variations on how to solve this problem, but I find a

Re: OT: unix newbie questions

2006-03-27 Thread Inyeol Lee
On Sat, Mar 25, 2006 at 03:45:56AM -0800, Gerard Flanagan wrote: [...] > * If I want to do : > > mv mypackage-1.0.2.tar.gz subdir/mypackage-1.0.2.tar.gz > > then tab-completion gives me the first occurrence of the file, but I > have to type the second occurrence - is there a way of

Re: problems with looping, i suppose

2006-03-27 Thread Scott David Daniels
John Salerno wrote: > Here's another question that is related: > > while True: > year = raw_input('Enter year (or other character to quit): ') > try: > year = int(year) > except NameError: > break > ... > raw_input() > > This works as expected, except that if you e

Re: pysqlite

2006-03-27 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 abcd wrote: > anyone have v2.x of pysqlite that I could download? the website is > down for a hardware upgrade with no date as to when it will be back. [...] The plan is for the complete upgrade to happen tonight. - -- Gerhard -BEGIN PGP SIGNATU

Re: Where does Python look for libraries?

2006-03-27 Thread Robert Kern
Jesus Rivero - (Neurogeek) wrote: > Python has sys.path > If you want to add dirs into your PYTHONPATH add them to sys.path The OP seems to be asking about C libraries dynamically linked to extension modules, not Python libraries. > ACB wrote: >>>I have been trying to get the gdmodule installed a

Re: python -U problem for 2.4.3c1 on Windows 2000 (was Does -U option really exist?)

2006-03-27 Thread Martin v. Löwis
Petr Prikryl wrote: > I did observe the problem when using the -U > option on Windows 2000. Seems like some infinite > recursion in cp1250.py -- see below. > > I did not try it with earlier versions of Python. > > Can this be reproduced on your computer? I can't try right now. However, I can r

Re: pysqlite

2006-03-27 Thread Kent Johnson
Kent Johnson wrote: > abcd wrote: > anyone have v2.x of pysqlite that I could download? the website is down for a hardware upgrade with no date as to when it will be back. >>> >>I need v 2.x for windows, running python v2.4 > > > I sent pysqlite-2.0.4.win32-py2.4.exe Well tried, a

Re: CGI redirection: let us discuss it further

2006-03-27 Thread I V
Sullivan WxPyQtKinter wrote: > 1. Are there any method (in python of course) to redirect to a web page > without causing a "Back" button trap(ie, when user click the back > button on their web browser, they are redirect to their current page, > while their hope is probably to go back to the last pa

Re: Where does Python look for libraries?

2006-03-27 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Python has sys.path If you want to add dirs into your PYTHONPATH add them to sys.path Jesus Rivero - (Neurogeek) ACB wrote: > I have been trying to get the gdmodule installed and have run into > an issue. When I import gd I get the following error.

[ANN] Dabo 0.6 released

2006-03-27 Thread Ed Leafe
It has been a while since the last release of Dabo (version 0.5.1 back in January), but we haven't been standing still. A big reason for the long span was PyCon Dallas back in February, which involved lots of preparation beforehand, as well as lots of work after from the great respo

Re: pysqlite

2006-03-27 Thread Kent Johnson
abcd wrote: >>>anyone have v2.x of pysqlite that I could download? the website is >>>down for a hardware upgrade with no date as to when it will be back. >>> >> > > I need v 2.x for windows, running python v2.4 I sent pysqlite-2.0.4.win32-py2.4.exe Kent -- http://mail.python.org/mailman/listin

[ANN] jsonrpclib for accessing JSON-RPC from python

2006-03-27 Thread matt
Folks- I've created some python code for accessing JSON-RPC (think xmlrpc but replace XML with JSON). I've written an article about it here: http://developer.spikesource.com/wiki/index.php/Article:Accessing_JSON-RPC_with_Python Let me know if you have any questions or feedback. I also have a qu

Re: What is Caching my DB

2006-03-27 Thread Ivan Voras
Siah wrote: > I just launched my django site for a client. My problem is something > is caching my db data in a bizzar way. Here are some of the behaviours > I get: > > - I login, and every other page it makes me login again for a 5 minutes > or so and then it remembers that I am logged in. > -

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-27 Thread Chris F Clark
Yes, there is literature on the generating side of the regular expression/FSM model. In fact, the matching problem and the generating problems are exactly equivalent. A slight variation of the definition of how a matcher works, turns it into a generator and vice versa. To directly generate (rath

Re: Newbie Dictionary from tuples

2006-03-27 Thread Felipe Almeida Lessa
Em Seg, 2006-03-27 às 14:26 -0500, Tommy Grav escreveu: > I have two tuples: keys and subjects. How do I construct a dictionary > using these two tuples? dict(zip(keys, subjects)) -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with looping, i suppose

2006-03-27 Thread John Salerno
Gary wrote: > 0 Alignment problem with the "except" clause. > As I'm sure you've already discovered, Python is "whitespace > sensitive". Wow, I'm really confused. As it turns out, whitespace *was* the problem, but it looks no different now (as it works) than it did then (when it didn't work

Re: What is Caching my DB

2006-03-27 Thread Siah
Sorry, this post had to go on Django Users group. I'll post it there. You may ignore this post here. Sia -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C wrapper question

2006-03-27 Thread Dave Mandelin
Shi, Jue wrote: > Hello, Gurus, > > I have a question on wrapping C function in Python. > > > My C code is like this: > > typedef void (WINAPI *myCallBack) (unsigned int myarg1, unsigned int myarg2) > > bool myfunc(myCallBack callfunc) > > > Now I want to call myfunc in Python, what should I do?

Re: Please help me to resolve this issue

2006-03-27 Thread Dave Mandelin
Yanping Zhang wrote: > Hello everyone, > > I am pretty new in python. Please give me any idea about > this issue: > > There is a function like this in my c dll: > > typedef void (WINAPI *myCallBack) (unsigned int myarg1, unsigned int myarg2) > > bool myfunc(myCallBack mycall) > > > In my python co

Linux developer with Python and Perl

2006-03-27 Thread forusa99
I have a 6 months contract position open in one of my client sites at San Jose, CA. Here is the job description: General Linux Application Developer: Job Description: Develop a wide variety of user space features using C, Java, Python, Perl, and various shell scripts. Development includes, wr

Re: detecting drives for windows and linux

2006-03-27 Thread Florian Diesch
[EMAIL PROTECTED] (Alex Martelli) wrote: > Max <[EMAIL PROTECTED]> wrote: > >> BWill wrote: >> >> > oh, I wasn't expecting a single solution for both platforms, just some >> > good solutions >> > >> > thanks >> >> Are you aware that this idea is somewhat foreign to Linux? (Maybe you >> are and

Re: problems with looping, i suppose

2006-03-27 Thread Gary
John -- I looked at your exercise. As it appears in my browser, there appear to be a couple of problems with the bottom "While" block. 0 Alignment problem with the "except" clause. As I'm sure you've already discovered, Python is "whitespace sensitive". If it looks like a block, it is; other

Re: front end GUI

2006-03-27 Thread [EMAIL PROTECTED]
I have done a few GUI apps in python. I like many started with tKinter. tKinter is quick, easy, ugly and limited. It did really well for little programs I wrote for my wife, like a shopping cart, and some quick admin tools for clients. Now I'm a big wxPython fan. wxPython has a small learning cu

Re: problems with looping, i suppose

2006-03-27 Thread [EMAIL PROTECTED]
Ha, you found it all before I could fire it up. The whitespace thing is very odd, and it took about a month before I was comfortable using it for scope. On the bright side, scope errors are a lot easier to find than you might think, once you get used to looking at py code. I thought, if your in t

Newbie Dictionary from tuples

2006-03-27 Thread Tommy Grav
I have two tuples: keys and subjects. How do I construct a dictionary  using these two tuples?CheersTommy[EMAIL PROTECTED]http://homepage.mac.com/tgrav/"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the

Re: problems with looping, i suppose

2006-03-27 Thread [EMAIL PROTECTED]
Ok I felt a little bad for my quick answer, these just seem like homework problems. first problem - it's scope. (there are two scope errors in the sample) white space is meaningful. get consistent with tabs or spaces, or choose an editor that replaces tab press with space. It'll make life a lot

Re: New-style Python icons

2006-03-27 Thread Steven Bethard
Robin Becker wrote: > Steven Bethard wrote: > ... >>> >>> http://www.doxdesk.com/img/software/py/icons.zip >> >> I just wanted to say that I've been using these icons for almost a >> week now and I love them! I'd like to reiterate EuGeNe's request that >> these go into the Python 2.5 relea

Re: problems with looping, i suppose

2006-03-27 Thread John Salerno
John Salerno wrote: > I think it has to do with the exception I'm using. For the leap year > program, it should be ValueError. For the other one, its' a combination > of that and the input function. Hmm, turns out something was wrong with the indentation of the second while loop! Even though i

Re: maximum() efficency

2006-03-27 Thread Steve R. Hastings
On Mon, 27 Mar 2006 07:50:01 -0800, Arne Ludwig wrote: > Just for completeness: The functions in Steve's original post named > maximum calculate the minimum. Er, yes. I benchmarked them but clearly I should have function-tested them as well. Here is, I hope, my last word on maximum(). It figu

win32com: error 80004005

2006-03-27 Thread ago
I am trying to make the win32com HelloWorld server work with a VBA client but I get: Run-time error '-2147467259(80004005)': Automation error Unspecified error I googled for the error but the suggested solutions (commenting out _reg_class_spec_ and putting the server on the python path) do not se

Re: problems with looping, i suppose

2006-03-27 Thread John Salerno
[EMAIL PROTECTED] wrote: > Just barely looked the code answer: > check you scope on the second try block. > > if that doesn't work... > I'll read it for real :) > > Try PyDev plugin with eclipse - it's served me fairly well, but I did > come from Java - so I'm an eclipse fan already. > I think

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 27)

2006-03-27 Thread Peter Otten
QOTW: "Testing real examples in doctstrings, or external documentation like tutorials, is important because it's very frustrating for people reading the docs if the examples don't work as advertised." - Marc Rintsch "If you don't document what the sundry variables are FOR, you're really not docume

What is Caching my DB

2006-03-27 Thread Siah
I just launched my django site for a client. My problem is something is caching my db data in a bizzar way. Here are some of the behaviours I get: - I login, and every other page it makes me login again for a 5 minutes or so and then it remembers that I am logged in. - I add a record, it reflect

Re: object references

2006-03-27 Thread Scott David Daniels
DrConti wrote: > I need a variable alias ( what in other languages you would call "a > pointer" (c) or "a reference" (perl)) Or, you think you need it. > I read some older mail articles and I found that the offcial position > about that was that variable referencing wasn't implemented because > i

Re: problems with looping, i suppose

2006-03-27 Thread [EMAIL PROTECTED]
Just barely looked the code answer: check you scope on the second try block. if that doesn't work... I'll read it for real :) Try PyDev plugin with eclipse - it's served me fairly well, but I did come from Java - so I'm an eclipse fan already. -- http://mail.python.org/mailman/listinfo/python-

Re: problems with looping, i suppose

2006-03-27 Thread John Salerno
John Salerno wrote: > Here's an exercise I was doing to guess a number from 1-100. Here's another question that is related: while True: year = raw_input('Enter year (or other character to quit): ') try: year = int(year) except NameError: break if (year % 4 =

Re: object references

2006-03-27 Thread bruno at modulix
Steven D'Aprano wrote: > On Sat, 25 Mar 2006 21:33:24 -0800, DrConti wrote: > > >>Dear Python developer community, >>I'm quite new to Python, so perhaps my question is well known and the >>answer too. >> >>I need a variable alias ( what in other languages you would call "a >>pointer" (c) or "a r

Re: problems with looping, i suppose

2006-03-27 Thread John Salerno
John Salerno wrote: > Here's an exercise I was doing This might help: import random number = random.choice(range(1, 100)) tries = 0 while True: try: guess = input('Enter a number between 1 and 100: ') break except NameError: print 'Invalid number\n' co

problems with looping, i suppose

2006-03-27 Thread John Salerno
Here's an exercise I was doing to guess a number from 1-100. Just for fun (ha ha) I decided to add some error checking too, and now when I run it, the DOS prompt flashes real quick and disappears. At first, I had just the top try/except block and not the second one, and that worked (as far as i

Re: pysqlite

2006-03-27 Thread abcd
Dennis Lee Bieber wrote: > On 27 Mar 2006 10:17:21 -0800, "abcd" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > anyone have v2.x of pysqlite that I could download? the website is > > down for a hardware upgrade with no date as to when it will be back. > > > Source o

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-27 Thread funkyj
Going in a slightly different direction ... There has been lots of published work on how to create efficient FSMs from regexps. Generally these FSMs are used for pattern matching (i.e. "does string 's' match regexp 'e'?"). Is there any corresponding literature on the topic addressed by the OP's

Re: CGI redirection: let us discuss it further

2006-03-27 Thread Sybren Stuvel
Sullivan WxPyQtKinter enlightened us with: > 1. Are there any method (in python of course) to redirect to a web > page without causing a "Back" button trap(ie, when user click the > back button on their web browser, they are redirect to their current > page, while their hope is probably to go back

pysqlite

2006-03-27 Thread abcd
anyone have v2.x of pysqlite that I could download? the website is down for a hardware upgrade with no date as to when it will be back. I checked sourceforge but there are no files there to download. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: front end GUI

2006-03-27 Thread Diez B. Roggisch
DataSmash schrieb: > I'm looking for software to create a simple GUI to execute python code > for users in the office. > The GUI would need a couple text boxes for user input and some option > buttons and check boxes. > Can anyone recommend free software that doesn't require a huge learning > curve

Re: Difference between 'is' and '=='

2006-03-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: ... > So - your conclusion is basically right: use is on (complex) objects, not on > numbers and strings and other built-ins. The exception from the rule is > None - that should only exist once, so > > foo is not None >

Re: using a perl mod

2006-03-27 Thread Paddy
There is also:PyPerl at: http://search.cpan.org/dist/pyperl/perlmodule.pod But you need to check if it is current. - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: using a perl mod

2006-03-27 Thread Paddy
Don't know if there is a way to call perl from Python but the perl inline python module allows you to call perl from python from within an outer perl interpreter. Thts what I make of the following anyway: http://aspn.activestate.com/ASPN/CodeDoc/Inline-Python/Python.html - Paddy. -- http://m

Re: Difference between 'is' and '=='

2006-03-27 Thread filipwasilewski
Clemens Hepper wrote: > It's strange: python seem to cache constants from 0 to 99: That's true. The Python api doc says that Python keeps an array of integer objects for all integers between -1 and 100. See http://docs.python.org/api/intObjects.html. This also seems to be true for integers from -5

CGI redirection: let us discuss it further

2006-03-27 Thread Sullivan WxPyQtKinter
I am now programming python scripts for CGI environment. The redirection has been discussed in this forum for over one hundred times. I have seen most of them, but still have some questions: 1. Are there any method (in python of course) to redirect to a web page without causing a "Back" button tra

  1   2   >