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

2013-06-06 Thread Chris Angelico
On Thu, Jun 6, 2013 at 4:22 PM, Nobody wrote: > 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

HOW DOES ISLAM DIFFER FROM OTHER FAITHS? (PART 1 OF 2)

2013-06-06 Thread BV BV
How Does Islam Differ from other Faiths? (part 1 of 2) Description: Some of the Unique Features of Islam not found in other belief systems and ways of life. B Simplicity, Rationality and Practicality Islam is a religion without any mythology. Its teachings are simple and intelligible. It is fr

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

2013-06-06 Thread Heiko Wundram
Am 05.06.2013 18:44, schrieb MRAB: 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. Most probably, his ter

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

2013-06-06 Thread Mark Lawrence
On 06/06/2013 07:11, Chris Angelico wrote: 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 It's obviously one that doesn't use the flawed Python Flexible Strin

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

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 12:29:44 +1000, 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 ar

Speeding up Python

2013-06-06 Thread Steven D'Aprano
Comparing CPython, PyPy, SciPy, Parakeet and Numba for writing image filters: http://www.phi-node.com/2013/06/faster-morphological-image-filters-in.html -- Steven -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-06 Thread Chris Angelico
On Thu, Jun 6, 2013 at 7:29 PM, Steven D'Aprano wrote: > Whatever benefit there is in declaring the type of a function is lost due > to the inability to duck-type or program to an interface. There's no type > that says "any object with a 'next' method", for example. And having to > declare local v

"The system cannot find the path specified[...]" wxPython strange bug

2013-06-06 Thread m2cl3k
Hi, I'm developing plugin for sublime text 2. I'm importing wxPython module and sometimes I get following error: [code] Reloading plugin C:\Users\User\AppData\Roaming\Sublime Text 2\Packages\User\my_plugin.py Traceback (most recent call last): File ".\sublime_plugin.py", line 62, in reload_plug

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

2013-06-06 Thread Cameron Simpson
On 05Jun2013 11:43, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: | > 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

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 11:50:55 π.μ. UTC+3, ο χρήστης Heiko Wundram έγραψε: > Am 05.06.2013 18:44, schrieb MRAB: > > > 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

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

2013-06-06 Thread Heiko Wundram
Am 06.06.2013 12:35, schrieb Νικόλαος Κούρας: ni...@superhost.gr [~/www/data/apps]# ls -l | file - /dev/stdin: ASCII text Did you actually try to understand what I wrote? -- --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Avnesh Shakya
hi, I am running a python script and it will create a file name like filename0.0.0 and If I run it again then new file will create one more like filename0.0.1.. my code is- i = 0 for i in range(1000): try: with open('filename%d.%d.%d.json'%(0,0,i,)): pass continue

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

2013-06-06 Thread Νικόλαος Κούρας
I have re-enabled 'suexec' and set cgi as default phphandler and then trying: print( cookie ) print( '''Content-type: text/html; charset=utf-8\n''' ) print( message ) - ni...@superhost.gr [~/www/data/apps]# [Thu Jun 06 13:51:28 2013] [error] [client 79.103.41.173]

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

2013-06-06 Thread Νικόλαος Κούρας
Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that putty is responsible for the encoding mess? the rename command on the command-line of his shell session, the "mv"  command gets a stream of bytes as the new file name which happens to be  the ISO-8859-7 encoding of the file

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

2013-06-06 Thread Heiko Wundram
Am 06.06.2013 13:00, schrieb Νικόλαος Κούρας: Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that putty is responsible for the encoding mess? Exactly. Check the encoding that putty uses for the terminal session. If it doesn't use UTF-8, switch your terminal session to UTF

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

2013-06-06 Thread Serhiy Storchaka
06.06.13 12:45, Chris Angelico написав(ла): For the "accept any object that has a next() method" sorts of rules, I don't know of any really viable system that does that usefully. The concept of implementing interfaces in Java comes close, but the class author has to declare that it's implementing

Re: "The system cannot find the path specified[...]" wxPython strange bug

2013-06-06 Thread Jeicam
It seems like it constructs path wrongly(as I have seen before), but why sometimes it works and sometimes doesn't(so maybe sometimes it generates path correctly)? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Cameron Simpson
On 06Jun2013 03:50, Avnesh Shakya wrote: | hi, |I am running a python script and it will create a file name like filename0.0.0 and If I run it again then new file will create one more like filename0.0.1.. my code is- | | i = 0 | for i in range(1000): | try: | with open('file

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 1:24:16 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε: > On 05Jun2013 11:43, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= > wrote: > > | Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > > | > Using Python, I think you could get the filenames using os.

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 2:09:22 μ.μ. UTC+3, ο χρήστης Heiko Wundram έγραψε: > Am 06.06.2013 13:00, schrieb Νικόλαος Κούρας: > > > Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that > > putty is responsible for the encoding mess? > > > > Exactly. Check the encoding that

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

2013-06-06 Thread Heiko Wundram
Am 06.06.2013 13:24, schrieb Νικόλαος Κούρας: ni...@superhost.gr [~/www/data/apps]# ls *.mp3 | file - /dev/stdin: ASCII text Again, did you actually read (and try to understand) what I wrote? I said to redo the rename after you change your terminal session to UTF-8. -- --- Heiko. -- http://m

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

2013-06-06 Thread Νικόλαος Κούρας
# Compute a set of current fullpaths fullpaths = os.listdir( '/home/nikos/public_html/data/apps/' ) # Load'em for fullpath in fullpaths: try: # Check the presence of a file against the database and insert if it doesn't exist cur.execute('''SELECT url FROM

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

2013-06-06 Thread MRAB
On 06/06/2013 04:43, Νικόλαος Κούρας wrote: Τη Τετάρτη, 5 Ιουνίου 2013 9:43:18 μ.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε: > Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > > > On 05/06/2013 18:43, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ wrote: > > > > > > > οΏ½οΏ½ ο

Mistakes in documentation

2013-06-06 Thread Paul Volkov
Where can I submit little mistakes in Python documantation? I found one while browsing tutorial.pdf (Python 3.3.2): Section 3.1 says (on page 12): >>> word[2:5] # characters from position 2 (included) to 4 (excluded) ’tho’ Shouldn't the comment say "5 (excluded)" or "4 (included)" instead? -- ht

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

2013-06-06 Thread Νικόλαος Κούρας
First of all thank you for helping me MRAB. After make some alternation to your code ia have this: # Give the path as a bytestring so that we'll get the filenames as bytestrings path = b"/home/nikos/public_html/data/apps/" # Setting TESTING to True will m

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Avnesh Shakya
Thanks. On Thu, Jun 6, 2013 at 4:49 PM, Cameron Simpson wrote: > On 06Jun2013 03:50, Avnesh Shakya wrote: > | hi, > |I am running a python script and it will create a file name like > filename0.0.0 and If I run it again then new file will create one more like > filename0.0.1.. my code

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Dave Angel
On 06/06/2013 06:50 AM, Avnesh Shakya wrote: hi, I am running a python script and it will create a file name like filename0.0.0 and If I run it again then new file will create one more like filename0.0.1.. my code is- i = 0 Redundant initialization of i. for i in range(1000):

Re: Mistakes in documentation

2013-06-06 Thread Serhiy Storchaka
06.06.13 15:01, Paul Volkov написав(ла): Where can I submit little mistakes in Python documantation? http://bugs.python.org/ -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-06 Thread Steven D'Aprano
On Tue, 04 Jun 2013 02:00:43 -0700, Νικόλαος Κούρας wrote: > Τη Τρίτη, 4 Ιουνίου 2013 11:47:01 π.μ. UTC+3, ο χρήστης Steven D'Aprano > έγραψε: > >> Please run these commands, and show what result they give: [...] > ni...@superhost.gr [~/www/data/apps]# alias ls > alias ls='/bin/ls $LS_OPTIONS'

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Jussi Piitulainen
Avnesh Shakya writes: > I am running a python script and it will create a file name like > filename0.0.0 and If I run it again then new file will create one > more like filename0.0.1.. my code is- > > i = 0 > for i in range(1000): > try: > with open('filename%d.%d.%d.json'%(0,0,i,

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

2013-06-06 Thread MRAB
On 06/06/2013 13:04, Νικόλαος Κούρας wrote: First of all thank you for helping me MRAB. After make some alternation to your code ia have this: # Give the path as a bytestring so that we'll get the filenames as bytestrings path = b"/home/nikos/public_html/

Re: Mistakes in documentation

2013-06-06 Thread Terry Jan Reedy
On 6/6/2013 8:01 AM, Paul Volkov wrote: Where can I submit little mistakes in Python documantation? I found one while browsing tutorial.pdf (Python 3.3.2): Section 3.1 says (on page 12): >>> word[2:5] # characters from position 2 (included) to 4 (excluded) ’tho’ Shouldn't the comment say "5 (e

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

2013-06-06 Thread rusi
On Jun 6, 6:45 am, Chris Angelico wrote: > 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. In many Indian languages there is a saying: A poor dancer blames the crooked floor. [Yeah…

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

2013-06-06 Thread Armando Montes De Oca
Yes Steven a C book I am reading has a quote "Every programmer is fluent in swearing" After my blow ups and confusion I am happy with my program anyway. I will get better at it eventually. I did change things to "raw_input" and works fine. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 12:09 AM, rusi wrote: > When we switched from to python (via Scheme and a haskell- > predecessor), I dont remember ever getting a segmentation fault. Oh, it's easy to segfault Python. import sys sys.setrecursionlimit(9) def foo(): foo() foo() :) ChrisA -- http:

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

2013-06-06 Thread Robert Kern
On 2013-06-06 10:45, Chris Angelico wrote: For the "accept any object that has a next() method" sorts of rules, I don't know of any really viable system that does that usefully. The concept of implementing interfaces in Java comes close, but the class author has to declare that it's implementing

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Chris Angelico
On Thu, Jun 6, 2013 at 10:14 PM, Dave Angel wrote: > If you're planning on having the files densely populated (meaning no gaps in > the numbering), then you could use a binary search to find the last one. > Standard algorithm would converge with 10 existence checks if you have a > limit of 1000 fi

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

2013-06-06 Thread rusi
On Jun 6, 8:26 pm, Chris Angelico wrote: > On Fri, Jun 7, 2013 at 12:09 AM, rusi wrote: > > When we switched from to python (via Scheme and a haskell- > > predecessor), I dont remember ever getting a segmentation fault. > > Oh, it's easy to segfault Python. > > import sys > sys.setrecursionlimit(

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

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:36 AM, rusi wrote: > On Jun 6, 8:26 pm, Chris Angelico wrote: >> On Fri, Jun 7, 2013 at 12:09 AM, rusi wrote: >> > When we switched from to python (via Scheme and a haskell- >> > predecessor), I dont remember ever getting a segmentation fault. >> >> Oh, it's easy to segf

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

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:35 AM, Robert Kern wrote: > On 2013-06-06 10:45, Chris Angelico wrote: > >> For the "accept any object that has a next() method" sorts of rules, I >> don't know of any really viable system that does that usefully. The >> concept of implementing interfaces in Java comes clo

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread MRAB
On 06/06/2013 16:37, Chris Angelico wrote: On Thu, Jun 6, 2013 at 10:14 PM, Dave Angel wrote: If you're planning on having the files densely populated (meaning no gaps in the numbering), then you could use a binary search to find the last one. Standard algorithm would converge with 10 existence

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

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 11:59:07 AM UTC-5, Chris Angelico wrote: > 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 >

Re: How to store a variable when a script is executing for next time execution?

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:54 AM, MRAB wrote: > On 06/06/2013 16:37, Chris Angelico wrote: >> >> On Thu, Jun 6, 2013 at 10:14 PM, Dave Angel wrote: >>> >>> If you're planning on having the files densely populated (meaning no gaps >>> in >>> the numbering), then you could use a binary search to find

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

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:49 AM, Rick Johnson wrote: > On Wednesday, June 5, 2013 11:59:07 AM UTC-5, Chris Angelico wrote: > >> 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 bu

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

2013-06-06 Thread Robert Kern
On 2013-06-06 16:41, Chris Angelico wrote: Anyway, regardless of your language, there's always some criteria that can't be coded. Suppose the valid input for a function were "integers whose square roots are integers but whose cube roots are not". You won't easily get compile-time checking of tha

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

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 6:18:13 PM UTC-5, 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 n

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

2013-06-06 Thread Devin Jeanpierre
On Thu, Jun 6, 2013 at 12:24 PM, Rick Johnson wrote: > In Python, if you fail to use the return statement, then Python will return > None, NOT some some value that just happens to be the last line executed in > the function -- Ruby breaks the law of least astonishment. Ruby comes from a traditi

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

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 2:15:57 AM UTC-5, Chris Angelico wrote: > [...] > I cannot name a single modern programming language that does NOT have > some kind of implicit boolification. Congrats: Again you join the ranks of most children who make excuses for their foolish actions along the lines

Thread-safe way to prevent decorator from being nested

2013-06-06 Thread Michael
I'm writing a decorator that I never want to be nested. Following from the answer on my StackOverflow question (http://stackoverflow.com/a/16905779/106244), I've adapted it to the following. Can anyone spot any issues with this? It'll be run in a multi-threaded environment serving Django reques

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

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 2:49 AM, Rick Johnson wrote: > On Wednesday, June 5, 2013 2:15:57 AM UTC-5, Chris Angelico wrote: >> [...] >> I cannot name a single modern programming language that does NOT have >> some kind of implicit boolification. > > Congrats: Again you join the ranks of most children

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

2013-06-06 Thread rusi
On Jun 6, 9:08 pm, Robert Kern wrote: > On 2013-06-06 16:41, Chris Angelico wrote: > > > Anyway, regardless of your language, there's always some criteria that > > can't be coded. Suppose the valid input for a function were "integers > > whose square roots are integers but whose cube roots are not

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

2013-06-06 Thread Grant Edwards
On 2013-06-06, Chris Angelico wrote: > Would you say that doubling the testing period is a good thing or a > bad thing? It could be a neutral thing (ignoring the costs involved). I once read read an article claiming that as you test (and fix) any large, complex piece of software, you asymptotic

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

2013-06-06 Thread Mark Janssen
> Whatever benefit there is in declaring the type of a function is lost due > to the inability to duck-type or program to an interface. There's no type > that says "any object with a 'next' method", for example. And having to > declare local variables is a PITA with little benefit. > > Give me a la

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

2013-06-06 Thread rurpy
On 06/05/2013 08:02 PM, Tim Chase wrote: > On 2013-06-05 17:57, ru...@yahoo.com 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

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

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 8:37:20 PM UTC-5, Steven D'Aprano wrote: > 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: > What prevents bugs is the skill of the people writing the code,

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

2013-06-06 Thread Russ P.
On Thursday, June 6, 2013 2:29:02 AM UTC-7, Steven D'Aprano wrote: > On Thu, 06 Jun 2013 12:29:44 +1000, 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 experienc

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

2013-06-06 Thread Rick Johnson
On Thursday, June 6, 2013 1:03:24 PM UTC-5, Rick Johnson wrote: > The second covers type checking objects that enter into new > namespaces. That would cover all functions/methods arguments > (at a minimum). Yeah, before anyone starts complaining about this, i meant to say "scope". Now you can

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 3:50:52 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > If you're happy for that change to happen, then go ahead. I have made some modifications to the code you provided me but i think something that doesnt accur to me needs fixing. for example i switched: # Give the path as a

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

2013-06-06 Thread Devin Jeanpierre
Super OT divergence because I am a loser nerd: On Thu, Jun 6, 2013 at 1:27 PM, rusi wrote: > Yes, all programming communities have blind-spots. The Haskell > community's is that Haskell is safe and safe means that errors are > caught at compile-time. I don't think Haskell people believe this wi

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

2013-06-06 Thread rurpy
On 06/06/2013 04:53 AM, Νικόλαος Κούρας wrote:> I have re-enabled 'suexec' and set cgi as default phphandler and then trying: > > print( cookie ) > print( '''Content-type: text/html; charset=utf-8\n''' ) > print( message ) > > - > ni...@superhost.gr [~/www/data/ap

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > py> s = '999-Eυχή-του-Ιησού' > py> bytes_as_utf8 = s.encode('utf-8') > py> t = bytes_as_utf8.decode('iso-8859-7', errors='replace') > py> print(t) > 999-EΟΟΞ�-ΟΞΏΟ-ΞΞ·ΟΞΏΟ errors='replace' mean dont break in case o

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

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > ... > # Load'em > for fullpath in path: > try: > ... > > The error is: > [Thu Jun 06 21:10:23 2013] [error] [client 79.103.41.173] File "files.py", > line 64 > [Thu Jun 06 21:10:23 2013] [error] [client 79.103.41.173] for fullpath in > path > [Thu Jun 06 21

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 9:40:04 μ.μ. UTC+3, ο χρήστης ru...@yahoo.com έγραψε: > On 06/06/2013 04:53 AM, Νικόλαος Κούρας wrote:> I have re-enabled 'suexec' > and set cgi as default phphandler and then trying: > > > > > > print( cookie ) > > > print( '''Content-type: text/html; charset=utf-8\n

[JOB] Look for a Full Time Plone Developer

2013-06-06 Thread Patrick Waldo
Hi All, Please take a look at a new job opportunity for Python/Plone developers. Patrick Waldo, Project Manager Decernis *Job Description: Full Time Python/Plone Developer* We are looking for a highly motivated and self-reliant developer to work on systems built with Plon

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

2013-06-06 Thread Νικόλαος Κούρας
Since cPanel is in charge of apache i ahve even: chown nobody:nobody to both of the suexec logs. ni...@superhost.gr [~/www/cgi-bin]# ls -l /usr/local/apache/logs/suexec_log -rw-rw-r-- 1 nobody nobody 675389 Jun 6 22:05 /usr/local/apache/logs/suexec_log ni...@superhost.gr [~/www/cgi-bin]# ls -l /

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 10:03:02 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Νικόλαος Κούρας writes: > > > > > ... > > > # Load'em > > > for fullpath in path: > > > try: > > > ... > > > > > > The error is: > > > [Thu Jun 06 21:10:23 2013] [error] [client 79.103.41.173] File > >

Python Community Training Events

2013-06-06 Thread Calloway, Chris
Here are some upcoming Python community training events organized by the Triangle Python Users Group: PyOhio PyCamp 2013 offered July 22-26, 2013 at Ohio State University in conjunction with the PyOhio 2013 regional Python conference: http://trizpug.org/boot-camp/pyohio13/ Python Network and W

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

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > I have re-enabled 'suexec' and set cgi as default phphandler and then trying: > > print( cookie ) > print( '''Content-type: text/html; charset=utf-8\n''' ) > print( message ) Did you tried running that by a standalone Python interpreter? Did you notice something strange

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 10:26:08 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Did you tried running that by a standalone Python interpreter? Did you > notice something strange, something like that an empty line is missing > between headers and body? No, nothing at all. Two '/n/n' are not requi

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

2013-06-06 Thread Skip Montanaro
> Did you tried running that by a standalone Python interpreter? Did you > notice something strange, something like that an empty line is missing > between headers and body? He will get an extra blank line, since he added a newline character at the end of his Content-Type string. Skip -- http://

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

2013-06-06 Thread MRAB
On 06/06/2013 19:13, Νικόλαος Κούρας wrote: Τη Πέμπτη, 6 Ιουνίου 2013 3:50:52 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > If you're happy for that change to happen, then go ahead. I have made some modifications to the code you provided me but i think something that doesn

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 10:42:25 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > On 06/06/2013 19:13, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ > wrote: > > > > οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 6 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2013 3:50:52 > οΏ½.οΏ½. UTC+3, οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ MRAB οΏ½οΏ½οΏ

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

2013-06-06 Thread Νικόλαος Κούρας
Something else i need to try so for 'suexec' to be able to open its own lof file? What a weird error that is. An Apache's extension that can open its own log file. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-06 Thread Νικόλαος Κούρας
Actually about the Spurious procedure iam happy with myelf that came up with this: # Delete spurious cur.execute('''SELECT url FROM files''') data = cur.fetchall() for filename in path url = '/home/nikos/public_html/data/apps/' + filename urls.add( url ) for url in data:

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

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Now the error afetr fixithg that transformed to: > > [Thu Jun 06 22:13:49 2013] [error] [client 79.103.41.173] filename = > fullpath.replace( '/home/nikos/public_html/data/apps/', '' ) > [Thu Jun 06 22:13:49 2013] [error] [client 79.103.41.173] TypeError: expected

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

2013-06-06 Thread Lele Gaifax
Skip Montanaro writes: > He will get an extra blank line, since he added a newline character at > the end of his Content-Type string. Right, missed that, sorry for the noise. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad a

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

2013-06-06 Thread Νικόλαος Κούρας
Τη Πέμπτη, 6 Ιουνίου 2013 11:25:15 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Νικόλαος Κούρας writes: > > > > > Now the error afetr fixithg that transformed to: > > > > > > [Thu Jun 06 22:13:49 2013] [error] [client 79.103.41.173] filename = > > fullpath.replace( '/home/nikos/public_htm

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

2013-06-06 Thread Νικόλαος Κούρας
Has some errors: # # Get filenames of the apps directory as bytestrings path = os.listdir( b'/home/nikos/public_html/data/apps/' ) # iterate over all filenames in the apps directory for filename in path: # Grabbing just the filename

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

2013-06-06 Thread Νικόλαος Κούρας
I'm very sorry for continuous pastes. Didnt include the whole thing before. Here it is: # # Get filenames of the path dir as bytestrings path = os.listdir( b'/home/nikos/public_html/data/apps/' ) # iterate over all filenames in the apps dir

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

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Tahnks here is what i have up until now with many corrections. I'm afraid many more are needed :-) > ... > # rename filename form greek bytestreams --> utf-8 bytestreams > old_path = b'/home/nikos/public_html/data/apps/' + b'filename') >

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

2013-06-06 Thread Lele Gaifax
Νικόλαος Κούρας writes: > The only problem now is the bytestrings: *One*, not the *only*. > > ni...@superhost.gr [~/www/cgi-bin]# [Thu Jun 06 23:50:42 2013] [error] > [client 79.103.41.173] File "files.py", line 78 > [Thu Jun 06 23:50:42 2013] [error] [client 79.103.41.173] old_path = >

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

2013-06-06 Thread MRAB
On 06/06/2013 22:07, Lele Gaifax wrote: Νικόλαος Κούρας writes: Tahnks here is what i have up until now with many corrections. I'm afraid many more are needed :-) ... # rename filename form greek bytestreams --> utf-8 bytestreams old_path = b'/home/nikos/pub

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

2013-06-06 Thread Cameron Simpson
On 06Jun2013 05:04, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | We are in test mode so i dont know if when renaming actually take place what the encodings will be. | Shall i switch off test mode and try it for real? I would make a copy. Since you're renaming stuff, hard links would do:

trigger at TDM/2 only

2013-06-06 Thread cerr
Hi, I have a process that I can trigger only at a certain time. Assume I have a TDM period of 10min, that means, I can only fire my trigger at the 5th minute of every 10min cycle i.e. at XX:05, XX:15, XX:25... For hat I came up with following algorithm which oly leaves the waiting while loop if

Re: trigger at TDM/2 only

2013-06-06 Thread Dave Angel
On 06/06/2013 08:03 PM, cerr wrote: Hi, I have a process that I can trigger only at a certain time. Assume I have a TDM period of 10min, that means, I can only fire my trigger at the 5th minute of every 10min cycle i.e. at XX:05, XX:15, XX:25... For hat I came up with following algorithm whic

Re: trigger at TDM/2 only

2013-06-06 Thread MRAB
On 07/06/2013 01:03, cerr wrote: Hi, I have a process that I can trigger only at a certain time. Assume I have a TDM period of 10min, that means, I can only fire my trigger at the 5th minute of every 10min cycle i.e. at XX:05, XX:15, XX:25... For hat I came up with following algorithm which o

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

2013-06-06 Thread alex23
On Jun 7, 3:59 am, Mark Janssen wrote: > Okay, I'm going straighten out you foo(l)s once and for all. Gosh, really?! THANKS. > Python has seduced us all into lazy typing.  That's what it is. Bulshytt. If you have no idea what polymorphism is, you shouldn't even be participating in this conversa

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

2013-06-06 Thread Cameron Simpson
On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= wrote: | Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: | > py> s = '999-Eυχή-του-Ιησού' | > py> bytes_as_utf8 = s.encode('utf-8') | > py> t = bytes_as_utf8.decode('iso-8859-7', errors='replace') | > py

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

2013-06-06 Thread alex23
On Jun 7, 2:39 am, Devin Jeanpierre wrote: > Languages do not exist in a vacuum. They do if all you use them for is academic point scoring over practical purposes. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-06 Thread Dan Stromberg
On Thu, Jun 6, 2013 at 9:49 AM, Rick Johnson wrote: > Congrats: Again you join the ranks of most children who make excuses for > their foolish actions along the lines of: > > "Hey, they did it first!" > > Well, the lemmings get what they deserve i suppose. > Lemmings don't really jump off cliffs

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

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 12:17:16 -0700, Νικόλαος Κούρας wrote: > i can remove the bianry openign from os.listdir but then this will not > work. MRAB has told me that i need to open those paths and filenames as > bytestreams and not as unicode strings. Do you understand why? If you do not understand

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

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 13:56:36 -0700, Νικόλαος Κούρας wrote: > SyntaxError: invalid syntax > > > Dont know how to add a bytestremed path to a bytestream filename Nikos, READ THE ERROR MESSAGE!!! The error doesn't say anything about *adding*. It is a SyntaxError. Please stop flooding us with do

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

2013-06-06 Thread Mark Janssen
>> Python has seduced us all into lazy typing. That's what it is. > > Bulshytt. If you have no idea what polymorphism is, you shouldn't even > be participating in this conversation. I am aware of what it means, but Python doesn't really have it (although it may evolve to it with annotations). Bu

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

2013-06-06 Thread alex23
On Jun 7, 11:44 am, Mark Janssen wrote: > > Bulshytt. If you have no idea what polymorphism is, you shouldn't even > > be participating in this conversation. > > I am aware of what it means, but Python doesn't really have it You really need to stop commenting when you clearly have no understandin

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

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 11:46:20 -0700, Νικόλαος Κούρας wrote: > Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano > έγραψε: > >> py> s = '999-Eυχή-του-Ιησού' >> py> bytes_as_utf8 = s.encode('utf-8') >> py> t = bytes_as_utf8.decode('iso-8859-7', errors='replace') >> py> print

Re: Beginner question

2013-06-06 Thread Steven D'Aprano
Sorry for the delay in replying. On Tue, 04 Jun 2013 15:51:38 +0300, Carlos Nepomuceno wrote: >> [1] Technically it's a type, not a function, but the difference makes >> no difference here. > Can you explain me the difference of the type and function you've just > mentioned? We were talking ab

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

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 18:44:49 -0700, Mark Janssen wrote: >>> Python has seduced us all into lazy typing. That's what it is. >> >> Bulshytt. If you have no idea what polymorphism is, you shouldn't even >> be participating in this conversation. > > I am aware of what it means, but Python doesn't re

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

2013-06-06 Thread rusi
On Jun 6, 11:44 pm, Devin Jeanpierre wrote: > > > Unfortunately* the halting problem stands. When generalized to Rice > > theorem it says that only trivial properties of programs are > > algorithmically decidable: > >http://mathworld.wolfram.com/RicesTheorem.html > > > And so the semantic correct

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

2013-06-06 Thread Mark Janssen
>> I am aware of what it means, but Python doesn't really have it (although >> it may evolve to it with annotations). > > No polymorphism huh? > > > py> len([1, 2, 3]) # len works on lists > 3 > py> len((1, 2)) # and on tuples > 2 > py> len({}) # and on dicts > 0 > py> len('I pity the fool') #

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

2013-06-06 Thread rusi
On Jun 7, 12:03 am, Lele Gaifax wrote: > You should *read* and *understand* the error message! When you *shout* at the deaf, the non-deaf get deaf . -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >