RE: metatype

2013-03-11 Thread Peter Otten
shangyu wrote: > Hi dear all, > I have following Python code > class mydict(dict): > def __init__(self): > pass > I wonder how this new type get created . What is the type of metatype in > the following line ? type = (PyTypeObject *)metatype->tp_alloc(metatype, > nslots); (line 2296 of

Re: Running external module and accessing the created objects

2013-03-11 Thread Rick Johnson
On Monday, March 11, 2013 6:57:28 PM UTC-5, Kene Meniru wrote: > > -- > # contents of myapp.py > import math > > class MyApp(object): > def __init__(self): > super(MyApp, self).__init__() > self.name = "MyAppName" > > > def testFunction():

Re: del not working for (exhausted) dict iterable value (Python 3.3)

2013-03-11 Thread alex23
On Mar 12, 3:35 pm, Nick Mellor wrote: > event['Items'] is an exhausted (all used up) iterable. > > Now I do the following (lines 142-4): > >             event.update({'Attributes': filtered_attributes}) >             del event['Items'] >             yield event > > and get a KeyError on the del s

del not working for (exhausted) dict iterable value (Python 3.3)

2013-03-11 Thread Nick Mellor
Hi all, event['Items'] is an exhausted (all used up) iterable. Now I do the following (lines 142-4): event.update({'Attributes': filtered_attributes}) del event['Items'] yield event and get a KeyError on the del statement. 'Items' is a key in the event dicti

Re: Running external module and accessing the created objects

2013-03-11 Thread Michael Torrie
On 03/11/2013 06:48 PM, Dave Angel wrote: > I hope you're just kidding. execfile() and exec() are two of the most > dangerous mechanisms around. import or __import__() would be much > better, as long as your user hasn't already run myapp.py as his script. It's not possible to setuid a python s

Re: Running external module and accessing the created objects

2013-03-11 Thread Dave Angel
On 03/11/2013 09:58 PM, Kene Meniru wrote: Dave Angel wrote: On 03/11/2013 07:57 PM, Kene Meniru wrote: I hope you're just kidding. execfile() and exec() are two of the most dangerous mechanisms around. import or __import__() would be much better, as long as your user hasn't already run m

Re: Running external module and accessing the created objects

2013-03-11 Thread Dave Angel
On 03/11/2013 09:23 PM, Kene Meniru wrote: Dave Angel wrote: On 03/11/2013 07:57 PM, Kene Meniru wrote: I hope you're just kidding. execfile() and exec() are two of the most dangerous mechanisms around. import or __import__() would be much better, as long as your user hasn't already run m

Re: Running external module and accessing the created objects

2013-03-11 Thread Kene Meniru
Dave Angel wrote: > On 03/11/2013 07:57 PM, Kene Meniru wrote: > > I hope you're just kidding. execfile() and exec() are two of the most > dangerous mechanisms around. import or __import__() would be much > better, as long as your user hasn't already run myapp.py as his script. > Tried __imp

RE: metatype

2013-03-11 Thread shangyu
I think I've found it out . For new-style class it's PyType_Type and for old-style class it's PyClass_Type . Thanks anyway. To: python-list@python.org From: yush...@outlook.com Subject: metatype Date: Tue, 12 Mar 2013 06:22:24 +0800 发件人: shangyu 发送时间: ‎2013/‎3/‎12 0:20 收件人: core-mentors

Re: Running external module and accessing the created objects

2013-03-11 Thread Kene Meniru
Dave Angel wrote: > On 03/11/2013 07:57 PM, Kene Meniru wrote: > > I hope you're just kidding. execfile() and exec() are two of the most > dangerous mechanisms around. import or __import__() would be much > better, as long as your user hasn't already run myapp.py as his script. > It does wha

Re: Running external module and accessing the created objects

2013-03-11 Thread Dave Angel
On 03/11/2013 07:57 PM, Kene Meniru wrote: Here's the answer to this question. The summary of the question: how to run a module (called myapp.py) from another module (called myappwin.py) and be able to access the namespace of myapp.py from myappwin.py. --

Re: How to quickly set up a multithreaded server that can handle http file post.

2013-03-11 Thread Shiyao Ma
Yes, sounds good. I should give it a try. On Tue, Mar 12, 2013 at 1:02 AM, Xavier L. wrote: > On 13-03-11 10:42 AM, Shiyao Ma wrote: > >> Today I come across a problem. >> Basically, my need is that I want to launch a http server that can not >> only support get but also support post (including

ANN: A new version (0.3.3) of the Python module which wraps GnuPG has been released.

2013-03-11 Thread Vinay Sajip
A new version of the Python module which wraps GnuPG has been released. What Changed? = This is a minor enhancement and bug-fix release. See the project website ( http://code.google.com/p/python-gnupg/ ) for more information. Summary: Improved support for status messages from GnuPG. F

Re: Running external module and accessing the created objects

2013-03-11 Thread Kene Meniru
Here's the answer to this question. The summary of the question: how to run a module (called myapp.py) from another module (called myappwin.py) and be able to access the namespace of myapp.py from myappwin.py. -- # contents of myapp.py import math class

Re: This mail never gets delivered. Any ideas why?

2013-03-11 Thread Thomas Rachel
Am 10.03.2013 19:39 schrieb Νίκος Γκρ33κ: Hey man this worked via Python! [...] if( os.system( 'echo "%s" | mail -s "%s" supp...@superhost.gr' % (MESSAGE, FROM) ) ): [...] Thank you! I beleive this is the simplest way of sending an email! Until you get a MESSAGE which

Re: BPLUSPY-1.0 Installation issue

2013-03-11 Thread mbg1708
On Sunday, March 10, 2013 11:22:37 AM UTC-5, Steven D'Aprano wrote: > On Sun, 10 Mar 2013 08:38:43 -0700, mbg1708 wrote: > > > > > The Bpluspy-1.0 package from Pypi is excellent. The usual setup loads > > > the software into site-packages. Unfortunately, once installed, Python > > > import s

metatype

2013-03-11 Thread shangyu
-原始邮件- 发件人: "shangyu" 发送时间: ‎2013/‎3/‎12 0:20 收件人: "core-mentors...@python.org" 主题: [Core-mentorship] metatype Hi dear all, I have following Python code class mydict(dict): def __init__(self): pass I wonder how this new type get created . What is the type of metatype in the

صور لابنه الاعلامى باسم يوسف

2013-03-11 Thread 23alagmy
صور لابنه الاعلامى باسم يوسف https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fnatigtas7ab.blogspot.com%2F2013%2F03%2Fblog-post_5505.html%23.UT5PNJwVeBF.facebook -- http://mail.python.org/mailman/listinfo/python-list

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Ian Kelly
On Mon, Mar 11, 2013 at 2:43 PM, Alex Gardner wrote: > I tried to append what you told me to. Now it appears that I have a syntax > error! I checked my indentations and they look fine to me, but I get this > error: > > paddle_pos = pygame.mouse.get_pos() >

Re: Pygame mouse cursor load/unload

2013-03-11 Thread MRAB
On 11/03/2013 20:43, Alex Gardner wrote: On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: I am in the process of making a pong game in python using the pygame library. My current problem is that when I move the mouse, it turns off as soon as the mouse stops moving. The way I

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Alex Gardner
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: > I am in the process of making a pong game in python using the pygame library. > My current problem is that when I move the mouse, it turns off as soon as > the mouse stops moving. The way I am doing this is by making the default

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-11 Thread djc
On 11/03/13 17:27, Adam Tauno Williams wrote: Because date/time management in Python is *@*&@R&*(R *@&Y terrible! Period, full-stop, awful, crappy, lousy, and aggravating. The design is haphazard and error inducing. +1 -- djc -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression problem

2013-03-11 Thread Terry Reedy
On 3/11/2013 2:30 PM, Serhiy Storchaka wrote: On 11.03.13 04:06, Terry Reedy wrote: On 3/10/2013 1:42 PM, mukesh tiwari wrote: Hello all I am trying to solve this problem[1] [1] http://www.spoj.com/problems/MAIN12C/ As I remember, and as it still appears, this site severely penalizes Python s

Re: Problem installing Pyparsing

2013-03-11 Thread Ian Kelly
om pyparsing import __version__ as pyparsing_version > File "/tmp/openerp-7.0-20130311-002114/pyparsing-2.0.0/pyparsing.py", line > 629 > nonlocal limit,foundArity > ^ > SyntaxError: invalid syntax > > > How can I solve it? nonlocal is a Python 3 keyword.

Problem installing Pyparsing

2013-03-11 Thread Jaime Stuardo
Hello… I have downloaded pyparsing-2.0.0 files. When I run “python setup.py install” I get this error: Traceback (most recent call last): File "setup.py", line 9, in from pyparsing import __version__ as pyparsing_version File "/tmp/openerp-7.0-20130311-002114/

Can't get any output from python-sqlkit, how to diagnose?

2013-03-11 Thread tinnews
I am trying to use python-sqlkit (https://pypi.python.org/pypi/sqlkit/0.9.5.1) but I'm not really getting over the first hurdle. If I run sqledit (the ready made executable that needs no programming) on my data then it works fine and displays my table data. However if I enter the minimal example

Re: Regular expression problem

2013-03-11 Thread Serhiy Storchaka
On 11.03.13 04:06, Terry Reedy wrote: On 3/10/2013 1:42 PM, mukesh tiwari wrote: Hello all I am trying to solve this problem[1] [1] http://www.spoj.com/problems/MAIN12C/ As I remember, and as it still appears, this site severely penalizes Python solvers by using the same time limit for all lan

Arcade Game Programming with Python

2013-03-11 Thread proteus . cronus
If you know someone that wants to learn to program their own arcade games, check out: http://ProgramArcadeGames.com * 84 free tutorial videos * Start creating graphics by Chapter 5 * Full text of the book on-line. * Cookbook of 47 example programs * On-line multiple choice quizzes track your pro

On topic, please [Was:Re: Regular expression problem]

2013-03-11 Thread Ned Deily
A friendly reminder that this forum is for general discussion and questions about Python. "Pretty much anything Python-related is fair game for discussion, and the group is even fairly tolerant of off-topic digressions; there have been entertaining discussions of topics such as floating point,

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Ian Kelly
On Mon, Mar 11, 2013 at 11:33 AM, Alex Gardner wrote: > My bad! http://pastebin.com/yuvpT7bH You're still drawing the blank paddle in two different places. One of those places is immediately after you draw the paddle, which undoes the work you just did in drawing it. That's why you're not seei

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-11 Thread Adam Tauno Williams
On Fri, 2013-03-08 at 13:41 -0500, Roy Smith wrote: > To make a long (and painful) story short, I've got a (large) list of > datetimes, and was getting some bizarre errors working with it. One of > the things I tried while debugging the problem was verifying that all > the elements of the list

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Alex Gardner
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: > I am in the process of making a pong game in python using the pygame library. > My current problem is that when I move the mouse, it turns off as soon as > the mouse stops moving. The way I am doing this is by making the default

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Ian Kelly
On Mon, Mar 11, 2013 at 11:00 AM, Alex Gardner wrote: > I added the blank paddle and now the green one is just gone. I feel like > such a newbie >< > > > screen.blit(bpaddle, paddle_rect) We're not psychic, so you'll need to post the current code if you want any suggestions on how to fix it.

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Alex Gardner
On Monday, March 11, 2013 12:00:37 PM UTC-5, Alex Gardner wrote: > On Monday, March 11, 2013 11:57:49 AM UTC-5, Alex Gardner wrote: > > > On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: > > > > > > > I am in the process of making a pong game in python using the pygame > > > li

Re: How to quickly set up a multithreaded server that can handle http file post.

2013-03-11 Thread Xavier L.
On 13-03-11 10:42 AM, Shiyao Ma wrote: Today I come across a problem. Basically, my need is that I want to launch a http server that can not only support get but also support post (including post file). My first idea is to use -m http.sever. However, it only supports get. Later I find some one ex

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Alex Gardner
On Monday, March 11, 2013 11:57:49 AM UTC-5, Alex Gardner wrote: > On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: > > > I am in the process of making a pong game in python using the pygame > > library. My current problem is that when I move the mouse, it turns off as > > soon

Re: Pygame mouse cursor load/unload

2013-03-11 Thread Alex Gardner
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: > I am in the process of making a pong game in python using the pygame library. > My current problem is that when I move the mouse, it turns off as soon as > the mouse stops moving. The way I am doing this is by making the default

Re: This mail never gets delivered. Any ideas why?

2013-03-11 Thread Thomas Rachel
Am 11.03.2013 10:15 schrieb nagia.rets...@gmail.com: Thank you Thomas but that simple line as i have it now its capable of sending mail successfully Obviously not, otherwise you wouldn't ask, would you? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice regarding multiprocessing module

2013-03-11 Thread Oscar Benjamin
On 11 March 2013 14:57, Abhinav M Kulkarni wrote: > Hi Jean, > > Below is the code where I am creating multiple processes: > > if __name__ == '__main__': > # List all files in the games directory > files = list_sgf_files() > > # Read board configurations > (intermediateBoards, fina

Re: working with dict : incrementing dict dynamically

2013-03-11 Thread Sven
On 11 March 2013 15:23, inshu chauhan wrote: > I am trying to create a dictionary with a key and its values seraching > from a data set. But something is going wrong. This is the first time I am > working with dicts. > > My code is : > > import cv > def Computesegclass(segimage): > num_pixel

Re: working with dict : incrementing dict dynamically

2013-03-11 Thread John Gordon
In inshu chauhan writes: > --14dae93408ffe4594104d7a7bf0c > Content-Type: text/plain; charset=ISO-8859-1 > I am trying to create a dictionary with a key and its values seraching from > a data set. But something is going wrong. This is the first time I am > working with dicts. > My code is :

working with dict : incrementing dict dynamically

2013-03-11 Thread inshu chauhan
I am trying to create a dictionary with a key and its values seraching from a data set. But something is going wrong. This is the first time I am working with dicts. My code is : import cv def Computesegclass(segimage): num_pixel = 0 for y in xrange(0, segimage.height): for x

Very Urgent Requirement, Interview within 3 hours-immediate start

2013-03-11 Thread thinksoft . ithub
Please review the Requirements’ which are quit urgent with our client it’s immediate hire, Please forward the Resumes with expected rate and skills matrix, Please send as the resume of your own W2 consultants Send your Resumes to s...@thinksofttech.com or reach me on 302-343-7478 Requirement

Re: This mail never gets delivered. Any ideas why?

2013-03-11 Thread Chris Angelico
On Sun, Mar 10, 2013 at 8:25 AM, Νίκος Γκρ33κ wrote: > mail = form.getvalue('mail') > > id what the user types in an html form and click submits. this can be a non > valid email of course i just check if there is a '@' in the mail address. > > But will the mail, gets delivered even if mail's valu

Re: comment récupérer les valeurs de canvas dans python

2013-03-11 Thread Jean-Michel Pichavant
- Original Message - > comment récupérer la couleur d'un canvas ou id d'un canvas? > -- > http://mail.python.org/mailman/listinfo/python-list Hello, I'll take my chance : http://effbot.org/tkinterbook/canvas.htm JM PS : write in english, or frenglish like I do, something that has a c

Re: Advice regarding multiprocessing module

2013-03-11 Thread Abhinav M Kulkarni
Hi Jean, Below is the code where I am creating multiple processes: if __name__ == '__main__': # List all files in the games directory files = list_sgf_files() # Read board configurations (intermediateBoards, finalizedBoards) = read_boards(files) # Initialize parameters

Fwd: Re: [Python-Help] idle doesn't work

2013-03-11 Thread leonardo
sorry for that, that answer didn't help me.. regards Il 10/03/2013 23.59, Matthew Dixon Cowles ha scritto: Dear Leonardo, Sending the same message three times isn't likely to produce faster or better help. Is the reply that you got on the main Python list satisfactory? Regards,

How to quickly set up a multithreaded server that can handle http file post.

2013-03-11 Thread Shiyao Ma
Today I come across a problem. Basically, my need is that I want to launch a http server that can not only support get but also support post (including post file). My first idea is to use -m http.sever. However, it only supports get. Later I find some one extended basehttpserver and made it suppor

Re: Set x to to None and del x doesn't release memory in python 2.7.1 (HPUX 11.23, ia64)

2013-03-11 Thread Grant Edwards
On 2013-03-09, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> What I should have said was that there's no way to return to the OS >> memory obtained via calls to malloc() et al. > > That's true (for certain values of "et al"). > >> and those are the calls that "good" C programmers (

Re: Regular expression problem

2013-03-11 Thread rusi
On Mar 11, 2:28 pm, jmfauth wrote: > On 11 mar, 03:06, Terry Reedy wrote: > > > > > ... > > By teaching 'speed before correctness", this site promotes bad > > programming habits and thinking (and the use of low-level but faster > > languages). > > ... > > This is exactly what "your" flexible stri

Re: Advice regarding multiprocessing module

2013-03-11 Thread Dave Angel
On 03/11/2013 01:57 AM, Abhinav M Kulkarni wrote: * My laptop has quad-core Intel i5 processor, so I thought using multiprocessing module I can parallelize my code (basically calculate gradient in parallel on multiple cores simultaneously). * As a result I end up creating a

Re: Advice regarding multiprocessing module

2013-03-11 Thread Jean-Michel Pichavant
- Original Message - > Dear all, > I need some advice regarding use of the multiprocessing module. > Following is the scenario: > * I am running gradient descent to estimate parameters of a pairwise > grid CRF (or a grid based graphical model). There are 106 data > points. Each data po

Re: This mail never gets delivered. Any ideas why?

2013-03-11 Thread Benjamin Schollnick
Nagia, > Thank you Thomas but that simple line as i have it now its capable of sending > mail successfully wven with greek letters two in subject or in message > variables. > > Now need to dad additional extra code for it to work. Your code as it is, isn't working. They just sent you several

Re: Store a variable permanently

2013-03-11 Thread Jean-Michel Pichavant
- Original Message - > On Fri, 01 Mar 2013 11:19:22 +0100, Jean-Michel Pichavant wrote: > > > - Original Message - > >> So i have a variable called funds that i want to store the value > >> of > >> even after the program is exited. My funds variable holds the > >> total > >> valu

Re: Regular expression problem

2013-03-11 Thread Mark Lawrence
On 11/03/2013 09:28, jmfauth wrote: On 11 mar, 03:06, Terry Reedy wrote: ... By teaching 'speed before correctness", this site promotes bad programming habits and thinking (and the use of low-level but faster languages). ... This is exactly what "your" flexible string representation does!

Re: Regular expression problem

2013-03-11 Thread jmfauth
On 11 mar, 03:06, Terry Reedy wrote: > > ... > By teaching 'speed before correctness", this site promotes bad > programming habits and thinking (and the use of low-level but faster > languages). > ... This is exactly what "your" flexible string representation does! And away from technical aspe

Re: This mail never gets delivered. Any ideas why?

2013-03-11 Thread nagia . retsina
Thank you Thomas but that simple line as i have it now its capable of sending mail successfully wven with greek letters two in subject or in message variables. Now need to dad additional extra code for it to work. -- http://mail.python.org/mailman/listinfo/python-list