Moving Places, Subtracting from slices/lists

2005-06-01 Thread Mark Sargent
Hi All, playing around with the tut now. How can I get this code to remove the original instance of 'roof'.? >>> hotcat = ['Cat', 'roof', 'on', 'a', 'hot', 'tin'] >>> for x in hotcat[:]: ... if x == 'roof': hotcat.insert(6,x) ... >>> hotcat ['Cat', 'roof', 'on', 'a', 'hot', 'tin', 'roof']

Re: creating a hex value

2005-06-01 Thread Peter Otten
John Machin wrote: >> delim = chr(0x15) > > Ooooh -- a function with a constant arg; I wonder what that evaluates to? > > >>> chr(0x15) > '\x15' > > Shsh. OK, let's double-check that: >>> chr(0x15) 'The argument is constant -- but not necessarily the /function/.' >>> Shsh :-) Peter

Re: Software licenses and releasing Python programs for review

2005-06-01 Thread poisondart
If this thread has shown anything it is I'm a bit green with respect to software licenses, but the other thing is that I consider myself as an isolated case and I wanted to know if there were others who wanted the same thing as me. I'm curious to know what the money that open source or GPL'd proje

Re: Performance Issues please help

2005-06-01 Thread Peter Otten
PyPK wrote: > I was testing this piece of code and it takes about 24-30 seconds to do > a look up on a list(m) of size 1000x1000 > m -> list of size 1000x1000 > import time > print time.ctime() > box = {} > for r,row in enumerate(m): > for c,e in enumerate(row): > if box.has_key(e): >

Re: scripting browsers from Python

2005-06-01 Thread Stephen Thorne
On 31 May 2005 00:52:33 -0700, Michele Simionato <[EMAIL PROTECTED]> wrote: > I would like to know what is available for scripting browsers from > Python. > For instance, webbrowser.open let me to perform GET requests, but I > would like > to do POST requests too. I don't want to use urllib to emul

Re: scripting browsers from Python

2005-06-01 Thread Olivier Favre-Simon
On Wed, 01 Jun 2005 22:27:44 +, John J. Lee wrote: > Olivier Favre-Simon <[EMAIL PROTECTED]> writes: > >> On Tue, 31 May 2005 00:52:33 -0700, Michele Simionato wrote: >> >> > I would like to know what is available for scripting browsers from >> > Python. > [...] >> ClientForm http://wwwsea

Unicode string in exec()

2005-06-01 Thread Shrii
1.I read a unicode file by using codec 2.I want to pass that string to exec() statement 3.But one of my character (U+0950) in that string is not showing properly in the output got by that exec() statement could anyone help me to get proper output. ? somesh -- http://mail.python.org/mailman/lis

Re: What are OOP's Jargons and Complexities?

2005-06-01 Thread Ray Dillinger
Matthias Buelow wrote: > And btw., I haven't used Pascal in a dozen years but my latest info is > that Turbo Pascal still lives in the form of "Delphi" for the Windows > platform. Surely not "dead" as I understand it. There's also FreePascal, which compiles approximately the same language as Tur

Weekly Python Patch/Bug Summary

2005-06-01 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 344 open ( +2) / 2845 closed ( +6) / 3189 total ( +8) Bugs: 916 open (-20) / 5014 closed (+40) / 5930 total (+20) RFE : 191 open ( +2) / 163 closed ( +4) / 354 total ( +6) New / Reopened Patches __ Optimizat

Re: dictionaries and threads

2005-06-01 Thread Tim Peters
[Gary Robinson] > I know the Global Interpreter Lock ensures that only one python thread > has access to the interpreter at a time, which prevents a lot of > situations where one thread might step on another's toes. Not really. The CPython implementation's C code relies on the GIL in many ways t

Re: Beginner question: Logs?

2005-06-01 Thread Elliot Temple
On Jun 1, 2005, at 9:04 PM, Svens wrote: > Hey thanks... > > Still getting an error message though. Here's what i'm doing: > -- > import math > log10(15625) > -- > -It says that log10 is not defined, but it is since the module is > imported, right? do either import math math.log10(1562

Re: Beginner question: Logs?

2005-06-01 Thread Stephen Prinster
Svens wrote: > Hey thanks... > > Still getting an error message though. Here's what i'm doing: > -- > import math > log10(15625) > -- > -It says that log10 is not defined, but it is since the module is > imported, right? > try this: import math math.log10(15625) -- http://mail.python.

Re: Beginner question: Logs?

2005-06-01 Thread Robert Kern
Svens wrote: > Hey thanks... > > Still getting an error message though. Here's what i'm doing: > -- > import math > log10(15625) > -- > -It says that log10 is not defined, but it is since the module is > imported, right? No, read the tutorial. import math math.log10(15625) -- Robert K

Re: Beginner question: Logs?

2005-06-01 Thread Svens
Hey thanks... Still getting an error message though. Here's what i'm doing: -- import math log10(15625) -- -It says that log10 is not defined, but it is since the module is imported, right? -- http://mail.python.org/mailman/listinfo/python-list

Re: The need to put "self" in every method

2005-06-01 Thread spinach
>Explicit is better than implicit. import sarcasm def whatAboutMyImplicitModuleMethod() -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle alternative

2005-06-01 Thread Paul Rubin
[EMAIL PROTECTED] writes: > It appears to work faster than pickle, however, the decode process is > much slower (5x) than the encode process. Has anyone got any tips on > ways I might speed this up? I think you should implement it as a C extension and/or write a PEP. This has been an unfilled need

Re: Information about Python Codyng Projects Ideas

2005-06-01 Thread Casey Hawthorne
The slightly slower startup time makes no difference for apps running 24 hours a day, except when reloading changed source modules! I imagine reloading modules is also slower -- but I could be mis t ak en! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner question: Logs?

2005-06-01 Thread Robert Kern
Svens wrote: > Hey everyone! I'm a math student working on a short script involving > logs. I have a function on my scientific calculator, and was wondering > if there was a similar funtion in python. > > For example: > > (log65536)/(log4)= 8 > > I've searched around a bit and haven't been able

Beginner question: Logs?

2005-06-01 Thread Svens
Hey everyone! I'm a math student working on a short script involving logs. I have a function on my scientific calculator, and was wondering if there was a similar funtion in python. For example: (log65536)/(log4)= 8 I've searched around a bit and haven't been able to find anything. Thanks! -Ch

Re: anygui,anydb, any opinions?

2005-06-01 Thread Skip Montanaro
>> Are we talking about a drag-and-drop GUI builder? Thomas> I am! >> What about Glade? Thomas> Dying to try that. Ask me again in a week. I use Glade at work on a regular basis. Took me a few days to get proficient, and it has some warts, but it sure beats the heck out of manu

Re: any macro-like construct/technique/trick?

2005-06-01 Thread alex23
Mac wrote: > * using >def debug_emit(obj): >if debug: >emit_dbg_obj(obj) > is a poor solution, because it *always* instantiates DbgObj*, even when > not needed; I want to avoid such unnecessary waste Rather than passing in an instantiated object and only operating on it if

Re: any macro-like construct/technique/trick?

2005-06-01 Thread Andrew Dalke
Mac wrote: > After I wrote my post I realized I didn't provide enough context of > what I'm doing, [explanation followed] I have a similar case in mind. Some graph algorithms work with a handler, which is notified about various possible events: "entered new node", "doing a backtrack", "about to l

Re: dictionaries and threads

2005-06-01 Thread Paul Rubin
Gary Robinson <[EMAIL PROTECTED]> writes: > As far as I can tell, if the Python bytecodes that cause dictionary > modifications are atomic, then there should be no problem. But I don't > know that they are because I haven't looked at the bytecodes. Depending on behavior like that is asking for

Re: PySol not working on WinXP, SP2

2005-06-01 Thread Skip Montanaro
Ivan> Nope. The pyc files don't match the py files, and he imports the Ivan> pyc files directly. That's what 'imp.load_compiled("__main__", Ivan> sys.argv[0])' means. The windows version that Markus shipped Ivan> never included the .py files anyway, since he didn't need them. Iv

Re: Rss lib in python?

2005-06-01 Thread Owen
lihui <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Please use feedparser: > > http://feedparser.org/ > > 2005/6/1, Grant Edwards <[EMAIL PROTECTED]>: > > On 2005-06-01, Owen <[EMAIL PROTECTED]> wrote: > >=20 > > > i want to know some rss library in python.For example, some

Re: anygui,anydb, any opinions?

2005-06-01 Thread Skip Montanaro
>> Apparently, most Python people feel productive enough without such a >> tool. Thomas> As did many with Fortran. Or Cobol. Are we now so productive Thomas> that there is no longer an unmet need for new/better software? Thomas> Do we stop here? Is Python a comfortable place

dictionaries and threads

2005-06-01 Thread Gary Robinson
Hi, I know the Global Interpreter Lock ensures that only one python thread has access to the interpreter at a time, which prevents a lot of situations where one thread might step on another's toes. But I'd like to ask about a specific situation just to be sure I understand things relative to

Re: Python as client-side browser script language

2005-06-01 Thread Paul Rubin
Greg Ewing <[EMAIL PROTECTED]> writes: > If the DOM objects are implemented as built-in Python > types, there shouldn't be any difficulty with that. > Python objects have complete control over which attributes > can be read or written by Python code. No, they don't. See the sorry history of the r

Re: any macro-like construct/technique/trick?

2005-06-01 Thread Andrew Dalke
Mac wrote: > Is there a way to mimic the behaviour of C/C++'s preprocessor for > macros? There are no standard or commonly accepted ways of doing that. You could do as Jordan Rastrick suggested and write your own sort of preprocessor, or use an existing one. With the new import hooks you can pro

viewing generated images

2005-06-01 Thread Tim Flynn
Hi, I'm trying to write a simple image viewer using Tkinter and ImageTk from the PIL toolkit. The images are stored in memory and I don't want to create temporary files for them. My code looks like this : from Tkinter import * import Image import ImageTk class Viewer(Frame):

Re: pickle alternative

2005-06-01 Thread mdoukidis
Running stest.py produced these results for me: marshal enc T: 12.5195908977 marshal dec T: 0.134508715493 sencode enc T: 3.75118904777 sencode dec T: 5.86602012267 11.9369997978 0.109000205994 True Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Notice the slow "m

Re: any macro-like construct/technique/trick?

2005-06-01 Thread Mac
After I wrote my post I realized I didn't provide enough context of what I'm doing, hence it is not quite clear to any readers why the heck I would want this. The gist is this. I have a number of algorithms that perform the same task. I'm trying to assess which ones work better under which circum

Re: Like a star, I burn bright, dissipating into the night.

2005-06-01 Thread Peter "Shaggy" Haywood
Groovy hepcat Jeff_Relf was jivin' on 2 Jun 2005 00:37:41 GMT in comp.lang.c. Like a star, I burn bright, dissipating into the night.'s a bad trip! Dig it! > >Hi eprint10108, Hiding like a rat, You asked me if I was saved ? : [URL snipped.] >No, I am not, and neither are you. >You can't han

Re: Python as client-side browser script language

2005-06-01 Thread Greg Ewing
Paul Rubin wrote: > Huh? The language itself has to provide the sandbox. > Remember that scripts have to be able to see > certain DOM elements but not others, and some of them have to be > read-only, etc. If the DOM objects are implemented as built-in Python types, there shouldn't be any diffi

Re: Pressing A Webpage Button

2005-06-01 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > > I presume you can figure out how to open the URL instead of > > printing it? > > Ah, never mind. That doesn't work. Google somehow detects > you're not sending the query from a browser and bonks you. Try setting the User-agent: header to one that lo

Re: Pressing A Webpage Button

2005-06-01 Thread Grant Edwards
On 2005-06-02, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-06-01, Elliot Temple <[EMAIL PROTECTED]> wrote: > >> How do I make Python press a button on a webpage? > > You just do whatever action is specified for the form > containing the button. > >> I looked at urllib, but I only see how to

Re: Strange KeyError using cPickle

2005-06-01 Thread Tim Peters
[Tim Peters] >> What is "XWwz"? Assuming it's a bizarre typo for "open", change the >> 'w' there to 'wb'. Pickles are binary data, and files holding pickles >> must be opened in binary mode, especially since: >> >>> ... >>> (on WinXP, CPython 2.4.1) [Rune Strand] > Thanks Tim. The bizarre 'typo

Re: Pressing A Webpage Button

2005-06-01 Thread Grant Edwards
On 2005-06-01, Elliot Temple <[EMAIL PROTECTED]> wrote: > How do I make Python press a button on a webpage? You just do whatever action is specified for the form containing the button. > I looked at urllib, but I only see how to open a URL with > that. Guess what happens when you push that butt

Re: What are OOP's Jargons and Complexities?

2005-06-01 Thread Greg Ewing
Anno Siegel wrote: > These languages had an axe to grind. They were designed (by Niklas > Wirth) at a time of a raging discussion whether structured programming > (goto-less programming, mostly) is practical. Their goal was to prove > that it is, and in doing so the restrictive aspects of the lan

Re: Strange KeyError using cPickle

2005-06-01 Thread Rune Strand
[Tim Peters] > What is "XWwz"? Assuming it's a bizarre typo for "open", change the > 'w' there to 'wb'. Pickles are binary data, and files holding pickles > must be opened in binary mode, especially since: > > > ... > > (on WinXP, CPython 2.4.1) Thanks Tim. The bizarre 'typo' appears to be cause

Re: * * * Please Read And/Or Print This! * * * Press [Ctrl][P] Keys On Your Keyboard To Print >> June 1, 2004 8:23:43 pm >> http://115639.aceboard.net/forum2.php?rub=158&cat=61&login=115639&page=0#id96 << * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

2005-06-01 Thread The Ghost In The Machine
In comp.os.linux.advocacy, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote on 1 Jun 2005 17:23:05 -0700 <[EMAIL PROTECTED]>: > * * * Please ... ... go jump in a lake. [rest snipped] -- #191, [EMAIL PROTECTED] It's still legal to go .sigless. -- http://mail.python.org/mailman/listinfo/python-list

Re: any macro-like construct/technique/trick?

2005-06-01 Thread Jordan Rastrick
Is having to read two lines really that much worse than one? And the only thing you find objectionable about the most obvious solution? If so, then what's wrong with: def foo(): # do some stuff if debug: emit_dbg_obj(DbgObjFoo(a,b,c)) # do more stuff To my mind, this is no l

Re: Performance Issues please help

2005-06-01 Thread John Machin
PyPK wrote: > > I am suspecious abput dictionary approach here. Is this slower than if > i do it with arrays or lists with index of array as my key ? > "with index of array as my key" is either redundant -- indicating that your answer to my question about "e" should have included something lik

Re: plotting with Python

2005-06-01 Thread Fernando Perez
Rolf Wester wrote: > Hi, > > I have a Python console application that is intended to be used > interactively and I have to add plotting capabilities (multiple XY plots > and if possible 2D-surface plots). I'm loocking for a reasonably fast > plotting library (not GPL'ed, needs not be for free) th

Re: Performance Issues please help

2005-06-01 Thread PyPK
>Info req'd for discussing algorithm changes: >1. How much free memory do you have? - Memory is not a problem but I am working on some timing constraints.Thats is the reason I am a bit concerned abt these 30 seconds > 2. What can you tell us about the distribution of "e"? - the distribution

BUG-FIX: RUR-PLE 0.9.0.1

2005-06-01 Thread André Roberge
RUR is a Python Learning Environment, based after Pattis's Karel the robot. More details can be found at http://rur-ple.sourceforge.net Version 0.9.0.1 is a bug-fix. Version 0.9 relied on the presence of a unicode version of wxPython (version 2.6 preferred). Version 0.9.0.1 should work with

Re: prob with ActiveState and FireFox on Win32 (XP and W2K)

2005-06-01 Thread John Roth
"curtin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi, > i just downloaded the latest version of ActiveState's IDE (pywin 2.4.X) > and have noticed that i can't have firefox/ActiveState open at the same > time. if i try to create a 'new' script, the AS IDE blocks till i > te

Re: Information about Python Codyng Projects Ideas

2005-06-01 Thread Dan Christensen
M1st0 <[EMAIL PROTECTED]> writes: > I would like to join the Google summer code program > (http://code.google.com/summerofcode.html). > From the sponsored links I have choose to help The Python Software > Foundation, because I like a lot the language. I've always thought it'd be great if psyco wa

Re: Strange KeyError using cPickle

2005-06-01 Thread Tim Peters
[Rune Strand] > I'm experiencing strange errors both with pickle and cPickle in the > below code: > > > import cPickle as pickle > #import pickle > from string import ascii_uppercase > from string import ascii_lowercase > > def createData(): >d1 = list("Something's rotten") >d2 = tuple('in

Re: Performance Issues please help

2005-06-01 Thread John Machin
PyPK wrote: > I was testing this piece of code and it takes about 24-30 seconds to do > a look up on a list(m) of size 1000x1000 > m -> list of size 1000x1000 > import time > print time.ctime() > box = {} > for r,row in enumerate(m): > for c,e in enumerate(row): > if box.has_key(e): >

Re: Pressing A Webpage Button

2005-06-01 Thread jerky
hi, urllib does not work when search from google.com, since google.com have some limitations to developer , you can get more details from www.google.com/apis/ "Elliot Temple" <[EMAIL PROTECTED]> ??:[EMAIL PROTECTED] > How do I make Python press a button on a webpage? I looked at urllib,

Like a star, I burn bright, dissipating into the night.

2005-06-01 Thread Jeff_Relf
Hi eprint10108, Hiding like a rat, You asked me if I was saved ? : http://115639.aceboard.net/forum2.php?rub=158&cat=61&login=115639&page=0#id96 No, I am not, and neither are you. You can't handle reality, can't face your own mortality, so, instead of taking drugs to hallucinate, you get hig

Re: bug with isinstance() ?

2005-06-01 Thread Mac
OK, it's al coming together now, thx. Grrr... all this misconception, again, due to the evil, evil, EVIL influence of having worked a lot before with an inferior language (C/C++)... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: PySol not working on WinXP, SP2

2005-06-01 Thread Terry Reedy
"Rocco Moretti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are you sure you're using the Python version (2.3, 2.4 etc) that the > Pysol .pyw files were compiled for? As I understand it, that's what the > "magic number" is - a versioning number for the .pyc/.pyw files which > ch

Re: NSLU2 and python - a love story ?

2005-06-01 Thread Terry Reedy
"Thomas W" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > have replacement-firmware. The point is that alot of people have > modified their NSLU2, which by the way don't remove any of the > functionality of the original product as I understand it, There are two replacement firmwar

Re: prob with ActiveState and FireFox on Win32 (XP and W2K)

2005-06-01 Thread Trent Mick
[curtin wrote] > hi, > i just downloaded the latest version of ActiveState's IDE (pywin 2.4.X) > and have noticed that i can't have firefox/ActiveState open at the same > time. if i try to create a 'new' script, the AS IDE blocks till i > tear down firefox. this is on an XP and W2K box. I suspec

prob with ActiveState and FireFox on Win32 (XP and W2K)

2005-06-01 Thread curtin
hi, i just downloaded the latest version of ActiveState's IDE (pywin 2.4.X) and have noticed that i can't have firefox/ActiveState open at the same time. if i try to create a 'new' script, the AS IDE blocks till i tear down firefox. this is on an XP and W2K box. i did some digging on ActiveState

* * * Please Read And/Or Print This! * * * Press [Ctrl][P] Keys On Your Keyboard To Print >> June 1, 2004 8:23:43 pm >> http://115639.aceboard.net/forum2.php?rub=158&cat=61&login=115639&page=0#id96 << * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

2005-06-01 Thread eprint10108
* * * Please Read And/Or Print This! * * * Press [Ctrl][P] Keys On Your Keyboard To Print >> June 1, 2004 8:23:46 pm >> http://115639.aceboard.net/forum2.php?rub=158&cat=61&login=115639&page=0#id96 << * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Re: plotting with Python

2005-06-01 Thread Magnus Lyck?
Rolf Wester <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Philippe C. Martin wrote: > > Look at wxPython > I will do it, thank you for your reply. What you want specifically for the drawing in wx is probably a Device Context. (Typically a wxClientDC, but you might want to swa

Strange KeyError using cPickle

2005-06-01 Thread Rune Strand
I'm experiencing strange errors both with pickle and cPickle in the below code: import cPickle as pickle #import pickle from string import ascii_uppercase from string import ascii_lowercase def createData(): d1 = list("Something's rotten") d2 = tuple('in the state of Denmark') d3 =

Re: Case Sensitive, Multiline Comments

2005-06-01 Thread Magnus Lyck?
> > > You haven't looked very well though: there are actually quite a lot > > > of extra spaces. Still, it's nicely done indeed. > > Hmm. I only saw doubled spaces after commas and periods. > Doubled spaces after commas are definitely not standard usage. I guess the fact that *all* comments on

Performance Issues please help

2005-06-01 Thread PyPK
I was testing this piece of code and it takes about 24-30 seconds to do a look up on a list(m) of size 1000x1000 m -> list of size 1000x1000 import time print time.ctime() box = {} for r,row in enumerate(m): for c,e in enumerate(row): if box.has_key(e): params = box[e]

Re: Monitoring a USB-drive / Card-reader using python?

2005-06-01 Thread Diez B. Roggisch
Thomas W wrote: > I want to monitor a given USB-device, like a Memory Card-reader, and > when a memory card is inserted I want to move the data on the card to a > different location on the filesystem ( or do something else with the > files). > > Does anybody know how to do this ( on Linux and/or w

Re: using builtin array

2005-06-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I am constructing a packet, with the first 6 bytes being the > destination address, followed by src, and type. As I told you - use struct. > The remaining space > will be filled with data. I need to use an array because of the > buffer_info method i am calling. That's

Re: bug with isinstance() ?

2005-06-01 Thread John Machin
Mac wrote: [snip] > I guess the problem is I'm thinking of "classes" > as these abstract concepts, sort of like Platonian "forms", whereas I > should be thinking of classes as "class objects", object instances, > each coming from some module's namespace... is this sort of the idea? > Someone help

Re: bug with isinstance() ?

2005-06-01 Thread Terry Reedy
"Mac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I see, interesting. OK, I understand that recursive importing can be > problematic (having to "hide" the test2 import should have been a tip > off; it's just that in my original app this relationship is not as > clear), but what

Re: scripting browsers from Python

2005-06-01 Thread David Boddie
Michele Simionato wrote: > This looks interesting, but I need an example here. What would be the > command to open Konqueror to a given page and to post a form with given > parameters? Launch Konqueror, note the process ID (pid), and use the dcop command line tool to open the page at a specified U

Re: Function Serialization

2005-06-01 Thread Lonnie Princehouse
By default, shelve uses pickle to serialize objects.Pickle doesn't actually serialize functions... it just saves the function's name and name of its defining module, and upon loading attempts to find that function again. This is pretty much /never/ going to work the way you want it to if you'r

Re: Pressing A Webpage Button

2005-06-01 Thread John J. Lee
Elliot Temple <[EMAIL PROTECTED]> writes: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no luck. [...] You might find the FAQ list and hints below useful after you get over the initial barriers (and

Re: bug with isinstance() ?

2005-06-01 Thread John Machin
Mac wrote: > Under certain circumstances isinstance() seems to return incorrect > value for me. I'm using Python 2.3 (latest from Debian's unstable). > Here's a sample program... the multi-module nature of the code is key. Yes, it has the multi-module nature. What it needs, though, is the Buddha

Re: BUG pythonw vs subprocess

2005-06-01 Thread John J. Lee
Paul Rubin writes: > I thought pythonw didn't provide a console and so it could be that > stdin and stdout aren't connected to anything. Popen therefore doesn't > make sense. You have to use sockets or something. Yeah... I don't know about module subprocess, but I rec

any macro-like construct/technique/trick?

2005-06-01 Thread Mac
Is there a way to mimic the behaviour of C/C++'s preprocessor for macros? The problem: a lot of code like this: def foo(): # do some stuff if debug: emit_dbg_obj(DbgObjFoo(a,b,c)) # do more stuff if debug: emit_dbg_obj(DbgObjBar(d,e)) # ... and so o

Thread Stack Size

2005-06-01 Thread Hughes, Chad O
Title: Thread Stack Size I am using the threading module to create a great deal of threads. Is there any way to set the thread stack size?  It looks like each thread is being given a default stack size of 1MB.  I have looked all over and I cannot find a way to shrink the stack to a few KB.  W

python socket error

2005-06-01 Thread Thomas Thomas
Is there any getaround for the following error .. This happens when uploading large files say>50MB..   Python version Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.   Traceback (most recent

Re: scripting browsers from Python

2005-06-01 Thread John J. Lee
Olivier Favre-Simon <[EMAIL PROTECTED]> writes: > On Tue, 31 May 2005 00:52:33 -0700, Michele Simionato wrote: > > > I would like to know what is available for scripting browsers from > > Python. [...] > ClientFormhttp://wwwsearch.sourceforge.net/ClientForm/ > > I use it for automation of PO

Re: idiom for constructor?

2005-06-01 Thread Mac
This was the direction I was aiming for initially, and I have used this form before, but was hoping there was a way I could go one step further, and somehow get rid of the repetition of "self."... Heh, ideally: self.{a,b,c,d} = a,b,c,d Alas, not Python syntax... :) I do like Steven's form of

Re: NSLU2 and python - a love story ?

2005-06-01 Thread Thomas W
Well, AFAIK people are running web-sites using apache, php and mysql on it and with ok performance. I'm not saying this would replace a real server, but for normal home-use with not too much traffic it seems to do the job. It's a fact that Linksys uses a somewhat modified version of linux on the N

Re: pickle alternative

2005-06-01 Thread Reinhold Birkenfeld
[EMAIL PROTECTED] wrote: > Andrew Dalke wrote: >> This is with Python 2.3; the stock one provided by Apple >> for my Mac. > > Ahh that is the difference. I'm running Python 2.4. I've checked my > benchmarks on a friends machine, also in Python 2.4, and received the > same results as my machine. >

Re: bug with isinstance() ?

2005-06-01 Thread Mac
I see, interesting. OK, I understand that recursive importing can be problematic (having to "hide" the test2 import should have been a tip off; it's just that in my original app this relationship is not as clear), but what is the lesson I should take away from this? I mean, I was under the impres

Re: ConfigParser, mapping one key to multiple values

2005-06-01 Thread Larry Bates
I accomplish this by using the following construct with ConfigParser: [sync files] ignore_001=.*/foodir/.*\.pyc ignore_002=.*/foodir/.*~ . . . It may be a workaround, but it works just fine. It is easy to write code to handle this (not tested): section='sync files' ignore_options=[x for x in in

Re: PySol not working on WinXP, SP2

2005-06-01 Thread Rocco Moretti
Ivan Van Laningham wrote: > Hi All-- > I've been using PySol-4.40 for years, because that was the last Windows > installer version I could find. My wife's been using it for almost the > same length of time. That version's worked just fine on W98, W98SE, W2K > (server included), and WinXP SP1. >

Re: anygui,anydb, any opinions?

2005-06-01 Thread Rocco Moretti
Skip Montanaro wrote: > Thomas> The Python world lacks the phenomenally successful development > Thomas> models enjoyed by the now ancient Turbo Pascal, Delphi and > Thomas> Visual Basic. > Thomas> AND > Thomas> If the likes of Visual Basic can have it, then it becomes >

Re: BUG pythonw vs subprocess

2005-06-01 Thread Tim Roberts
Paul Rubin wrote: > >I thought pythonw didn't provide a console and so it could be that >stdin and stdout aren't connected to anything. Popen therefore doesn't >make sense. You have to use sockets or something. Exactly right. The error message is quite accurate: non-c

help with extending python

2005-06-01 Thread siddharthram
Hello, I'd appreciate some help figuring out what I might be doing wrong. I am trying to extend Python to add some modules. However, when the code appended below runs, the conversion always fails (returns -1), and I get a TypeError Thanks Siddharth So the usage is like this: >>> import PyTest_i

Re: Pressing A Webpage Button

2005-06-01 Thread Tim Roberts
Elliot Temple <[EMAIL PROTECTED]> wrote: > >How do I make Python press a button on a webpage? I looked at >urllib, but I only see how to open a URL with that. I searched >google but no luck. > >For example, google has a button how would i make a script to press that button? > >Just for fu

Re: Information about Python Codyng Projects Ideas

2005-06-01 Thread Terry Reedy
"M1st0" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have read the proposed Ideas from > > http://wiki.python.org/moin/CodingProjectIdeas > > And the more interesting for me were those about Optimization. > > MemoryUsageProfiler > ProfileReplacementProject > SpeedUpInterpreterS

Re: anygui,anydb, any opinions?

2005-06-01 Thread rzed
"Thomas Bartkus" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > "rzed" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> So what do you think? What's wrong with the picture? Why isn't >> there a greater priority to work in this direction? > > > What's wrong with the p

Re: Calculating Inflation, retirement and cost of living adjustments over 30 years

2005-06-01 Thread Roel Schroeven
rbt wrote: > Is this mathematically correct? > > > def inflation(): > start = int(str.strip(raw_input("How much money do you need each > month at the start of retirement: "))) > inflation = float(str.strip(raw_input("What will inflation average > over the next 30 years(.03, .04, etc):

Re: idiom for constructor?

2005-06-01 Thread Terry Reedy
"Mac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a nice Python idiom for constructors which would expedite the > following? > > class Foo: > def __init__(self, a,b,c,d,...): >self.a = a >self.b = b >self.c = c >self.d = d Do you like this better? sel

Re: Calculating Inflation, retirement and cost of living adjustments over 30 years

2005-06-01 Thread John Machin
rbt wrote: > Is this mathematically correct? > > > def inflation(): > start = int(str.strip(raw_input("How much money do you need each > month at the start of retirement: "))) > inflation = float(str.strip(raw_input("What will inflation average > over the next 30 years(.03, .04, etc): "

Re: The need to put "self" in every method

2005-06-01 Thread Piet van Oostrum
> [EMAIL PROTECTED] (Aahz) (A) wrote: >A> [posted & e-mailed] >A> In article <[EMAIL PROTECTED]>, >A> Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>> >>> There is. >>> Inside a method there are 3 kinds of identifiers: >>> - local ones e.g. parameters and local variables >>> - global ones (ac

Re: The need to put "self" in every method

2005-06-01 Thread Max M
Aahz wrote: > [posted & e-mailed] > Any objection to swiping this for the FAQ? (Probably with some minor > edits.) I think it is missing the most important reason, that functions can act as unbound methods. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mai

Re: bug with isinstance() ?

2005-06-01 Thread Terry Reedy
"Mac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Under certain circumstances isinstance() seems to return incorrect > value for me. I'm using Python 2.3 (latest from Debian's unstable). > Here's a sample program... the multi-module nature of the code is key. The key, which my

Re: The need to put "self" in every method

2005-06-01 Thread Max M
Terry Hancock wrote: > def __add__(a,b): > return Vector((a.x+b.x), (a.y+b.y), (a.z+b.z)) > > or something like that. I still have twinges of guilt about it, > though, and I had to write a long note in the comments, apologizing > and rationalizing a lot. ;-) Assigning self to a could have m

Re: metaclass that inherits a class of that metaclass?

2005-06-01 Thread Michael Spencer
ironfroggy wrote: > Hoping this isn't seeming too confusing, but I need to create a > metaclass and a class using that metaclass, such that one of the bases > of the metaclass is the class created with that metaclass. I can't > figure out a way to do this, even after trying to add the class as a >

Re: anygui,anydb, any opinions?

2005-06-01 Thread Thomas Bartkus
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > "Thomas Bartkus" <[EMAIL PROTECTED]> writes: > > > Given that for the most part nobody in the Python community has a > > > handle on any other Python person's paycheck, it's unlikely that > > > enough of the community

Re: What are OOP's Jargons and Complexities?

2005-06-01 Thread Matthias Buelow
Andrea Griffini wrote: >>With a few relaxations and extensions, you can get a surprisingly useful >>language out of the rigid Pascal, as evidenced by Turbo Pascal, one of >>the most popular (and practical) programming languages in the late 80ies >>/ start of the 90ies. > > It was not a language.

Re: creating a hex value

2005-06-01 Thread John Machin
[EMAIL PROTECTED] wrote: > What about > > [EMAIL PROTECTED]:~$ python > Python 2.3.5 (#2, May 4 2005, 08:51:39) > [GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > hex(21) > > '0x15' > > >>> len('0x15') 4 Quadruple sheee

Re: creating a hex value

2005-06-01 Thread John Machin
Paul Rubin wrote: > David Bear <[EMAIL PROTECTED]> writes: > >>I'm not seeing it in my python essential ref. how can I do >> >>delim = 0x15 > > > delim = chr(0x15) Ooooh -- a function with a constant arg; I wonder what that evaluates to? >>> chr(0x15) '\x15' Shsh. -- http://mail.python.

Re: bug with isinstance() ?

2005-06-01 Thread Bruno Desthuilliers
Mac a écrit : > Under certain circumstances isinstance() seems to return incorrect > value for me. I'm using Python 2.3 (latest from Debian's unstable). > Here's a sample program... the multi-module nature of the code is key. > > > === test.py === > > class Foo: > pass > > def test(): >

  1   2   3   >