Why chunks is not part of the python standard lib?

2013-04-30 Thread Ricardo Azpeitia Pimentel
After reading How do you split a list into evenly sized chunks in Python? and seeing this kind of mistakes happening https://code.djangoproject.com/ticket/18972 all the time. Why is not a chunks

Re: in need of some help...

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 9:20 AM, Alex Norton wrote: > the teacher actually cant teach anything, he as the knowledge of Vb but his > teaching methods are abysmal and severely lacking, but he said we can use any > language we feel more comfortable in. some are using VB others PHP and some > in C +

Re: in need of some help...

2013-04-30 Thread Alex Norton
On Wednesday, 1 May 2013 00:02:51 UTC+1, Ian wrote: > On Tue, Apr 30, 2013 at 4:30 PM, Alex Norton wrote: > > > oh FYI its for my college course.. i didnt really want to use Visual Basic > > so the teacher cannot help > > > > If the course is being taught in Visual Basic then that would prob

Re: Drag and drop in Windows

2013-04-30 Thread Kevin Walzer
Official link: http://tkinterdnd.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

PDF in a Bottle - creating PDF using xtopdf, ReportLab, Bottle and Python

2013-04-30 Thread vasudevram
pdf_bottle.py is a program I wrote that allows you to create a PDF file from text, over the web, by entering your text into a form and submitting it. Here is the post about it: http://jugad2.blogspot.in/2013/05/pdf-in-bottle-creating-pdf-using-xtopdf.html - Vasudev Ram dancingbison.com jugad2.b

Re: in need of some help...

2013-04-30 Thread Ian Kelly
On Tue, Apr 30, 2013 at 4:30 PM, Alex Norton wrote: > oh FYI its for my college course.. i didnt really want to use Visual Basic so > the teacher cannot help If the course is being taught in Visual Basic then that would probably be the best thing to use. I'm surprised that the teacher is allowi

Re: in need of some help...

2013-04-30 Thread Alex Norton
On Tuesday, April 30, 2013 11:13:24 PM UTC+1, Chris Angelico wrote: > On Wed, May 1, 2013 at 8:06 AM, Alex Norton wrote: > > > > > > hi, > > > > > > i am currently trying to make a rock paper scissors game based on a game. > > > > > > the code for the game itself works fine, it does what i n

Re: in need of some help...

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 8:06 AM, Alex Norton wrote: > > hi, > > i am currently trying to make a rock paper scissors game based on a game. > > the code for the game itself works fine, it does what i need it to do > > the issue i am having is that i haven't a clue how to combine the game code i > ha

in need of some help...

2013-04-30 Thread Alex Norton
hi, i am currently trying to make a rock paper scissors game based on a game. the code for the game itself works fine, it does what i need it to do the issue i am having is that i haven't a clue how to combine the game code i have with the QT GUI code i have. -- http://mail.python.org/mailm

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 4:10 AM, Tony Romeo wrote: > Updating to 2.5+ resolved the error. > > Here is the old info : > Version : 2.4.3 Vendor: CentOS Yup, that would be it! Did you get as far as 2.7? Once you're there, you'll never have to worry about upgradin

Re: how to compare two fields in python

2013-04-30 Thread Fábio Santos
> The data was sorted and so duplicates will not appear anywhere in the dataframe. > I guess that's it. Use the standard csv module and itertools.groupby. Groupby will produce a list of grouped objects. So you can group by the first column by supplying a key function which just returns the first c

Re: how to compare two fields in python

2013-04-30 Thread upendra kumar Devisetty
The data was sorted and so duplicates will not appear anywhere in the dataframe. The values does not have significance and can be ignored safely. Thanks Upendra On Tuesday, April 30, 2013 11:19:56 AM UTC-7, Tim Chase wrote: > On 2013-04-30 10:41, upendra kumar Devisetty wrote: > > > I have a ve

Re: python process accounting

2013-04-30 Thread Giampaolo Rodola'
2013/4/30 Rita : > Hi, > > I was wondering if it possible to write a python wrapper which will account > my processes. I would like to account for all the children processes (fork) > by looking at their /proc/ info. Such as memory, io, open files, stats. > > So, instead of me running "/bin/sleep 10

Re: how to compare two fields in python

2013-04-30 Thread Tim Chase
On 2013-04-30 10:41, upendra kumar Devisetty wrote: > I have a very basic question in python. I want to go through each > line of the a csv file and compare to see if the first field of > line 1 is same as first field of next line and so on. If it finds a > match then i would like to put that field

Re: python process accounting

2013-04-30 Thread Robert Kern
On 2013-04-30 17:25, Rita wrote: Hi, I was wondering if it possible to write a python wrapper which will account my processes. I would like to account for all the children processes (fork) by looking at their /proc/ info. Such as memory, io, open files, stats. So, instead of me running "/bin/sl

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Tony Romeo
Updating to 2.5+ resolved the error. Thank you --- Here is the old info : [mongrel@crms-demo ~]$ rpm -qi python Name: python Relocations: (not relocatable) Version : 2.4.3 Vendor: CentOS Release : 56.el5

Re: python process accounting

2013-04-30 Thread Rita
Exactly, its a place holder measure. Currently, I have a shell program like this. #!/usr/bin/env bash exec "$@" Any thoughts how I can put python in there? On Tue, Apr 30, 2013 at 1:54 PM, Robert Kern wrote: > On 2013-04-30 17:38, Dave Angel wrote: > >> On 04/30/2013 12:25 PM, Rita wrote:

Re: how to compare two fields in python

2013-04-30 Thread Fábio Santos
... And collections.Counter. This is useful for (you guessed it) counting. Maybe itertools.groupby will be helpful as well (it could be used to give you your data grouped by the first column of data), but it could be a tad advanced for you if you are not too familiar with iterators. -- http://mai

Re: python process accounting

2013-04-30 Thread Robert Kern
On 2013-04-30 17:38, Dave Angel wrote: On 04/30/2013 12:25 PM, Rita wrote: Hi, I was wondering if it possible to write a python wrapper which will account my processes. I would like to account for all the children processes (fork) by looking at their /proc/ info. Such as memory, io, open files,

Re: how to compare two fields in python

2013-04-30 Thread Joel Goldstick
On Tue, Apr 30, 2013 at 1:41 PM, upendra kumar Devisetty < upendrakumar.devise...@googlemail.com> wrote: > I have a very basic question in python. I want to go through each line of > the a csv file and compare to see if the first field of line 1 is same as > first field of next line and so on. If

how to compare two fields in python

2013-04-30 Thread upendra kumar Devisetty
I have a very basic question in python. I want to go through each line of the a csv file and compare to see if the first field of line 1 is same as first field of next line and so on. If it finds a match then i would like to put that field in an object1 else put that field in a different object2

Re: python process accounting

2013-04-30 Thread Dave Angel
On 04/30/2013 12:38 PM, Dave Angel wrote: Oops, a typo. See below. On 04/30/2013 12:25 PM, Rita wrote: Hi, I was wondering if it possible to write a python wrapper which will account my processes. I would like to account for all the children processes (fork) by looking at their /proc/ info.

Re: python process accounting

2013-04-30 Thread Dave Angel
On 04/30/2013 12:25 PM, Rita wrote: Hi, I was wondering if it possible to write a python wrapper which will account my processes. I would like to account for all the children processes (fork) by looking at their /proc/ info. Such as memory, io, open files, stats. So, instead of me running "/bin

python process accounting

2013-04-30 Thread Rita
Hi, I was wondering if it possible to write a python wrapper which will account my processes. I would like to account for all the children processes (fork) by looking at their /proc/ info. Such as memory, io, open files, stats. So, instead of me running "/bin/sleep 10", i would like to run it as

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 1:58 AM, Dave Angel wrote: > On 04/30/2013 11:49 AM, Chris Angelico wrote: >> >> On Wed, May 1, 2013 at 1:43 AM, Dave Angel wrote: >>> >>> On 04/30/2013 11:27 AM, tro...@mdlogix.com wrote: Please help me to debug --- shmid = shmget(SHM

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Dave Angel
On 04/30/2013 11:49 AM, Chris Angelico wrote: On Wed, May 1, 2013 at 1:43 AM, Dave Angel wrote: On 04/30/2013 11:27 AM, tro...@mdlogix.com wrote: Please help me to debug --- shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) ^ S

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 1:52 AM, Tony Romeo wrote: > Thank you for the response. > > Results after using 0666: > > > Traceback (most recent call last): > File "dump_cdorked_config.py", line 15, in ? > from ctypes import * > ImportError: No module named ctypes You really need to offer a lot m

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Tony Romeo
Thank you for the response. Results after using 0666: Traceback (most recent call last): File "dump_cdorked_config.py", line 15, in ? from ctypes import * ImportError: No module named ctypes -- http://mail.python.org/mailman/listinfo/python-list

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 1:43 AM, Dave Angel wrote: > On 04/30/2013 11:27 AM, tro...@mdlogix.com wrote: >> >> >> Please help me to debug >> >> --- >> shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) >> ^ >> SyntaxError: invalid syntax >

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Dave Angel
On 04/30/2013 11:27 AM, tro...@mdlogix.com wrote: Please help me to debug --- shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) ^ SyntaxError: invalid syntax 0o666 is indeed a syntax error. What is that value supposed to be? If

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Chris Angelico
On Wed, May 1, 2013 at 1:27 AM, wrote: > > Please help me to debug > > --- > shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) >^ > SyntaxError: invalid syntax In Python 2, just use 0666. ChrisA -- http://mail.python.org/mailman/li

Re: shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread Joel Goldstick
On Tue, Apr 30, 2013 at 11:27 AM, wrote: > > Please help me to debug > > --- > shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) >^ > SyntaxError: invalid syntax > > If you google 0o666 python you see that if some version of python ne

shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) - syntax error.

2013-04-30 Thread tromeo
Please help me to debug --- shmid = shmget(SHM_KEY, SHM_SIZE, 0o666) ^ SyntaxError: invalid syntax here is the code Ref: http://www.welivesecurity.com/2013/04/26/linuxcdorked-new-apache-backdoor-in-the-wild-serves-bla

Re: Drag and drop in Windows

2013-04-30 Thread Kevin Walzer
On 4/29/13 6:25 AM, Robert Flintham wrote: I’ve found this (TkDND): http://wiki.tcl.tk/2768 Michael Lange has written a nice Python wrapper for TkDND. His site is offline at the moment, but I found the source files on my system and have wrapped them up here: http://www.codebykevin.com/T

Re: Passing special characters in soap data

2013-04-30 Thread John Gordon
In Ombongi Moraa Fe writes: > My provider sends soap data to me as they receive from subscriber. as > expected the messages with special characters like quotes are received as > html entities. > like the message below had a quote: > ...I'll shape it up myself... > > Since i pass this data

Re: kbhit/getch python equivalent

2013-04-30 Thread xDog Walker
On Monday 2013 April 22 06:34, alb wrote: > Hi everyone, > > I'm looking for a kbhit/getch equivalent in python in order to be able > to stop my inner loop in a controlled way (communication with external > hardware is involved and breaking it abruptly may cause unwanted errors > on the protocol).

Re: Can read in the BMP data correctly ,but the size is not right?

2013-04-30 Thread Jimmie He
On Tuesday, April 30, 2013 1:57:07 AM UTC+8, Peter Otten wrote: > Jimmie He wrote: > > > > >I'm trying to read in the BMP data by the the code below,and I'm check > > >the data array with WINHEX,and it is correct,but which confuse me is > > >why the size is 0x180,but the actual pic

Re: Unwanted window spawns when using Tkinter with multiprocessing.

2013-04-30 Thread alternative00
> Dave A. No, not a new window, but my player function doesn't play any sound anymore. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unwanted window spawns when using Tkinter with multiprocessing.

2013-04-30 Thread Dave Angel
On 04/30/2013 08:22 AM, alternativ...@rocketmail.com wrote: > Dave A. Yeah I'm using MRAB's code, my current code is : #Initalisation global event global hitkey #Functions def key(event): hitkey = event.char instance = multiprocessing.Process(target=player, args=(hitkey,))

Re: Unwanted window spawns when using Tkinter with multiprocessing.

2013-04-30 Thread alternative00
> Dave A. Yeah I'm using MRAB's code, my current code is : #Initalisation global event global hitkey #Functions def key(event): hitkey = event.char instance = multiprocessing.Process(target=player, args=(hitkey,)) instance.start() def player(hitkey): winsound

Re: Drag and drop in Windows

2013-04-30 Thread Christian Gollwitzer
Hi Robert, Am 30.04.13 10:39, schrieb Robert Flintham: Thanks Christian. I've tried the following code: import Tkinter root = Tkinter.Tk() root.title("DICOM Opener") root.tk.eval('lappend auto_path {K:/Python27/Lib/site-packages/tkdnd2.6}') root.tk.eval('package require tkdnd'

RE: Passing special characters in soap data

2013-04-30 Thread Ombongi Moraa Fe
Hi Team, My provider sends soap data to me as they receive from subscriber. as expected the messages with special characters like quotes are received as html entities. like the message below had a quote: I'll shape it up myself... Since i pass this data into my python script as a command line

ANN: eGenix PyRun - One file Python Runtime 1.2.0

2013-04-30 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyRun - One file Python Runtime Version 1.2.0 An easy-to-use single file relocatable Python run-time - available for Windows, Mac OS X and

RE: Drag and drop in Windows

2013-04-30 Thread Robert Flintham
Thanks Christian. I've tried the following code: import Tkinter root = Tkinter.Tk() root.title("DICOM Opener") root.tk.eval('lappend auto_path {K:/Python27/Lib/site-packages/tkdnd2.6}') root.tk.eval('package require tkdnd') But I get the following traceback: ###