Re: hello please can you help me with the below problem am facing

2015-01-09 Thread gcptesthp
On Friday, January 9, 2015 at 3:47:27 AM UTC-8, mubarak idris wrote: > Please how can I make an .exe executable app out of my python script easily http://www.py2exe.org/ -- https://mail.python.org/mailman/listinfo/python-list

hello please can you help me with the below problem am facing

2015-01-09 Thread mubarak idris
Please how can I make an .exe executable app out of my python script easily -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello World

2015-01-08 Thread Grant Edwards
On 2015-01-08, Michael Torrie wrote: > On 01/08/2015 10:02 AM, Steve Hayes wrote: >> On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) >> wrote: >> >>> I don't trust sudo because it is too complicated. (To the point that >>> I removed it from my machine.) I do >> >> H

Re: Hello World

2015-01-08 Thread Michael Torrie
On 01/08/2015 10:02 AM, Steve Hayes wrote: > On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) > wrote: > >> I don't trust sudo because it is too complicated. >> (To the point that I removed it from my machine.) >> I do > > How do you do that? > > I avoided Ubuntu bec

Re: Hello World

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 4:02 AM, Steve Hayes wrote: > On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) > wrote: > >>I don't trust sudo because it is too complicated. >>(To the point that I removed it from my machine.) >>I do > > How do you do that? > > I avoided Ubuntu

Re: Hello World

2015-01-08 Thread Steve Hayes
On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) wrote: >I don't trust sudo because it is too complicated. >(To the point that I removed it from my machine.) >I do How do you do that? I avoided Ubuntu because it had sudo, and then discovered that Fedora had it as wel

Re: Hello World

2015-01-08 Thread alister
On Thu, 08 Jan 2015 16:31:22 +0200, Marko Rauhamaa wrote: > alister : > >> On Thu, 08 Jan 2015 16:06:16 +0200, Marko Rauhamaa wrote: >>> An administrator doesn't need the users' passwords for anything but >>> should be assumed to know them. >> >> The administrator may be able to change them but h

Re: Hello World

2015-01-08 Thread Marko Rauhamaa
alister : > On Thu, 08 Jan 2015 16:06:16 +0200, Marko Rauhamaa wrote: >> An administrator doesn't need the users' passwords for anything but >> should be assumed to know them. > > The administrator may be able to change them but he should NEVER know > them (or need to)! When you are under an adm

Re: Hello World

2015-01-08 Thread alister
On Thu, 08 Jan 2015 16:06:16 +0200, Marko Rauhamaa wrote: > Chris Angelico : > >> With sudo, you get MUCH finer control. I can grant some user the power >> to run "sudo eject sr0", but no other commands. I can permit someone to >> execute any of a large number of commands, all individually logged

Re: Hello World

2015-01-08 Thread Michael Ströder
Chris Angelico wrote: > With sudo, you get MUCH finer control. But it's very hard, almost impossible, to really implement fine-grained control with sudo. Too many programs provide shell exits. Well, it's off-topic here. How about taking this to news:comp.security.unix ? Ciao, Michael. -- https

Re: Hello World

2015-01-08 Thread Marko Rauhamaa
Chris Angelico : > With sudo, you get MUCH finer control. I can grant some user the power > to run "sudo eject sr0", but no other commands. I can permit someone > to execute any of a large number of commands, all individually logged. I can't remember ever having a need for that. I sometimes use s

Re: Hello World

2015-01-08 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Thu, Jan 8, 2015 at 11:43 PM, Albert van der Horst > wrote: >> I don't trust sudo because it is too complicated. >> (To the point that I removed it from my machine.) >> I do >> su >> .. >> # >> su nobody >> >> Who needs sudo? > >With sudo, you get MUCH finer

Re: Hello World

2015-01-08 Thread Chris Angelico
On Thu, Jan 8, 2015 at 11:43 PM, Albert van der Horst wrote: > I don't trust sudo because it is too complicated. > (To the point that I removed it from my machine.) > I do > su > .. > # > su nobody > > Who needs sudo? With sudo, you get MUCH finer control. I can grant some user the power to run "

Re: Hello World

2015-01-08 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy wrote: >> Just to be clear, writing to sys.stdout works fine in Idle. >>>>> import sys; sys.stdout.write('hello ') >> hello #2.7 >> >> In 3.4, the

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-26 Thread alister
On Fri, 26 Dec 2014 15:13:25 +1100, Steven D'Aprano wrote: > Deep in the brain, well underneath the level of modern languages and > consciousness, there is a deeper "machine language" of the brain. If you > can write instructions in this machine language, you can control > people's brains. Back

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-25 Thread Steven D'Aprano
alex23 wrote: > On 24/12/2014 2:20 AM, Grant Edwards wrote: >> And even _with_ all the technical jibber-jabber, none of it explained >> or justified the whole "writing a virus to infect the brain through >> the optic nerve" thing which might just have well been magick and >> witches. > > While I

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-25 Thread alex23
On 24/12/2014 9:50 PM, alister wrote: what feels like 3 or 4 chapters in & it is still trying to set the scene, an exercise in stylish writing with very little content so far. even early scifi written for magazines on a per word basis were not this excessive (because if they were they would proba

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-25 Thread alex23
On 24/12/2014 2:20 AM, Grant Edwards wrote: And even _with_ all the technical jibber-jabber, none of it explained or justified the whole "writing a virus to infect the brain through the optic nerve" thing which might just have well been magick and witches. While I love SNOW CRASH, I do think it

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-24 Thread alister
On Tue, 23 Dec 2014 16:20:10 +, Grant Edwards wrote: > On 2014-12-23, Steven D'Aprano > wrote: >> Chris Angelico wrote: >> >>> On Tue, Dec 23, 2014 at 12:15 AM, Roy Smith wrote: If I really didn't trust something, I'd go to AWS and spin up one of their free-tier micro instances and

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-23 Thread Steven D'Aprano
Grant Edwards wrote: > On 2014-12-23, Steven D'Aprano > wrote: >> Chris Angelico wrote: >> >>> On Tue, Dec 23, 2014 at 12:15 AM, Roy Smith wrote: If I really didn't trust something, I'd go to AWS and spin up one of their free-tier micro instances and run it there :-) >>> >>> How do yo

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-23 Thread Steven D'Aprano
Rustom Mody wrote: > On Tuesday, December 23, 2014 9:50:22 PM UTC+5:30, Grant Edwards wrote: >> >> And even _with_ all the technical jibber-jabber, none of it explained >> or justified the whole "writing a virus to infect the brain through >> the optic nerve" thing which might just have well been

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-23 Thread Rustom Mody
On Tuesday, December 23, 2014 9:50:22 PM UTC+5:30, Grant Edwards wrote: > > And even _with_ all the technical jibber-jabber, none of it explained > or justified the whole "writing a virus to infect the brain through > the optic nerve" thing which might just have well been magick and > witches. Yo

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-23 Thread Grant Edwards
On 2014-12-23, Steven D'Aprano wrote: > Chris Angelico wrote: > >> On Tue, Dec 23, 2014 at 12:15 AM, Roy Smith wrote: >>> If I really didn't trust something, I'd go to AWS and spin up one of >>> their free-tier micro instances and run it there :-) >> >> How do you know it won't create console ou

Re: Hello World

2014-12-22 Thread Rustom Mody
O thats nothing. Ive eaten cookies. Given by strangers can contain narcotics you know! Ive even walked on the road. Mines? Youve heard of them right?!? People get their legs blown off [shivers] Only computers I dont use -- Just too dangerous. If cars and bikes can have bombs -- why not a compu

Re: Hello World

2014-12-22 Thread Mark Lawrence
On 23/12/2014 01:39, Chris Angelico wrote: On Tue, Dec 23, 2014 at 12:37 PM, MRAB wrote: And a programming newsgroup isn't really the plaice for it anyway! And yet we do carp on a bit, don't we... ChrisA Gordon Bennett what have I started? You dangle a bit of bait and... -- My fellow Py

OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-22 Thread Steven D'Aprano
Chris Angelico wrote: > On Tue, Dec 23, 2014 at 12:15 AM, Roy Smith wrote: >> If I really didn't trust something, I'd go to AWS and spin up one of >> their free-tier micro instances and run it there :-) > > How do you know it won't create console output that stroboscopically > infects you with a

Re: Hello World

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 12:37 PM, MRAB wrote: > And a programming newsgroup isn't really the plaice for it anyway! And yet we do carp on a bit, don't we... ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello World

2014-12-22 Thread MRAB
On 2014-12-23 01:03, sohcahto...@gmail.com wrote: On Monday, December 22, 2014 4:56:13 PM UTC-8, Roy Smith wrote: In article , Tim Chase wrote: > On 2014-12-22 19:05, MRAB wrote: > > On 2014-12-22 18:51, Mark Lawrence wrote: > > > I'm having wonderful thoughts of Michael Palin's favourite Pyt

Re: Hello World

2014-12-22 Thread sohcahtoa82
On Monday, December 22, 2014 4:56:13 PM UTC-8, Roy Smith wrote: > In article , > Tim Chase wrote: > > > On 2014-12-22 19:05, MRAB wrote: > > > On 2014-12-22 18:51, Mark Lawrence wrote: > > > > I'm having wonderful thoughts of Michael Palin's favourite Python > > > > sketch which involved fish sl

Re: Hello World

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 11:55 AM, Roy Smith wrote: > In article , > Tim Chase wrote: > >> On 2014-12-22 19:05, MRAB wrote: >> > On 2014-12-22 18:51, Mark Lawrence wrote: >> > > I'm having wonderful thoughts of Michael Palin's favourite Python >> > > sketch which involved fish slapping. >> > > >>

Re: Hello World

2014-12-22 Thread Roy Smith
In article , Tim Chase wrote: > On 2014-12-22 19:05, MRAB wrote: > > On 2014-12-22 18:51, Mark Lawrence wrote: > > > I'm having wonderful thoughts of Michael Palin's favourite Python > > > sketch which involved fish slapping. > > > > > Well, ChrisA _has_ mentioned Pike in this thread. :-) > > B

Re: Encryption - was Hello World

2014-12-22 Thread Dave Angel
On 12/22/2014 05:29 PM, Chris Angelico wrote: On Tue, Dec 23, 2014 at 6:57 AM, Dave Angel wrote: I figure I must be misunderstanding something in your explanation, since a brute-force password guesser would seem to only need four billion tries to (probably) crack that. As to the assump

Re: Encryption - was Hello World

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 6:57 AM, Dave Angel wrote: > I figure I must be misunderstanding something in your explanation, since a > brute-force password guesser would seem to only need four billion tries to > (probably) crack that. > > 1) Are you assuming that the cracker can read the source code, b

Encryption - was Hello World

2014-12-22 Thread Dave Angel
On 12/22/2014 12:25 PM, Chris Angelico wrote: There's one exception. Writing your own crypto is a bad idea if that means reimplementing AES... but if you want something that's effective on completely different levels, sometimes it's best to write your own. I had a project a while ago that needed

Re: Hello World

2014-12-22 Thread Tim Chase
On 2014-12-22 19:05, MRAB wrote: > On 2014-12-22 18:51, Mark Lawrence wrote: > > I'm having wonderful thoughts of Michael Palin's favourite Python > > sketch which involved fish slapping. > > > Well, ChrisA _has_ mentioned Pike in this thread. :-) But you know he does it just for the halibut... -

Re: Hello World

2014-12-22 Thread alister
On Mon, 22 Dec 2014 16:18:33 +, Grant Edwards wrote: > On 2014-12-21, Tony the Tiger wrote: >> On Sat, 20 Dec 2014 23:57:08 +1100, Steven D'Aprano wrote: >> >>> I am in total awe. >> >> I'm not. It has no real value. Write your code like that and you'll >> soon be looking for a new job. > >

Re: Hello World

2014-12-22 Thread MRAB
On 2014-12-22 18:51, Mark Lawrence wrote: On 22/12/2014 16:23, Grant Edwards wrote: On 2014-12-21, Roy Smith wrote: In article <54974ed7$0$12986$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Obviously you don't write obfuscated code like this for production use, except in su

Re: Hello World

2014-12-22 Thread Mark Lawrence
On 22/12/2014 16:23, Grant Edwards wrote: On 2014-12-21, Roy Smith wrote: In article <54974ed7$0$12986$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Obviously you don't write obfuscated code like this for production use, except in such cases where you deliberately want to wri

Re: Hello World

2014-12-22 Thread Mark Lawrence
On 22/12/2014 15:39, Skip Montanaro wrote: On Mon, Dec 22, 2014 at 9:22 AM, Steven D'Aprano mailto:steve%2bcomp.lang.pyt...@pearwood.info>> wrote: > Don't try this at home! > > > # download_naked_pictures_of_jennifer_lawrence.py > import os > os.system("rm ――rf /") And because Steven *kno

Re: Hello World

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 3:23 AM, Grant Edwards wrote: >> Heh. I once worked on a C++ project that included its own crypo code >> (i.e. custom implementations of things like AES and SHA-1). > > Damn. Should I ever start to do something like that (for a real > product), I hereby officially request

Re: Hello World

2014-12-22 Thread Steven D'Aprano
Skip Montanaro wrote: > On Mon, Dec 22, 2014 at 9:22 AM, Steven D'Aprano < > steve+comp.lang.pyt...@pearwood.info> wrote: >> Don't try this at home! >> >> >> # download_naked_pictures_of_jennifer_lawrence.py >> import os >> os.system("rm ――rf /") > > And because Steven *knows* some fool will "try

Re: Hello World

2014-12-22 Thread Grant Edwards
for production use. > > Yes, my initial reaction was "that's awesome". > > And my second thought was that it was scary. > > I ran it. It worked, and printed "Hello world". I was awed. > > But what if I had run it and it reformatted my hard disk? > &g

Re: Hello World

2014-12-22 Thread Grant Edwards
On 2014-12-21, Roy Smith wrote: > In article <54974ed7$0$12986$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Obviously you don't write obfuscated code like this for production use, >> except in such cases where you deliberately want to write obfuscated code >> for production

Re: Hello World

2014-12-22 Thread Grant Edwards
On 2014-12-21, Tony the Tiger wrote: > On Sat, 20 Dec 2014 23:57:08 +1100, Steven D'Aprano wrote: > >> I am in total awe. > > I'm not. It has no real value. Write your code like that and you'll soon > be looking for a new job. I think you'll find that people who know enough to write code like th

Re: Hello World

2014-12-22 Thread Chris Warrick
On Mon, Dec 22, 2014 at 4:36 PM, Jussi Piitulainen wrote: > Steven D'Aprano writes: > >> Don't try this at home! >> >> # download_naked_pictures_of_jennifer_lawrence.py >> import os >> os.system("rm ――rf /") > > Not sure what that character is (those characters are) but it's not > (they aren't) th

Re: Hello World

2014-12-22 Thread Skip Montanaro
On Mon, Dec 22, 2014 at 9:22 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > Don't try this at home! > > > # download_naked_pictures_of_jennifer_lawrence.py > import os > os.system("rm ――rf /") And because Steven *knows* some fool will "try this at home", he cripples the rm co

Re: Hello World

2014-12-22 Thread Jussi Piitulainen
Steven D'Aprano writes: > Don't try this at home! > > # download_naked_pictures_of_jennifer_lawrence.py > import os > os.system("rm ――rf /") Not sure what that character is (those characters are) but it's not (they aren't) the hyphen that rm expects in its options, so: >>> os.system("rm ――rf

Re: Hello World

2014-12-22 Thread Steven D'Aprano
Roy Smith wrote: > If I wanted to write something evil, I wouldn't write it to > look obfuscated.  I'd write it to look like it did something useful. That's an order of magnitude harder than merely obfuscating code. If you wanted to write something evil, better to just rely on the fact that most

Re: Hello World

2014-12-22 Thread Roy Smith
In article <87egrrrf2i@elektro.pacujo.net>, Marko Rauhamaa wrote: > Roy Smith : > > > If I really didn't trust something, I'd go to AWS and spin up one of > > their free-tier micro instances and run it there :-) > > Speaking of trust and AWS, Amazon admins—and by extension, the NSA—hav

Re: Hello World

2014-12-22 Thread Marko Rauhamaa
Roy Smith : > If I really didn't trust something, I'd go to AWS and spin up one of > their free-tier micro instances and run it there :-) Speaking of trust and AWS, Amazon admins—and by extension, the NSA—have full access to the virtual machines. That needs to be taken into account when running s

Re: Hello World

2014-12-22 Thread Chris Angelico
On Tue, Dec 23, 2014 at 12:15 AM, Roy Smith wrote: > If I really didn't trust something, I'd go to AWS and spin up one of > their free-tier micro instances and run it there :-) How do you know it won't create console output that stroboscopically infects you with a virus through your eyes? Because

Re: Hello World

2014-12-22 Thread Roy Smith
In article <5497e1d5$0$12978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Steve Hayes wrote: > > > Yes, my initial reaction was "that's awesome". > > > > And my second thought was that it was scary. > > > &

Re: Hello World

2014-12-22 Thread Roy Smith
? :-) > > > > > >Obviously you don't write obfuscated code like this for production use, > >except in such cases where you deliberately want to write obfuscated code > >for production use. > > Yes, my initial reaction was "that's awesome"

Re: Hello World

2014-12-22 Thread Marko Rauhamaa
Steven D'Aprano : > Steve Hayes wrote: >> But what if I had run it and it reformatted my hard disk? >> >> How would I have known that it would or wouldn't do that? > > That's why I didn't run it myself :-) Well, I admit having run yum install python3 as root. > Ultimately, I'm trusting the

Re: Hello World

2014-12-22 Thread Steven D'Aprano
Steve Hayes wrote: > Yes, my initial reaction was "that's awesome". > > And my second thought was that it was scary. > > I ran it. It worked, and printed "Hello world". I was awed. > > But what if I had run it and it reformatted my hard disk

Re: Hello World

2014-12-22 Thread Chris Angelico
On Mon, Dec 22, 2014 at 7:52 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> Level 0: Why implement your own crypto?!? > > Licensing concerns come to mind. > > For example, the reference implementations of MD5 [RFC1321] and SHA1 > [RFC3174] are not in the public domain. Which would you prefer?

Re: Hello World

2014-12-22 Thread Marko Rauhamaa
Chris Angelico : > Level 0: Why implement your own crypto?!? Licensing concerns come to mind. For example, the reference implementations of MD5 [RFC1321] and SHA1 [RFC3174] are not in the public domain. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello World

2014-12-21 Thread Chris Angelico
On Mon, Dec 22, 2014 at 6:46 PM, Steve Hayes wrote: > But a hacker who can write that kind of stuff can probably bypass any > safeguards built into the OS. This isn't magic. You can't just do more of it to get past the firewalls, like in sci fi. It's much MUCH easier to attack the humans than the

Re: Hello World

2014-12-21 Thread Steve Hayes
On Mon, 22 Dec 2014 17:33:10 +1100, Chris Angelico wrote: >On Mon, Dec 22, 2014 at 5:21 PM, Steve Hayes wrote: >> Yes, my initial reaction was "that's awesome". >> >> And my second thought was that it was scary. >> >> I ran it. It worked, and prin

Re: Hello World

2014-12-21 Thread Chris Angelico
On Mon, Dec 22, 2014 at 5:21 PM, Steve Hayes wrote: > Yes, my initial reaction was "that's awesome". > > And my second thought was that it was scary. > > I ran it. It worked, and printed "Hello world". I was awed. > > But what if I had run it and it

Re: Hello World

2014-12-21 Thread Steve Hayes
e obfuscated code >for production use. Yes, my initial reaction was "that's awesome". And my second thought was that it was scary. I ran it. It worked, and printed "Hello world". I was awed. But what if I had run it and it reformatted my hard disk? How would I ha

Re: Hello World

2014-12-21 Thread Mark Lawrence
On 22/12/2014 00:20, mm0fmf wrote: On 22/12/2014 00:10, Chris Angelico wrote: Level 0: Why implement your own crypto?!? Because people who don't understand the concepts behind cryptography don't understand that the crypto algorithm can be open whilst the results of applying the algorithm are s

Re: Hello World

2014-12-21 Thread Rustom Mody
where you deliberately want to write obfuscated code > for production use. > > Any beginner with 3 seconds experience with Python can write: > > print "Hello World" > Bad Boy -- Stand in the corner for forgetting the '()' [Good boys use python3] On a mor

Re: Hello World

2014-12-21 Thread Cameron Simpson
lambda _, __, ___, , _, __, ___, : _ File "C:/Python27/helloworld.py", line 21, in _))) + (_ << __) + (_ << ___) OSError: [Errno 9] Bad file descriptor Yes, because - like most "Hello world" programs - it attempts to write to stdout. This interfere

Re: Hello World

2014-12-21 Thread Tim Chase
On 2014-12-22 00:20, mm0fmf wrote: > On 22/12/2014 00:10, Chris Angelico wrote: > > Level 0: Why implement your own crypto?!? > > Because people who don't understand the concepts behind > cryptography don't understand that the crypto algorithm can be open > whilst the results of applying the algor

Re: Hello World

2014-12-21 Thread Chris Angelico
On Mon, Dec 22, 2014 at 11:12 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Mon, Dec 22, 2014 at 10:50 AM, Roy Smith wrote: >> > Heh. I once worked on a C++ project that included its own crypo code >> > (i.e. custom implementations of things like AES and SHA-1). The pers

Re: Hello World

2014-12-21 Thread mm0fmf
On 22/12/2014 00:10, Chris Angelico wrote: Level 0: Why implement your own crypto?!? Because people who don't understand the concepts behind cryptography don't understand that the crypto algorithm can be open whilst the results of applying the algorithm are secure. There again I always use

Re: Hello World

2014-12-21 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Dec 22, 2014 at 10:50 AM, Roy Smith wrote: > > Heh. I once worked on a C++ project that included its own crypo code > > (i.e. custom implementations of things like AES and SHA-1). The person > > who wrote some particular bit of the code had decided

Re: Hello World

2014-12-21 Thread Chris Angelico
On Mon, Dec 22, 2014 at 10:50 AM, Roy Smith wrote: > Heh. I once worked on a C++ project that included its own crypo code > (i.e. custom implementations of things like AES and SHA-1). The person > who wrote some particular bit of the code had decided that deliberately > obfuscating the function

Re: Hello World

2014-12-21 Thread Roy Smith
In article <54974ed7$0$12986$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Obviously you don't write obfuscated code like this for production use, > except in such cases where you deliberately want to write obfuscated code > for production use. Heh. I once worked on a C++ proje

Re: Hello World

2014-12-21 Thread Steven D'Aprano
e wrong side of the bed this morning? :-) Obviously you don't write obfuscated code like this for production use, except in such cases where you deliberately want to write obfuscated code for production use. Any beginner with 3 seconds experience with Python can write: print "Hello Wo

Re: Hello World

2014-12-21 Thread Marko Rauhamaa
Tony the Tiger : > On Sat, 20 Dec 2014 23:57:08 +1100, Steven D'Aprano wrote: > >> I am in total awe. > > I'm not. It has no real value. It is, of course, a joke, and there are whole tongue-in-cheek languages like Brainfuck. However, some similar exercises carry deep meaning. Take, for example, i

Re: Hello World

2014-12-21 Thread Marko Rauhamaa
CM : > On Sunday, December 21, 2014 2:44:50 AM UTC-5, CM wrote: >> Hello, world! >> 13 > > Actually, there is no comma after Hello. Do you have a patch? Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello World

2014-12-20 Thread CM
On Sunday, December 21, 2014 2:44:50 AM UTC-5, CM wrote: > On Sunday, December 21, 2014 1:45:02 AM UTC-5, Chris Angelico wrote: > > On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy wrote: > > > Just to be clear, writing to sys.stdout works fine in Idle. > > >>>>

Re: Hello World

2014-12-20 Thread Chris Angelico
On Sun, Dec 21, 2014 at 6:44 PM, CM wrote: > Yes, just tested it on the same machine in the terminal and it prints: > > Hello, world! > 13 > > Not sure what the 13 is all about. Thanks. Number of bytes output. It's the return value from the output call - common with

Re: Hello World

2014-12-20 Thread CM
On Sunday, December 21, 2014 1:45:02 AM UTC-5, Chris Angelico wrote: > On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy wrote: > > Just to be clear, writing to sys.stdout works fine in Idle. > >>>> import sys; sys.stdout.write('hello ') > > hello #2.7 > &

Re: Hello World

2014-12-20 Thread Chris Angelico
On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy wrote: > Just to be clear, writing to sys.stdout works fine in Idle. >>>> import sys; sys.stdout.write('hello ') > hello #2.7 > > In 3.4, the number of chars? bytes? is returned and written also. > > Whether you

Re: Hello World

2014-12-20 Thread Terry Reedy
_ File "C:/Python27/helloworld.py", line 21, in _))) + (_ << __) + (_ << ___) OSError: [Errno 9] Bad file descriptor Yes, because - like most "Hello world" programs - it attempts to write to stdout. This interferes with IDLE and the way it cap

Re: Hello World

2014-12-20 Thread Chris Angelico
hon27/helloworld.py", line 21, in > _))) + (_ << __) + (_ << ___) > OSError: [Errno 9] Bad file descriptor Yes, because - like most "Hello world" programs - it attempts to write to stdout. This interferes with IDLE and the way it captures output for the

Re: Hello World

2014-12-20 Thread Steven D'Aprano
CM wrote: > On Saturday, December 20, 2014 7:57:19 AM UTC-5, Steven D'Aprano wrote: >> Taken from Ben Kurtovic's blog: >> >> http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html [...] > I ran it in IDLE with Python 2.7.8 and got: > > Traceb

Re: Hello World

2014-12-20 Thread CM
On Saturday, December 20, 2014 7:57:19 AM UTC-5, Steven D'Aprano wrote: > Taken from Ben Kurtovic's blog: > > http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html > > > > (lambda _, __, ___, , _, __, ___, : > getattr( &

Re: Hello World

2014-12-20 Thread alister
On Sat, 20 Dec 2014 23:57:08 +1100, Steven D'Aprano wrote: > Taken from Ben Kurtovic's blog: > > http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html > > > > (lambda _, __, ___, , _, __, ___, : > getattr( >

Re: Hello World

2014-12-20 Thread Steve Hayes
On Sat, 20 Dec 2014 23:57:08 +1100, Steven D'Aprano wrote: >Taken from Ben Kurtovic's blog: > >http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html > > > >(lambda _, __, ___, , _, __, ___, : >getattr( >

Re: Hello World

2014-12-20 Thread Rustom Mody
On Saturday, December 20, 2014 6:27:19 PM UTC+5:30, Steven D'Aprano wrote: > Taken from Ben Kurtovic's blog: > > http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html > > > > (lambda _, __, ___, , _, __, ___, : > getattr( &

Re: Hello World

2014-12-20 Thread Mark Lawrence
On 20/12/2014 12:57, Steven D'Aprano wrote: Taken from Ben Kurtovic's blog: http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html (lambda _, __, ___, , _, __, ___, : getattr( __import__(True.__class__.__name__[_] + [].__class_

Re: Hello World

2014-12-20 Thread Chris Angelico
On Sat, Dec 20, 2014 at 11:57 PM, Steven D'Aprano wrote: > Taken from Ben Kurtovic's blog: > > http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html Introduction to Functional Programming in Python. Sadly, it doesn't work on Python 3. Someone needs to port it

Hello World

2014-12-20 Thread Steven D'Aprano
Taken from Ben Kurtovic's blog: http://benkurtovic.com/2014/06/01/obfuscating-hello-world.html (lambda _, __, ___, , _, __, ___, : getattr( __import__(True.__class__.__name__[_] + [].__class__.__name__[__]), ().__class__.__eq__.__class__.__n

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, 2014-11-04 at 23:03 +0630, Veek M wrote: > okay got it working - thanks Jason! The 3.2 docs are slightly different. What did you need to do to get it working? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
okay got it working - thanks Jason! The 3.2 docs are slightly different. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, Nov 4, 2014 at 11:09 AM, Veek M wrote: > static PyMethodDef hellomethods[] = { > {"hello", py_hello, METH_VARARGS, py_hello_doc}, > {NULL, NULL, 0, NULL}, > }; > > It's basically the METH_VARARGS field that's giving the problem. Switching

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
static PyMethodDef hellomethods[] = { {"hello", py_hello, METH_VARARGS, py_hello_doc}, {NULL, NULL, 0, NULL}, }; It's basically the METH_VARARGS field that's giving the problem. Switching it to NULL gives, SystemError: Bad call flags in PyCFunction_Call. METH_

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
0\0\3\0>\0\1\0\0\0\300\7\0\0\0\0\0\0"..., 832) = 832 fstat(5, {st_mode=S_IFREG|0755, st_size=19217, ...}) = 0 getcwd("/root/github/junk/hello", 128) = 24 mmap(NULL, 2101544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0x7f215b71c000 mprotect(0x7f215b71d000, 2093056, PROT_N

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
hread -fPIC -I/usr/include/python3.4 -c pyhello.c -o build/temp.linux-x86_64-3.4/pyhello.o pyhello.c:15:5: warning: initialization from incompatible pointer type [enabled by default] {"hello", py_hello, METH_NOARGS, py_hello_doc}, ^ pyhello.c:15:5: warning: (near initialization fo

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
Søren wrote: > import ctypes Hi, yeah i kind of liked it - still reading the docs though, Beazley has the Python.h solution so I though I'd try that first. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
0\3\0>\0\1\0\0\0\300\7\0\0\0\0\0\0"..., 832) = 832 fstat(5, {st_mode=S_IFREG|0755, st_size=19217, ...}) = 0 getcwd("/root/github/junk/hello", 128) = 24 mmap(NULL, 2101544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0x7f65daea5000 mprotect(0x7f65daea6000, 20930

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Søren
I'm not sure if it fits your needs, but we are very happy with calling c libs directly from python using ctypes: https://docs.python.org/2/library/ctypes.html It requires a few extra lines in Python to handle the parameter and return types. import ctypes result = ctypes.windll.Hello.hello()

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Jason Swails
On Tue, 2014-11-04 at 16:22 +0630, Veek M wrote: > https://github.com/Veek/Python/tree/master/junk/hello > doesn't work. > I have: > hello.c which contains: int hello(void); > hello.h > > To wrap that up, i have: > hello.py -> _hello (c extension) -> pyhello

Re: Python extension using a C library with one 'hello' function

2014-11-04 Thread Chris Angelico
On Tue, Nov 4, 2014 at 8:52 PM, Veek M wrote: > https://github.com/Veek/Python/tree/master/junk/hello > doesn't work. > I have: > hello.c which contains: int hello(void); > hello.h > > To wrap that up, i have: > hello.py -> _hello (c extension) -> pyhello.c -&

Python extension using a C library with one 'hello' function

2014-11-04 Thread Veek M
https://github.com/Veek/Python/tree/master/junk/hello doesn't work. I have: hello.c which contains: int hello(void); hello.h To wrap that up, i have: hello.py -> _hello (c extension) -> pyhello.c -> method py_hello() People using this will do: python3.2>> import hello pyt

Re: What meaning of this ""hello %s you are %s years old" % x"

2014-07-28 Thread Chris Angelico
On Mon, Jul 28, 2014 at 5:41 PM, Albert-Jan Roskam wrote: >> That's not tuple%tuple, but rather string%tuple. And string%tuple is >> the older method of formatting an output string from a template and a >> tuple of values. See >> https://docs.python.org/2/library/stdtypes.html#string-formatting

<    1   2   3   4   5   >