Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread Νικόλαος Κούρας
Yes this is a linxu issue although locale is se to utf-8

root@nikos [~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
root@nikos [~]#


Since 'locale' is set to 'utf-8' why when i:

'mv 'Euxi tou Ihsou.mp3' 'Ευχή του Ιησού.mp3'

lead to that unknown encoded bytestream 
'\305\365\367\336\\364\357\365\311\347\363\357\375.mp3'

which isn't by default an utf-8 bytestream as locale indicated and python 
expected?

how 'files.py' is supposed to read this file now using:

# Compute a set of current fullpaths 
fullpaths = set() 
path = "/home/nikos/public_html/data/apps/" 

for root, dirs, files in os.walk(path): 
for fullpath in files: 
fullpaths.add( os.path.join(root, fullpath) ) 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
root@nikos [~]# chmod 755 /var/log
root@nikos [~]# chmod 755 /var/log/httpd
root@nikos [~]# chmod 666 /var/log/httpd/suexec.log

root@nikos [~]# chmod 755 /usr/local/apache
root@nikos [~]# chmod 755 /usr/local/apache/logs/
root@nikos [~]# chmod 666 /usr/local/apache/logs/error_log


and then execute via browser:  http://superhost.gr/cgi-bin/koukos.py
still same error appearing:

[Thu Jun 06 09:23:54 2013] [error] [client 79.103.41.173] suexec failure: could 
not open log file
[Thu Jun 06 09:23:54 2013] [error] [client 79.103.41.173] fopen: Permission 
denied
[Thu Jun 06 09:23:54 2013] [error] [client 79.103.41.173] Premature end of 
script headers: koukos.py


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to detect the character encoding in a web page ?

2013-06-05 Thread Nobody
On Thu, 06 Jun 2013 03:55:11 +1000, Chris Angelico wrote:

> The HTTP header is completely out of band. This is the best way to
> transmit encoding information. Otherwise, you assume 7-bit ASCII and start
> parsing. Once you find a meta tag, you stop parsing and go back to the
> top, decoding in the new way.

Provided that the meta tag indicates an ASCII-compatible encoding, and you
haven't encountered any decode errors due to 8-bit characters, then
there's no need to go back to the top.

> "ASCII-compatible" covers a huge number of
> encodings, so it's not actually much of a problem to do this.

With slight modifications, you can also handle some
almost-ASCII-compatible encodings such as shift-JIS.

Personally, I'd start by assuming ISO-8859-1, keep track of which bytes
have actually been seen, and only re-start parsing from the top if the
encoding change actually affects the interpretation of any of those bytes.

And if the encoding isn't even remotely ASCII-compatible, you aren't going
to be able to recognise the meta tag in the first place. But I don't think
I've ever seen a web page encoded in UTF-16 or EBCDIC.

Tools like chardet are meant for the situation where either no encoding is
specified or the specified encoding can't be trusted (which is rather
common; why else would web browsers have a menu to allow the user to
select the encoding?).

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 3:54 PM, jmfauth  wrote:
> ("filesystems are just bytes",
> yeah, whatever...).

Sure. You tell me what a proper Unicode rendition of an animated GIF is.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Ian Kelly
On Wed, Jun 5, 2013 at 10:25 PM, Russ P.  wrote:
> I recall reading a few years ago that Guido was thinking about adding 
> optional type annotations. I don't know if that went anywhere or not, but I 
> thought it was a good idea. Eventually I got tired of waiting, and I realized 
> that I just wanted a statically typed language, so I started using one.

Python 3 has support for arbitrary function argument annotations.  The
language itself ascribes no special meaning to it, so it's up to the
user to add a type-checker (or whatever else they might want to use it
for).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread jmfauth
On 5 juin, 19:43, Νικόλαος Κούρας  wrote:
> Ôç ÔåôÜñôç, 5 Éïõíßïõ 2013 8:56:36 ð.ì. UTC+3, ï ÷ñÞóôçò Steven D'Aprano 
> Ýãñáøå:
>
> Somehow, I don't know how because I didn't see it happen, you have one or
> more files in that directory where the file name as bytes is invalid when
> decoded as UTF-8, but your system is set to use UTF-8. So to fix this you
> need to rename the file using some tool that doesn't care quite so much
> about encodings. Use the bash command line to rename each file in turn
> until the problem goes away.
>
> But renaming ia hsell access like 'mv 'Euxi tou Ihsou.mp3' 'Åõ÷Þ ôïõ 
> Éçóïõ.mp3' leade to that unknown encoding of this bytestream 
> '\305\365\367\336\ \364\357\365\ \311\347\363\357\375.mp3'
>
> But please tell me Steven what linux tool you think it can encode the weird 
> filename to proper 'Åõ÷Þ ôïõ Éçóïõ.mp3' utf-8?
>
> or we cna write a script as i suggested to decode back the bytestream using 
> all sorts of available decode charsets boiling down to the original greek 
> letters.

---

see
http://bugs.python.org/issue13643, msg msg149949 - (view)   Author:
Antoine Pitrou (pitrou)


Quote:

So, you're complaining about something which works, kind of:

$ touch héhé
$ LANG=C python3 -c "import os; print(os.listdir())"
['h\udcc3\udca9h\udcc3\udca9']

> This makes robustly working with non-ascii filenames on different
> platforms needlessly annoying, given no modern nix should have problems
> just using UTF-8 in these cases.

So why don't these supposedly "modern" systems at least set the
appropriate environment variables for Python to infer the proper
character encoding?
(since these "modern" systems don't have a well-defined encoding...)

Answer: because they are not modern at all, they are antiquated,
inadapted and obsolete pieces of software designed and written by
clueless Anglo-American people. Please report bugs against these
systems. The culprit is not Python, it's the Unix crap and the utterly
clueless attitude of its maintainers ("filesystems are just bytes",
yeah, whatever...).

jmf
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Magazine

2013-06-05 Thread DRJ Reddy
> The real problem is the ongoing supply of content. If you can publish
> 
> on a regular schedule (weekly?) with interesting content, you'll have
> 
> a highly successful magazine... but if you have to provide all that
> 
> content yourself, you'll burn out. Try to line up a couple of backup
> 
> writers or columnists to help out - and no, I'm not offering, I have
> 
> way too much happening already :) Though the number of words I've
> 
> typed into python-list today would probably be enough for a month's
> 
> worth of newsletters...
> 
> 
> 
> Let's have more of these threads that are actually Python-related!
> 
> 
> 
> ChrisA

Dear ChrisA,
Currently we are a team of three. We are planning to have contect 
categorized into topics like
☺ Some application made of python(command line program or a GUI program) that 
we make using a python module(planning to cover as many modules as possible) 
ie; of included batteries of python.
☺ Python in Security ie; Some scripts that we can write in python like a 
dictionary attack tool
☺ One for covering Tkinter.
☺ One small Game using python.
☺ Python Facts,Python Quotes, Python PersonalitY (a python personnel bio or an 
interview), Python video(about a python video from Python Conferences)
☺ Python articles Guest as well as our own.
☺ Python Tutorials.
☺ Python Place( A place where python is being used for production).
☺ If we are not overloading magazine we would also cover about Python tools 
like say Ninja-IDE(an IDE for Python extensively written in Python).
After a few days we are planning to cover
☺ Python in cloud.(Open Stack)
☺ Network Programming.(probably Twisted framework)
☺ Database programming with SQLite.
☺ Python Puzzles(some programming Questions).
☺ Python Webframework probably Django.
We welcome further suggestions from the community.
Regards,
DRJ and Team.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread Νικόλαος Κούρας
Can someone else explain to me what MRAB is trying to say to me?
Is there a way even if we dont know the encoding used from filanems to become 
bytestreams still to be able to open the greek filenames?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 7:29:44 PM UTC-7, Chris Angelico wrote:
> On Thu, Jun 6, 2013 at 11:56 AM, Steven D'Aprano
> 
>  wrote:
> 
> > On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote:
> 
> >> As for Python, my experience with it is that, as
> 
> >> your application grows, you start getting confused about what the
> 
> >> argument types are or are supposed to be.
> 
> >
> 
> > Whereas people never get confused about the arguments in static typed
> 
> > languages?
> 
> >
> 
> > The only difference is whether the compiler tells you that you've passed
> 
> > the wrong type, or your unit test tells you that you've passed the wrong
> 
> > type. What, you don't have unit tests? Then how do you know that the code
> 
> > does the right thing when passed data of the right type? Adding an extra
> 
> > couple of unit tests is not that big a burden.
> 
> 
> 
> The valid type(s) for an argument can be divided into two categories:
> 
> Those the compiler can check for, and those the compiler can't check
> 
> for. Some languages have more in the first category than others, but
> 
> what compiler can prove that a string is an
> 
> HTML-special-characters-escaped string? In a very few languages, the
> 
> compiler can insist that an integer be between 7 and 30, but there'll
> 
> always be some things you can't demonstrate with a function signature.
> 
> 
> 
> That said, though, I do like being able to make at least *some*
> 
> declaration there. It helps catch certain types of error.

I recall reading a few years ago that Guido was thinking about adding optional 
type annotations. I don't know if that went anywhere or not, but I thought it 
was a good idea. Eventually I got tired of waiting, and I realized that I just 
wanted a statically typed language, so I started using one.

Steven's view on static vs. dynamic typing are interesting, but I think they 
are "out of the mainstream," for whatever that's worth. Does that mean he is 
wrong? I don't know. But I do know that statically typed code just seems to me 
to fit together tighter and more solidly. Maybe it's a liberal/conservative 
thing. Do liberals tend to favor dynamic typing?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 6:57:08 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:
> On Wed, 05 Jun 2013 03:32:42 -0700, Νικόλαος Κούρας wrote:
> 
> 
> 
> [...]
> 
> > You spare it from the list because you wanted to bitch in private. Now
> 
> > sod off.
> 
> 
> 
> Νικόλαος, please stop trading insults with people who you feel have 
> 
> wronged you.
> 
> 
> 
> If somebody gives you deliberately bad advice, that is one thing. 
> 
> Otherwise, please try to ignore their insults rather than throwing fuel 
> 
> on the fire by insulting back.
> 
> 
> 
> But please also try to learn from them! Most of the criticisms given have 
> 
> been valid, even if put rudely.
> 
> 
> 
> For example, this thread, and related threads, are ENORMOUS. I cannot 
> 
> keep track of all the issues. Please try not to make this thread 
> 
> unnecessarily complicated with rapid fire responses that don't help.
> 
> 
> 
> *  Please think before you reply. Does your reply *help* the 
> 
> conversation, or make it worse? 
> 
> 
> 
> * Please stop making multiple changes at once. It makes it hard to see 
> 
> what causes the breakage.
> 
> 
> 
> * If you change something, and it breaks, undo the change, then 
> 
> experiment outside of your live system to try to understand and fix the 
> 
> issue.
> 
> 
> 
> 
> 
> As for everyone else, please try to be polite and helpful, or don't reply 
> 
> at all.
> 
> 
> 
> 
> 
> Thank you.
> 
> 
> 
> 
> 
> -- 
> 
> Steven

Okey as, you ahve seen form yesterday night(Greek time) i have stopped 
answering to this thread.
I have said what needed ot be heard.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 03:32:42 -0700, Νικόλαος Κούρας wrote:

[...]
> You spare it from the list because you wanted to bitch in private. Now
> sod off.

Νικόλαος, please stop trading insults with people who you feel have 
wronged you.

If somebody gives you deliberately bad advice, that is one thing. 
Otherwise, please try to ignore their insults rather than throwing fuel 
on the fire by insulting back.

But please also try to learn from them! Most of the criticisms given have 
been valid, even if put rudely.

For example, this thread, and related threads, are ENORMOUS. I cannot 
keep track of all the issues. Please try not to make this thread 
unnecessarily complicated with rapid fire responses that don't help.

*  Please think before you reply. Does your reply *help* the 
conversation, or make it worse? 

* Please stop making multiple changes at once. It makes it hard to see 
what causes the breakage.

* If you change something, and it breaks, undo the change, then 
experiment outside of your live system to try to understand and fix the 
issue.


As for everyone else, please try to be polite and helpful, or don't reply 
at all.


Thank you.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner question

2013-06-05 Thread eschneider92
Thanks everyone!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:43:18 μ.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε:
> Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
> 
> > On 05/06/2013 18:43, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ wrote:
> 
> > 
> 
> > > οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 5 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2013 8:56:36 
> > > οΏ½.οΏ½. UTC+3, οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ Steven D'Aprano 
> > > οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½:
> 
> > 
> 
> > >
> 
> > 
> 
> > > Somehow, I don't know how because I didn't see it happen, you have one or
> 
> > 
> 
> > > more files in that directory where the file name as bytes is invalid when
> 
> > 
> 
> > > decoded as UTF-8, but your system is set to use UTF-8. So to fix this you
> 
> > 
> 
> > > need to rename the file using some tool that doesn't care quite so much
> 
> > 
> 
> > > about encodings. Use the bash command line to rename each file in turn
> 
> > 
> 
> > > until the problem goes away.
> 
> > 
> 
> > >
> 
> > 
> 
> ' leade to that unknown encoding of this bytestream '\305\365\367\336\ 
> \364\357\365\ \311\347\363\357\375.mp3'
> 
> > 
> 
> > >
> 
> > 
> 
> > > But please tell me Steven what linux tool you think it can encode the 
> > > weird filename to proper 'οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½.mp3' 
> > > utf-8?
> 
> > 
> 
> > >
> 
> > 
> 
> > > or we cna write a script as i suggested to decode back the bytestream 
> > > using all sorts of available decode charsets boiling down to the original 
> > > greek letters.
> 
> > 
> 
> > >
> 
> > 
> 
> 
> 
> 
> 
> Actually you were correct i was typing greek and is aw the fileneme here in 
> gogole groups as:
> 
> 
> 
> > > But renaming ia hsell access like 'mv 'Euxi tou Ihsou.mp3' 'οΏ½οΏ½οΏ½οΏ½ 
> > > οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½.mp3
> 
> 
> 
> so maybe the filenames have to be decoded to greek-iso but then agian the 
> contain both greek letters but their extension are in english chars like 
> '.mp3'
> 
> 
> 
> 
> 
> > Using Python, I think you could get the filenames using os.listdir, 
> 
> > passing the directory name as a bytestring so that it'll return the
> 
> > names as bytestrings.
> 
>  
> 
> 
> 
> > Then, for each name, you could decode from its current encoding and 
> 
> > encode to UTF-8 and rename the file, passing the old and new paths to
> 
> > os.rename as bytestrings.
> 
> 
> 
> Iam not sure i follow:
> 
> 
> 
> Change this:
> 
> 
> 
> # Compute a set of current fullpaths
> 
> fullpaths = set()
> 
> path = "/home/nikos/public_html/data/apps/"
> 
> 
> 
> for root, dirs, files in os.walk(path):
> 
>   for fullpath in files:
> 
>   fullpaths.add( os.path.join(root, fullpath) )
> 
> 
> 
> 
> 
> to what to make the full url readable by files.py?

MRAB can you please explain in more clarity your idea of solution?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 1:21:08 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 7:18 AM,   wrote:
> 
> > On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
> 
> >> On Thu, Jun 6, 2013 at 6:56 AM,   wrote:
> 
> >> > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
> 
> >> >>...
> 
> >> >> print( cookie, "Content-type: text/html; charset=utf-8\n", message )
> 
> >> >>...
> 
> >> >   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
> 
> >> > (ie, note the two \n's after the "utf-8" test.)
> 
> >>
> 
> >> But that won't solve it either. The default separator for print is a
> 
> >> space, so this will indent his Content-type line by one space.
> 
> >
> 
> > Ah, quite right.  Something like
> 
> >
> 
> >   print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )
> 
> >
> 
> > then.
> 
> 
> 
> Or change the sep, or concatenate with + instead of using , between
> 
> them. Or put them on separate lines. Anything like that would work.
> 
> And it's really easy to try things out interactively to see what
> 
> they'll do...
> 
> 
> 
> ChrisA

Thi is failing also with same error:

print( cookie )
print( '''Content-type: text/html; charset=utf-8\n''' )
print( message )
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 12:18:39 π.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε:
> On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
> 
> > On Thu, Jun 6, 2013 at 6:56 AM,   wrote:
> 
> > > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
> 
> > >>...
> 
> > >> print( cookie, "Content-type: text/html; charset=utf-8\n", message ) 
> 
> > >>...
> 
> > >   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
> 
> > > (ie, note the two \n's after the "utf-8" test.)
> 
> > 
> 
> > But that won't solve it either. The default separator for print is a
> 
> > space, so this will indent his Content-type line by one space.
> 
> 
> 
> Ah, quite right.  Something like 
> 
> 
> 
>   print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )
> 
> 
> 
> then.


print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )

or by trying:

print( cookie + "\nContent-type: text/html; charset=utf-8\n\n" + message )

the output is for both:

ni...@superhost.gr [~]# tail -F /usr/local/apache/logs/error_log &

ni...@superhost.gr [~]# [Thu Jun 06 06:20:11 2013] [error] [client 
79.103.41.173] (2)No such file or directory: exec of 
'/home/nikos/public_html/cgi-bin/koukos.py' failed
[Thu Jun 06 06:20:11 2013] [error] [client 79.103.41.173] Premature end of 
script headers: koukos.py
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Do you consider Python a 4GL? Why (not)?

2013-06-05 Thread Ian Kelly
On Tue, Jun 4, 2013 at 6:38 PM, Carlos Nepomuceno
 wrote:
> I don't have an opinion yet, but I've found contradictory evidence from many
> sources, such as:
>
> "A domain-specific language (DSL) is a type of programming language or
> specification language in software development and domain engineering
> dedicated to a particular problem domain,
> [...]
> The opposite is:
>
> a general-purpose programming language, such as C, Java or Python,"
>
> http://en.wikipedia.org/wiki/Domain-specific_programming_language
>
> Since, 4GL is considered a subset of DSLs, this wiki page doesn't consider
> Python a 4GL.
>
> Is is true? Why???

I wasn't previously familiar with the 3GL / 4GL nomenclature, but
based upon the definitions given at Wikipedia, Python is clearly a
3GL.  That said, virtually all general-purpose languages in common
usage today would be 3GLs, so the distinction does not seem terribly
useful to me.  The terms "4GL" and "5GL" while suggesting a language
that is somehow more "advanced" than a 3GL, seem to be mainly 80s
hype.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 11:56 AM, Steven D'Aprano
 wrote:
> On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote:
>> As for Python, my experience with it is that, as
>> your application grows, you start getting confused about what the
>> argument types are or are supposed to be.
>
> Whereas people never get confused about the arguments in static typed
> languages?
>
> The only difference is whether the compiler tells you that you've passed
> the wrong type, or your unit test tells you that you've passed the wrong
> type. What, you don't have unit tests? Then how do you know that the code
> does the right thing when passed data of the right type? Adding an extra
> couple of unit tests is not that big a burden.

The valid type(s) for an argument can be divided into two categories:
Those the compiler can check for, and those the compiler can't check
for. Some languages have more in the first category than others, but
what compiler can prove that a string is an
HTML-special-characters-escaped string? In a very few languages, the
compiler can insist that an integer be between 7 and 30, but there'll
always be some things you can't demonstrate with a function signature.

That said, though, I do like being able to make at least *some*
declaration there. It helps catch certain types of error.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 07:40:52 -0700, Armando Montes De Oca wrote:

> Traceback (most recent call last):
>   File "Guessing_Game.py", line 32, in 
> input (enter)
>   File "", line 0
> ^
> SyntaxError: unexpected EOF while parsing


Your problem is that you should not be using input(), but raw_input() 
instead.

Replace every call to input() to raw_input() instead, and this specific 
problem will go away. It may reveal other bugs, but that's programming 
for you.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Tim Chase
On 2013-06-05 17:57, ru...@yahoo.com wrote:
> On 06/05/2013 05:19 PM, Dennis Lee Bieber wrote:
> stories over the years where people where convicted (or
> at least charged with) violating the DMCA (or perhaps 
> equally draconian followup U.S. laws) even though they 
> clearly penetrated the system to point out security flaws.

I suspect you read "CFAA" (Computer Fraud & Abuse Act) and thought
"DMCA" (Digital Millennium Copyright Act), as there have been a
number of prosecutions under the CFAA (including the whole Aaron
Swartz ordeal) for nebulous "exceeding authorization".

-tkc


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote:


> I'm not an Ada guy, but Ada advocates claim that it reduces development
> time by half in the long run compared to C and C++ due to reduced
> debugging time and simpler maintenance. 

They may be right. Far too many people think that C and C++ are "best of 
breed" in static languages. They aren't.


> Then again, I think Java people make a similar claim.

Java people would take credit for the sun coming up if they could :-)


> As for Python, my experience with it is that, as
> your application grows, you start getting confused about what the
> argument types are or are supposed to be. 

Whereas people never get confused about the arguments in static typed 
languages?

The only difference is whether the compiler tells you that you've passed 
the wrong type, or your unit test tells you that you've passed the wrong 
type. What, you don't have unit tests? Then how do you know that the code 
does the right thing when passed data of the right type? Adding an extra 
couple of unit tests is not that big a burden.

Of course, if there was a way to automate that, why wouldn't you take 
advantage of it? Python currently has no standard way of doing such 
automated type tests, and probably won't ever get one. A static typed 
language gives you those tests for free, but in many languages at the 
cost that you probably end up spending more time fighting to satisfy the 
compiler than you save by not writing unit tests.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


THRINAXODON BEATS A HOMOSEXUAL, TO THE GROUND!!

2013-06-05 Thread Thrinaxodon
AS THRINAXODON VENTURED ACROSS THE WORLD, HE MET PROMINENT GAYS,
"David Iain Greig" AND "Peter Nyikos", AS THRINAXODON CAUGHT THE TWO
"GIVING LOVE," THRINAXODON BEATS THEM WITH HIS WOODEN STICK(S). AS HE
CAUGHT ASSHAT, RUNNING WILD, TRYING TO GET OUT OF THEIR; THRINAXODON
JUMPED AND PUNCHED, DROP-KICKED, NYIKOS, AS WELL AS RIP HIS LIMBS OFF.
GREIG PUNCHES THRINAXODON, AND RUNS AWAY, BUT IN ANOTHER POST
THRINAXODON WILL SHOW HOW HE KILLED GREIG.

===
=
THE DARK NIGHTS ARE BACK.
https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSjD2J4Gz25xDkgT...
===
=
THRINAXODON HAS UPDATED HIS PROFILE PICTURE.
http://thrinaxodon.wordpress.com/2013/06/01/thrinaxodons-new-profile-...
===
KILL THE RABBIT FAT-ASS.
https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQYQMJp1kIuqs1dy...
===
THRINAXODON IS NOW ON TWITTER.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python netcdf

2013-06-05 Thread Sudheer Joseph
Thank you very much Jason
With best regards
Sudheer

On Thursday, June 6, 2013, Jason Swails wrote:

>
>
>
> On Wed, Jun 5, 2013 at 9:07 PM, Sudheer Joseph 
> 
> > wrote:
>
>> Dear Members,
>>   Is there a way to get the time:origin attribute from a
>> netcdf file as string using the Python netcdf?
>>
>
> Attributes of the NetCDF file and attributes of each of the variables can
> be accessed via the dot-operator, as per standard Python.
>
> For instance, suppose that your NetCDF file has a Conventions attribute,
> you can access it via:
>
> ncfile.Conventions
>
> Suppose that your variable, time, has an attribute "origin", you can get
> it via:
>
> ncfile.variables['time'].origin
>
> Of course there's the question of what NetCDF bindings you're going to
> use.  The options that I'm familiar with are the ScientificPython's
> NetCDFFile class (Scientific.IO.NetCDF.NetCDFFile), pynetcdf (which is just
> the ScientificPython's class in a standalone format), and the netCDF4
> package.  Each option has a similar API with attributes accessed the same
> way.
>
> An example with netCDF4 (which is newer, has NetCDF 4 capabilities, and
> appears to be more supported):
>
> from netCDF4 import Dataset
>
> ncfile = Dataset('my_netcdf_file.nc', 'r')
>
> origin = ncfile.variables['time'].origin
>
> etc. etc.
>
> The variables and dimensions of a NetCDF file are stored in dictionaries,
> and the data from variables are accessible via slicing:
>
> time_data = ncfile.variables['time'][:]
>
> The slice returns a numpy ndarray.
>
> HTH,
> Jason
>


-- 
Sent from my iPad Mini
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 11:37 AM, Steven D'Aprano
 wrote:
> What prevents bugs is the skill of the people writing the code, not the
> compiler.

+1 QOTW.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Cameron Simpson
On 05Jun2013 14:18, ru...@yahoo.com  wrote:
| On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
| > On Thu, Jun 6, 2013 at 6:56 AM,   wrote:
| > > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
| > >>...
| > >> print( cookie, "Content-type: text/html; charset=utf-8\n", message ) 
| > >>...
| > >   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
| > > (ie, note the two \n's after the "utf-8" test.)
| > 
| > But that won't solve it either. The default separator for print is a
| > space, so this will indent his Content-type line by one space.
| 
| Ah, quite right.  Something like 
| 
|   print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )
| 
| then.

Unless "cookie" already has a newline. Then you'll end the headers there:-)

A more robust approach might be to build a dict (or possibly better,
list) of headers without newlines and then as a separate act to
print them with newlines and add the spacer newline later, before
writing the message body.

Cheers,
-- 
Cameron Simpson 

Drill for oil? You mean drill into the ground to try and find oil?
You're  crazy.
  --Drillers whom Edwin L. Drake tried to enlist to his project
to drill for  oil in 1859.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 09:15:01 -0700, Russ P. wrote:

> On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote:
>> On 05/06/2013 07:11, Russ P. wrote:
>> 
>> > But then, what would you expect of a language that allows you to
>> > write
>> >
>> > x = 1
>> > x = "Hello"
>> >
>> > It's all loosey goosey -- which is fine for many applications but
>> > certainly not for critical ones.
>> >
>> 
>> 
>> I want to launch this rocket with an expensive satellite on top.  I
>> know it's safe as the code is written in ADA.  Whoops :(
> 
> 
> So Python would have been a better choice? Yeah, right. 

Putting issues of efficiency aside, yes, it probably would have. Had the 
programmers not been so sure that the compiler was protecting them from 
bugs, a misplaced hope if there ever was one, they might have written 
some tests and noticed that their simulated rocket launch ended up going 
boom instead of into orbit.

I'm referring to the first test flight of the Ariane 5, which failed due 
to a software bug. There was no actual satellite on this flight. The 
failure Mark refers to was due to a leak in coolant pipes, which of 
course is a hardware problem and cannot be blamed on the software.

http://en.wikipedia.org/wiki/Ariane_5#Notable_launches



> If you know
> anything about that rocket mishap, you should know that Ada was not the
> source of the problem. Ada won't keep airplane wings from breaking
> either, by the way. It's not magic.

Again, referring to the infamous 64-bit float to 16-bit integer bug, Ada 
may not have been the *source* of the problem, but neither did it prevent 
it.

What prevents bugs is the skill of the people writing the code, not the 
compiler. Compile-time static type checking is merely a tool, which has 
costs and benefits. It is ludicrous to think that any one single tool, or 
the lack of that tool, will make all the difference between working code 
and non-working code.

Static type-checking is no better, or worse, for "critical code" than 
dynamic type-checking. One language chooses to deal with some errors at 
compile-time, others deal with them at run-time. Either way, the 
programmer has to deal with them in some way.

A static type system forces you to deal with a limited subset of errors, 
"type errors", in one way only: by removing any execution paths in the 
software which would assign data of type X to a variable of type Y. For 
reasons of machine efficiency, that is often a good was to deal with such 
errors. But a dynamic type system makes different trade-offs.

And of course, type errors are such a vanishingly small subset of all the 
possible errors that might be made that, frankly, the difference in code 
quality between those with static typing and those without is essentially 
indistinguishable. There's no evidence that code written in static typed 
languages is less buggy than code written in dynamic languages.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Python 3 and ‘python-daemon’ (was: [RELEASED] Python 2.7.5)

2013-06-05 Thread Ben Finney
Joshua Landau  writes:

> Don't take this list too seriously - some of those do have fully
> working and stable Python 3 packages that just aren't in pip, like
> python-daemon.

That's news to me, as the package maintainer. There's no official
‘python-daemon’ release for Python 3. What ‘python-daemon’ works in
Python 3?

-- 
 \ “We are not gonna be great; we are not gonna be amazing; we are |
  `\   gonna be *amazingly* amazing!” —Zaphod Beeblebrox, _The |
_o__)Hitch-Hiker's Guide To The Galaxy_, Douglas Adams |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 8:36 AM,   wrote:
>> And it's really easy to try things out interactively to see what
>> they'll do...
>
> Sure, once one makes the connection between "Server Error" and missing "\n"
> which is where Νικόλαος was stuck I'm guessing.

I know that's a bit of a jump. That's why, right back when he first
posted his problem, I quoted _that one line_ and pointed him to the
interactive interpreter. I'm pretty sure he still isn't reading my
posts... or, most likely, anyone's.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python netcdf

2013-06-05 Thread Jason Swails
On Wed, Jun 5, 2013 at 9:07 PM, Sudheer Joseph  wrote:

> Dear Members,
>   Is there a way to get the time:origin attribute from a
> netcdf file as string using the Python netcdf?
>

Attributes of the NetCDF file and attributes of each of the variables can
be accessed via the dot-operator, as per standard Python.

For instance, suppose that your NetCDF file has a Conventions attribute,
you can access it via:

ncfile.Conventions

Suppose that your variable, time, has an attribute "origin", you can get it
via:

ncfile.variables['time'].origin

Of course there's the question of what NetCDF bindings you're going to use.
 The options that I'm familiar with are the ScientificPython's NetCDFFile
class (Scientific.IO.NetCDF.NetCDFFile), pynetcdf (which is just the
ScientificPython's class in a standalone format), and the netCDF4 package.
 Each option has a similar API with attributes accessed the same way.

An example with netCDF4 (which is newer, has NetCDF 4 capabilities, and
appears to be more supported):

from netCDF4 import Dataset

ncfile = Dataset('my_netcdf_file.nc', 'r')

origin = ncfile.variables['time'].origin

etc. etc.

The variables and dimensions of a NetCDF file are stored in dictionaries,
and the data from variables are accessible via slicing:

time_data = ncfile.variables['time'][:]

The slice returns a numpy ndarray.

HTH,
Jason
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Michael Torrie
On 06/05/2013 05:52 PM, Russ P. wrote:
> My comment shows you nothing about what I understand about names, 
> objects, and variables.

Yes that probably is true.

> You have chosen to question my understanding apparently because my
> point bothered you but you don't have a good reply. Then you link me
> with Rick for good measure. That's two ad hominems in three
> sentences.

Your statement didn't bother me.  I just felt, perhaps erroneously, that
such a comment needs clarification.  We get into trouble in python when
we get caught up in treating python names exactly like variables and
blame it on the lack of static typing.  In uni we looked at various
means of dealing with the name covering/hiding issue including renaming
or requiring that each binding be a unique name (meaning the second x =
"hello word" statement would be a runtime error).  Anyway, I got a bit
distracted by your example of using the same name twice with different
objects when the real issue that can cause pain is function call
parameter expectation.

My apologies for linking you to Rick.  You're right that was an
ad-hominem attack, though I didn't intend that!
-- 
http://mail.python.org/mailman/listinfo/python-list


python netcdf

2013-06-05 Thread Sudheer Joseph
Dear Members,
  Is there a way to get the time:origin attribute from a netcdf 
file as string using the Python netcdf?
with best regards,
Sudheer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread rurpy
On 06/05/2013 05:19 PM, Dennis Lee Bieber wrote:
> On Wed, 5 Jun 2013 10:29:44 -0700 (PDT), Íéêüëáïò Êïýñáò
>  declaimed the following in
> gmane.comp.python.general:
>>
>> In the US there is a law called the DMCA which I think would make what
>> you did illegal, even though i have you a password, because i
>> clearly gave you access to help me fix a problem, not to do what you
>> did. Of course US law doesn't help in this case since you i live in Greece 
>> and you live in Australia...
>>
>   I doubt it... DMCA mainly concerns itself with the breaking of
> copyright restrictions applied to media -- for example, e-books that are
> keyed to single user's account. The "CA" part is "copyright act"
> (without googling, I think the "DM" is "digital millenium"); the key is
> "copyright". No copyrights were violated in this teaching...

>From vague memory (and without enough interest in the
subject to research it), I recall hearing several news
stories over the years where people where convicted (or
at least charged with) violating the DMCA (or perhaps 
equally draconian followup U.S. laws) even though they 
clearly penetrated the system to point out security flaws.

>   But what you did was the equivalent of handing out the key to
> strangers (on the Barnes&Noble Nook, the "key" is the combination of an
> email address and a credit card number -- if you are willing to hand
> your email and CC# to a perfect stranger they can legitimately open the
> e-book file you gave them).
> 
>   In short, you "said": I give you total control over my server; do
> anything you want with it though I'd like for you to clean up my mess.

No he didn't -- as I read his posts he was clearly offering
access for the purpose of having someone help him fix his 
problems. 

That I give you my car keys (even if you're a stranger) does 
not mean I am giving you permission to do whatever you want 
with my car.  

Nor does the fact that I think you shouldn't pick up hitchikers 
permit me to teach you a lesson by getting picked up by you and
then robbing you.

But a bunch of legally ignorant programmers (including myself) 
speculating about the subject here is about as informative as 
a group of 6-graders thoughts on Einstein's theory of relativity.
-- 
http://mail.python.org/mailman/listinfo/python-list


Dijkstra (was Re: Source code to identify user through browser?)

2013-06-05 Thread Terry Jan Reedy

On 6/5/2013 6:07 PM, Carlos Nepomuceno wrote:


Didn't know he was such a humorist! lol

Although I prefer when he's serious:

http://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1094.html


pythonic summary:
Let S be an finite iterable of numbers (make it not an iterable if one 
interprets the conclusion as requiring reiteration) and let n = len(S) 
(or len(list(S)) if need be). The if n > 2 and len(set(S)) > 1,

n * min(S) < sum(S) < max(S)  # easily shown by induction on n

If the n = 1 or the items in S are all the same,
n*min == sum == n*max

I might call this the 'Averages are not extreme' theorem.

Corollary: if min(s) == 1 and sum(S) > n, then max(S) > 1
'Pigeonhole Principle'

--
Terry Jan Reedy



--
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 4:18:13 PM UTC-7, Michael Torrie wrote:
> On 06/05/2013 12:11 AM, Russ P. wrote:
> 
> > But then, what would you expect of a language that allows you to
> 
> > write
> 
> > 
> 
> > x = 1 
> 
> > x = "Hello"
> 
> > 
> 
> > It's all loosey goosey -- which is fine for many applications but
> 
> > certainly not for critical ones.
> 
> 
> 
> This comment shows me that you don't understand the difference between
> 
> names, objects, and variables.  May sound like a minor quibble, but
> 
> there're actually major differences between binding names to objects
> 
> (which is what python does) and variables (which is what languages like
> 
> C have).  It's very clear Rick does not have an understanding of this
> 
> either.

My comment shows you nothing about what I understand about names, objects, and 
variables. You have chosen to question my understanding apparently because my 
point bothered you but you don't have a good reply. Then you link me with Rick 
for good measure. That's two ad hominems in three sentences.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Mark Lawrence

On 05/06/2013 23:51, Armando Montes De Oca wrote:

Well I am sure this will end up a simple solution which is not solved by the 
geniuses with no sense of humor. Programmers are known for being odd nerds and 
I just got two of them. Goldstick Jesus what a couple of lazy minded nonsense. 
Your an ass hole.



So that's three people at least within the last couple of weeks who 
could have written "How to win friends and influence people".


--
"Steve is going for the pink ball - and for those of you who are 
watching in black and white, the pink is next to the green." Snooker 
commentator 'Whispering' Ted Lowe.


Mark Lawrence

--
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Michael Torrie
On 06/05/2013 12:11 AM, Russ P. wrote:
> But then, what would you expect of a language that allows you to
> write
> 
> x = 1 
> x = "Hello"
> 
> It's all loosey goosey -- which is fine for many applications but
> certainly not for critical ones.

This comment shows me that you don't understand the difference between
names, objects, and variables.  May sound like a minor quibble, but
there're actually major differences between binding names to objects
(which is what python does) and variables (which is what languages like
C have).  It's very clear Rick does not have an understanding of this
either.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Well I am sure this will end up a simple solution which is not solved by the 
geniuses with no sense of humor. Programmers are known for being odd nerds and 
I just got two of them. Goldstick Jesus what a couple of lazy minded nonsense. 
Your an ass hole. 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread rurpy
On 06/05/2013 04:21 PM, Chris Angelico wrote:
> On Thu, Jun 6, 2013 at 7:18 AM,   wrote:
>> On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
..[...]
>> Ah, quite right.  Something like
>>
>>   print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )
>>
>> then.
> 
> Or change the sep, or concatenate with + instead of using , between
> them. Or put them on separate lines. Anything like that would work.

Of course.

> And it's really easy to try things out interactively to see what
> they'll do...

Sure, once one makes the connection between "Server Error" and missing "\n"
which is where Νικόλαος was stuck I'm guessing.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 7:18 AM,   wrote:
> On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
>> On Thu, Jun 6, 2013 at 6:56 AM,   wrote:
>> > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
>> >>...
>> >> print( cookie, "Content-type: text/html; charset=utf-8\n", message )
>> >>...
>> >   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
>> > (ie, note the two \n's after the "utf-8" test.)
>>
>> But that won't solve it either. The default separator for print is a
>> space, so this will indent his Content-type line by one space.
>
> Ah, quite right.  Something like
>
>   print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )
>
> then.

Or change the sep, or concatenate with + instead of using , between
them. Or put them on separate lines. Anything like that would work.
And it's really easy to try things out interactively to see what
they'll do...

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Source code to identify user through browser?

2013-06-05 Thread Carlos Nepomuceno
> Date: Wed, 5 Jun 2013 08:18:56 -0700
> Subject: Re: Source code to identify user through browser?
> From: rustompm...@gmail.com
[...]
> > What do you mean by user?
> 
> Ha! Nice question.  Not in direct answer but here's E.W Dijkstra
> defining 'user':
> 
> [from http://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD618.html
> ]
> 
> The computer “user” isn’t a real person of flesh and blood, with
> passions and brains. No, he is a mythical figure, and not a very
> pleasant one either. A kind of mongrel with money but without taste,
> an ugly caricature that is very uninspiring to work for. He is, as a
> matter of fact, such an uninspiring idiot that his stupidity alone is
> a sufficient explanation for the ugliness of most computer systems.
> And oh! Is he uneducated! That is perhaps his most depressing
> characteristic. He is equally education-resistant as another equally
> mythical bore, “the average programmer”, whose solid stupidity is the
> greatest barrier to progress in programming. It is a sad thought that
> large sections of computing science are effectively paralyzed by the
> narrow-mindedness and other grotesque limitations with which a poor
> literature has endowed these influential mythical figures. (Computing
> science is not unique in inventing such paralyzing caricatures:
> universities all over the world are threatened by the invention of
> “the average student”, scientific publishing is severely hampered by
> the invention of “the innocent reader” and even “the poor reader”!)

Didn't know he was such a humorist! lol

Although I prefer when he's serious:

http://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1094.html

  -- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 9:59:07 AM UTC-7, Chris Angelico wrote:
> On Thu, Jun 6, 2013 at 2:15 AM, Russ P. wrote:
> 
> > On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote:
> 
> >> I want to launch this rocket with an expensive satellite on top.  I know
> 
> >>
> 
> >> it's safe as the code is written in ADA.  Whoops :(
> 
> >
> 
> >
> 
> > So Python would have been a better choice? Yeah, right. If you know 
> > anything about that rocket mishap, you should know that Ada was not the 
> > source of the problem. Ada won't keep airplane wings from breaking either, 
> > by the way. It's not magic.
> 
> 
> 
> Frankly, I don't think the language much matters. It's all down to the
> 
> skill of the programmers and testers. Ada wasn't the source of the
> 
> problem unless Ada has a bug in it... which is going to be true of
> 
> pretty much any language. Maybe Python would be a better choice, maybe
> 
> not; but let me tell you this, if the choice of language means the
> 
> difference between testable in three months and testable code in three
> 
> years, I'm going for the former.
> 
> 
> 
> ChrisA

I'm not an Ada guy, but Ada advocates claim that it reduces development time by 
half in the long run compared to C and C++ due to reduced debugging time and 
simpler maintenance. Then again, I think Java people make a similar claim. As 
for Python, my experience with it is that, as your application grows, you start 
getting confused about what the argument types are or are supposed to be. That 
requires the developer to keep much more of the design in his head, and that 
undesirable. Of course, you can always put the argument types in comments, but 
that won't be verified by the compiler.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread rurpy
On Wednesday, June 5, 2013 3:03:29 PM UTC-6, Chris Angelico wrote:
> On Thu, Jun 6, 2013 at 6:56 AM,   wrote:
> > On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
> >>...
> >> print( cookie, "Content-type: text/html; charset=utf-8\n", message ) 
> >>...
> >   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
> > (ie, note the two \n's after the "utf-8" test.)
> 
> But that won't solve it either. The default separator for print is a
> space, so this will indent his Content-type line by one space.

Ah, quite right.  Something like 

  print( cookie, "\nContent-type: text/html; charset=utf-8\n\n", message )

then.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Not to make excuses as to my forum etiquette I apologize. I am half Cuban and 
simple. I meant no disrespect I like Mr. Goldstick's name. Maybe I can find the 
answer somewhere else true. However a simple code to close the program like in 
Visual Basic "Me.close" seems like  something that should come easy to a 
program environment. sys.exit(0) for python is logical. I just get the line: 
program exited  with code (0). I will Google the line in any case. You know in 
school I did well in English writing if that helps. I also can take the line 
out sys.exit(0). So I need a different line of code to close or to do something 
to make that line not appear. I also understand that programming languages can 
be more complex to get somethings done.

Thank You all for your time.
apologies.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 6:56 AM,   wrote:
> On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
>>...
>> print( cookie, "Content-type: text/html; charset=utf-8\n", message )
>>...
>
> If you look in the Apache error log file, you will see something like,
>
>   [Wed Jun 05 16:39:14 2013] [error] [client 192.168.0.1] malformed header 
> from script. Bad header= \xce\x91\xce\xa0\xce\x9f \xce\x94\xce\xa9 
> \xce\x9a\xce\x91\xce\x99 \xce\xa3\xce\xa4\xce\x9f \xce\x95\xce: koukos.py
>
> which is saying that the 'message' text is being interpreted as
> being part of the headers.
>
> You are missing a blank line between the header lines and the
> page text.  That is, I think you want,
>
>   print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )
>
> (ie, note the two \n's after the "utf-8" test.)

But that won't solve it either. The default separator for print is a
space, so this will indent his Content-type line by one space. Nikos,
do you know what effect that will have? If not, research HTTP. RFC
2616 is a good place to start.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread rurpy
On Wednesday, June 5, 2013 1:54:45 PM UTC-6, Νικόλαος Κούρας wrote:
>...
> print( cookie, "Content-type: text/html; charset=utf-8\n", message )
>...

If you look in the Apache error log file, you will see something like,

  [Wed Jun 05 16:39:14 2013] [error] [client 192.168.0.1] malformed header from 
script. Bad header= \xce\x91\xce\xa0\xce\x9f \xce\x94\xce\xa9 
\xce\x9a\xce\x91\xce\x99 \xce\xa3\xce\xa4\xce\x9f \xce\x95\xce: koukos.py

which is saying that the 'message' text is being interpreted as 
being part of the headers.

You are missing a blank line between the header lines and the 
page text.  That is, I think you want, 

  print( cookie, "Content-type: text/html; charset=utf-8\n\n", message )

(ie, note the two \n's after the "utf-8" test.)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Joel Goldstick
On Wed, Jun 5, 2013 at 4:18 PM, Thomas Murphy
wrote:

> Goldstick which seems Jewish to me. I would think as a Gentile Heathen
> Jesus save us this would project a need for a good sex life
>
> *WAT*
> *
> *
>
I second the WAT.  You are a strange  person.  I think you were being
offensive.  I can't help you with your sex life.  Sorry kid.

> **
> *
> *
> Armando, are you understanding that input and raw_input make Python do
> very different things, and this is dependent of the version of Python
> you're using? Folks aren't being pedantic, it's critical to giving you a
> good answer.
>
>
> So it seems you changed your input to raw_input and now your program
works.  But you don't like the final message.  Do you know what this line
does:

sys.exit(0)

If you don't, then you shouldn't have put it in your program.  Google it
"python sys.exit(0)".

I imagine that is what is causing the message you are concerned with.  Try
removing that line (each place you have them) and see what happens.

Also, there is a python-tutor list that may be a better place for you to
post.

Try being polite.  You may be quite a bit more lost than you realize!


> On Wed, Jun 5, 2013 at 3:59 PM, Armando Montes De Oca <
> armandomontesdeoca...@gmail.com> wrote:
>
>> Well I am replying to To whom it may concern at this point I am a bit
>> lost. I posted all my code. I am not taking classes on this nor do I have a
>> book I followed a guy on You Tube. I am a student but I heard Python is a
>> good language to learn in conjunction with C++ and Perl for example. I have
>> taken Visual Basic 2010 last semester so keep thinking for me if you like
>> if not when I can get a Python book or lesson. Joel Goldstick seems the
>> more "professorly" so far by telling me the right thing of I have not
>> learned something yet. Also with a name like Goldstick which seems Jewish
>> to me. I would think as a Gentile Heathen Jesus save us this would project
>> a need for a good sex life.
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
>
> --
> Sincerely,
> Thomas Murphy
> Code Ninja
> 646.957.6115
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 5:59 AM, Armando Montes De Oca
 wrote:
> Well I am replying to To whom it may concern at this point I am a bit lost. I 
> posted all my code. I am not taking classes on this nor do I have a book I 
> followed a guy on You Tube. I am a student but I heard Python is a good 
> language to learn in conjunction with C++ and Perl for example. I have taken 
> Visual Basic 2010 last semester so keep thinking for me if you like if not 
> when I can get a Python book or lesson. Joel Goldstick seems the more 
> "professorly" so far by telling me the right thing of I have not learned 
> something yet. Also with a name like Goldstick which seems Jewish to me. I 
> would think as a Gentile Heathen Jesus save us this would project a need for 
> a good sex life.

 uhh...

Have you been taking lessons from Dihedral?

If not, let's leave out the personal remarks. I don't think they're
helping, and they're certainly not making you any easier to comprehed.
(I'm still not sure what your last sentence is saying.)

As to context, though: It's conventional on mailing lists and
newsgroups to retain some of the previous post's text to provide a
hook as to what you're replying to. You'll find plenty of information
about that on the internet; the general recommendation is to eyeball
what you're sending and trim the text to just what it takes to provide
context for your post. The quoted text goes first, and your text
underneath (possibly interspersed, if appropriate).

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Thomas Murphy
Goldstick which seems Jewish to me. I would think as a Gentile Heathen
Jesus save us this would project a need for a good sex life

*WAT*
*
*
*
*
Armando, are you understanding that input and raw_input make Python do very
different things, and this is dependent of the version of Python you're
using? Folks aren't being pedantic, it's critical to giving you a good
answer.


On Wed, Jun 5, 2013 at 3:59 PM, Armando Montes De Oca <
armandomontesdeoca...@gmail.com> wrote:

> Well I am replying to To whom it may concern at this point I am a bit
> lost. I posted all my code. I am not taking classes on this nor do I have a
> book I followed a guy on You Tube. I am a student but I heard Python is a
> good language to learn in conjunction with C++ and Perl for example. I have
> taken Visual Basic 2010 last semester so keep thinking for me if you like
> if not when I can get a Python book or lesson. Joel Goldstick seems the
> more "professorly" so far by telling me the right thing of I have not
> learned something yet. Also with a name like Goldstick which seems Jewish
> to me. I would think as a Gentile Heathen Jesus save us this would project
> a need for a good sex life.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Sincerely,
Thomas Murphy
Code Ninja
646.957.6115
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread John Gordon
In <400ea041-adcf-4640-8872-f81808f7d...@googlegroups.com> 
=?ISO-8859-7?B?zenq/Ovh7/Igyu/98eHy?=  writes:

> 'python files.py' interprets without an error.
> Problem is that when via browser - http://superhost.gr/cgi-bin/koukos.py
> i receive the following:

Why should 'files.py' have any relation to 'koukous.py'?

> What file does the error complain it cannot find? I do not understand its
> message. Here is the code of koukos.py

> -
> #!/usr/bin/python

Does /usr/bin/python exist?  Scripts can throw a 'No such file or directory'
or 'Command not found' error if they begin with a shebang line which refers
to a nonexistent program.

-- 
John Gordon   A is for Amy, who fell down the stairs
gor...@panix.com  B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 5:54 AM, Νικόλαος Κούρας  wrote:
> print( cookie, "Content-type: text/html; charset=utf-8\n", message )
>

Do you know what this does?

Try it at the console. See what it outputs.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Well I am replying to To whom it may concern at this point I am a bit lost. I 
posted all my code. I am not taking classes on this nor do I have a book I 
followed a guy on You Tube. I am a student but I heard Python is a good 
language to learn in conjunction with C++ and Perl for example. I have taken 
Visual Basic 2010 last semester so keep thinking for me if you like if not when 
I can get a Python book or lesson. Joel Goldstick seems the more "professorly" 
so far by telling me the right thing of I have not learned something yet. Also 
with a name like Goldstick which seems Jewish to me. I would think as a Gentile 
Heathen Jesus save us this would project a need for a good sex life.
-- 
http://mail.python.org/mailman/listinfo/python-list


Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread Νικόλαος Κούρας
Since the other thread gone into the wild, i choosed not to participate any 
longer and i state the question in this new thread.

'python files.py' interprets without an error.
Problem is that when via browser - http://superhost.gr/cgi-bin/koukos.py
i receive the following:

---
root@nikos [/home/nikos/www/cgi-bin]# ls
./  ../  convert.py*  files.py*  .htaccess  koukos.py*  metrites.py*  
pelatologio.py*

root@nikos [/home/nikos/www/cgi-bin]# tail -F /usr/local/apache/logs/error_log &

root@nikos [/home/nikos/www/cgi-bin]# [Wed Jun 05 22:47:43 2013] [error] 
[client 
79.103.41.173] (2)No such file or directory: exec of 
'/home/nikos/public_html/c  
  gi-bin/koukos.py' failed
[Wed Jun 05 22:47:43 2013] [error] [client 79.103.41.173] Premature end of 
scrip   
 t headers: koukos.py
--

What file does the error complain it cannot find? I do not understand its 
message. Here is the code of koukos.py


-
#!/usr/bin/python
# coding=utf-8

import cgitb; cgitb.enable()
import cgi, os, sys, locale, codecs
from http import cookies

#needed line, script does *not* work without it
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach())

# initialize cookie
cookie = cookies.SimpleCookie( os.environ.get('HTTP_COOKIE') )
cookie.load( cookie )
nikos = cookie.get('nikos')

# if visitor cookie does exist
if nikos:
message = "ΑΠΟ ΤΗΝ ΕΠΟΜΕΝΗ ΕΠΙΣΚΕΨΗ ΣΟΥ ΘΑ ΣΕ ΥΠΟΛΟΓΙΖΩ ΩΣ ΕΠΙΣΚΕΠΤΗ 
ΑΥΞΑΝΟΝΤΑΣ ΤΟΝ ΜΕΤΡΗΤΗ!"
cookie['nikos'] = 'admin'
cookie['nikos']['path'] = '/'
cookie['nikos']['expires'] = -1 #this cookie will expire now
else:
message  = "ΑΠΟ ΔΩ ΚΑΙ ΣΤΟ ΕΞΗΣ ΔΕΝ ΣΕ ΕΙΔΑ, ΔΕΝ ΣΕ ΞΕΡΩ, ΔΕΝ ΣΕ 
ΑΚΟΥΣΑ! ΘΑ ΕΙΣΑΙ ΠΛΕΟΝ Ο ΑΟΡΑΤΟΣ ΕΠΙΣΚΕΠΤΗΣ!!"
cookie['nikos'] = 'admin'
cookie['nikos']['path'] = '/'
cookie['nikos']['expires'] = 60*60*24*30*12 #this cookie 
will expire in a year


print( cookie, "Content-type: text/html; charset=utf-8\n", message )

sys.exit(0)
-

All it tries to do is to set a cookie.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Joel Goldstick


Now, you were right about my bad mouth because iam going to tell you to sod
off.


  >Well, if he had ethics he would have told me that his intentiosn were to
screw my business and also he could actually tried to help me out.

Many times I've seen people here give you their best advice and you come
back seemingly having not even read what they had to say.  You just whine
and say someone should help you, even though many have already done that.
You don't take the help.

Now in this case, Chris more or less proved my point.  I've been reading
along, and he said exactly what he would do if you gave him root access to
your account.  He said he would write to your users and explain to them the
peril of how you run your hosting service.  He didn't say he would help
you.

Go back and read exactly what he said, and then take a deep breath and do
some introspection of your own conduct.  He basically said, don't touch the
stove, its hot.  And you touched the stove and then complained.  You act
very poorly here.  Grow up

 >I'am not incompetentm i;m a beginner and i learn along the way, also i
ahve a hostign company and 3rd level tech that support me when it come to
system administration.

I think you are incompetent.  No one knows everything, and groups like this
are a great place to learn more.  But part of being competent is being
careful.  You are reckless.  You work on a live server for which you have
paying customers.  You make endless changes to your code without taking the
time to go off and google for information about the topic you are
struggling with.  Your live site should probably have been put together
using a framework, but that would have required you to read about,
experiment with and use a framework.  You write html code in the midst of
your python code.  You have endless encoding/decoding issues, but you have
never apparently read the many articles on how unicode works.

Have some respect for the science and craft of making good software.




On Wed, Jun 5, 2013 at 3:03 PM, Chris Angelico  wrote:

> On Thu, Jun 6, 2013 at 4:55 AM, rusi  wrote:
> > If you obdurately, obstinately, insistently, incessantly behave like
> > an asshole, you leave no-one the choice but to treat you like an
> > asshole.
>
> This is Python. We duck-type people.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 10:13:41 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 4:58 AM, Νικόλαος Κούρας  wrote:
> 
> > Well, if he had ethics he would have told me that his intentiosn were to 
> > screw my business and also he could actually tried to help me out.
> 
> 
> 
> I did. :)
> 
> 
> 
> > I'am not incompetentm i;m a beginner and i learn along the way, also i ahve 
> > a hostign company and 3rd level tech that support me when it come to system 
> > administration.
> 
> 
> 
> Beginners learning along the way do not run businesses. I wouldn't
> 
> hire someone to build me a porch if he admits that he's still learning
> 
> which end of the hammer to hit with. (That's understandable if it's a
> 
> PHP hammer with claws on both ends, but I still wouldn't hire him.)
> 
> And if I hired someone to build that porch and only afterward
> 
> discovered that he didn't know a screw from a nail, I would be pretty
> 
> miffed. Nikos, you are that carpenter.
> 
> 
> 
> There's nothing wrong with being a beginner. We all start out that
> 
> way. But a beginner plays with things that don't have major
> 
> consequence. If you didn't have paying customers, you would not need
> 
> to worry about what I might have done; at very worst, you just wipe
> 
> the system and reinstall. (You DO have basic firewalling to make sure
> 
> I can't damage any other box, right?) And even more so, if you didn't
> 
> have paying customers, you would not be in a tizz about things. You
> 
> could simply set the matter aside and come back later. This is safe.
> 
> 
> 
> Don't do what you wouldn't stand for someone else doing.


I'll have you know that all 10 of my client webpages run unproblematically and 
i support them by mail and teamviewer for free.

I have even bough Softaculous licenses for them to have joomla and Drupal 
install in an automatic way so things go smooth and easy for them because tehy 
can all build Joomla from scratch.

If i couldnt host their webistes i woudlnt have done so, but i can.
And when i find t hard their is always the webhost company that supports me by 
just openign a ticket.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 4:58 AM, Νικόλαος Κούρας  wrote:
> Well, if he had ethics he would have told me that his intentiosn were to 
> screw my business and also he could actually tried to help me out.

I did. :)

> I'am not incompetentm i;m a beginner and i learn along the way, also i ahve a 
> hostign company and 3rd level tech that support me when it come to system 
> administration.

Beginners learning along the way do not run businesses. I wouldn't
hire someone to build me a porch if he admits that he's still learning
which end of the hammer to hit with. (That's understandable if it's a
PHP hammer with claws on both ends, but I still wouldn't hire him.)
And if I hired someone to build that porch and only afterward
discovered that he didn't know a screw from a nail, I would be pretty
miffed. Nikos, you are that carpenter.

There's nothing wrong with being a beginner. We all start out that
way. But a beginner plays with things that don't have major
consequence. If you didn't have paying customers, you would not need
to worry about what I might have done; at very worst, you just wipe
the system and reinstall. (You DO have basic firewalling to make sure
I can't damage any other box, right?) And even more so, if you didn't
have paying customers, you would not be in a tizz about things. You
could simply set the matter aside and come back later. This is safe.

Don't do what you wouldn't stand for someone else doing.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:55:46 μ.μ. UTC+3, ο χρήστης rusi έγραψε:
> On Jun 5, 11:34 pm, Νικόλαος Κούρας  wrote:
> 
> > Here is the mails you sent to my customers for the other members to see.
> 
> 
> 
> 
> 
> In the normal run of things, I would say Chris has done a horrible
> 
> thing.
> 
> In this case however, let us remember:
> 
> Many people -- hardly exclusively Chris -- tried to educate you
> 
>   1. on technical matters
> 
>   2. on methodological matters (eg how to debug)
> 
>   3. on matters of minimum etiquette -- eg spellchecking
> 
>   4. on basic security
> 
> 
> 
> For the most part, you simply have not listened.
> 
> Finally Chris warned you what he can do.
> 
> Instead of listening, you whined: "I trust you!!" (Heres a kiss!) and
> 
> gave him your password.
> 
> He gently tapped you on your rather hard and impervious 'Ferrous
> 
> Cranus' to let you understand the implications.
> 
> 
> 
> Even now, instead of understanding that you were wrong throughout, you
> 
> are still blaming Chris -- Good Grief!
> 
> 
> 
> And you expect us to sympathize with you?!?!  I dont know whether to
> 
> laugh or cry...
> 
> 
> 
> Please note Nikos:
> 
> If you obdurately, obstinately, insistently, incessantly behave like
> 
> an asshole, you leave no-one the choice but to treat you like an
> 
> asshole.
> 
> 
> 
> So... Are you an asshole??  One can only hope that you prove me wrong...

No, its your attitude that is beyond asshood.

I decided a long time ago the certain people on the Python list were
assholes, perhaps you are the leader here.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 4:55 AM, rusi  wrote:
> If you obdurately, obstinately, insistently, incessantly behave like
> an asshole, you leave no-one the choice but to treat you like an
> asshole.

This is Python. We duck-type people.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:52:27 μ.μ. UTC+3, ο χρήστης Zero Piraeus έγραψε:
> :
> 
> 
> 
> On 5 June 2013 14:34, Νικόλαος Κούρας  wrote:
> 
> > Here is the mails you sent to my customers for the other members to see.
> 
> > ---
> 
> > [...]
> 
> > I advise that you look to alternative web hosting.
> 
> > ---
> 
> >
> 
> > Thanks for screwing me up entirely and made me look what you made me look 
> > for all i did was to trust you.
> 
> 
> 
> Chris has done your customers an important service (one which I would
> 
> not have risked, given your propensity for badmouthing those with whom
> 
> you come in contact). You are dangerously incompetent as a hosting
> 
> provider, as you have demonstrated here repeatedly. Be thankful that
> 
> the person you stupidly granted root access to has a sense of ethics,
> 
> and learn your trade.
> 
> 
> 
>  -[]z.

Well, if he had ethics he would have told me that his intentiosn were to screw 
my business and also he could actually tried to help me out.

I'am not incompetentm i;m a beginner and i learn along the way, also i ahve a 
hostign company and 3rd level tech that support me when it come to system 
administration.

Now, you were right about my bad mouth because iam going to tell you to sod off.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread rusi
On Jun 5, 11:34 pm, Νικόλαος Κούρας  wrote:
> Here is the mails you sent to my customers for the other members to see.


In the normal run of things, I would say Chris has done a horrible
thing.
In this case however, let us remember:
Many people -- hardly exclusively Chris -- tried to educate you
  1. on technical matters
  2. on methodological matters (eg how to debug)
  3. on matters of minimum etiquette -- eg spellchecking
  4. on basic security

For the most part, you simply have not listened.
Finally Chris warned you what he can do.
Instead of listening, you whined: "I trust you!!" (Heres a kiss!) and
gave him your password.
He gently tapped you on your rather hard and impervious 'Ferrous
Cranus' to let you understand the implications.

Even now, instead of understanding that you were wrong throughout, you
are still blaming Chris -- Good Grief!

And you expect us to sympathize with you?!?!  I dont know whether to
laugh or cry...

Please note Nikos:
If you obdurately, obstinately, insistently, incessantly behave like
an asshole, you leave no-one the choice but to treat you like an
asshole.

So... Are you an asshole??  One can only hope that you prove me wrong...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:46:03 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 4:34 AM, Νικόλαος Κούρας  wrote:
> 
> > Here is the mails you sent to my customers for the other members to see.
> 
> 
> 
> Yep, containing nothing I haven't said on-list.
> 
> 
> 
> > Thanks for screwing me up entirely and made me look what you made me look 
> > for all i did was to trust you.
> 
> 
> 
> Making you look like what? A systems administrator who can't be
> 
> trusted? Because that is, quite frankly, entirely accurate.
> 
> 
> 
> Suppose you go to a posh place that offers valet parking. You make
> 
> sure that the person you're giving your car key to is employed by the
> 
> club, and you let him take control of your car. Unbeknownst to you, he
> 
> doesn't actually park your car, he calls out to the loafers, asking
> 
> them to park it. He knows these guys, they're always hanging around.
> 
> He gives the key to one of them, who gets in your car and looks
> 
> around.
> 
> 
> 
> That's what you've done. You violated the trust your clients placed in
> 
> you, and your only response is to claim that a person (with whom you
> 
> had no contractual arrangement or even verbal promise) violated your
> 
> trust. It's like saying "I can keep a secret, it's just the folks I
> 
> tell it to who can't".
> 
> 
> 
> ChrisA

Its funny how doing what you did you manage to turn the whole thing against me.
WHY isntead of doing wht you did, dint you choose to actually *help* ?

I'am beginning to dislkike you more and more as you speak.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Zero Piraeus
:

On 5 June 2013 14:34, Νικόλαος Κούρας  wrote:
> Here is the mails you sent to my customers for the other members to see.
> ---
> [...]
> I advise that you look to alternative web hosting.
> ---
>
> Thanks for screwing me up entirely and made me look what you made me look for 
> all i did was to trust you.

Chris has done your customers an important service (one which I would
not have risked, given your propensity for badmouthing those with whom
you come in contact). You are dangerously incompetent as a hosting
provider, as you have demonstrated here repeatedly. Be thankful that
the person you stupidly granted root access to has a sense of ethics,
and learn your trade.

 -[]z.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 4:34 AM, Νικόλαος Κούρας  wrote:
> Here is the mails you sent to my customers for the other members to see.

Yep, containing nothing I haven't said on-list.

> Thanks for screwing me up entirely and made me look what you made me look for 
> all i did was to trust you.

Making you look like what? A systems administrator who can't be
trusted? Because that is, quite frankly, entirely accurate.

Suppose you go to a posh place that offers valet parking. You make
sure that the person you're giving your car key to is employed by the
club, and you let him take control of your car. Unbeknownst to you, he
doesn't actually park your car, he calls out to the loafers, asking
them to park it. He knows these guys, they're always hanging around.
He gives the key to one of them, who gets in your car and looks
around.

That's what you've done. You violated the trust your clients placed in
you, and your only response is to claim that a person (with whom you
had no contractual arrangement or even verbal promise) violated your
trust. It's like saying "I can keep a secret, it's just the folks I
tell it to who can't".

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
> On 05/06/2013 18:43, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ wrote:
> 
> > οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 5 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2013 8:56:36 οΏ½.οΏ½. 
> > UTC+3, οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ Steven D'Aprano οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½:
> 
> >
> 
> > Somehow, I don't know how because I didn't see it happen, you have one or
> 
> > more files in that directory where the file name as bytes is invalid when
> 
> > decoded as UTF-8, but your system is set to use UTF-8. So to fix this you
> 
> > need to rename the file using some tool that doesn't care quite so much
> 
> > about encodings. Use the bash command line to rename each file in turn
> 
> > until the problem goes away.
> 
> >
> 
' leade to that unknown encoding of this bytestream '\305\365\367\336\ 
\364\357\365\ \311\347\363\357\375.mp3'
> 
> >
> 
> > But please tell me Steven what linux tool you think it can encode the weird 
> > filename to proper 'οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½.mp3' utf-8?
> 
> >
> 
> > or we cna write a script as i suggested to decode back the bytestream using 
> > all sorts of available decode charsets boiling down to the original greek 
> > letters.
> 
> >
> 


Actually you were correct i was typing greek and is aw the fileneme here in 
gogole groups as:

> > But renaming ia hsell access like 'mv 'Euxi tou Ihsou.mp3' 'οΏ½οΏ½οΏ½οΏ½ 
> > οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½.mp3

so maybe the filenames have to be decoded to greek-iso but then agian the 
contain both greek letters but their extension are in english chars like '.mp3'


> Using Python, I think you could get the filenames using os.listdir, 
> passing the directory name as a bytestring so that it'll return the
> names as bytestrings.
 

> Then, for each name, you could decode from its current encoding and 
> encode to UTF-8 and rename the file, passing the old and new paths to
> os.rename as bytestrings.

Iam not sure i follow:

Change this:

# Compute a set of current fullpaths
fullpaths = set()
path = "/home/nikos/public_html/data/apps/"

for root, dirs, files in os.walk(path):
for fullpath in files:
fullpaths.add( os.path.join(root, fullpath) )


to what to make the full url readable by files.py?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 4:22 AM, Νικόλαος Κούρας  wrote:
> Τη Τετάρτη, 5 Ιουνίου 2013 9:16:56 μ.μ. UTC+3, ο χρήστης Chris Angelico 
> έγραψε:
>
>>Do you contact strangers to ask them to feed your cat? Or do you talk to a 
>>>trusted friend?
>
> Well i dont consider you a perfect stranger, because we kind of know each 
> other since we speak here sometime.
>
> You know how much i was striving for help resolving this, and i was happy 
> this morning thinking that Chris will fianlly put me out of this encoding 
> misery

See, that's the thing. All you know about me is that I happen to
answer a lot of questions here. Now, if you ask around on this list,
you'll probably learn a lot about me, but the most important thing
right now is that I told you up-front that I was not intending to
help, yet you still gave me the root password. You get so stuck on
your own problems that you are unable to see anyone else's. In fact,
you are very much in the position of Alice Liddell at the time of
American McGee's game, "Alice: Madness Returns". (It's a decent game,
but don't buy anything from EA Games.) The problem isn't so much what
you're doing, as what you're not doing. Slow down, take a step back.
Give yourself some breathing space. If you had a test computer to play
around on before deploying things to your live server, you would not
be panicked by little problems; and you could take a bit of time to
(a) polish your posts before hitting Send, and (b) read the responses
more thoroughly. Between those two, you could avoid a lot of trouble
fairly easily.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Here is the mails you sent to my customers for the other members to see.

---
Greetings.

I apologize for this unsolicited email, but I feel that you have a
right to know about the security of your server. Νικόλαος Κούρας
(Nikos) has been in repeated communication with the members of
python-list with regard to many issues he is having, and he has
happily granted root access to his server to someone he has never met
and has no reason to trust. This compromises your data and your web
site.

Fortunately for you, the person he gave his password is me, and I have
no intention of causing damage. However, if I wanted to, I could do
*anything* to his server. As a simple demonstration, I have placed a
file called Hello_from_Rosuav in the root directory of each of your
web sites, for instance:

http://leonidasgkelos.com/Hello_from_Rosuav
http://parking-byzantio.gr/Hello_from_Rosuav

Your email addresses, too, I obtained from the server. If you are
storing personal details of any of your customers, I could access
those, but on principle I haven't looked.

Please consider carefully who you trust with your hosting. There is no
need to panic right now, as there has been no damage done (beyond the
creation of the file I mentioned above, which you can easily delete).
But be aware that Nikos is not a competent systems administrator, and
I would not trust him with any of my data.

You can find a large number of posts by Nikos on python-list here:
http://news.gmane.org/gmane.comp.python.general
http://mail.python.org/pipermail/python-list/2013-June/thread.html

Feel free to contact me for further details. I apologize that I cannot
communicate in Greek; I hope that this will not be a problem.

I advise that you look to alternative web hosting.
---

Thanks for screwing me up entirely and made me look what you made me look for 
all i did was to trust you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread MRAB

On 05/06/2013 18:43, Νικόλαος Κούρας wrote:

Τη Τετάρτη, 5 Ιουνίου 2013 8:56:36 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:

Somehow, I don't know how because I didn't see it happen, you have one or
more files in that directory where the file name as bytes is invalid when
decoded as UTF-8, but your system is set to use UTF-8. So to fix this you
need to rename the file using some tool that doesn't care quite so much
about encodings. Use the bash command line to rename each file in turn
until the problem goes away.

But renaming ia hsell access like 'mv 'Euxi tou Ihsou.mp3' 'Ευχή του Ιησου.mp3' 
leade to that unknown encoding of this bytestream '\305\365\367\336\ 
\364\357\365\ \311\347\363\357\375.mp3'

But please tell me Steven what linux tool you think it can encode the weird 
filename to proper 'Ευχή του Ιησου.mp3' utf-8?

or we cna write a script as i suggested to decode back the bytestream using all 
sorts of available decode charsets boiling down to the original greek letters.


Using Python, I think you could get the filenames using os.listdir,
passing the directory name as a bytestring so that it'll return the
names as bytestrings.

Then, for each name, you could decode from its current encoding and
encode to UTF-8 and rename the file, passing the old and new paths to
os.rename as bytestrings.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:16:56 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:

>Do you contact strangers to ask them to feed your cat? Or do you talk to a 
>>trusted friend?

Well i dont consider you a perfect stranger, because we kind of know each other 
since we speak here sometime.

You know how much i was striving for help resolving this, and i was happy this 
morning thinking that Chris will fianlly put me out of this encoding misery
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 4:08 AM, Νικόλαος Κούρας  wrote:
> Anyway, i should'n have given root access to you, i was a bit worried doing 
> so, but i was also under stress of also correcting this damn encoding issue 
> and i wanted to think you would be the one that finally help solving it.
>
> You shouldnt have gone "that far", just to prove a point.
> Its not that malicious activity didn't occur to me that migth happen, i just 
> like to think that it wont.

Sure, you'd like to think that nothing will ever go wrong. Trouble is,
you can't depend on that. Maybe Steven D'Aprano would have solved your
problem for you... maybe not. Maybe you would have picked someone who
totally smashed your system, reputation, bank balance, and family pet.
How would you know?

The point of security is not to trust that most people will be fine.
The point of security is to be secure. You may not be able to guard
against everything, but you can certainly put some effort into not
making it easy for an attacker.

Treat the root password as a keyring with all of your keys on it, and
assume that you're going on holidays overseas. Do you contact
strangers to ask them to feed your cat? Or do you talk to a trusted
friend?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 8:47:38 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 3:29 AM, Νικόλαος Κούρας  wrote:
> 
> > Now about what you did to me. I wanted to tell you that I (and I am sure 
> > there are other people too) don't agree with what you did. I think it was 
> > pretty rotten -- you told me it was a bad idea to give out the root 
> > password and that was as far as you should have gone, you had no right to 
> > "prove" it by screwing with my system.
> 
> >
> 
> > In the US there is a law called the DMCA which I think would make what
> 
> > you did illegal, even though i have you a password, because i
> 
> > clearly gave you access to help me fix a problem, not to do what you
> 
> > did. Of course US law doesn't help in this case since you i live in Greece 
> > and you live in Australia...
> 
> 
> 
> IANAL, but I don't think the DMCA has anything to do with this. (That
> 
> is to say, I don't think it would even if everything were under US
> 
> jurisdiction, which as you say isn't the case anyway.) What I did is
> 
> no more illegal than you lending your car keys to a stranger with the
> 
> request that he lock your door for you, and him then leafing through
> 
> the contents of your car and telling your spouse what he found. If
> 
> that causes your marriage to break up, the fault was with you for
> 
> having something in your car that would break up your marriage, and
> 
> for letting a stranger poke around in there.
> 
> 
> 
> > I still maintain my belief that most people are good and want to help
> 
> > rather than be destructive(which to your defense you weren't entirely. The 
> > mails you sent to my few customers though really pissed me off).
> 
> 
> 
> The mails to your customers stop you from pretending to them that you
> 
> know what you're doing. That's all. Now, you may be able to come back
> 
> from this by making a public change of policy (you so far have a
> 
> declared stance that you would give out the root password to someone
> 
> else in future) and apologizing profusely to your customers, but if
> 
> you can't, that is your problem and not mine.
> 
> 
> 
> I was programming computers for eighteen years before I got a job
> 
> doing it. Getting money for hosting people's web sites is something
> 
> that you should see as a privilege for people who can demonstrably
> 
> provide this service safely, and should not be something you strive
> 
> for while you're learning the basics of Linux.
> 
> 
> 
> > And of course, i have no idea, if you ahve installed some kind of a 
> > backdoor utility that will grant you shell access via ssh to my system.
> 
> > I want to convince myself that you haven't done so.
> 
> 
> 
> I can help with that convincing. No, I did not install any sort of
> 
> backdoor. There is no way you can prove that statement, but you have
> 
> my promise and pledge that your system is safe from me. All I did was:
> 
> 
> 
> 1) Change the root password, storing the new one in a way that you could find 
> it
> 
> 2) Create the cookie file as proof of what I could do
> 
> 3) Collect email addresses from /home/*/.contactemail
> 
> 4) Inspect the index.html files in a few directories as a means of
> 
> locating the web sites concerned
> 
> 5) 'mv .bash_history .bash_history_old', and later mv it back
> 
> 
> 
> There is no ongoing access, and now that you've changed the root
> 
> password (btw, I hope you weren't silly enough to change it to the
> 
> same password you emailed me), the system is under your control again.
> 
>  But you cannot be sure that the *other* people you've given root
> 
> access to didn't do the same.

Every time i granted access to other folks when jobs done i alwaws 'passwd' as 
root to avoid unwanted access.

All customers are also my friends and they like me and trust me. I also fix 
their computers too and use "TeamViewer" many times to help them from home.

Still, all of your doing could be avoided if isntead of fiddlign with my 
clients, you would actually try to provide a helping had.

Anyway, i should'n have given root access to you, i was a bit worried doing so, 
but i was also under stress of also correcting this damn encoding issue and i 
wanted to think you would be the one that finally help solving it.

I was wrong. But no matter what you say i won't lose my beleif hat if for 
example i have given access to Steven, things could have turn into a positive 
solution.

You shouldnt have gone "that far", just to prove a point.
Its not that malicious activity didn't occur to me that migth happen, i just 
like to think that it wont.

Any way, enough said.



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to detect the character encoding in a web page ?

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 1:14 AM, iMath  wrote:
> 在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
>> how to detect the character encoding  in a web page ?
>>
>> such as this page
>>
>>
>>
>> http://python.org/
>
> by the way  ,we cannot get character encoding programmatically from the mate 
> data without knowing the  character encoding  ahead !

The rules for web pages are (massively oversimplified):

1) HTTP header
2) ASCII-compatible encoding and meta tag

The HTTP header is completely out of band. This is the best way to
transmit encoding information. Otherwise, you assume 7-bit ASCII and
start parsing. Once you find a meta tag, you stop parsing and go back
to the top, decoding in the new way. "ASCII-compatible" covers a huge
number of encodings, so it's not actually much of a problem to do
this.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Magazine

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 2:17 AM, DRJ Reddy  wrote:
>
>> Do you have other magazines? Which ones? How are you going to supply 
>> contents?
>
> We don't have other magazines. I was referring to old python magazines which 
> terminated now. Portable documents(PDF , EPUB or MOBI) for now is being 
> planned.

The real problem is the ongoing supply of content. If you can publish
on a regular schedule (weekly?) with interesting content, you'll have
a highly successful magazine... but if you have to provide all that
content yourself, you'll burn out. Try to line up a couple of backup
writers or columnists to help out - and no, I'm not offering, I have
way too much happening already :) Though the number of words I've
typed into python-list today would probably be enough for a month's
worth of newsletters...

Let's have more of these threads that are actually Python-related!

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 3:29 AM, Νικόλαος Κούρας  wrote:
> Now about what you did to me. I wanted to tell you that I (and I am sure 
> there are other people too) don't agree with what you did. I think it was 
> pretty rotten -- you told me it was a bad idea to give out the root password 
> and that was as far as you should have gone, you had no right to "prove" it 
> by screwing with my system.
>
> In the US there is a law called the DMCA which I think would make what
> you did illegal, even though i have you a password, because i
> clearly gave you access to help me fix a problem, not to do what you
> did. Of course US law doesn't help in this case since you i live in Greece 
> and you live in Australia...

IANAL, but I don't think the DMCA has anything to do with this. (That
is to say, I don't think it would even if everything were under US
jurisdiction, which as you say isn't the case anyway.) What I did is
no more illegal than you lending your car keys to a stranger with the
request that he lock your door for you, and him then leafing through
the contents of your car and telling your spouse what he found. If
that causes your marriage to break up, the fault was with you for
having something in your car that would break up your marriage, and
for letting a stranger poke around in there.

> I still maintain my belief that most people are good and want to help
> rather than be destructive(which to your defense you weren't entirely. The 
> mails you sent to my few customers though really pissed me off).

The mails to your customers stop you from pretending to them that you
know what you're doing. That's all. Now, you may be able to come back
from this by making a public change of policy (you so far have a
declared stance that you would give out the root password to someone
else in future) and apologizing profusely to your customers, but if
you can't, that is your problem and not mine.

I was programming computers for eighteen years before I got a job
doing it. Getting money for hosting people's web sites is something
that you should see as a privilege for people who can demonstrably
provide this service safely, and should not be something you strive
for while you're learning the basics of Linux.

> And of course, i have no idea, if you ahve installed some kind of a backdoor 
> utility that will grant you shell access via ssh to my system.
> I want to convince myself that you haven't done so.

I can help with that convincing. No, I did not install any sort of
backdoor. There is no way you can prove that statement, but you have
my promise and pledge that your system is safe from me. All I did was:

1) Change the root password, storing the new one in a way that you could find it
2) Create the cookie file as proof of what I could do
3) Collect email addresses from /home/*/.contactemail
4) Inspect the index.html files in a few directories as a means of
locating the web sites concerned
5) 'mv .bash_history .bash_history_old', and later mv it back

There is no ongoing access, and now that you've changed the root
password (btw, I hope you weren't silly enough to change it to the
same password you emailed me), the system is under your control again.
 But you cannot be sure that the *other* people you've given root
access to didn't do the same.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Announcement: MICCAI workshop on Bio- Imaging and Visualization for Patient-Customized Simulations 2013

2013-06-05 Thread tava...@fe.up.pt
MICCAI workshop on Bio- Imaging and Visualization
for Patient-Customized Simulations 2013
September 26, 2013
Nagoya University, Nagoya, Japan
http://sites.google.com/site/mwbivpcs

Description
Imaging and Visualization are among the most dynamic and innovative areas of 
research of the past few decades. Justification of this activity arises from 
the requirements of important practical applications such as the visualization 
of computational data, the processing of medical images for assisting medical 
diagnosis and intervention, and the 3D geometry reconstruction and processing 
for computer simulations.
Currently, due to the development of more powerful hardware resources, 
mathematical and physical methods, investigators have been incorporating 
advanced computational techniques to derive sophisticated methodologies that 
can better enable the solution of the problems encountered. Consequent to these 
efforts any effective methodologies have been proposed, validated and some of 
them have already been integrated into commercial software for computer 
simulations.
The main goal of this MICCAI workshop on Bio- Imaging and Visualization for 
Patient-Customized Simulations 2013 (http://sites.google.com/site/mwbivpcs) is 
to provide a platform for communications among specialists from complementary 
fields such as signal and image processing, mechanics, computational vision, 
mathematics, physics, informatics, computer graphics, bio-medical-practice, 
psychology and industry. Participants in this workshop are going to present and 
discuss their proposed techniques and methods in the corresponding fields that 
are related to the workshop topics and explore the translational potentials of 
these emerging technological fields. This workshop will be an excellent 
opportunity to refine ideas for future work and to establish constructive 
cooperation for new and improved solutions of imaging and visualization 
techniques and modelling methods towards more realistic and efficient computer 
simulations.
Another important objective of the  MICCAI workshop on Bio- Imaging and 
Visualization for Patient-Customized Simulations 2013 is to establish a viable 
connection between software developers, specialist researchers and applied 
end-users from diverse fields related to Signal Processing, Imaging, 
Visualization, Biomechanics and Simulation.

Topics of interest include (but are not restricted to):
- Image processing and Analysis for Patient-Customized Simulations;
- Image Enhancement, Segmentation and Description in Patient-Customized 
Simulations;
- Image based Tracking, Matching and Registration in Patient-Customized 
Simulations;
- Computer Modelling for Patient-Customized Simulations 
- 3D Shape Reconstruction and Processing in Patient-Customized Simulations;
- Medical Imaging for Patient-Customized Simulations;
- Data Processing, Modelling and Analysis in Patient-Customized Simulations;
- Scientific Visualization for Patient-Customized Simulations;
- Enhanced Visualization in Patient-Customized Simulations;
- Human-Computer Interaction in Patient-Customized Simulations;
- Enhanced and Virtual Reality in Patient-Customized Simulations;
- Software Development for Patient-Customized Simulations;
- Grid Computing in Patient-Customized Simulations;
- Applications of Patient-Customized Simulations.

Publications
- The best 6 papers presented in the workshop will be invited to be included as 
extended versions in a special issue of the Taylor and Francis group “Computer 
Methods in Biomechanics and Biomedical Engineering: Imaging & Visualization” 
journal (http://www.tandfonline.com/tciv).
- 15 papers presented in the workshop will be select to be include as extended 
versions in a book dedicated to “Imaging and Visualization for 
Patient-Customized Simulations” to be published by SPRINGER under the “Lecture 
Notes in Computational Vision and Biomechanics” book series 
(http://www.springer.com/series/8910).

Award:
A best paper prize will be given by the workshop organizers to the best paper 
presented in the workshop.

Important Dates:
Deadline for Submission: June 21, 2013
Notification of Acceptance: July 8, 2013
Camera-Ready Submission: July 12, 2013
Workshop Final Program: July 31, 2013
Workshop: September 26, 2013

Deadline for Submission to Journal Special Issue: Nov. 1, 2013
Deadline for Submission to Chapter Book: April 1, 2014

Program Committee:
Alberto Santamaria-Pang, GE Global Research Center, USA
Alexandre X. Falcão, Universidade Estadual de Campinas, Brazil
Aly Farag, Louisville University, USA
Bernard Gosselin, University of Mons, Belgium
Begoña Calvo, University of Zaragoza, Spain
Bin Gu, University of Western Ontario, Canada
Christos E. Constantinou, Stanford University, USA
Daniela Iacoviello, Università degli Studi di Roma "La Sapienza", Italy
Eduardo Soudah, International Center for Numerical Methods in Engineering, Spain
F. Xavier Roca, Universitat Autònoma de Barcelona, Spain
Francisco P.M. Olivei

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 8:56:36 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:

Somehow, I don't know how because I didn't see it happen, you have one or 
more files in that directory where the file name as bytes is invalid when 
decoded as UTF-8, but your system is set to use UTF-8. So to fix this you 
need to rename the file using some tool that doesn't care quite so much 
about encodings. Use the bash command line to rename each file in turn 
until the problem goes away. 

But renaming ia hsell access like 'mv 'Euxi tou Ihsou.mp3' 'Ευχή του Ιησου.mp3' 
leade to that unknown encoding of this bytestream '\305\365\367\336\ 
\364\357\365\ \311\347\363\357\375.mp3'

But please tell me Steven what linux tool you think it can encode the weird 
filename to proper 'Ευχή του Ιησου.mp3' utf-8?

or we cna write a script as i suggested to decode back the bytestream using all 
sorts of available decode charsets boiling down to the original greek letters.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 8:16:46 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 3:02 AM, Νικόλαος Κούρας  wrote:
> 
> > Τη Τετάρτη, 5 Ιουνίου 2013 7:33:50 μ.μ. UTC+3, ο χρήστης Chris Angelico 
> > έγραψε:
> 
> >> In fact, I didn't even bother fiddling with syslog. All I did was
> 
> >> .bash_history. Of course, I wasn't worried about you getting my IP
> 
> >> addresses (one of them is public anyway, and the other isn't mine any
> 
> >> longer than I'm using it), and nothing I did there was sufficiently
> 
> >> serious to be worth hiding, but I just did the history so I could
> 
> >> point out how easy this is.
> 
> >
> 
> > So, by executing .bash_history commands issued are cleared. okey.
> 
> > What abiut 'syslog' that Heiko mentioned. Since you didnt fiddle with 
> > syslog can the latter show me what commands have been executed, files 
> > opened, commands given, services started-stopped etc?
> 
> 
> 
> Poke around in /var/log - I didn't tamper with anything there, so you
> 
> may well find log entries. But I don't know for sure what I did and
> 
> what I didn't do.
> 
> 
> 
> >> and nothing I did there was sufficiently serious to be worth hiding.
> 
> >
> 
> > Actually i believ you, because if you had malice in mind you could 'rm -rf 
> > /' or deface frontpages which you didnt do.
> 
> >
> 
> > But is there a way for me to see what commands have been issued? syslog 
> > perhaps as ia sk above?
> 
> > Since you didn't hurm the system why the need of wipe clean bash's history?
> 
> 
> 
> There won't be a full list of all commands, but you may find some
> 
> hints. And why wipe it? Just to show how easily it could be done.
> 
> Imagine if I'd:
> 
> 
> 
> 1) Created a new user, with a home directory of /etc
> 
> 2) Made a setuid root binary that gives me a shell
> 
> 3) Removed all logfile traces of having done so
> 
> 
> 
> I could then *retain full access* even after you change the root
> 
> password. And you would not know what I'd done, if I do the logfile
> 
> wipes correctly. You might see some hint (eg that logs were rotated
> 
> prematurely), but it'd be extremely hard to figure out what I did.

Forensics is not my strong point, currently i'm learning linux hence i only 
have basic knowledge just to get some basic stuff up and running.

Now about what you did to me. I wanted to tell you that I (and I am sure there 
are other people too) don't agree with what you did. I think it was pretty 
rotten -- you told me it was a bad idea to give out the root password and that 
was as far as you should have gone, you had no right to "prove" it by screwing 
with my system. 

In the US there is a law called the DMCA which I think would make what
you did illegal, even though i have you a password, because i
clearly gave you access to help me fix a problem, not to do what you
did. Of course US law doesn't help in this case since you i live in Greece and 
you live in Australia...

I decided a long time ago the certain people on the Python list were
assholes, you leading the list followed by alex23, Mark Lawrence 
and several more. Your post about how you are a good Christian just 
confirms to me that you aren't -- people who brag about how moral they
are are usually immoral. And besides the major assholes, there are
lots of people there that will just agree with prevailing opinion 
without thinking for themselves.

I still maintain my belief that most people are good and want to help
rather than be destructive(which to your defense you weren't entirely. The 
mails you sent to my few customers though really pissed me off).

And of course, i have no idea, if you ahve installed some kind of a backdoor 
utility that will grant you shell access via ssh to my system.
I want to convince myself that you haven't done so.



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 3:02 AM, Νικόλαος Κούρας  wrote:
> Τη Τετάρτη, 5 Ιουνίου 2013 7:33:50 μ.μ. UTC+3, ο χρήστης Chris Angelico 
> έγραψε:
>> In fact, I didn't even bother fiddling with syslog. All I did was
>> .bash_history. Of course, I wasn't worried about you getting my IP
>> addresses (one of them is public anyway, and the other isn't mine any
>> longer than I'm using it), and nothing I did there was sufficiently
>> serious to be worth hiding, but I just did the history so I could
>> point out how easy this is.
>
> So, by executing .bash_history commands issued are cleared. okey.
> What abiut 'syslog' that Heiko mentioned. Since you didnt fiddle with syslog 
> can the latter show me what commands have been executed, files opened, 
> commands given, services started-stopped etc?

Poke around in /var/log - I didn't tamper with anything there, so you
may well find log entries. But I don't know for sure what I did and
what I didn't do.

>> and nothing I did there was sufficiently serious to be worth hiding.
>
> Actually i believ you, because if you had malice in mind you could 'rm -rf /' 
> or deface frontpages which you didnt do.
>
> But is there a way for me to see what commands have been issued? syslog 
> perhaps as ia sk above?
> Since you didn't hurm the system why the need of wipe clean bash's history?

There won't be a full list of all commands, but you may find some
hints. And why wipe it? Just to show how easily it could be done.
Imagine if I'd:

1) Created a new user, with a home directory of /etc
2) Made a setuid root binary that gives me a shell
3) Removed all logfile traces of having done so

I could then *retain full access* even after you change the root
password. And you would not know what I'd done, if I do the logfile
wipes correctly. You might see some hint (eg that logs were rotated
prematurely), but it'd be extremely hard to figure out what I did.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 3:05 AM, Νικόλαος Κούρας  wrote:
> I grant shell access to very new account i create but some of my customers 
> dont evn know the existance of linux, and the other that do, have no idea of 
> what a shell access is. But i grant them the ability just in cae for future 
> usage.
>
> Most of them are doign the work via cPanel tools.

I would strongly recommend NOT giving shell access, then. The chances
are low that they'll ever need it, and you improve your security
significantly by closing it off.

On Thu, Jun 6, 2013 at 3:07 AM, Νικόλαος Κούρας  wrote:
> Τη Τετάρτη, 5 Ιουνίου 2013 7:35:48 μ.μ. UTC+3, ο χρήστης Joel Goldstick 
> έγραψε:
>
>>To solve the OPs problems once and for all, I believe we need to know his 
>>>social security number and his mother's maiden name.  (Yes, i know SSN is 
>>for US >but... )
>
> Even if i gibe you that info, what can you possibly expect to happen?
> Gain access to my Gmail account because you stuck in its security question?

What about: gain access to your bank account the same way? How would
you feel about random people on the internet having the ability to
transfer money on your behalf?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 7:35:48 μ.μ. UTC+3, ο χρήστης Joel Goldstick έγραψε:

>To solve the OPs problems once and for all, I believe we need to know his 
>>social security number and his mother's maiden name.  (Yes, i know SSN is for 
>US >but... )

Even if i gibe you that info, what can you possibly expect to happen?
Gain access to my Gmail account because you stuck in its security question?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 7:33:50 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Wed, Jun 5, 2013 at 9:19 PM, Νικόλαος Κούρας  wrote:
> 
> > Τη Τετάρτη, 5 Ιουνίου 2013 2:14:34 μ.μ. UTC+3, ο χρήστης Heiko Wundram 
> > έγραψε:
> 
> >> Am 05.06.2013 13:07, schrieb οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½:
> 
> >>
> 
> >> >Btw, since history doesnt show me his history comamnds when he logged in
> 
> >> >from .au(why not really?), how can i tell what exactly did he do when he
> 
> >> >logged on to the server?
> 
> >
> 
> >> As root has full access to your system (i.e., can change file contents
> >> and system state at will), and you gave him root access: you can't. And
> >> he made sure to remove things such as .bash_history and the syslog
> >> contents, I guess. At least that's what I'd have done to prove a point.

> In fact, I didn't even bother fiddling with syslog. All I did was
> .bash_history. Of course, I wasn't worried about you getting my IP
> addresses (one of them is public anyway, and the other isn't mine any
> longer than I'm using it), and nothing I did there was sufficiently
> serious to be worth hiding, but I just did the history so I could
> point out how easy this is.

So, by executing .bash_history commands issued are cleared. okey.
What abiut 'syslog' that Heiko mentioned. Since you didnt fiddle with syslog 
can the latter show me what commands have been executed, files opened, commands 
given, services started-stopped etc? 

> and nothing I did there was sufficiently serious to be worth hiding.

Actually i believ you, because if you had malice in mind you could 'rm -rf /' 
or deface frontpages which you didnt do.

But is there a way for me to see what commands have been issued? syslog perhaps 
as ia sk above?
Since you didn't hurm the system why the need of wipe clean bash's history?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 7:37:47 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Thu, Jun 6, 2013 at 12:46 AM, Serhiy Storchaka  wrote:
> 
> > 05.06.13 11:09, Chris Angelico написав(ла):
> 
> >>
> 
> >> Oh, and I changed the root password, since the current one was sent in
> 
> >> clear text across the internet. Nikos, the new password has been
> 
> >> stored in /home/nikos/new_password - you should be able to access that
> 
> >> using your non-root login. I recommend you change it immediately.
> 
> >
> 
> >
> 
> > What are permission modes of /home/nikos and /home/nikos/new_password?
> 
> 
> 
> I didn't actually fiddle with that, but you're right, I ought to have
> 
> ensured that the password file was mode 600. However, I don't think it
> 
> would have made a lot of difference; mainly I was wanting to guard
> 
> against randoms on the internet, not actual legit users of his system
> 
> (and even they may well not have shell access).

I grant shell access to very new account i create but some of my customers dont 
evn know the existance of linux, and the other that do, have no idea of what a 
shell access is. But i grant them the ability just in cae for future usage.

Most of them are doign the work via cPanel tools.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 2:15 AM, Russ P.  wrote:
> On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote:
>> I want to launch this rocket with an expensive satellite on top.  I know
>>
>> it's safe as the code is written in ADA.  Whoops :(
>
>
> So Python would have been a better choice? Yeah, right. If you know anything 
> about that rocket mishap, you should know that Ada was not the source of the 
> problem. Ada won't keep airplane wings from breaking either, by the way. It's 
> not magic.

Frankly, I don't think the language much matters. It's all down to the
skill of the programmers and testers. Ada wasn't the source of the
problem unless Ada has a bug in it... which is going to be true of
pretty much any language. Maybe Python would be a better choice, maybe
not; but let me tell you this, if the choice of language means the
difference between testable in three months and testable code in three
years, I'm going for the former.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-05 Thread MRAB

On 05/06/2013 06:40, Michael Torrie wrote:

On 06/04/2013 10:15 PM, Νικόλαος Κούρας wrote:

One of my Greek filenames is "Ευχή του Ιησού.mp3". Just a Greek
filename with spaces. Is there a problem when a filename contain both
english and greek letters? Isn't it still a unicode string?

All i did in my CentOS was 'mv "Euxi tou Ihsou.mp3" "Ευχή του
Ιησού.mp3"

and the displayed filename after 'ls -l' returned was:

is -rw-r--r-- 1 nikos nikos 3511233 Jun 4 14:11 \305\365\367\336\
\364\357\365\ \311\347\363\357\375.mp3

There is no way at all to check the charset used to store it in hdd?
It should be UTF-8, but it doesn't look like it. Is there some linxu
command or some python command that will print out the actual
encoding of '\305\365\367\336\ \364\357\365\
\311\347\363\357\375.mp3' ?


I can see that you are starting to understand things. I can't answer
your question (don't know the answer), but you're correct about one
thing.  A filename is just a sequence of bytes.  We'd hope it would be
utf-8, but it could be anything.  Even worse, it's not possible to tell
from a byte stream what encoding it is unless we just try one and see
what happens.  Text editors, for example, have to either make a guess
(utf-8 is a good one these days), or ask, or try to read from the first
line of the file using ascii and see if there's a source code character
set command to give it an idea.


From the previous posts I guessed that the filename might be encoded
using ISO-8859-7:

>>> s = b"\305\365\367\336\ \364\357\365\ \311\347\363\357\375.mp3"
>>> s.decode("iso-8859-7")
'Ευχή\\ του\\ Ιησού.mp3'

Yes, that looks the same.
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to increment date by week?

2013-06-05 Thread PieGuy
On Tuesday, June 4, 2013 2:31:07 PM UTC-7, PieGuy wrote:
> Starting on any day/date, I would like to create a one year list, by week 
> (start date could be any day of week).  Having a numerical week index in 
> front of date, ie 1-52, would be a bonus.  
> 
>ie, 1.  6/4/2013
> 
>2.  6/11/2013
> 
>3.  6/18/2013etc to # 52.
> 
> Thank you Python Community!  I am almost 75, moving from 2.7 to 3.n, just 
> started with Linux Ubuntu, and using WING IDE but my 3 Python books do not 
> offer the clarity of this group.  Again, thanks to all who responded.  
> 
>And to save that result to a file.
> 
>Moving from 2.7 to 3.3
> 
> TIA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 12:46 AM, Serhiy Storchaka  wrote:
> 05.06.13 11:09, Chris Angelico написав(ла):
>>
>> Oh, and I changed the root password, since the current one was sent in
>> clear text across the internet. Nikos, the new password has been
>> stored in /home/nikos/new_password - you should be able to access that
>> using your non-root login. I recommend you change it immediately.
>
>
> What are permission modes of /home/nikos and /home/nikos/new_password?

I didn't actually fiddle with that, but you're right, I ought to have
ensured that the password file was mode 600. However, I don't think it
would have made a lot of difference; mainly I was wanting to guard
against randoms on the internet, not actual legit users of his system
(and even they may well not have shell access).

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Joel Goldstick
On Wed, Jun 5, 2013 at 12:24 PM, Chris Angelico  wrote:

> On Wed, Jun 5, 2013 at 9:07 PM, Νικόλαος Κούρας 
> wrote:
> > I will understand by his attitude in general if he is likely to help me
> or not.
>
> How much of my attitude did you read before you decided I would trust
> you? Posts like this:
>
> http://mail.python.org/pipermail/python-list/2013-June/648428.html
> http://mail.python.org/pipermail/python-list/2013-June/648496.html
>
> and especially this:
>
> http://mail.python.org/pipermail/python-list/2013-June/648459.html
>
> state fairly clearly what I'm intending. I was NOT planning to solve
> your problem. I was planning all along to do exactly what I did:
> search for some proof that I had full access, email it to the persons
> concerned, then leave without doing any actual damage.
>
> So if you were *that wrong* about me, what makes you think you can
> judge someone else safely?
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>

To solve the OPs problems once and for all, I believe we need to know his
social security number and his mother's maiden name.  (Yes, i know SSN is
for US but... )

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Wed, Jun 5, 2013 at 9:19 PM, Νικόλαος Κούρας  wrote:
> Τη Τετάρτη, 5 Ιουνίου 2013 2:14:34 μ.μ. UTC+3, ο χρήστης Heiko Wundram έγραψε:
>> Am 05.06.2013 13:07, schrieb οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½:
>>
>> >Btw, since history doesnt show me his history comamnds when he logged in
>> >from .au(why not really?), how can i tell what exactly did he do when he
>> >logged on to the server?
>
>> As root has full access to your system (i.e., can change file contents
>> and system state at will), and you gave him root access: you can't. And
>> he made sure to remove things such as .bash_history and the syslog
>> contents, I guess. At least that's what I'd have done to prove a point.

In fact, I didn't even bother fiddling with syslog. All I did was
.bash_history. Of course, I wasn't worried about you getting my IP
addresses (one of them is public anyway, and the other isn't mine any
longer than I'm using it), and nothing I did there was sufficiently
serious to be worth hiding, but I just did the history so I could
point out how easy this is.

> I see. Thanks.
> Is there some logging utility i can use next time iam offering root access to 
> someone(if i do it) or perhaps logging a normal's account activity?

You could log a normal user fairly easily, because root trumps normal
users. To log root access, there are a few options:

1) Don't actually give unrestricted roots, but require the use of
sudo, which logs. Not 100% perfect unless you actually restrict the
commands that can be executed, but it'd at least let you have some
idea that things were tampered with.

2) Provide a special bouncer. This is a little complex to describe, so
bear with me. Imagine you have *two* computers, WebHost and Bouncer.
You want to give root access to WebHost, so you invite someone to ssh
to webroot@bouncer - the shell of that user establishes a secondary
connection to root@webhost and passes everything on, but also logs it.
Since *no* access to Bouncer has been granted, the logs can't be
tampered with. This can be complicated to set up and secure, but it's
certainly possible. However, I think it is beyond your ability, at
least at the moment.

3) Provide a hacked-up root shell that logs to a network location, and
disable all other shell usage. Imperfect but would probably work.

4) Require that all root shell access be done through screen/tmux, and
monitor it.

You can probably think of a few others, too.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Joel Goldstick
On Wed, Jun 5, 2013 at 12:15 PM, Zachary Ware  wrote:

> On Wed, Jun 5, 2013 at 10:35 AM, Armando Montes De Oca
>  wrote:
> > Thank You now the program exits with:
> > (program exited with code: 0)
> > Press return to continue
> >
> >
> > Is there a way to get the line (program exited with code: 0) to say
> something
> >
> > like: "The game will end now"
> >
> > Press return to contine
>
> To whom are you replying?  Please quote what (and who) you are
> replying to to provide context.
>
> As for how to change that line, it depends on how you're running the
> script.
> --
> http://mail.python.org/mailman/listinfo/python-list
>


The program exited with code: 0 is being provided by geany after your
program has run.

If instead you open up a terminal and type:
python your_program.py

You will run your program and get an error message from python.  You can
get rid of the error message by using try/except, but you may not have
learned about that yet.

good luck
-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread Chris Angelico
On Wed, Jun 5, 2013 at 9:07 PM, Νικόλαος Κούρας  wrote:
> I will understand by his attitude in general if he is likely to help me or 
> not.

How much of my attitude did you read before you decided I would trust
you? Posts like this:

http://mail.python.org/pipermail/python-list/2013-June/648428.html
http://mail.python.org/pipermail/python-list/2013-June/648496.html

and especially this:

http://mail.python.org/pipermail/python-list/2013-June/648459.html

state fairly clearly what I'm intending. I was NOT planning to solve
your problem. I was planning all along to do exactly what I did:
search for some proof that I had full access, email it to the persons
concerned, then leave without doing any actual damage.

So if you were *that wrong* about me, what makes you think you can
judge someone else safely?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Source code to identify user through browser?

2013-06-05 Thread rusi
On Jun 5, 8:31 pm, Mark Lawrence  wrote:
> On 05/06/2013 16:18, rusi wrote:
>
>
>
>
>
>
>
>
>
> > On Jun 5, 8:10 pm, Carlos Nepomuceno 
> > wrote:
> >>> From: nos...@nospam.com
> >>> Subject: Source code to identify user through browser?
> >>> Date: Wed, 5 Jun 2013 15:08:54 +0200
> >>> To: python-l...@python.org
>
> >>> Hello
>
> >>> I was wondering if some Python module were available to identify a
> >>> user through their browser, like it's done on the Panopticlick site:
>
> >> What do you mean by user?
>
> > Ha! Nice question.  Not in direct answer but here's E.W Dijkstra
> > defining 'user':
>
> > [fromhttp://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD618.html
> > ]
> > 
> > The computer �user� isn�t a real person of flesh and blood, with
> > passions and brains. No, he is a mythical figure, and not a very
> > pleasant one either. A kind of mongrel with money but without taste,
> > an ugly caricature that is very uninspiring to work for. He is, as a
> > matter of fact, such an uninspiring idiot that his stupidity alone is
> > a sufficient explanation for the ugliness of most computer systems.
> > And oh! Is he uneducated! That is perhaps his most depressing
> > characteristic. He is equally education-resistant as another equally
> > mythical bore, �the average programmer�, whose solid stupidity is the
> > greatest barrier to progress in programming. It is a sad thought that
> > large sections of computing science are effectively paralyzed by the
> > narrow-mindedness and other grotesque limitations with which a poor
> > literature has endowed these influential mythical figures. (Computing
> > science is not unique in inventing such paralyzing caricatures:
> > universities all over the world are threatened by the invention of
> > �the average student�, scientific publishing is severely hampered by
> > the invention of �the innocent reader� and even �the poor reader�!)
>
> Where does the Bastard Operator From Hell fit in this? :)

:-)
Yes Dijkstra is quite a devil.
Always thought-provoking and entertaining -- never to be taken too
seriously!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Magazine

2013-06-05 Thread DRJ Reddy

> Do you have other magazines? Which ones? How are you going to supply contents?

We don't have other magazines. I was referring to old python magazines which 
terminated now. Portable documents(PDF , EPUB or MOBI) for now is being planned.
Regards,
DRJ.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote:
> On 05/06/2013 07:11, Russ P. wrote:
> 
> 
> 
> > But then, what would you expect of a language that allows you to write
> 
> >
> 
> > x = 1
> 
> > x = "Hello"
> 
> >
> 
> > It's all loosey goosey -- which is fine for many applications but certainly 
> > not for critical ones.
> 
> >
> 
> 
> 
> I want to launch this rocket with an expensive satellite on top.  I know 
> 
> it's safe as the code is written in ADA.  Whoops :(


So Python would have been a better choice? Yeah, right. If you know anything 
about that rocket mishap, you should know that Ada was not the source of the 
problem. Ada won't keep airplane wings from breaking either, by the way. It's 
not magic.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Zachary Ware
On Wed, Jun 5, 2013 at 10:35 AM, Armando Montes De Oca
 wrote:
> Thank You now the program exits with:
> (program exited with code: 0)
> Press return to continue
>
>
> Is there a way to get the line (program exited with code: 0) to say something
>
> like: "The game will end now"
>
> Press return to contine

To whom are you replying?  Please quote what (and who) you are
replying to to provide context.

As for how to change that line, it depends on how you're running the script.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-05 Thread Terry Jan Reedy

On 6/5/2013 2:11 AM, Russ P. wrote:


But then, what would you expect of a language that allows you to
write

x = 1

> x = "Hello"


It's all loosey goosey -- which is fine for many applications but
certainly not for critical ones.


I believe Shedskin, a Python *subset* compiler*, will reject that, 
because it compiles ints to C ints. Some code checkers might too.



--
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
try: 
input = raw_input 
except NameError: 
pass 

This gave me the same output exited with code zero 

Same with or without.

I am happy with the code 0 in it for now but if anyone knows with Geany in 
Linux Mint 14 Nadia what I can do to get it to say something nice and proper I 
would appreciate it for my next program.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Thank You I will give it a try 

I am using Linux Mint 14 Nadia 
and my Python is with Geany 1.22 and I think it is python 2
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
Thank You now the program exits with:
(program exited with code: 0)
Press return to continue


Is there a way to get the line (program exited with code: 0) to say something 

like: "The game will end now"

Press return to contine
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Zachary Ware
On Wed, Jun 5, 2013 at 10:14 AM, Armando Montes De Oca
 wrote:
> On Wednesday, June 5, 2013 10:40:52 AM UTC-4, Armando Montes De Oca wrote:
>> Traceback (most recent call last):
>>
>>   File "Guessing_Game.py", line 32, in 
>>
>> input (enter)
>>
>>   File "", line 0
>>
>> ^
>>
>> SyntaxError: unexpected EOF while parsing
>>
>> --
>>
>> (program exited with code: 1)
>>
>> This is the only place a string is used:
>>
>> else:
>>
>>   print "Sorry you loose the game."
>>
>>   computernum = str(computernum)
>>
>>   print " The computers number was!"+ computernum
>>
>>   input (enter)
>>
>>   sys.exit(0)
>> Yes I did declare and enter value it is:
>  enter = "Please Press Enter To Continue..."
>> Thank You,

Hi Armando,

There are a few problems with your question.  To be able to help you,
we really need to know your Python version, what OS you are using, how
you are running your script, and at what point you get the error in
question.  Also, just a snippet of code from the middle of the script
is useless to us, we need to see a complete, runnable program that
shows your problem.

In this particular case, though, I can deduce a few things and, I
believe, answer your question.

First, your Python version.  Judging by your use of 'print' as a
statement rather than a function, it looks like you're using Python 2,
probably 2.7.  This is a big factor in your problem.

Second, when you get your error.  I'm betting it's after you see
"Please Press Enter To Continue..." and have pressed 'enter'.

Now the kicker: I can reproduce your problem with the following
complete program:

# error_test.py
input('Press enter')
# end of error_test.py

The problem here is that you are using 'input()' in Python 2.  In
Python 2, 'input()' is equivalent to 'eval(raw_input())', which means
that anything you give to 'input' will be evaluated in the current
scope, and this is a HUGE security hole.  It can also cause serious
issues, such as you are having with your program: when you press enter
at the prompt, you pass '' (the empty string) to eval, which sees EOF
before it can actually evaluate anything, and so it raises a
SyntaxError.  The simple fix here is to replace every occurance of
'input(' with 'raw_input(', or to make a step towards Python 3
compatibility, add this to the top of your program:

try:
input = raw_input
except NameError:
pass

Hope this helps,

Zach
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Source code to identify user through browser?

2013-06-05 Thread Mark Lawrence

On 05/06/2013 16:18, rusi wrote:

On Jun 5, 8:10 pm, Carlos Nepomuceno 
wrote:

From: nos...@nospam.com
Subject: Source code to identify user through browser?
Date: Wed, 5 Jun 2013 15:08:54 +0200
To: python-l...@python.org



Hello



I was wondering if some Python module were available to identify a
user through their browser, like it's done on the Panopticlick site:


What do you mean by user?


Ha! Nice question.  Not in direct answer but here's E.W Dijkstra
defining 'user':

[from http://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD618.html
]

The computer “user” isn’t a real person of flesh and blood, with
passions and brains. No, he is a mythical figure, and not a very
pleasant one either. A kind of mongrel with money but without taste,
an ugly caricature that is very uninspiring to work for. He is, as a
matter of fact, such an uninspiring idiot that his stupidity alone is
a sufficient explanation for the ugliness of most computer systems.
And oh! Is he uneducated! That is perhaps his most depressing
characteristic. He is equally education-resistant as another equally
mythical bore, “the average programmer”, whose solid stupidity is the
greatest barrier to progress in programming. It is a sad thought that
large sections of computing science are effectively paralyzed by the
narrow-mindedness and other grotesque limitations with which a poor
literature has endowed these influential mythical figures. (Computing
science is not unique in inventing such paralyzing caricatures:
universities all over the world are threatened by the invention of
“the average student”, scientific publishing is severely hampered by
the invention of “the innocent reader” and even “the poor reader”!)



Where does the Bastard Operator From Hell fit in this? :)

--
"Steve is going for the pink ball - and for those of you who are 
watching in black and white, the pink is next to the green." Snooker 
commentator 'Whispering' Ted Lowe.


Mark Lawrence

--
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Mark Lawrence

On 05/06/2013 16:18, Armando Montes De Oca wrote:

I just post all my code I have for the guessing game.



Please post with some context so we don't have to go to other parts of 
the thread to find out what you're talking about, thanks.


--
"Steve is going for the pink ball - and for those of you who are 
watching in black and white, the pink is next to the green." Snooker 
commentator 'Whispering' Ted Lowe.


Mark Lawrence

--
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Armando Montes De Oca
import random
import sys
enter = "Please Press Enter To Continue..."
print " Hello! Welcome to a Guessing game!"
print " Please Guess a number between 1 - 100"
computernum = random.randint (1, 100)
Guess1 = input ( "My First Guess Is:   ")
if Guess1 == computernum:
print "You Win !"
input (enter)
sys.exit(0)
else:
print "Sorry, Try Again!"
print "You have Two guesses remaining!"
Guess2 = input("My Second Guess Is:   ")
if Guess2 == computernum:
print "Wow, Congradulations YOU WIN!"
input (enter)
sys.exit(0)
else:
print "Sorry One more try!"
print "You have One final guess remaining!"
Guess3 = input (" My final guess is")
if Guess3 == computernum:
print "Congradulations shit head"
input (enter)
sys.exit (0)
else:
print "Sorry you loose the game."
computernum = str(computernum)
print "The computers number was!" + computernum
input (enter)
sys.exit(0)





-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Tim Golden
On 05/06/2013 16:14, Armando Montes De Oca wrote:
> On Wednesday, June 5, 2013 10:40:52 AM UTC-4, Armando Montes De Oca wrote:
>> Traceback (most recent call last):
>>
>>   File "Guessing_Game.py", line 32, in 
>>
>> input (enter)
>>
>>   File "", line 0
>>
>> ^
>>
>> SyntaxError: unexpected EOF while parsing


Armando. Try this at a Python prompt, and just press Enter without
entering any text.

  input("Please enter something:")


The trouble is that the beguilingly-named "input" function actually
*evaluates* what you type, ie it's the same as doing this:

  eval("")

which, as you can see, gives the same error message. You're clearly
using Python 2.x as your prints are statements, so input has this
characteristic. Instead you should use raw_input:

  raw_input(enter)

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >