Creating a torrent file & associated tracker through a django web app

2012-11-20 Thread ashish
Hi c.l.p folks Following is a description of what i am trying to achieve : The user should log into a django web app, select a file & the web app should generate a .torrent file & a private tracker(http://IP_ADDRESS:PORT_NUMBER/announce) for that .torrent file. Basically, i want to programmati

Suitable software stacks for simple python web service

2012-11-20 Thread Kev Dwyer
Hello List, I have to build a simple web service which will: - receive queries from our other servers - forward the requests to a third party SOAP service - process the response from the third party - send the result back to the original requester >From the point of view of the requester, th

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Wed, 21 Nov 2012 17:35:27 +1100, Chris Angelico wrote: > And yet, trivial though it may seem, function naming in a permanent API > is pretty important. Threads like this can be the difference between > coherent and useful APIs and veritable piles of excrement. "There are only two hard problem

Re: 10 sec poll - please reply!

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 4:25 PM, rh wrote: > To counter your question. 10 sec. poll for the name for the law that > states that people will discuss/argue the most over those things > having little or no significance. You mean bikeshedding? Parkinson's Law of something-or-other... not the Law of

Re: Getting a seeded value from a list

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 2:47 PM, Steven D'Aprano wrote: > On Wed, 21 Nov 2012 14:41:24 +1100, Chris Angelico wrote: > >> However, this still means that the player will see the exact same level >> regenerated every time, absolutely fresh. As previously stated in this >> thread, that's not usually a

Re: Getting a seeded value from a list

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 1:18 PM, wrote: > Each time the player goes from 'Foo' to 'Bar' (or vice versa), make_map > randomly generates a new layout for either level. > > What I'd like to do is select values from 'levelSeed' and assign them to the > levels that make_map generates so that the pla

Re: Getting a seeded value from a list

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 18:18:17 -0800, frednotbob wrote: > The problem, in a nutshell, is this: > > When the player starts a new game, make_map() randomly generates level > 'Foo' as the player's starting floor. Floor 'Bar' is similarly > generated as the player descends from 'Foo' to 'Bar. > > Ea

moving object along circle

2012-11-20 Thread sparx10
I'm trying to move an object along a circle (orbit), and I did come up with this: radius = 100 from math import sqrt for x in range(-radius,radius): y = sqrt(radius**2-x**2) print(x, y) however it moves faster at the beginning and end of the range (y value changes faster than x value) b

Re: 10 sec poll - please reply!

2012-11-20 Thread Alan Bawden
Since the event being generated is commonly called a "keystroke", and since my dictionary defines the noun "stroke" as being: "the act of striking", a good verb to choose for the action itself would seem to be "strike": strike('a') -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a seeded value from a list

2012-11-20 Thread frednotbob
> >The former can be generated from the seed each >time you enter the level; the latter must be generated the first time then >stored. > Random.random() is already populating the levelSeed list; I've set it as part of new_game() so that any time the player begins a new game, the levelSeed list

Re: Re: 10 sec poll - please reply!

2012-11-20 Thread Evan Driscoll
On 11/20/2012 05:46 PM, Alan Meyer wrote: On 11/20/2012 11:29 AM, mherrmann...@gmail.com wrote: > ... generate_keystrokes? ... Not bad. "gen_keystrokes", or even "keystrokes" might also do. I would emphatically vote "no" for "keystrokes". That's a noun, not a verb. What does it do? Tell you

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote: > The source of bugs is not excessive complexity in a method, just > excessive lines of code. Taken literally, that cannot possibly the case. def method(self, a, b, c): do_this(a) do_that(b) do_something_else(c) def method(self

Re: 10 sec poll - please reply!

2012-11-20 Thread Tim Chase
On 11/20/12 19:20, Steven D'Aprano wrote: > *Accidental* shadowing of names is a bad thing, because you get > unexpected bugs. *Deliberate* shadowing is not. We're all > consenting adults here, if somebody calls "from module import > type", and shadows the builtin type, that's their right to shoot

Re: proxy??

2012-11-20 Thread Jorge Alberto Diaz Orozco
When I try to open facebook or search something using google it is just not working. gives me forbidden or not found errors. that's why I think the problem is about the headers of the request. On 20/11/12 15:29, Joshua Landau wrote: On 20 November 2012 14:48, Jorge Alberto Diaz Orozco mailto:j

Re: 10 sec poll - please reply!

2012-11-20 Thread Tim Chase
On 11/20/12 19:17, Steven D'Aprano wrote: > On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote: >> Just to add one more to the pot, Vim uses "feedkeys()" for a similar >> purpose. > > What does it feed to the keys? In Vim's case, the signature would be something like def feedkeys(str, mode='m

Re: Problem with subprocess.call and windows schtasks

2012-11-20 Thread Dave Angel
On 11/20/2012 06:41 PM, Tom Borkin wrote: (Please don't top-post. Now we lose all the context) > Using shlex, I now have this: > #!\Python27\python > import os, subprocess > path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2", > "htdocs", "ccc", "run_alert.py") > #subprocess.ca

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 21:08:24 +, Prasad, Ramit wrote: >> I believe that your initial instinct for the name of this function was >> correct. It automates typing, so you should call it "type" or (for >> those paranoid about shadowing the built-in, "type_str". >> >> > I can too easily see somebo

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote: > On 11/20/12 06:18, Michael Herrmann wrote: >> am having difficulty picking a name for the function that simulates key >> strokes. I currently have it as 'type' but that clashes with the >> built-in function. > > Just to add one more to the po

Re: Greedy parsing of argparse/positional arguments

2012-11-20 Thread Joshua Landau
On 20 November 2012 10:02, Johannes Bauer wrote: > Hi list, > > I have a problem with Python3.2's argparse module. The following sample: > > parser = argparse.ArgumentParser(prog = sys.argv[0]) > parser.add_argument("-enc", metavar = "enc", nargs = "+", type = str, > default = [ "utf-8" ]) > pars

Re: 10 sec poll - please reply!

2012-11-20 Thread Tim Chase
On 11/20/12 06:18, Michael Herrmann wrote: > am having difficulty picking a name for the function that > simulates key strokes. I currently have it as 'type' but that > clashes with the built-in function. Just to add one more to the pot, Vim uses "feedkeys()" for a similar purpose. -tkc -- ht

Re: 10 sec poll - please reply!

2012-11-20 Thread Alan Meyer
On 11/20/2012 11:29 AM, mherrmann...@gmail.com wrote: > ... generate_keystrokes? ... Not bad. "gen_keystrokes", or even "keystrokes" might also do. I suggest using a name that is unique enough that you can grep through piles of code and find where it's used. "type" fails that test. "genera

Re: Problem with subprocess.call and windows schtasks

2012-11-20 Thread Tom Borkin
Using shlex, I now have this: #!\Python27\python import os, subprocess path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2", "htdocs", "ccc", "run_alert.py") #subprocess.call(['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"', '/TR', path, '/ST', '23:50']) subprocess.call(['Sc

RE: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Prasad, Ramit
brint...@controlledthinking.com wrote: > > On Tuesday, November 20, 2012 2:41:58 PM UTC-8, Prasad, Ramit wrote: > > brintoul at controlledthinking.com wrote: > > > > Apologies, I misread your question. > > > > According to the imaplib docs, you can subclass IMAP4 and override > > `IMAP4.open` to c

Re: Encoding conundrum

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 2:49 PM, Daniel Klein wrote: > With the assistance of this group I am understanding unicode encoding issues > much better; especially when handling special characters that are outside of > the ASCII range. I've got my application working perfectly now :-) > > However, I am

Re: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread brintoul
On Tuesday, November 20, 2012 2:41:58 PM UTC-8, Prasad, Ramit wrote: > brintoul at controlledthinking.com wrote: > > Apologies, I misread your question. > > > > According to the imaplib docs, you can subclass IMAP4 and override > > `IMAP4.open` to create the socket and bind it to the desired

Re: Encoding conundrum

2012-11-20 Thread Dave Angel
On 11/20/2012 04:49 PM, Daniel Klein wrote: > With the assistance of this group I am understanding unicode encoding > issues much better; especially when handling special characters that are > outside of the ASCII range. I've got my application working perfectly now > :-) > > However, I am still co

RE: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Prasad, Ramit
brint...@controlledthinking.com wrote: > > > I have a multihomed machine that I would like to run the Python imaplib's > > > IMAP4 client on. I would like to be > > > able to specify which interface the underlying socket will bind to as its > > > source address. How could I best do > > > this?

Re: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 9:00 AM, wrote: > On Tuesday, November 20, 2012 1:48:46 PM UTC-8, Chris Angelico wrote: >> On Wed, Nov 21, 2012 at 8:14 AM, wrote: >> >> > I have a multihomed machine that I would like to run the Python imaplib's >> > IMAP4 client on. I would like to be able to specify

Re: Yet another Python textbook

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 8:55 AM, Mark Lawrence wrote: > On 20/11/2012 21:00, Chris Angelico wrote: >> >> >> To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393 >> strings. Take no notice; the rest of the world sees this as a huge >> advantage. Python is now in a VERY small group of la

Managing multiple packages

2012-11-20 Thread Evan Driscoll
I have perhaps a bit of a silly question, but I'm interested in what people do for workflow when actively developing multiple Python modules at once (for a single project). Suppose I have packages A-C. In addition to being modules in the Python sense, they are logically distinct, probably sit in d

Re: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread brintoul
On Tuesday, November 20, 2012 1:59:34 PM UTC-8, Prasad, Ramit wrote: > brintoul at controlledthinking.com wrote: > > > > > > Hello: > > > > > > I have a multihomed machine that I would like to run the Python imaplib's > > IMAP4 client on. I would like to be > > > able to specify which inte

Re: How to use the python to do the unit test

2012-11-20 Thread Mark Lawrence
On 20/11/2012 17:40, yujian4newsgr...@gmail.com wrote: I write a mfc application, then I want to use the python to test this application. just as user click that button. Please tell me how to write the python application? Easy, open your favourite editor and start typing, what's the proble

Re: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread brintoul
On Tuesday, November 20, 2012 1:48:46 PM UTC-8, Chris Angelico wrote: > On Wed, Nov 21, 2012 at 8:14 AM, wrote: > > > Hello: > > > > > > I have a multihomed machine that I would like to run the Python imaplib's > > IMAP4 client on. I would like to be able to specify which interface the > >

RE: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Prasad, Ramit
brint...@controlledthinking.com wrote: > > Hello: > > I have a multihomed machine that I would like to run the Python imaplib's > IMAP4 client on. I would like to be > able to specify which interface the underlying socket will bind to as its > source address. How could I best do > this? One

Re: Yet another Python textbook

2012-11-20 Thread Mark Lawrence
On 20/11/2012 21:00, Chris Angelico wrote: To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393 strings. Take no notice; the rest of the world sees this as a huge advantage. Python is now in a VERY small group of languages (I'm aware of just one other) that have absolutely proper Uni

Encoding conundrum

2012-11-20 Thread Daniel Klein
With the assistance of this group I am understanding unicode encoding issues much better; especially when handling special characters that are outside of the ASCII range. I've got my application working perfectly now :-) However, I am still confused as to why I can only use one specific encoding.

Re: Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 8:14 AM, wrote: > Hello: > > I have a multihomed machine that I would like to run the Python imaplib's > IMAP4 client on. I would like to be able to specify which interface the > underlying socket will bind to as its source address. How could I best do > this? You're

RE: 10 sec poll - please reply!

2012-11-20 Thread Prasad, Ramit
Steven D'Aprano wrote: > > On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: > > > Thanks again for your further replies. So far, it's 4 votes for > > 'send_keys' and 1 vote for 'type'. > > > > Regarding 'send_keys': To me personally it makes sense to send keys _to_ > > something. Howev

Re: Yet another Python textbook

2012-11-20 Thread Terry Reedy
On 11/20/2012 3:02 AM, Pavel Solin wrote: previous page that Python 3 was released in 2008. Is there any work underway get Python 3 into NCLab? There is an ongoing discussion but we are not sure. Are there any reasons except for the print () command and division of integers? (In add

Re: 10 sec poll - please reply!

2012-11-20 Thread xDog Walker
On Tuesday 2012 November 20 08:29, mherrmann...@gmail.com wrote: > To everyone else who has been so kind to reply thus far: What do you think > of generate_keystrokes? It's a bit long but describes exactly what the > function would be doing. If not already offered and rejected, how about enter() ?

Choosing Source Address to Bind Socket to in IMAP Client

2012-11-20 Thread brintoul
Hello: I have a multihomed machine that I would like to run the Python imaplib's IMAP4 client on. I would like to be able to specify which interface the underlying socket will bind to as its source address. How could I best do this? Thanks for any help... -- http://mail.python.org/mailman/li

RE: Problem with list.remove() method

2012-11-20 Thread Prasad, Ramit
Alvaro Combo wrote: > > Hi All, > > I'm relatively new to Python... but I have found something I cannot > explain... and I'm sure you can help me. > > I have the following function that serves for removing the duplicates from a > list... It's a simple and (almost) > trivial task. > > I'm usi

RE: Index Error

2012-11-20 Thread Prasad, Ramit
Can you please post in plain text and stop top-posting? Thanks. inshu chauhan wrote: > > def distance(c, p): >     dist = sqrt( >     ((c[0]-p[0])**2) + >     ((c[1]-p[1])**2) + >     ((c[2]-p[2])**2) >     ) >     return dist > > > def GenerateRing(x,y, N): Gen

Re: Yet another Python textbook

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 1:57 AM, wrote: > Le mardi 20 novembre 2012 09:09:50 UTC+1, Chris Angelico a écrit : >> On Tue, Nov 20, 2012 at 7:02 PM, Pavel Solin wrote: >> >> > Perhaps you are right. Is there any statistics of how many Python >> >> > programmers are using 2.7 vs. 3? Most of people I

Re: 10 sec poll - please reply!

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 3:21 AM, Steven D'Aprano wrote: > On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: > >> Thanks again for your further replies. So far, it's 4 votes for >> 'send_keys' and 1 vote for 'type'. >> >> Regarding 'send_keys': To me personally it makes sense to send keys

Re: [Python 3.3/Windows] Path Browser seems to be broken

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 7:58 AM, Daniel Klein wrote: > If you try to expand any of the paths in the Path Browser (by clicking the + > sign) then it not only closes the Path Browser but it also closes all other > windows that were opened in IDLE, including the IDLE interpreter itself. > > I did a G

Re: Problem with list.remove() method

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 1:37 AM, Alvaro Combo wrote: > Dear Chris, > > Thank you very much for you reply... > For a newcomer to Python the Hell is in the details... :-). You're most welcome! As Adam Savage of Mythbusters is fond of saying (with an exaggerated accent), "It's all a learning experie

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Robert Kern
On 20/11/2012 20:22, Andriy Kornatskyy wrote: Robert, I respect your point of view and it definitely make sense to me. I personally do not have a problem to understand CC but agree, method LoC is easier to understand. Regardless the path your choose in your next refactoring (based on method

[Python 3.3/Windows] Path Browser seems to be broken

2012-11-20 Thread Daniel Klein
If you try to expand any of the paths in the Path Browser (by clicking the + sign) then it not only closes the Path Browser but it also closes all other windows that were opened in IDLE, including the IDLE interpreter itself. I did a Google search and it doesn't look like this been reported. If t

Re: Problem with list.remove() method

2012-11-20 Thread Terry Reedy
On 11/20/2012 9:14 AM, Chris Angelico wrote: On Wed, Nov 21, 2012 at 12:56 AM, Alvaro Combo wrote: Hi All, I'm relatively new to Python... but I have found something I cannot explain... and I'm sure you can help me. I have the following function that serves for removing the duplicates from

Re: proxy??

2012-11-20 Thread Joshua Landau
On 20 November 2012 14:48, Jorge Alberto Diaz Orozco < jaoro...@estudiantes.uci.cu> wrote: > Hi there. > Does anyone knows how to manage headers using a simple proxy??? > I'm doing this but It gives me problems In some pages. > I don't know the answer, but I do know you'd get more favour if you e

RE: Web Frameworks Excessive Complexity

2012-11-20 Thread Andriy Kornatskyy
Robert, I respect your point of view and it definitely make sense to me. I personally do not have a problem to understand CC but agree, method LoC is easier to understand. Regardless the path your choose in your next refactoring (based on method CC, LoC) it gives your better product. Andriy

Re: 10 sec poll - please reply!

2012-11-20 Thread Joshua Landau
On 20 November 2012 16:19, Dave Angel wrote: > On 11/20/2012 11:09 AM, John Gordon wrote: > > In <3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com> Michael > Herrmann writes: > > > >> What, in your view, would be the most intuitive alternative name? > > keyboard_input(). > > > > Well, since

Re: Path Browser seems to be broken

2012-11-20 Thread Terry Reedy
On 11/20/2012 1:23 PM, Peter Otten wrote: Daniel Klein wrote: If you try to expand any of the paths in the Path Browser (by clicking the + sign) then it not only closes the Path Browser but it also closes all other windows that were opened in IDLE, including the IDLE interpreter itself. A Goog

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Robert Kern
On 20/11/2012 19:46, Andriy Kornatskyy wrote: Robert, Thank you for the comment. I do not try relate CC with LOC. Instead pointing to excessive complexity, something that is beyond recommended threshold, a subject to refactoring in respective web frameworks. Those areas are likely to be pote

RE: Web Frameworks Excessive Complexity

2012-11-20 Thread Andriy Kornatskyy
Robert, Thank you for the comment. I do not try relate CC with LOC. Instead pointing to excessive complexity, something that is beyond recommended threshold, a subject to refactoring in respective web frameworks. Those areas are likely to be potential source of bugs (e.g. due to low code cover

Re: re.search when used within an if/else fails

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 12:37 PM, Ian Kelly wrote: > On Tue, Nov 20, 2012 at 12:09 PM, Kevin T wrote: >> #if re.search( "rsrvd", sigName ) : #version a >> #if re.search( "rsrvd", sigName ) == None : #version b >> if re.search( "rsrvd", sigName ) is None : #version bb >>print sigName >>

Re: re.search when used within an if/else fails

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 12:09 PM, Kevin T wrote: > #if re.search( "rsrvd", sigName ) : #version a > #if re.search( "rsrvd", sigName ) == None : #version b > if re.search( "rsrvd", sigName ) is None : #version bb >print sigName >newVal = "%s%s" % ('1'*signal['bits'] , newVal ) > #else

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Robert Kern
On 20/11/2012 17:41, Andriy Kornatskyy wrote: Cyclomatic (or conditional) complexity is a metric used to indicate the complexity of a source code. Excessive complexity is something that is beyond recommended level of 10 (threshold that points to the fact the source code is too complex and refa

Re: The type.__call__() method manages the calls to __new__ and __init__?

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 10:29 AM, Marco wrote: > Because when I call an instance the __call__ method is called, and because > the classes are instances of type, I thought when I call a Foo class this > imply the call type.__call__(Foo), and so this one manages the Foo.__new__ > and Foo.__init__ ca

Re: re.search when used within an if/else fails

2012-11-20 Thread Kevin T
On Monday, November 19, 2012 7:29:20 PM UTC-6, Steven D'Aprano wrote: > On Tue, 20 Nov 2012 01:24:54 +, Steven D'Aprano wrote: > > > > - use "if something is None", not == None. > > > Steven i will not include line #'s in the future, point taken i will change ==/!= to is/is not as most pe

Re: Stack_overflow error

2012-11-20 Thread Dieter Maurer
Aung Thet Naing writes: > I'm having Stack_overflow exception in _ctypes_callproc (callproc.c). The > error actually come from the: > > cleanup: > for (i = 0; i < argcount; ++i) > Py_XDECREF(args[i].keep); > > when args[i].keep->ob_refCnt == 1 Really a stack overflow or a general s

Re: Printing time in "at" format?

2012-11-20 Thread Roy Smith
On Nov 20, 2012, at 1:16 PM, Tim Chase wrote: > Your statement can be ambiguously parsed as "I need to merely > *generate* time specifications that 'at' can parse", or it can be > parsed as "I need to generate *and consume* time specifications the > same way as 'at' does" > > If it's the former,

Re: Path Browser seems to be broken

2012-11-20 Thread Peter Otten
Daniel Klein wrote: > If you try to expand any of the paths in the Path Browser (by clicking the > + sign) then it not only closes the Path Browser but it also closes all > other windows that were opened in IDLE, including the IDLE interpreter > itself. > > A Google search doesn't look like this

Re: How to use the python to do the unit test

2012-11-20 Thread emile
On 11/20/2012 09:40 AM, yujian4newsgr...@gmail.com wrote: I write a mfc application, then I want to use the python to test this application. just as user click that button. Please tell me how to write the python application? I currently use MacroScheduler (http://www.mjtnet.com/) then write

Web Frameworks Excessive Complexity

2012-11-20 Thread Andriy Kornatskyy
Cyclomatic (or conditional) complexity is a metric used to indicate the complexity of a source code. Excessive complexity is something that is beyond recommended level of 10 (threshold that points to the fact the source code is too complex and refactoring is suggested). Here is a list of web f

The type.__call__() method manages the calls to __new__ and __init__?

2012-11-20 Thread Marco
Looking at the documentation of Py3.3: http://docs.python.org/3.3/reference/datamodel.html#object.__new__ I saw the method `__new__()` is called automatically when I create an istance. After the call to __new__(), if it returns an instance `self` then `self.__init__()` is called. Because whe

Re: Yet another Python textbook

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 1:02 AM, Pavel Solin wrote: > There is an ongoing discussion but we are not sure. > Are there any reasons except for the print () command > and division of integers? The big one is that Python 3 holds the future of Python development. There are no more feature releases pla

Re: 10 sec poll - please reply!

2012-11-20 Thread mherrmann . at
That's a very good suggestion Emile!! So I might eventually need both 'press' and 'release' (or press_key/release_key). Thanks for this! To everyone else who has been so kind to reply thus far: What do you think of generate_keystrokes? It's a bit long but describes exactly what the function wou

Re: 10 sec poll - please reply!

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: > Thanks again for your further replies. So far, it's 4 votes for > 'send_keys' and 1 vote for 'type'. > > Regarding 'send_keys': To me personally it makes sense to send keys _to_ > something. However, in our API, send_keys would not be

Re: 10 sec poll - please reply!

2012-11-20 Thread Mark Lawrence
On 20/11/2012 15:18, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be called on an object or

Re: 10 sec poll - please reply!

2012-11-20 Thread emile
On 11/20/2012 04:18 AM, Michael Herrmann wrote: Hi, I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses o

Re: 10 sec poll - please reply!

2012-11-20 Thread Dave Angel
On 11/20/2012 11:09 AM, John Gordon wrote: > In <3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com> Michael Herrmann > writes: > >> What, in your view, would be the most intuitive alternative name? > keyboard_input(). > Well, since Python already has input() and raw_input(), it would then be

Re: Index Error

2012-11-20 Thread Dave Angel
On 11/20/2012 10:01 AM, inshu chauhan wrote: >> >> >> So did you read the following paragraphs? You should not be using "and" >> in that expression. > > > >> Yes i tried "or" also but no use . Explain "no use". If you mean you still fail, then what else did you try? For example, did you

Re: 10 sec poll - please reply!

2012-11-20 Thread John Gordon
In <3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com> Michael Herrmann writes: > What, in your view, would be the most intuitive alternative name? keyboard_input(). -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assau

Path Browser seems to be broken

2012-11-20 Thread Daniel Klein
If you try to expand any of the paths in the Path Browser (by clicking the + sign) then it not only closes the Path Browser but it also closes all other windows that were opened in IDLE, including the IDLE interpreter itself. A Google search doesn't look like this been reported. If this is truly a

Re: 10 sec poll - please reply!

2012-11-20 Thread MRAB
On 2012-11-20 15:18, Michael Herrmann wrote: Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be called on an object or

Re: Index Error

2012-11-20 Thread inshu chauhan
I dont want error actually to come. With try nd except , the error will come but without affecting my prog... -- http://mail.python.org/mailman/listinfo/python-list

Re: 10 sec poll - please reply!

2012-11-20 Thread Michael Herrmann
Thanks again for your further replies. So far, it's 4 votes for 'send_keys' and 1 vote for 'type'. Regarding 'send_keys': To me personally it makes sense to send keys _to_ something. However, in our API, send_keys would not be called on an object or with a parameter indicating the target. It w

Re: Index Error

2012-11-20 Thread inshu chauhan
The catch to the approach suggested by Chris is that you DON'T want to > break out of the whole loop when one value is out of range. You only > want to skip that one point. > > > Yes I want to skip only that one point (centre) but try and expect seems to be the last option.. I would like to try o

Re: Problems on these two questions

2012-11-20 Thread Neil Cerutti
On 2012-11-19, Dennis Lee Bieber wrote: > On Sun, 18 Nov 2012 17:52:35 -0800 (PST), su29090 > <129k...@gmail.com> declaimed the following in > gmane.comp.python.general: > >> >> I all of the other problems but I have issues with these: >> >> 1.Given a positive integer n , assign True to is_pri

Re: Index Error

2012-11-20 Thread inshu chauhan
> > > So did you read the following paragraphs? You should not be using "and" > in that expression. > Yes i tried "or" also but no use . > > >> > >> You do not want "and" in that expression. The way you've coded it, > >> it'll only skip items in which both indices are out of range. Change

Re: Yet another Python textbook

2012-11-20 Thread wxjmfauth
Le mardi 20 novembre 2012 09:09:50 UTC+1, Chris Angelico a écrit : > On Tue, Nov 20, 2012 at 7:02 PM, Pavel Solin wrote: > > > Perhaps you are right. Is there any statistics of how many Python > > > programmers are using 2.7 vs. 3? Most of people I know use 2.7. > > > > If you're teaching Pyt

proxy??

2012-11-20 Thread Jorge Alberto Diaz Orozco
Hi there. Does anyone knows how to manage headers using a simple proxy??? I'm doing this but It gives me problems In some pages. import SocketServer import SimpleHTTPServer import urllib2 PORT = class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): try:

Re: Index Error

2012-11-20 Thread Dave Angel
On 11/20/2012 09:26 AM, inshu chauhan wrote: >> def GenerateRing(x,y, N): Generates square rings around a point in data >>> which has 300 columns(x) and 3000 rows(y) >>> indices = [] >>> for i in xrange(-N, N): >>> indices.append((x+i, y-N)) >>> indices.append((x+N, y+i)) >>

Re: 10 sec poll - please reply!

2012-11-20 Thread Neil Cerutti
On 2012-11-20, Dave Angel wrote: > I also vote for send_keys(), even before I saw Chris' reply. > > 'type' is too overloaded a word. For example, in Windows, it's > the command to display the contents of a file - it types it to > the screen. type is a nice verb, but since it's also a well-used n

Re: Index Error

2012-11-20 Thread Dave Angel
On 11/20/2012 09:11 AM, inshu chauhan wrote: > On Tue, Nov 20, 2012 at 3:00 PM, Chris Angelico wrote: > >> On Wed, Nov 21, 2012 at 12:57 AM, inshu chauhan >> wrote: >>> I am using python 2.7.3 , so can it be done in that ? >> (Please don't top-post; just delete the couple of blank lines that >> g

Re: Problem with list.remove() method

2012-11-20 Thread Alvaro Combo
Dear Chris, Thank you very much for you reply... For a newcomer to Python the Hell is in the details... :-). You are absolutely right... and I just used the index instead of the value. Regarding you other (most relevant) comments, I absolutely agree... BUT in those cases... I was aware :-). Bu

Re: Index Error

2012-11-20 Thread inshu chauhan
> def GenerateRing(x,y, N): Generates square rings around a point in data > > which has 300 columns(x) and 3000 rows(y) > > indices = [] > > for i in xrange(-N, N): > > indices.append((x+i, y-N)) > > indices.append((x+N, y+i)) > > indices.append((x-i, y+N)) > >

Re: Problem with list.remove() method

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 12:56 AM, Alvaro Combo wrote: > Hi All, > > I'm relatively new to Python... but I have found something I cannot > explain... and I'm sure you can help me. > > I have the following function that serves for removing the duplicates from a > list... It's a simple and (almost

Re: Index Error

2012-11-20 Thread inshu chauhan
On Tue, Nov 20, 2012 at 3:00 PM, Chris Angelico wrote: > On Wed, Nov 21, 2012 at 12:57 AM, inshu chauhan > wrote: > > I am using python 2.7.3 , so can it be done in that ? > > (Please don't top-post; just delete the couple of blank lines that > gmail oh so kindly provides, and type your response

Re: Index Error

2012-11-20 Thread Dave Angel
On 11/20/2012 08:43 AM, inshu chauhan wrote: > def distance(c, p): > dist = sqrt( > ((c[0]-p[0])**2) + > ((c[1]-p[1])**2) + > ((c[2]-p[2])**2) > ) > return dist > > > def GenerateRing(x,y, N): Generates square rings around a point in data >

Re: Index Error

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 12:57 AM, inshu chauhan wrote: > I am using python 2.7.3 , so can it be done in that ? (Please don't top-post; just delete the couple of blank lines that gmail oh so kindly provides, and type your response at the bottom. You may also want to consider trimming the quoted te

Re: Linux compatibility

2012-11-20 Thread EDI Support
On Monday, November 19, 2012 11:44:37 AM UTC-5, EDI Support wrote: > Hi All, I would like know if Python 2.4.3 will be compatible with Linux RHEL > 5.5 or 6.1? Thanks Tony Thanks everyone for your replies. To clarify, We would like to run a Proof of concept - that our current version 2.4.3 will

Problem with list.remove() method

2012-11-20 Thread Alvaro Combo
Hi All, I'm relatively new to Python... but I have found something I cannot explain... and I'm sure you can help me. I have the following function that serves for removing the duplicates from a list... It's a simple and (almost) trivial task. I'm using WingIDE as editor/debugger and have Pyth

Re: Index Error

2012-11-20 Thread inshu chauhan
I am using python 2.7.3 , so can it be done in that ? On Tue, Nov 20, 2012 at 2:48 PM, Chris Angelico wrote: > On Wed, Nov 21, 2012 at 12:43 AM, inshu chauhan > wrote: > > I need help in this part as I am unable to device a method in which if > the > > points are out of index,it should stop...

Re: Index Error

2012-11-20 Thread Chris Angelico
On Wed, Nov 21, 2012 at 12:43 AM, inshu chauhan wrote: > I need help in this part as I am unable to device a method in which if the > points are out of index,it should stop. > > Traceback (most recent call last): > File "Z:/modules/Classify.py", line 73, in > ComputeClasses(data) > Fi

Index Error

2012-11-20 Thread inshu chauhan
def distance(c, p): dist = sqrt( ((c[0]-p[0])**2) + ((c[1]-p[1])**2) + ((c[2]-p[2])**2) ) return dist def GenerateRing(x,y, N): Generates square rings around a point in data which has 300 columns(x) and 3000 rows(y) indices = [] for

Re: 10 sec poll - please reply!

2012-11-20 Thread Dave Angel
On 11/20/2012 07:18 AM, Michael Herrmann wrote: > Hi, > > I'm developing a GUI Automation library (http://www.getautoma.com) and am > having difficulty picking a name for the function that simulates key strokes. > I currently have it as 'type' but that clashes with the built-in function. > Exam

Re: problem with module PyVisa

2012-11-20 Thread Jean Dubois
On 11 nov, 20:30, Jean Dubois wrote: > On 9 nov, 22:14, w...@mac.com wrote: > > > > > On Nov 9, 2012, at 3:43 PM, Jean Dubois wrote: > > > > The error may be obvious but finding this file and how to install it > > > is not unfortunately. > > > It seems I have to install it from the National Instr

  1   2   >