Eclipse, C, and Python

2012-03-19 Thread Richard Medina Calderon
Hello Forum. I have installed Python comnpiler in Eclipse Classic for Windows. After a while I have installed the C compiler. However, somehow now when I try to run my code in Python it shows me for default Ant Run -->Ant Build I switched my workspace but still. Do you know how to solve this?..

Distribution

2012-03-19 Thread prince.pangeni
Hi all, I am doing a simulation project using Python. In my project, I want to use some short of distribution to generate requests to a server. The request should have two distributions. One for request arrival rate (should be poisson) and another for request mix (i.e. out of the total requests

Re: s_push parser stack overflow

2012-03-19 Thread MRAB
On 20/03/2012 03:19, Артём Назаров wrote: Hi. Sorry of my english :-) code: print (((0)))" message fro

s_push parser stack overflow

2012-03-19 Thread Артём Назаров
Hi. Sorry of my english :-) code: print (((0)))" message from python is: s_push parser stack overflow C

Re: Currying in Python

2012-03-19 Thread Kiuhnm
On 3/20/2012 0:20, Ian Kelly wrote: I hope you don't mind if I critique your code a bit! Not at all. Thank you for your time. On Fri, Mar 16, 2012 at 7:21 PM, Kiuhnm wrote: Here we go. ---> def genCur(f, unique = True, minArgs = -1): [...] I'll update my code following your corrections,

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2012 20:32:03 +0100, Laszlo Nagy wrote: > The pythonw.exe may not have the rights to access network resources. >>> Have you set a default timeout for sockets? >>> >>> import socket >>> socket.setdefaulttimeout(10) # 10 seconds > I have added pythonw.exe to allowed exceptions. Disabl

Re: Currying in Python

2012-03-19 Thread Ian Kelly
I hope you don't mind if I critique your code a bit! On Fri, Mar 16, 2012 at 7:21 PM, Kiuhnm wrote: > Here we go. > > ---> > def genCur(f, unique = True, minArgs = -1): It is customary in Python for unsupplied arguments with no default to use the value None, not -1. That's what it exists for.

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Jon Clements
On Monday, 19 March 2012 19:32:03 UTC, Laszlo Nagy wrote: > The pythonw.exe may not have the rights to access network resources. > >> Have you set a default timeout for sockets? > >> > >> import socket > >> socket.setdefaulttimeout(10) # 10 seconds > I have added pythonw.exe to allowed exceptions.

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Laszlo Nagy
The pythonw.exe may not have the rights to access network resources. Have you set a default timeout for sockets? import socket socket.setdefaulttimeout(10) # 10 seconds I have added pythonw.exe to allowed exceptions. Disabled firewall completely. Set socket timeout to 10 seconds. Still nothing.

Re: New learner of Python--any suggestion on studying it?

2012-03-19 Thread Wim M
Hi, this might be of interest to you: http://www.udacity.com/overview/Course/cs101 All the best Wimm On 2012-03-19, yan xianming wrote: > Hello all, > > I'm a new learning of Python. > > > > Can someone give me some suggestion about it? > > thanks > xianming -- Wim. -- http://mail.python.org

pypi and dependencies

2012-03-19 Thread Andrea Crotti
When I publish something on Pypi, is there a way to make it fetch the list of dependencies needed by my project automatically? It would be nice to have it in the Pypi page, without having to look at the actual code.. Any other possible solution? -- http://mail.python.org/mailman/listinfo/pytho

Please recommend a open source for Python ACLs function

2012-03-19 Thread Yang Chun-Kai
Hello Dear All: I would like to write some simple python test code with ACL(Access Control List) functions. Now simply I aim to use MAC address as ACL parameters, is there any good ACL open source recommended for using? Simple one is better. Any tips or suggestions welcomed and appreciated.

Re: Python is readable

2012-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2012 12:44:53 +0100, Kiuhnm wrote: > On 3/18/2012 2:46, Steven D'Aprano wrote: >> On Sat, 17 Mar 2012 21:23:45 +0100, Kiuhnm wrote: >> >>> On 3/16/2012 14:03, Steven D'Aprano wrote: A one line routine is still a routine. There is nothing ungrammatical about "If you can: ta

Re: configobj validation

2012-03-19 Thread Andrea Crotti
On 03/19/2012 12:59 PM, Andrea Crotti wrote: I seemed to remember that type validation and type conversion worked out of the box, but now I can't get it working anymore. Shouldn't this simple example actually fail the parsing (instead it parses perfectly port to a string)? sample.py: from co

Re: Python is readable

2012-03-19 Thread Robert Kern
On 3/19/12 12:53 PM, Neil Cerutti wrote: I still think sentence fragments before a colon introducing a list often looks bad, and may be taken for an error. But it doesn't always look bad, and I didn't think about it enough. One of my English teachers suggested a rule that seems to accord (desc

A debugging story.

2012-03-19 Thread Neil Cerutti
I just spent two hours debugging a crucial, though fairly simple, program. As part of the processing of an admissions report, I use difflib to compare two csv files. I compare the current file with one from the immediate past. The file changes over time as new students are accepted, and current st

Re: Python is readable

2012-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2012 15:33:51 +1100, Chris Angelico wrote: >> This is at least the second time you've alleged that assembly language >> is more readable than Python. I think you're a raving nutter, no >> offence Chris :-) > > None taken; guilty as charged. And unashamedly so. With that dealt with,

Re: Message passing between python objects

2012-03-19 Thread Peter Otten
J. Mwebaze wrote: > I am trying to learn about the interaction between python objects. One > thing i have often read is that objects interact by sending messages to > other objects to invoke corresponding methods. I am specifically > interested in tracing these messages and also probably log the m

Re: New learner of Python--any suggestion on studying it?

2012-03-19 Thread Brian Wilkinson
On Mar 19, 2:30 am, yan xianming wrote: > Hello all, > > I'm a new learning of Python. > > Can someone give me some suggestion about it? > > thanks > xianming Once you have a few of the basics down (using the resources others have suggested), a good way to practice those skills is to visit Projec

Re: ANN: cmd2, an extenstion of cmd that parses its argument line

2012-03-19 Thread xDog Walker
On Sunday 2012 March 18 22:11, anntzer@gmail.com wrote: > I would like to announce the first public release of cmd2, an extension of > the standard library's cmd with argument parsing, here: > https://github.com/anntzer/cmd2. There already is a cmd2 package at PyPI and has been for a long time

configobj validation

2012-03-19 Thread Andrea Crotti
I seemed to remember that type validation and type conversion worked out of the box, but now I can't get it working anymore. Shouldn't this simple example actually fail the parsing (instead it parses perfectly port to a string)? sample.py: from configobj import ConfigObj conf = ConfigObj('sa

Re: Python is readable

2012-03-19 Thread Neil Cerutti
On 2012-03-19, Steven D'Aprano wrote: > On Mon, 19 Mar 2012 11:26:10 +, Neil Cerutti wrote: > [...] >>> *A major style guide for general American writing and >>> publication: used by some as the 'Bible'. >> >> Thanks for the discussion and corrections. My apologies to >> Steven for pushing my

Message passing between python objects

2012-03-19 Thread J. Mwebaze
I am trying to learn about the interaction between python objects. One thing i have often read is that objects interact by sending messages to other objects to invoke corresponding methods. I am specifically interested in tracing these messages and also probably log the messages for further scrutin

Re: Python is readable

2012-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2012 12:15:07 +0100, Kiuhnm wrote: > On 3/18/2012 0:04, Michael Torrie wrote: >> On 03/17/2012 03:28 PM, Kiuhnm wrote: They are equally readable. The first one sets EAX to 3; the second displays all elements of x on the console. Assembly is readable on a very low leve

Re: Python is readable

2012-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2012 11:26:10 +, Neil Cerutti wrote: [...] >> *A major style guide for general American writing and publication: used >> by some as the 'Bible'. > > Thanks for the discussion and corrections. My apologies to Steven for > pushing my apparnetly overly narrow view. There are plent

Re: Python is readable

2012-03-19 Thread Kiuhnm
On 3/18/2012 2:46, Steven D'Aprano wrote: On Sat, 17 Mar 2012 21:23:45 +0100, Kiuhnm wrote: On 3/16/2012 14:03, Steven D'Aprano wrote: A one line routine is still a routine. There is nothing ungrammatical about "If you can: take the bus.", although it is non-idiomatic English. In another pos

debugging ssl handshake failure

2012-03-19 Thread Ovidiu Deac
I have an HTTPS server written in python, based on ssl package. This application is running on 3 virtual machines which were created by clonning. The application works perfectly on 2 machines but on the third it doesn't. Instead of the normal "Server Hello" message it gives me an Alert Level: Fata

Re: Python is readable

2012-03-19 Thread Kiuhnm
On 3/18/2012 2:36, Steven D'Aprano wrote: On Sat, 17 Mar 2012 20:59:34 +0100, Kiuhnm wrote: Ok, so length and readability are orthogonal properties. Could you please explain to me in which way mov eax, 3 should be less readable than for i in x: print(i) ? "mov eax, 3" requires mor

Re: Python is readable

2012-03-19 Thread Neil Cerutti
On 2012-03-17, Terry Reedy wrote: > On 3/16/2012 9:08 AM, Neil Cerutti wrote: > >> A grammarian always uses complete sentence before a colon, even >> when introducing a list. > > The Chicago Manual of Style*, 13th edition, says "The colon is > used to mark a discontinuity of grammatical constructi

Re: Python is readable

2012-03-19 Thread Kiuhnm
On 3/18/2012 0:04, Michael Torrie wrote: On 03/17/2012 03:28 PM, Kiuhnm wrote: They are equally readable. The first one sets EAX to 3; the second displays all elements of x on the console. Assembly is readable on a very low level, but it's by nature verbose at a high level, and thus less readabl

Re: Programming D. E. Knuth in Python with the Deterministic Finite Automaton construct

2012-03-19 Thread Kiuhnm
On 3/19/2012 6:02, Dennis Lee Bieber wrote: On Mon, 19 Mar 2012 02:02:23 +0100, Kiuhnm declaimed the following in gmane.comp.python.general: Many ASM languages don't have structured control flow statements but only jmps, which are roughly equivalent to gotos. A good decompiler will need to a

Re: filter max from iterable for grouped element

2012-03-19 Thread Christian
On 19 Mrz., 09:45, Peter Otten <__pete...@web.de> wrote: > Christian wrote: > > as beginner in python , I struggle  somewhat to filter out only the > > maximum in the values for  and get hmax. > > h = {'abvjv': ('asyak', 0.9014230420411024), > >  'afqes': ('jarbm', 0.9327883839839753), > >  'aikdj'

Re: filter max from iterable for grouped element

2012-03-19 Thread Peter Otten
Christian wrote: > as beginner in python , I struggle somewhat to filter out only the > maximum in the values for and get hmax. > h = {'abvjv': ('asyak', 0.9014230420411024), > 'afqes': ('jarbm', 0.9327883839839753), > 'aikdj': ('jarbm', 0.9503941616408824), > 'ajbhn': ('jarbm', 0.932358308

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Laszlo Nagy
On 2012-03-17 19:18, Christian Heimes wrote: Am 17.03.2012 15:13, schrieb Laszlo Nagy: See attached example code. I have a program that calls exactly the same code, and here is the strange thing about it: * Program is started as "start.py", e.g. with an open console. In this case, the p

Re: ANN: cmd2, an extenstion of cmd that parses its argument line

2012-03-19 Thread Devin Jeanpierre
There already is a module named cmd2: http://pypi.python.org/pypi/cmd2 -- Devin On Mon, Mar 19, 2012 at 1:11 AM, wrote: > Dear all, > > I would like to announce the first public release of cmd2, an extension of > the standard library's cmd with argument parsing, here: > https://github.com/anntz

Re: New learner of Python--any suggestion on studying it?

2012-03-19 Thread Antti J Ylikoski
On 19.3.2012 8:30, yan xianming wrote: Hello all, I'm a new learning of Python. Can someone give me some suggestion about it? thanks xianming The best textbooks on Python that I have come across are: Learning Python by Mark Lutz, O'Reilly, http://oreilly.com, ISBN 978-0-596-15806-4 Progr

filter max from iterable for grouped element

2012-03-19 Thread Christian
Hi, as beginner in python , I struggle somewhat to filter out only the maximum in the values for and get hmax. Maybe it easier when i change the structure of h? Many thanks in advance Christian h = {'abvjv': ('asyak', 0.9014230420411024), 'afqes': ('jarbm', 0.9327883839839753), 'aikdj': ('j

Re: New learner of Python--any suggestion on studying it?

2012-03-19 Thread Chris Rebert
On Sun, Mar 18, 2012 at 11:30 PM, yan xianming wrote: > Hello all, > > I'm a new learning of Python. > > Can someone give me some suggestion about it? http://docs.python.org/tutorial/index.html http://wiki.python.org/moin/BeginnersGuide/NonProgrammers http://wiki.python.org/moin/BeginnersGuide/Pr