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

2013-06-04 Thread nagia . retsina
Τη Τρίτη, 4 Ιουνίου 2013 1:46:53 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: Not so -- it actually shows correctly, provided you use the right encoding. Tell your browser to view the page as UTF-8, and the file name is displayed correctly. I can't believe Chrome whcih by default uses utf8

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Νικόλαος Κούρας
Could you please install them because i need to work? a) pip (so that i can successfully run 'pip install pymysql' b) development tools I wiped the while perl away (leaving intact 2.6) but i wiped out pip at the proces to. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 1:37:37 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: It looks like your client is ignoring the charset header, and interpreting the bytes as Latin-1 when they are actually ISO-8859-7. py s = 'Eυχή του Ιησού.mp3' py print(s.encode('ISO-8859-7').decode('latin-1'))

RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
That doesn't even works because input() is the same as eval(raw_input()). So you'll get a NameError exception. I think you know that. Perhaps you mean raw_input() instead of input(). In that case the answer is yes, it can be more 'efficient' because the if-then-else clause always breaks the

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 07:44, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Could you please install them because i need to work? a) pip (so that i can successfully run 'pip install pymysql' b) development tools I wiped the while perl away (leaving intact 2.6) but i wiped out pip at the proces to.

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 10:08:44 π.μ. UTC+3, ο χρήστης Fábio Santos έγραψε: Pip should be in your system's package manager. In Ubuntu it's available through sudo apt-get install python-pip. What are those development tools you speak of? Why would you uninstall perl? Sorry i meant Python,

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread alex23
On Jun 4, 5:11 pm, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: So, i guess its something like 'yum install python-pip' i cannot find it, have searched it in variosu ways. If you're going to claim to have tried something, can you at least tell us what you tried? Because quelle surprise! the

Re: PyWart: The problem with print

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 11:37 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: The print function is the very definition of a syntactic sugar. For example: print(some sting) is much more readable than: sys.stdout.write(some string+\n) ... Again, the removal of a print function

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

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 4:28 PM, nagia.rets...@gmail.com wrote: Τη Τρίτη, 4 Ιουνίου 2013 1:46:53 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: Not so -- it actually shows correctly, provided you use the right encoding. Tell your browser to view the page as UTF-8, and the file name is

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 10:21:11 π.μ. UTC+3, ο χρήστης alex23 έγραψε: On Jun 4, 5:11 pm, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: So, i guess its something like 'yum install python-pip' i cannot find it, have searched it in variosu ways. If you're going to claim to have tried

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

2013-06-04 Thread Nobody
On Mon, 03 Jun 2013 23:28:21 -0700, nagia.retsina wrote: I can't believe Chrome whcih by default uses utf8 chosed iso-8859-1 to presnt the filenames. Chrome didn't choose ISO-8859-1, the server did; the HTTP response says: Content-Type: text/html;charset=ISO-8859-1 --

Re: Beginner question

2013-06-04 Thread Anssi Saari
eschneide...@comcast.net writes: Is there a more efficient way of doing this? Any help is gratly appreciated. Efficiency in a short program isn't a big thing. You have some pretty weird things in there, there's no need make single element tuples out of your strings and then putting those in a

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

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 2:45 PM, Michael Torrie torr...@gmail.com wrote: On 06/03/2013 05:33 PM, Carlos Nepomuceno wrote: I did a httpd 'make install' on CentOS 6 and it worked fine. Needed a few tweaks that I don't remember though. If you don't have any previous experience with Apache httpd

Re: Beginner question

2013-06-04 Thread John Ladasky
On Monday, June 3, 2013 11:46:03 PM UTC-7, Carlos Nepomuceno wrote: That doesn't even works because input() is the same as eval(raw_input()). So you'll get a NameError exception. I think you know that. Perhaps you mean raw_input() instead of input(). But the OP's code shows print()

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 10:39:08 π.μ. UTC+3, ο χρήστης Nobody έγραψε: Chrome didn't choose ISO-8859-1, the server did; the HTTP response says: Content-Type: text/html;charset=ISO-8859-1 From where do you see this: i receivf this when trying from terminal: ni...@superhost.gr

Re: Beginner question

2013-06-04 Thread John Ladasky
On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote: BTW, did I get the logic correctly, the end result is random? You're right! I'm guessing that's not what the OP wants? -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 10:35:31 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: I can't believe Chrome which by default uses 'utf-8' choosed 'iso-8859-1' to present the filenames. What do you mean, by default uses UTF-8? Chrome uses whatever it's told. In this case, you have no encoding

RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
Date: Tue, 4 Jun 2013 00:53:04 -0700 Subject: Re: Beginner question From: john_lada...@sbcglobal.net To: python-list@python.org On Monday, June 3, 2013 11:46:03 PM UTC-7, Carlos Nepomuceno wrote: That doesn't even works because input() is the same as eval(raw_input()). So you'll get

Re: Beginner question

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 5:57 PM, John Ladasky john_lada...@sbcglobal.net wrote: On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote: BTW, did I get the logic correctly, the end result is random? You're right! I'm guessing that's not what the OP wants? I'm guessing that's exactly

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Νικόλαος Κούρας
Still can't find it: ni...@superhost.gr [~/www/data/apps]# yum search *pip* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.netcologne.de * extras: mirror.optimate-server.de * updates: mirror.softaculous.com No Matches found ni...@superhost.gr

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

2013-06-04 Thread Steven D'Aprano
On Mon, 03 Jun 2013 23:28:21 -0700, nagia.retsina wrote: ni...@superhost.gr [~]# locale LANG=en_US.UTF-8 [...] Okay, this is good. This means that your system is currently using UTF-8. Hese is also how the terminal presents my filenames. [...] ni...@superhost.gr [~]# ls -l www/data/apps/

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 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]# ls -l *.mp3 -rw-r--r-- 1 nikos nikos 3511233 Jun 3 12:07 \305\365\367\336\ \364\357\365\

Re: Beginner question

2013-06-04 Thread Larry Hudson
On 06/03/2013 08:39 PM, eschneide...@comcast.net wrote: Is there a more efficient way of doing this? Any help is gratly appreciated. import random def partdeux(): print('''A man lunges at you with a knife! Do you DUCK or PARRY?''') option1=('duck') option2=('parry')

Re: Beginner question

2013-06-04 Thread Peter Otten
Chris Angelico wrote: On Tue, Jun 4, 2013 at 5:57 PM, John Ladasky john_lada...@sbcglobal.net wrote: On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote: BTW, did I get the logic correctly, the end result is random? You're right! I'm guessing that's not what the OP wants? I'm

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Νικόλαος Κούρας
Okey found it. since couldnt install pip i did: easy_install pymysql -- http://mail.python.org/mailman/listinfo/python-list

files.py failing when run via browser while properly executed via terminal

2013-06-04 Thread Νικόλαος Κούρας
ni...@superhost.gr [~/www/cgi-bin]# ni...@superhost.gr [~/www/cgi-bin]# python Python 3.3.2 (default, Jun 3 2013, 16:18:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux Type help, copyright, credits or license for more information. exit() Okey after compiling from source python 3.3.2 and

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

2013-06-04 Thread Νικόλαος Κούρας
I think i'll do a chmod 666 /var/log/httpd/suexec.log and see if the error goes away. I think what the problem is, i have the owner and group as root:root with read/write permissions, but apache is likely owned by something else (www:www or apache:webservd). So either i'll have to change

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

2013-06-04 Thread Νικόλαος Κούρας
I just tried out those: root@nikos [~]# ls -l /var/log/httpd/suexec.log -rw-rw-r-- 1 root root 0 Jun 1 02:52 /var/log/httpd/suexec.log root@nikos [~]# ls -l /usr/local/apache/logs/suexec_log -rw-rw-r-- 1 root apache 532667 Jun 4 13:11 /usr/local/apache/logs/suexec_log root@nikos [~]# chown

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

2013-06-04 Thread Benjamin Schollnick
On Jun 4, 2013, at 6:12 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Checking the permissions of /var/log/httpd directory itself: ni...@superhost.gr [~/www/cgi-bin]# ls -ld /var/log/httpd/ drwx-- 2 root root 4096 Jun 1 02:52 /var/log/httpd// Is that a problem? http != Apache ?

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

2013-06-04 Thread Νικόλαος Κούρας
root@nikos [/home/nikos/www/cgi-bin]# chmod 755 /var/log/httpd/suexec.log root@nikos [/home/nikos/www/cgi-bin]# ls -l /var/log/httpd/suexec.log -rwxr-xr-x 1 root apache 0 Jun 1 02:52 /var/log/httpd/suexec.log* root@nikos [/home/nikos/www/cgi-bin]# chmod 755 /usr/local/apache/logs/error_log

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

2013-06-04 Thread Carlos Nepomuceno
send the output of the following command: ps aux|grep httpd Date: Tue, 4 Jun 2013 03:56:19 -0700 Subject: Re: Apache and suexec issue that wont let me run my python script From: nikos.gr...@gmail.com To: python-list@python.org root@nikos [/home/nikos/www/cgi-bin]# chmod 755

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 2:04:36 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno έγραψε: send the output of the following command: ps aux|grep httpd root@nikos [/home/nikos/www/data/apps]# ps aux | grep httpd root 19194 0.0 0.2 74224 4440 ?Ss Jul13 0:00 /usr/local/apache/bin/httpd

RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
Started answering... now I'm asking! lol I've tried to use dict() to create a dictionary to use like the switch statement providing variable names instead of literals, such as: a='A' b='B' {a:0,b:1}#here the variables are resolved {'A': 0, 'B': 1} That's ok! But if I use dict()

Re: files.py failing when run via browser while properly executed via terminal

2013-06-04 Thread Νικόλαος Κούρας
i tried somehtign else too. uploaded 1.mp3 and 1.exe from windows 8 via FileZilla to linux webhost and then renamed them both to Greek letters so that the renaming take place from within the CentOS and after that i tried: http://superhost.gr/cgi-bin/files.py Guess what? Still same error :(

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 10:54, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Okey found it. since couldnt install pip i did: easy_install pymysql It is not the recommended way to install pip, but you can ironically easy_install pip -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Carlos Nepomuceno
The httpd processes are run by user 'nobody'. You have to change your httpd.conf to assign the correct user or change the owner of the log file to nobody. On httpd.conf look for the following directives: User root Group root Date: Tue, 4 Jun 2013 04:09:44 -0700 Subject: Re: Apache and

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

2013-06-04 Thread Νικόλαος Κούρας
root@nikos [/home/nikos/www/data/apps]# ls -l /usr/local/apache/logs/error_log -rwxr-xr-x 1 root apache 32447472 Jun 4 14:36 /usr/local/apache/logs/error_log* root@nikos [/home/nikos/www/data/apps]# chown nobody:apache /usr/local/apache/logs/error_log root@nikos [/home/nikos/www/data/apps]# ls

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 12:26, Fábio Santos fabiosantos...@gmail.com wrote: On 4 Jun 2013 10:54, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Okey found it. since couldnt install pip i did: easy_install pymysql It is not the recommended way to install pip, but you can ironically

RE: Beginner question

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 12:28, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: Started answering... now I'm asking! lol I've tried to use dict() to create a dictionary to use like the switch statement providing variable names instead of literals, such as: a='A' b='B' {a:0,b:1}#here the

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 2:27:25 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno έγραψε: The httpd processes are run by user 'nobody'. You have to change your httpd.conf to assign the correct user or change the owner of the log file to nobody. On httpd.conf look for the following directives: User

RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
On 4 Jun 2013 12:28, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: [...] What's going on? Is there a way to make dict() to resolve the variables? Well yes. dict(**{a:0,b:1}) The dict() constructor makes a dictionary from keyword arguments. So you just have to feed it keyword arguments

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

2013-06-04 Thread Carlos Nepomuceno
Post your httpd.conf to pastebin and send us the link... Date: Tue, 4 Jun 2013 04:38:44 -0700 Subject: Re: Apache and suexec issue that wont let me run my python script From: nikos.gr...@gmail.com To: python-list@python.org root@nikos [/home/nikos/www/data/apps]# ls -l

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

2013-06-04 Thread Carlos Nepomuceno
Date: Tue, 4 Jun 2013 04:36:06 -0700 Subject: Re: Apache and suexec issue that wont let me run my python script From: nikos.gr...@gmail.com To: python-list@python.org Τη Τρίτη, 4 Ιουνίου 2013 2:27:25 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno έγραψε: The httpd processes are run by user

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 2:42:52 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno έγραψε: Post your httpd.conf to pastebin and send us the link... Here it is: http://pastebin.com/kMT2BZp1 -- http://mail.python.org/mailman/listinfo/python-list

ANN: Version 0.1.1 of sarge (a subprocess wrapper library) has been released.

2013-06-04 Thread Vinay Sajip
Version 0.1.1 of Sarge, a cross-platform library which wraps the subprocess module in the standard library, has been released. What changed? - - Added the ability to scan for specific patterns in subprocess output streams. - Added convenience methods to operate on wrapped

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

2013-06-04 Thread Carlos Nepomuceno
Date: Tue, 4 Jun 2013 04:48:34 -0700 Subject: Re: Apache and suexec issue that wont let me run my python script From: nikos.gr...@gmail.com To: python-list@python.org Τη Τρίτη, 4 Ιουνίου 2013 2:42:52 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno έγραψε: Post your httpd.conf to pastebin and

RE: Beginner question

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 12:57, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: On 4 Jun 2013 12:28, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: [...] What's going on? Is there a way to make dict() to resolve the variables? Well yes. dict(**{a:0,b:1}) The dict() constructor makes a

Re: PyWart: The problem with print

2013-06-04 Thread jmfauth
On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about professionalism. Let's consider a thought exercise shall we? The flexible string

Re: Beginner question

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 14:53:29 +0300, Carlos Nepomuceno wrote: That's exactly the same! dict(**{a:0,b:1})=={a:0,b:1} True Of course it is. Isn't that what you wanted? It's also a waste of time, because you create a dict literal using {}, then unpack it into keyword arguments, then call dict()

RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Beginner question Date: Tue, 4 Jun 2013 12:25:27 + To: python-list@python.org On Tue, 04 Jun 2013 14:53:29 +0300, Carlos Nepomuceno wrote: That's exactly the same! dict(**{a:0,b:1})=={a:0,b:1} True Of course it is.

Re: Beginner question

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 14:23:39 +0300, Carlos Nepomuceno wrote: Started answering... now I'm asking! lol I've tried to use dict() to create a dictionary to use like the switch statement providing variable names instead of literals, such as: a='A' b='B' {a:0,b:1}#here the variables are

RE: Beginner question

2013-06-04 Thread Fábio Santos
Awesome! Now I can do it just like that: dict([(chr(ord('a')+x),x) for x in range(2)]) {'a': 0, 'b': 1} Thanks a lot! ;) Or dict((c, i) for (i, c) in enumerate('ab')) But at this point you could just use a dict comprehension. {c: i for i, c in enumerate('ab')} --

RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Beginner question Date: Tue, 4 Jun 2013 12:35:59 + To: python-list@python.org On Tue, 04 Jun 2013 14:23:39 +0300, Carlos Nepomuceno wrote: Started answering... now I'm asking! lol I've tried to use dict() to create a

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 3:11:18 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno έγραψε: Date: Tue, 4 Jun 2013 04:48:34 -0700 Subject: Re: Apache and suexec issue that wont let me run my python script From: nikos...@gmail.com To: pytho...@python.org Τη Τρίτη, 4 Ιουνίου 2013 2:42:52 μ.μ.

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

2013-06-04 Thread Νικόλαος Κούρας
root@nikos [~]# nano /usr/local/apache/conf/httpd.conf and altering user nobody to user root. root@nikos [~]# service httpd restart [Tue Jun 04 15:56:42 2013] [warn] module rpaf_module is already loaded, skipping Syntax error on line 175 of /usr/local/apache/conf/httpd.conf: Error:\tApache has

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

2013-06-04 Thread Nobody
On Tue, 04 Jun 2013 00:58:42 -0700, Νικόλαος Κούρας wrote: Τη Τρίτη, 4 Ιουνίου 2013 10:39:08 π.μ. UTC+3, ο χρήστης Nobody έγραψε: Chrome didn't choose ISO-8859-1, the server did; the HTTP response says: Content-Type: text/html;charset=ISO-8859-1 From where do you see this $ wget -S -O

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

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 10:57 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: root@nikos [~]# nano /usr/local/apache/conf/httpd.conf and altering user nobody to user root. root@nikos [~]# service httpd restart [Tue Jun 04 15:56:42 2013] [warn] module rpaf_module is already loaded, skipping

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

2013-06-04 Thread Carlos Nepomuceno
Date: Tue, 4 Jun 2013 05:57:54 -0700 Subject: Re: Apache and suexec issue that wont let me run my python script From: nikos.gr...@gmail.com To: python-list@python.org root@nikos [~]# nano /usr/local/apache/conf/httpd.conf and altering user nobody to user root. root@nikos [~]#

Re: Beginner question

2013-06-04 Thread Roy Smith
In article ikkdnevcx7wymjdmnz2dnuvz_ssdn...@giganews.com, Larry Hudson org...@yahoo.com wrote: def partdeux(): print('A man lunges at you with a knife!') option = input('Do you DUCK or PARRY? ').lower() success = random.randint(0, 1) if success: if option ==

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 4:10:58 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: On Tue, Jun 4, 2013 at 10:57 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: root@nikos [~]# nano /usr/local/apache/conf/httpd.conf and altering user nobody to user root. root@nikos [~]# service httpd

Re: PyWart: The problem with print

2013-06-04 Thread rusi
On Jun 4, 5:23 pm, jmfauth wxjmfa...@gmail.com wrote: On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about professionalism. Let's consider a thought

Re: PyWart: The problem with print

2013-06-04 Thread Mark Lawrence
On 04/06/2013 14:29, rusi wrote: On Jun 4, 5:23 pm, jmfauth wxjmfa...@gmail.com wrote: On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 4:01:48 μ.μ. UTC+3, ο χρήστης Nobody έγραψε: On Tue, 04 Jun 2013 00:58:42 -0700, Νικόλαος Κούρας wrote: Τη Τρίτη, 4 Ιουνίου 2013 10:39:08 π.μ. UTC+3, ο χρήστης Nobody έγραψε: Chrome didn't choose ISO-8859-1, the server did; the HTTP response says:

Re: How to get an integer from a sequence of bytes

2013-06-04 Thread Grant Edwards
On 2013-06-03, Dan Stromberg drsali...@gmail.com wrote: On Mon, Jun 3, 2013 at 7:31 AM, Grant Edwards invalid@invalid.invalidwrote: That's a common assumption, but historically, a byte was merely the smallest addressable unit of memory. The size of a byte on widely used used CPUs ranged from

Re: How to get an integer from a sequence of bytes

2013-06-04 Thread Grant Edwards
On 2013-06-03, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: Date: Mon, 3 Jun 2013 15:41:41 -0700 Subject: Re: How to get an integer from a sequence of bytes From: drsali...@gmail.com To: python-list@python.org [...] Today though, it would be

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

2013-06-04 Thread Νικόλαος Κούρας
Steven said: It looks like your client is ignoring the charset header, and interpreting the bytes as Latin-1 when they are actually ISO-8859-7. py s = 'Eυχή του Ιησού.mp3' py print(s.encode('ISO-8859-7').decode('latin-1')) Eõ÷Þ ôïõ Éçóïý.mp3 which matches what you see. If you can manually

RE: How to get an integer from a sequence of bytes

2013-06-04 Thread Carlos Nepomuceno
From: invalid@invalid.invalid Subject: Re: How to get an integer from a sequence of bytes Date: Tue, 4 Jun 2013 13:42:46 + To: python-list@python.org [...] VN designs are still very common in smaller CPUs (embedded stuff). DSPs perhaps... not CPUs. Even ARMs are Harvard variants.

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

2013-06-04 Thread Νικόλαος Κούρας
I' just tried to implment your idea by correcting file names as: # Compute a set of current fullpaths fullpaths = set() path = /home/nikos/www/data/apps/ for root, dirs, files in os.walk(path): for fullpath in files: fullpaths.add( os.path.join(root, fullpath) )

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

2013-06-04 Thread Mark Lawrence
On 04/06/2013 14:57, Νικόλαος Κούρας wrote: I' just tried to implment your idea by correcting file names as: # Compute a set of current fullpaths fullpaths = set() path = /home/nikos/www/data/apps/ for root, dirs, files in os.walk(path): for fullpath in files:

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

2013-06-04 Thread Νικόλαος Κούρας
No, brackets are all there. Just tried: # Compute a set of current fullpaths fullpaths = set() path = /home/nikos/www/data/apps/ for root, dirs, files in os.walk(path): for fullpath in files: fullpaths.add( os.path.join(root, fullpath) ) print (fullpath )

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

2013-06-04 Thread Νικόλαος Κούρας
Know i tries the decode thing the moment the string join. for root, dirs, files in os.walk(path): for fullpath in files: fullpaths.add( os.path.join(root, fullpath).decode('latin-1') ) But the /www/data/apps folder have inside them both english greek filenames It's

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

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 11:17 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: I DONT KNOW WHAT ELSE TO TRY PLEASE HELP ILL TRY ANYTHING YOU SAY. You should try power surging your drivers. Have you got a spare power cord? ChrisA [1] http://www.oocities.org/timessquare/4753/bofh.htm --

Re: Too many python installations. Should i remove them all and install the latest?

2013-06-04 Thread Michael Torrie
On 06/04/2013 01:39 AM, Νικόλαος Κούρας wrote: Well, since you dough me here it is: Did you even bother to google it? If you did, you'd find that python-pip is available in a semi-official repository called EPEL. Just about every RHEL and CentOS install should have EPEL installed. Now it's

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 5:33:03 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: I DONT KNOW WHAT ELSE TO TRY PLEASE HELP ILL TRY ANYTHING YOU SAY. You should try power surging your drivers. Have you got a spare power cord? Jokes are funny, but its over a week now the script is correct and the

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

2013-06-04 Thread Mark Lawrence
On 04/06/2013 15:40, Νικόλαος Κούρας wrote: Τη Τρίτη, 4 Ιουνίου 2013 5:33:03 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: I DONT KNOW WHAT ELSE TO TRY PLEASE HELP ILL TRY ANYTHING YOU SAY. You should try power surging your drivers. Have you got a spare power cord? Jokes are funny, but its

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

2013-06-04 Thread Chris “Kwpolska” Warrick
On Tue, Jun 4, 2013 at 4:49 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: I don't know much about the Python suexec module, can you please explain where it's documented. Or is suexec nothing to do with Python? From Wikipedia: Apache suEXEC is a feature of the Apache Web server. It allows

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

2013-06-04 Thread Michael Torrie
On 06/04/2013 08:18 AM, Νικόλαος Κούρας wrote: No, brackets are all there. Just tried: # Compute a set of current fullpaths fullpaths = set() path = /home/nikos/www/data/apps/ for root, dirs, files in os.walk(path): for fullpath in files: fullpaths.add(

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

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 1:06 AM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: [1] http://www.oocities.org/timessquare/4753/bofh.htm -- http://mail.python.org/mailman/listinfo/python-list Please link and read at the BOFH’s page. [0] is the page and [1] is this exact story. [0]:

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I

lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I just use: h01.lstrip('scaffold_') and this returns me '1' But, if the header is: h02:

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

2013-06-04 Thread Joel Goldstick
On Tue, Jun 4, 2013 at 11:11 AM, Chris Angelico ros...@gmail.com wrote: On Wed, Jun 5, 2013 at 1:06 AM, Chris “Kwpolska” Warrick kwpol...@gmail.com wrote: [1] http://www.oocities.org/timessquare/4753/bofh.htm -- http://mail.python.org/mailman/listinfo/python-list Please link and read

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I

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

2013-06-04 Thread Rick Johnson
On Tuesday, June 4, 2013 12:39:59 AM UTC-5, Steven D'Aprano wrote: On Mon, 03 Jun 2013 18:37:24 -0700, Rick Johnson wrote: Consider a simple thought experiment. Suppose we start with a sequence of if statements that begin simple and get more complicated: if a == 1: ... if a == 1 and b 2*c:

Re: lstrip problem - beginner question

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 16:34, mstagliamonte madmax...@yahoo.it wrote: On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file.

Re: lstrip problem - beginner question

2013-06-04 Thread MRAB
On 04/06/2013 16:21, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I just use: h01.lstrip('scaffold_') and this

Re: Source code as text/plain

2013-06-04 Thread Andreas Perstinger
On 04.06.2013 00:34, Carlos Nepomuceno wrote: Date: Mon, 3 Jun 2013 09:06:46 +1000 From: c...@zip.com.au To: c...@rebertia.com [...] http://hg.python.org/cpython/raw-file/tip/Lib/string.py What's the 'tip' tag?

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:41:43 AM UTC-4, Fábio Santos wrote: On 4 Jun 2013 16:34, mstagliamonte madm...@yahoo.it wrote: On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through...

Re: lstrip problem - beginner question

2013-06-04 Thread Peter Otten
mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 = ('scaffold_1') I just use: h01.lstrip('scaffold_') and this returns me '1'

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
On Tuesday, June 4, 2013 11:48:55 AM UTC-4, MRAB wrote: On 04/06/2013 16:21, mstagliamonte wrote: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is

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

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 1:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: But we are really ignoring the elephant in the room. Implict conversion to Boolean is just a drop in the bucket compared to the constant shell game we are subjected to when reading source code. We so naively

Re: lstrip problem - beginner question

2013-06-04 Thread John Gordon
In 1829efca-935d-4049-ba61-7138015a2...@googlegroups.com mstagliamonte madmax...@yahoo.it writes: Hi everyone, I am a beginner in python and trying to find my way through... :) I am writing a script to get numbers from the headers of a text file. If the header is something like: h01 =

Re: lstrip problem - beginner question

2013-06-04 Thread Mark Lawrence
On 04/06/2013 16:49, mstagliamonte wrote: [strip the double line spaced nonsense] Can you please check your email settings. It's bad enough being plagued with double line spaced mail from google, having it come from yahoo is just adding insult to injury, thanks :) -- Steve is going for the

Re: lstrip problem - beginner question

2013-06-04 Thread mstagliamonte
Thanks to everyone! I didn't expect so many replies in such a short time! Regards, Max -- http://mail.python.org/mailman/listinfo/python-list

create new python file

2013-06-04 Thread kakararunachalservice
Hi, Can anyone please tell me how to dynamically create a new python file within a program??? -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 17:04, Chris Angelico ros...@gmail.com wrote: On Wed, Jun 5, 2013 at 1:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: But we are really ignoring the elephant in the room. Implict conversion to Boolean is just a drop in the bucket compared to the constant shell game

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

2013-06-04 Thread Rick Johnson
On Jun 4, 10:44 am, Rick Johnson rantingrickjohn...@gmail.com wrote: What we need is a method by which we can validate a symbol and simultaneously do the vaidation in a manner that will cast light on the type that is expected. In order for this to work, you would need validators with unique

Re: create new python file

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 17:14, kakararunachalserv...@gmail.com wrote: Hi, Can anyone please tell me how to dynamically create a new python file within a program??? That's generally a bad idea. Why are you doing that? That said, it's just like writing to a text file. So if you write python in a text

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

2013-06-04 Thread Rick Johnson
On Jun 4, 11:00 am, Chris Angelico ros...@gmail.com wrote: You know, if you want a language with strict type declarations and extreme run-time efficiency, there are some around. I don't like declaring types everywhere, i hate it. I prefer duck typed languages, HOWEVER, in order for duck typing

  1   2   3   >