Re: my email

2012-07-19 Thread MRAB
On 18/07/2012 02:44, Maria Hanna Carmela Dionisio wrote: mmdionisio1...@yahoo.com.ph Just a newbhie here :> ...who has just revealed her password! [remainder snipped] -- http://mail.python.org/mailman/listinfo/python-list

Python Programming expert - adding user

2012-07-19 Thread Maria Hanna Carmela Dionisio
Im just a student :) Our prof gave as a task that we need to make a program using python (for redhat) and c++(for windows) Our objective is to make a program file and we will said it remotely to another computer via network ( its easy and i could do it lolz).. the hard part is the programming.

Re: my email

2012-07-19 Thread Karim
Le 18/07/2012 04:34, Simon Cropper a écrit : On 18/07/12 11:44, Maria Hanna Carmela Dionisio wrote: mmdionisio1...@yahoo.com.ph Just a newbhie here :> [snip] You must know your password to change your options (including changing the password, itself) or to unsubscribe. It is: sweet1030

Re: Foxpro goto command and deleted records

2012-07-19 Thread Ian Kelly
On Wed, Jul 18, 2012 at 8:40 AM, Grant Edwards wrote: > On 2012-07-17, Ethan Furman wrote: > >> In Foxpro if you do a > > Foxpro? http://en.wikipedia.org/wiki/Visual_FoxPro -- http://mail.python.org/mailman/listinfo/python-list

Re: A thread import problem

2012-07-19 Thread Dieter Maurer
Bruce Sherwood writes: > I'm trying to do something rather tricky, in which a program imports a > module that starts a thread that exec's a (possibly altered) copy of > the source in the original program, and the module doesn't return. > This has to do with an attempt to run VPython in the Mac Co

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Lipska the Kat
On 19/07/12 07:09, rusi wrote: On Jul 19, 6:34 am, Steven D'Aprano wrote: On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: Object Oriented programming is all about encapsulating human concepts in a way that makes sense to human beings. Make no mistake, it is NEVER the case that a soft

Incorrect detection of futimesns/futimes in 3.3.0b1

2012-07-19 Thread RICHARD MOSELEY
I have recently been compiling the source for 3.3.0 beta1 and have discovered that even though the functions futimens, futimes and lutimes are found by the configure script, since they exist as entry points in libc, their actually only stub functions that simply return ENOSYS (Not Implemented) when

Re: Incorrect detection of futimesns/futimes in 3.3.0b1

2012-07-19 Thread Christian Heimes
Am 19.07.2012 11:03, schrieb RICHARD MOSELEY: > I am now considering providing a general patch to the configure.ac > file which will more correctly detect all the > various flavours of utimes (futimens, futimes, lutimes, futimesat, > utimensat and utimes) using a different che

reloading code and multiprocessing

2012-07-19 Thread andrea crotti
We need to be able to reload code on a live system. This live system has a daemon process always running but it runs many subprocesses with multiprocessing, and the subprocesses might have a short life... Now I found a way to reload the code successfully, as you can see from this testcase: def

Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
tim@laptop:~/tmp$ python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import csv >>> from cStringIO import StringIO >>> s = StringIO('Email\n...@example.com\n...@example.org\n') >>> s.seek(0) >>> d

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Peter Otten
Tim Chase wrote: > tim@laptop:~/tmp$ python > Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import csv from cStringIO import StringIO s = StringIO('Email\n...@example.com\n...@example

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Steven D'Aprano
On Thu, 19 Jul 2012 06:21:58 -0500, Tim Chase wrote: > tim@laptop:~/tmp$ python > Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import csv from cStringIO import StringIO s = StringIO('E

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Steven D'Aprano
On Wed, 18 Jul 2012 23:09:13 -0700, rusi wrote: > Its not so much a question of language as in programming as language as > in layman-speak. > One characteristic with our field is that we take ordinary words and > then distort them so much the original meaning is completely lost. All technical fi

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
On 07/19/12 06:21, Tim Chase wrote: > tim@laptop:~/tmp$ python > Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import csv from cStringIO import StringIO s = StringIO('Email\n...@exampl

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Roy Smith
In article <500804cc$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Wed, 18 Jul 2012 23:09:13 -0700, rusi wrote: > > > Its not so much a question of language as in programming as language as > > in layman-speak. > > One characteristic with our field is that we take ord

Re: Python Programming expert - adding user

2012-07-19 Thread William R. Wing (Bill Wing)
On Jul 17, 2012, at 9:58 PM, Maria Hanna Carmela Dionisio wrote: > Im just a student :) > > Our prof gave as a task that we need to make a program using python (for > redhat) and c++(for windows) > > Our objective is to make a program file and we will said it remotely to > another computer via

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Hans Mulder
On 19/07/12 13:21:58, Tim Chase wrote: > tim@laptop:~/tmp$ python > Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import csv from cStringIO import StringIO s = StringIO('Email\n...@exa

Re: Google the video "9/11 Missing Links". 9/11 was a Jew Job!

2012-07-19 Thread Neal Becker
Google the video "Go fuck yourself" -- http://mail.python.org/mailman/listinfo/python-list

Use of compile flags in regular expressions.

2012-07-19 Thread Steven W. Orr
I have a problem that I'm solving using a regex. (Yeah, I know, now I have two problems...) ;-)> Anyways, the regex is about a couple of pages long and it works just peachy. There's just one thing I'd like to do to make it more elegant. I need to compile the regex with MULTILINE and DOTALL. B

Re: Google the video "9/11 Missing Links". 9/11 was a Jew Job!

2012-07-19 Thread Matty Sarro
I must be a Jew or a traitor as I keep deleting this email. Seriously guys, don't reply to it, it's not worth the time. On Thu, Jul 19, 2012 at 10:22 AM, Neal Becker wrote: > Google the video "Go fuck yourself" > > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.or

Re: reloading code and multiprocessing

2012-07-19 Thread 88888 Dihedral
andrea crotti於 2012年7月19日星期四UTC+8下午6時15分11秒寫道: > We need to be able to reload code on a live system. This live system > has a daemon process always running but it runs many subprocesses with > multiprocessing, and the subprocesses might have a short life... > > Now I found a way to reload the cod

Re: Use of compile flags in regular expressions.

2012-07-19 Thread MRAB
On 19/07/2012 15:22, Steven W. Orr wrote: I have a problem that I'm solving using a regex. (Yeah, I know, now I have two problems...) ;-)> Anyways, the regex is about a couple of pages long and it works just peachy. There's just one thing I'd like to do to make it more elegant. I need to compil

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread rusi
On Jul 19, 1:56 pm, Lipska the Kat wrote: > Academic twiddling with the distorted meaning of words spun by > vested interests is all very interesting I'm sure but doesn't really > advance the discussion does it? Well lets back up the discussion a bit. You coming from a Java background have one vi

shutil ignore fails on passing a tuple?

2012-07-19 Thread Alex van der Spek
This beats me: ipatterns ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) Traceback (most recent call last): File "", line 1, in ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) File "C:\

RE: shutil ignore fails on passing a tuple?

2012-07-19 Thread Prasad, Ramit
> >>> ipatterns > ('*.txt', '*.hdf', '*.pdf', '*.png') > >>> igf = shutil.ignore_patterns(ipatterns) > >>> ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) > > Traceback (most recent call last): > File "", line 1, in > ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) > File "C:\Python27

Re: shutil ignore fails on passing a tuple?

2012-07-19 Thread Joel Goldstick
On Thu, Jul 19, 2012 at 12:43 PM, Alex van der Spek wrote: > This beats me: > ipatterns > > ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) > > > Traceback (most recent call

Re: Odd csv column-name truncation with only one column

2012-07-19 Thread Tim Chase
On 07/19/12 08:52, Hans Mulder wrote: > Perhaps it should be documented that the Sniffer doesn't work > on single-column data. I think this would involve the least change in existing code, and go a long way towards removing my surprise. :-) > If you really need to read a one-column csv file, yo

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Paul Rudin
Steven D'Aprano writes: > For example, both ML and Haskell can, under some circumstances, report a > type-error for an infinite loop, *at compile time*. ... and in Charity all programs are guaranteed to terminate. Of course it's not Turing complete.

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Tim Chase
> If you think that people can routinely detect infinite loops, then > perhaps you would care to tell me whether this is an infinite loop or not: > > i = 1 > while not is_perfect(i): > i += 2 > print "odd perfect number discovered" > > > where is_perfect() returns True if the integer argume

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase wrote: > Sure it terminates...If you don't run out of RAM to represent the > number "i" in question, there's also this "heat death of the > universe" limit I keep hearing about ;-) I'd be more worried about the heat death of your computer, it's likely to

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Tim Chase
On 07/19/12 13:28, Chris Angelico wrote: > On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase > wrote: >> Sure it terminates...If you don't run out of RAM to represent the >> number "i" in question, there's also this "heat death of the >> universe" limit I keep hearing about ;-) > > I'd be more worried a

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 18, 6:36 pm, Simon Cropper wrote: > On 19/07/12 08:20, larry.mart...@gmail.com wrote: > > > > > > > > > > > I have an interesting problem I'm trying to solve. I have a solution > > almost working, but it's super ugly, and know there has to be a > > better, cleaner way to do it. > > > I have

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 18, 4:49 pm, Paul Rubin wrote: > "larry.mart...@gmail.com" writes: > > I have an interesting problem I'm trying to solve. I have a solution > > almost working, but it's super ugly, and know there has to be a > > better, cleaner way to do it. ... > > > My solution involves multiple maps and

RE: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread Prasad, Ramit
> > I am making the assumption that you intend to collapse the directory > > tree and store each file in the same directory, otherwise I can't think > > of why you need to do this. > > Hi Simon, thanks for the reply. It's not quite this - what I am doing > is creating a zip file with relative path

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 1:02 pm, "Prasad, Ramit" wrote: > > > I am making the assumption that you intend to collapse the directory > > > tree and store each file in the same directory, otherwise I can't think > > > of why you need to do this. > > > Hi Simon, thanks for the reply. It's not quite this - what I a

Re: shutil ignore fails on passing a tuple?

2012-07-19 Thread Dave Angel
On 07/19/2012 12:43 PM, Alex van der Spek wrote: > This beats me: > ipatterns > ('*.txt', '*.hdf', '*.pdf', '*.png') igf = shutil.ignore_patterns(ipatterns) ignorethis = igf(ddftopdir,os.listdir(ddftopdir)) > > > Why does it fail on passing in a tuple of ignore

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 18, 4:49 pm, Paul Rubin wrote: > "larry.mart...@gmail.com" writes: > > I have an interesting problem I'm trying to solve. I have a solution > > almost working, but it's super ugly, and know there has to be a > > better, cleaner way to do it. ... > > > My solution involves multiple maps and

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread Paul Rubin
"larry.mart...@gmail.com" writes: > Thanks for the reply Paul. I had not heard of itertools. It sounds > like just what I need for this. But I am having 1 issue - how do you > know how many items are in each group? Simplest is: for key, group in groupby(xs, lambda x:(x[-1],x[4],x[5])): gs

properly catch SIGTERM

2012-07-19 Thread Eric Frederich
So I wrote a script which acts like a daemon. And it starts with something like this ### Begin Code import signal STOPIT = False def my_SIGTERM_handler(signum, frame): global STOPIT print '\n--- Caught SIGTERM; Attempting to quit gracefully ---' STOPIT = True signal.sig

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread Paul Rubin
"larry.mart...@gmail.com" writes: > You can't do a len on the iterator that is returned from groupby, and > I've tried to do something with imap or defaultdict, but I'm not > getting anywhere. I guess I can just make 2 passes through the data, > the first time getting counts. Or am I missing

logging time format millisecond precision

2012-07-19 Thread Alex van der Spek
I use this formatter in logging: formatter = logging.Formatter(fmt='%(asctime)s \t %(name)s \t %(levelname)s \t %(message)s') Sample output: 2012-07-19 21:34:58,382 root INFO Removed - C:\Users\ZDoor\Documents The time stamp has millisecond precision but the decimal separator is a com

Let child process to run while parent is out (multiprocessing)

2012-07-19 Thread John Wong
def main(...): build_id = create_build_id(...) build_stuff return build_id Suppose build_stuff compiles a C program. It could take days to finish, and notify users their builds are ready. I was thinking about using mutliprocessing to handle the build_stuff. So here is a sample: #!/us

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
In Dennis Lee Bieber writes: > > Sure it terminates...If you don't run out of RAM to represent the > > number "i" in question, there's also this "heat death of the > > universe" limit I keep hearing about ;-) > > > Since the current evidence indicates the universe will just keep > expandi

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread MRAB
On 19/07/2012 20:06, larry.mart...@gmail.com wrote: On Jul 19, 1:02 pm, "Prasad, Ramit" wrote: > > I am making the assumption that you intend to collapse the directory > > tree and store each file in the same directory, otherwise I can't think > > of why you need to do this. > Hi Simon, thanks

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread OKB (not okblacke)
MRAB wrote: > """Thus spake the Lord: Thou shalt indent with four spaces. No > more, no less. > Four shall be the number of spaces thou shalt indent, and the > number of thy indenting shall be four. Eight shalt thou not indent, > nor either indent thou > two, excepting that thou then proceed to fo

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 7:01 AM, John Gordon wrote: > In Dennis Lee Bieber > writes: > >> > Sure it terminates...If you don't run out of RAM to represent the >> > number "i" in question, there's also this "heat death of the >> > universe" limit I keep hearing about ;-) >> > >> Since the c

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
In Chris Angelico writes: > The second law of thermodynamics states that energy tends to go from > higher states to lower, with heat being the very lowest. It's possible > to do work using (say) kinetic energy, and in the process, some of > that energy becomes heat. It's also possible to do wor

help

2012-07-19 Thread Miriam Gomez Rios
Hello, sorry for bothering you, but I have a doubt, Is there a way to turn this string into a tuplelist??, I need it for gurobi ('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),('per1','persona1.1','pro4'),('per1','persona1.1','pro5'),('per2','persona2.1'

Re: Let child process to run while parent is out (multiprocessing)

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 6:34 AM, John Wong wrote: > Here is output: > yeukhon@fermat:~$ python c2.py > abcd12345 > done [now hangs for 10 seconds] > I build things Side point: I just tried your code on Python 2.6 on Windows, and it produced all three lines of output before waiting the ten second

Re: help

2012-07-19 Thread Benjamin Kaplan
On Jul 19, 2012 4:04 PM, "Miriam Gomez Rios" wrote: > > Hello, sorry for bothering you, but I have a doubt, > > Is there a way to turn this string into a tuplelist??, I need it for gurobi > > ('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),('per1','person

Re: help

2012-07-19 Thread Tim Chase
On 07/19/12 17:31, Miriam Gomez Rios wrote: > Hello, sorry for bothering you, but I have a doubt, > > Is there a way to turn this string into a tuplelist??, I > need it for gurobi > > ('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),...,('per2','persona2.

RE: help

2012-07-19 Thread Prasad, Ramit
>('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),('per1','persona1.1','pro4'),('per1','persona1.1','pro5'),('per2','persona2.1','pro1'),('per2','persona2.1','pro2'),('per2','persona2.1','pro3'),('per2','persona2.1','pro4'),('per2','persona2.1','pro5'),('per2',

Re: help

2012-07-19 Thread Tim Chase
On 07/19/12 18:26, Prasad, Ramit wrote: >> ('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),('per1','persona1.1','pro4'),('per1','persona1.1','pro5'),('per2','persona2.1','pro1'),('per2','persona2.1','pro2'),('per2','persona2.1','pro3'),('per2','persona2.1','pr

best way to handle this in Python

2012-07-19 Thread Rita
Hello, I have data in many files (/data/year/month/day/) which are named like YearMonthDayHourMinute.gz. I would like to build a data structure which can easily handle querying the data. So for example, if I want to query data from 3 weeks ago till today, i can do it rather quickly. each YearMon

Re: Which lib can diff two dict tree?

2012-07-19 Thread alex23
On Jul 19, 7:51 pm, esbat...@gmail.com wrote: > Q1: > which lib can diff two dict tree? > Q2 > How can I diff two json file?How can I get struct_diff and value_diff? > Q3 > How can I diff two xml file? How can I get struct_diff and value_diff? Rather than trying to come up with a method for findin

Re: help

2012-07-19 Thread Tim Chase
On 07/19/12 19:32, Miriam Gomez Rios wrote: s = "('per1','persona1.1','pro1'),('per1','persona1.1','pro2')" >> resulting_tuple_of_tuples = ast.literal_eval(s) > > Traceback (most recent call last): > File "C:\Users\Miriam\scripts\prueba_datos", line 124, in > print resulting_tuple.s

Re: best way to handle this in Python

2012-07-19 Thread Dave Angel
On 07/19/2012 07:51 PM, Rita wrote: > Hello, > > I have data in many files (/data/year/month/day/) which are named like > YearMonthDayHourMinute.gz. > > I would like to build a data structure which can easily handle querying the > data. So for example, if I want to query data from 3 weeks ago till

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 1:56 pm, Paul Rubin wrote: > "larry.mart...@gmail.com" writes: > > You can't do a len on the iterator that is returned from groupby, and > > I've tried to do something with imap or      defaultdict, but I'm not > > getting anywhere. I guess I can just make 2 passes through the data, >

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 3:32 pm, MRAB wrote: > On 19/07/2012 20:06, larry.mart...@gmail.com wrote: > > > > > > > > > On Jul 19, 1:02 pm, "Prasad, Ramit" wrote: > >> > > I am making the assumption that you intend to collapse the directory > >> > > tree and store each file in the same directory, otherwise I can

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 1:43 pm, Paul Rubin wrote: > "larry.mart...@gmail.com" writes: > > Thanks for the reply Paul. I had not heard of itertools. It sounds > > like just what I need for this. But I am having 1 issue - how do you > > know how many items are in each group? > > Simplest is: > >   for key, grou

Re: best way to handle this in Python

2012-07-19 Thread Rita
Using linux 2.6.31; Python 2.7.3. I am not necessary looking for code just a pythonic way of doing it. Eventually, I would like to graph the data using matplotlib On Thu, Jul 19, 2012 at 8:52 PM, Dave Angel wrote: > On 07/19/2012 07:51 PM, Rita wrote: > > Hello, > > > > I have data in many fi

Re: Need help connecting via a remote VPN

2012-07-19 Thread The Coca Cola Kid
"Dave Angel" wrote in message news:mailman.2284.1342663213.4697.python-l...@python.org... Starting a VPN simply makes it possible for IP packets to get to the specified machine. You still need to match some protocol that the particular remote machine can handle. SSH is probably the most comm

Re: Need help connecting via a remote VPN

2012-07-19 Thread Dave Angel
On 07/19/2012 09:41 PM, The Coca Cola Kid wrote: > "Dave Angel" wrote in message > news:mailman.2284.1342663213.4697.python-l...@python.org... > >> Starting a VPN simply makes it possible for IP packets to get to the >> specified machine. You still need to match some protocol that the >> particul

Re: Finding duplicate file names and modifying them based on elements of the path

2012-07-19 Thread larry.mart...@gmail.com
On Jul 19, 7:01 pm, "larry.mart...@gmail.com" wrote: > On Jul 19, 3:32 pm, MRAB wrote: > > > > > > > > > > > On 19/07/2012 20:06, larry.mart...@gmail.com wrote: > > > > On Jul 19, 1:02 pm, "Prasad, Ramit" wrote: > > >> > > I am making the assumption that you intend to collapse the directory > >

Re: properly catch SIGTERM

2012-07-19 Thread Dieter Maurer
Eric Frederich writes: > ... > This seems to work okay but just now I got this while hitting ctrl-c > It seems to have caught the signal at or in the middle of a call to > sys.stdout.flush() > --- Caught SIGTERM; Attempting to quit gracefully --- > Traceback (most recent call last): >   File "/hom