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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 9:03:41 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: Nikos wrote: > > 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 ch

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

2013-06-04 Thread Russ P.
On Tuesday, June 4, 2013 8:44:11 AM UTC-7, Rick Johnson wrote: > Yes, but the problem is not "my approach", rather the lack > > of proper language design (my apologizes to the "anointed > > one". ;-) If you don't like implicit conversion to Boolean, then maybe you should be using another langu

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

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 08:47:01 +, Steven D'Aprano wrote: > Please run these commands, and show what result they give: > > alias ls > > printf %q\\n *.mp3 > > ls -b *.mp3 Do you have an answer for this yet? Better still, change the last two commands to this: printf %q\\n * ls -b * > If

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 8:40:39 π.μ. UTC+3, ο χρήστης Michael Torrie έγραψε: > 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 gre

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

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 21:15:23 -0700, Νικόλαος Κούρας 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? No problem, and Unicode includes bot

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 8:23:12 π.μ. UTC+3, ο χρήστης alex23 έγραψε: > On Jun 5, 3:11 pm, Νικόλαος Κούρας wrote: > > > I'm not trolling, you are the one that do not understand. > > > > > > Here i swicthed the code from: > > > path = "/home/nikos/www/data/apps/" > > > > > > to this since '

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

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 10:23:33 -0700, Νικόλαος Κούρας wrote: > What on eart is this damn error: Michael tried to explain to me about > surrogates but dont think i understand it. > > Encoding giving me trouble years now. > > [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] Original > excepti

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

2013-06-04 Thread Michael Torrie
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.

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

2013-06-04 Thread alex23
On Jun 5, 3:28 pm, Steven D'Aprano wrote: > How many years has Rick been coming here, proclaiming loudly [a]nd yet, > he still has no clue what > actually means. It's not just duck typing. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Steven D'Aprano
On Wed, 05 Jun 2013 02:27:26 +1000, Chris Angelico wrote: > On Wed, Jun 5, 2013 at 2:19 AM, Rick Johnson > wrote: >> On Jun 4, 11:00 am, Chris Angelico wrote: >>> You know, if you want a language with strict type declarations and >>> extreme run-time efficiency, there are some around. >> >> I do

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

2013-06-04 Thread Michael Torrie
On 06/04/2013 05:21 PM, Rick Johnson wrote: > If you still feel that this idea is garbage, then, keep on writing > your sloppy code. My proposal is the best method to handle the > problems that arise with duck typed languages in a manner that is not > restrictive or laborious -- it's actually quite

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

2013-06-04 Thread alex23
On Jun 5, 3:11 pm, Νικόλαος Κούρας wrote: > I'm not trolling, you are the one that do not understand. > > Here i swicthed the code from: > path = "/home/nikos/www/data/apps/" > > to this since '/home/nikos/public_html/cgi-bin' = '/home/nikos/www/cgi-bin' > as i said: > > # Compute a set of curren

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

2013-06-04 Thread Tim Roberts
Grant Edwards wrote: >On 2013-06-03, Dan Stromberg wrote: >> >> When I was a Freshman in college, I used a CDC Cyber a lot; it had 6 bit >> bytes and 60 bit words. This was in 1985. > >But you couldn't address individual 6-bit "hextets" in memory could >you? My recollection is that incrementin

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 7:59:31 π.μ. UTC+3, ο χρήστης alex23 έγραψε: > On Jun 5, 2:40 pm, Νικόλαος Κούρας wrote: > > > Of course '/home/nikos/public_html/cgi-bin' = '/home/nikos/www/cgi-bin' > > > What this has to do with what i asked? > > > > You display an error of "No such file or direc

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 7:47:40 π.μ. UTC+3, ο χρήστης alex23 έγραψε: > On Jun 5, 1:28 pm, Νικόλαος Κούρας wrote: > > > AS you have seen i've been struggling days now to get a solution to this > > and the closing parenthesis is not the prbpoem here, unicode. > > > > Oh really? > > > > >

Re: PyWart: The problem with "print"

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 05:23:19 -0700, jmfauth wrote: > How is is possible to arrive to such a situation ? The answer if far > beyond my understanding Truer words have never been spoken. > (although I have my opinion on the subject). http://en.wikipedia.org/wiki/Dunning–Kruger_effect -- Stev

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

2013-06-04 Thread alex23
On Jun 5, 2:40 pm, Νικόλαος Κούρας wrote: > Of course '/home/nikos/public_html/cgi-bin' = '/home/nikos/www/cgi-bin' > What this has to do with what i asked? You display an error of "No such file or directory" and you wonder why I'm trying to confirm the two locations are the same. Can you finall

Re: lstrip problem - beginner question

2013-06-04 Thread Larry Hudson
On 06/04/2013 08:21 AM, 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: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-04 Thread alex23
On Jun 5, 1:28 pm, Νικόλαος Κούρας wrote: > AS you have seen i've been struggling days now to get a solution to this and > the closing parenthesis is not the prbpoem here, unicode. Oh really? > if they are unicode then i really see no trouble when trying to: > cur.execute('''SELECT url FROM fil

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 7:34:55 π.μ. UTC+3, ο χρήστης alex23 έγραψε: > On Jun 5, 1:55 pm, Νικόλαος Κούρας wrote: > > > [Wed Jun 05 06:49:56 2013] [error] [client 46.12.95.59] (2)No such file or > > directory: exec of '/home/nikos/public_html/cgi-bin/koukos.py' failed > > > > > The script t

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

2013-06-04 Thread Νικόλαος Κούρας
Here is the script: #!/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()) # initializ

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

2013-06-04 Thread alex23
On Jun 5, 1:55 pm, Νικόλαος Κούρας wrote: > [Wed Jun 05 06:49:56 2013] [error] [client 46.12.95.59] (2)No such file or > directory: exec of '/home/nikos/public_html/cgi-bin/koukos.py' failed > The script though its interpretign  correctly as seen from > ni...@superhost.gr [~/www/cgi-bin]# python

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

2013-06-04 Thread Νικόλαος Κούρας
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 filenam

Re: Issue values dictionary

2013-06-04 Thread claire morandin
@alex23 I can't thank you enough this really helped me so much, not only fixing my issue but also understanding where was my original error Thanks a lot -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 6:44:38 π.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε: > Τη Τετάρτη, 5 Ιουνίου 2013 12:47:17 π.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: > > > > > >This indicates that i'am reading the filenames in a different encoding > > >than > > >what they actually are? What is

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 1:12:26 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Wed, Jun 5, 2013 at 3:12 AM, Νικόλαος Κούρας wrote: > > > I know what full root access mean. > > > I also trust you. > > > I'm hopeless man, its 1 week now dealing with this. > > > > The call is strong... I

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 12:47:17 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > >This indicates that i'am reading the filenames in a different encoding than > >> > >what they actually are? What is i try to use bytes for path > >specifications, > > >have Python decode them in 'utf-8' ? > > f

Re: How to increment date by week?

2013-06-04 Thread steve . ferg . bitbucket
pyfdate -- http://www.ferg.org/pyfdate/ from pyfdate import Time w = Time(2013,1,2) # start with January 2, 2013, just for example # print the ISO weeknumber and date for 52 weeks # date looks like this: October 31, 2005 for i in range(52): w = w.plus(weeks=1) print (w.weeknumber, w.d)

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 10:31:20 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > The code above was my (failed) attempt to focus your attention on why > one of your scripts raised a SyntaxError: translating that code in plain > english, that line (the "stmt" variable above) contains *two* open > bra

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

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 1:28 PM, Νικόλαος Κούρας wrote: > > YOU of all people should not speak at all, because you haven't helped me a > bit. > Its funny, how knowledge people that in facte tried to help me treat me with > respect while people like you who have never been of any help tend to just

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τετάρτη, 5 Ιουνίου 2013 4:28:17 π.μ. UTC+3, ο χρήστης alex23 έγραψε: > On Jun 5, 5:32 am, Νικόλαος Κούρας wrote: > > > Lele the output of: > > > > > > stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, > > )" > > > chars_count = Counter(stmt) > > > print("Number o

Re: Issue values dictionary

2013-06-04 Thread alex23
On Jun 5, 12:41 pm, claire morandin wrote: > But I have a problem storing all size length to the value size as it is > always comes back with the last entry. > Could anyone explain to me what I am doing wrong and how I should set the > values for each dictionary? Your code has two for loops, on

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

2013-06-04 Thread Carlos Nepomuceno
> Date: Tue, 4 Jun 2013 18:28:17 -0700 > Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain) > From: wuwe...@gmail.com [...] > Just a reminder to everyone that the OP originally went by the name of > Ferrous Cranus: > http://redwing.hutman.net/~mreed/warriorshtm/ferouscran

Issue values dictionary

2013-06-04 Thread claire morandin
I have two text file with a bunch of transcript name and their corresponding length, it looks like this: ERCC.txt ERCC-2 1061 ERCC-3 1023 ERCC-4 523 ERCC-9 984 ERCC-00012 994 ERCC-00013 808 ERCC-00014 1957 ERCC-00016 844 ERCC-00017 1136

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

2013-06-04 Thread alex23
On Jun 5, 2:09 am, Rick Johnson wrote: > This is how you design a language for consistency and readability. Great! Now you can shut up and get back to work on RickPython4000. Come back and let us know all about it when it's done. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread alex23
On Jun 5, 5:32 am, Νικόλαος Κούρας wrote: > Lele the output of: > > stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, )" > chars_count = Counter(stmt) > print("Number of '(': %d" % chars_count['(']) > print("Number of ')': %d" % chars_count[')']) > > is: > > Number of '('

Re: [Python-Dev] Do you consider Python a 4GL? Why (not)?

2013-06-04 Thread Dan Stromberg
On Tue, Jun 4, 2013 at 4:53 PM, Carlos Nepomuceno < carlosnepomuc...@outlook.com> wrote: > Do you consider Python a 4GL? Why (not)? > By the wikipedia definition of 4GL and 5GL, I'd say Python is neither. And it's not a VHLL either, again according to the wikipedia definition. But IMO it is too

Re: How to increment date by week?

2013-06-04 Thread Skip Montanaro
Check out the rrule module in the python-dateutil package: http://labix.org/python-dateutil https://pypi.python.org/pypi/python-dateutil Skip -- http://mail.python.org/mailman/listinfo/python-list

Multiple Python one-liners

2013-06-04 Thread vasudevram
http://jugad2.blogspot.com/2013/06/multiple-python-one-liners.html Some interesting and useful one-liners there ... -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Carlos Nepomuceno
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 opposit

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

2013-06-04 Thread Mark Lawrence
On 05/06/2013 01:14, Tim Chase wrote: On 2013-06-05 02:53, Carlos Nepomuceno wrote: Do you consider Python a 4GL? Why (not)? Of course it's a 4GL ("4 Guido Language"). You think he wrote it for somebody else? Unless you have some magical list of criteria that makes your own definition of "4G

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

2013-06-04 Thread Tim Chase
On 2013-06-05 02:53, Carlos Nepomuceno wrote: > Do you consider Python a 4GL? Why (not)? Of course it's a 4GL ("4 Guido Language"). You think he wrote it for somebody else? Unless you have some magical list of criteria that makes your own definition of "4GL", in which case you should look at you

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

2013-06-04 Thread Carlos Nepomuceno
Do you consider Python a 4GL? Why (not)? -- http://mail.python.org/mailman/listinfo/python-list

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

2013-06-04 Thread Mark Lawrence
On 05/06/2013 00:21, Rick Johnson wrote: [snip] Would you be kind enough not to smoke too much wacky baccy before posting, 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'

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

2013-06-04 Thread Rick Johnson
On Jun 4, 12:42 pm, Ian Kelly wrote: > > By this manner, we can roll three common tests into one > > method: > > * Boolean conversion > > * member truthiness for iterables > > * type checking > How exactly does this is_valid method perform the first two? Are you > suggesting that an

RE: How to increment date by week?

2013-06-04 Thread Carlos Nepomuceno
> Date: Tue, 4 Jun 2013 14:31:07 -0700 > Subject: How to increment date by week? > From: r90...@gmail.com > To: python-list@python.org > >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 > fro

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 3:12 AM, Νικόλαος Κούρας wrote: > I know what full root access mean. > I also trust you. > I'm hopeless man, its 1 week now dealing with this. The call is strong... I could rule the galaxy alongside my father... I've searched my feelings, and I know this to be true! Okay.

Re: How to increment date by week?

2013-06-04 Thread John Gordon
In PieGuy writes: >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

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

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 6:03 AM, Νικόλαος Κούρας wrote: >>UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc5' in position >>>61: surrogates not allowed > > This indicates that i'am reading the filenames in a different encoding than > what they actually are? What is i try to use byte

Re: lstrip problem - beginner question

2013-06-04 Thread Dave Angel
On 06/04/2013 12:01 PM, Mark Lawrence wrote: 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 in

Re: How to increment date by week?

2013-06-04 Thread Giorgos Tzampanakis
On 2013-06-04, 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/

Re: How to increment date by week?

2013-06-04 Thread Tim Chase
On 2013-06-04 14:31, 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. i

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

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 5:51 AM, Joshua Landau wrote: > On 4 June 2013 14:39, Grant Edwards wrote: >> On 2013-06-03, Dan Stromberg wrote: >>> Today though, it would be difficult to sell a conventional (Von Neumann) >>> computer that didn't have 8 bit bytes. >> >> There are tons (as in millions of

Re: How to increment date by week?

2013-06-04 Thread Joshua Landau
On 4 June 2013 22:31, 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

How to increment date by week?

2013-06-04 Thread PieGuy
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. And to save that resu

Problems with serial port interface

2013-06-04 Thread lionelgreenstreet
Hi, i'm programming in python for the first time: i want to create a serial port reader. I'm using python3.3 and pyQT4; i'm using also pyserial. Below a snippet of the code: class CReader(QThread): def start(self, ser, priority = QThread.InheritPriority): self.ser = ser QThrea

Re: [RELEASED] Python 2.7.5

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 21:47, "Joshua Landau" wrote: > > On 4 June 2013 00:12, Mark Lawrence wrote: > > On 03/06/2013 23:37, Carlos Nepomuceno wrote: > >> What still doesn't work in Python 3? > > > > http://python3wos.appspot.com/ > > Don't take this list too seriously - some of those do have fully > work

Re: [RELEASED] Python 2.7.5

2013-06-04 Thread Joshua Landau
On 4 June 2013 00:12, Mark Lawrence wrote: > On 03/06/2013 23:37, Carlos Nepomuceno wrote: >> What still doesn't work in Python 3? > > http://python3wos.appspot.com/ 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

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

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 21:18, "Νικόλαος Κούρας" wrote: > > Lele the output of: > > stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, )" > chars_count = Counter(stmt) > print("Number of '(': %d" % chars_count['(']) > print("Number of ')': %d" % chars_count[')']) > > is: > > Number

Re: create new python file

2013-06-04 Thread Tobiah
So, can i program within just by the print statement? Or do i have to do something else. it is completely indecipherable (to me at least) what you are saying, leave aside any issues with python. He said, "Oh, so writing python statements into a text file is as simple as printing them, referen

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

2013-06-04 Thread Νικόλαος Κούρας
Lele the output of: stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, )" chars_count = Counter(stmt) print("Number of '(': %d" % chars_count['(']) print("Number of ')': %d" % chars_count[')']) is: Number of '(': 2 Number of ')': 1 What do you make out of this please?

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

2013-06-04 Thread Νικόλαος Κούρας
>UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc5' in position >>61: surrogates not allowed This indicates that i'am reading the filenames in a different encoding than what they actually are? What is i try to use bytes for path specifications, and have Python decode them in 'utf

RE: create new python file

2013-06-04 Thread Carlos Nepomuceno
> Date: Tue, 4 Jun 2013 11:54:52 -0700 > Subject: Re: create new python file > From: kakararunachalserv...@gmail.com [...] > > > > > So, can i program within just by the print statement? Or do i have to do > > > something else. > > > > > > > > it is completely indecipherable (to me at least)

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

2013-06-04 Thread Joshua Landau
On 4 June 2013 14:39, Grant Edwards wrote: > On 2013-06-03, Dan Stromberg wrote: >> Today though, it would be difficult to sell a conventional (Von Neumann) >> computer that didn't have 8 bit bytes. > > There are tons (as in millions of units per month) of CPUs still being > sold in the DSP marke

Re: Beginner question

2013-06-04 Thread Joshua Landau
On 4 June 2013 04:39, 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') > optionsindex=[option1

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

2013-06-04 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Τη Τρίτη, 4 Ιουνίου 2013 9:18:29 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: >> Νικόλαος Κούρας writes: > >> >>> from collections import Counter >> >>> stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( >> >>> fullpath, )" >> >>> chars_count = Counter(stm

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 9:45:05 μ.μ. UTC+3, ο χρήστης Chris "Kwpolska" Warrick έγραψε: > On Tue, Jun 4, 2013 at 8:27 PM, Νικόλαος Κούρας wrote: > > > 2. No idea wht is flask or pyramid or wsgi > > > > http://lmgtfy.com/?q=flask+python > > http://lmgtfy.com/?q=pyramid+python > > http://lmgt

Re: create new python file

2013-06-04 Thread kakararunachalservice
On Tuesday, June 4, 2013 11:51:46 PM UTC+5:30, rusi wrote: > On Jun 4, 11:09 pm, kakararunachalserv...@gmail.com wrote: > > > Thank you so much! Why didn't i thought about that. So, can i program > > within just by the print > > > statement? Or do i have to do something else. I'm sorry, i just l

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

2013-06-04 Thread Chris “Kwpolska” Warrick
On Tue, Jun 4, 2013 at 8:27 PM, Νικόλαος Κούρας wrote: > 2. No idea wht is flask or pyramid or wsgi http://lmgtfy.com/?q=flask+python http://lmgtfy.com/?q=pyramid+python http://lmgtfy.com/?q=wsgi+python > 3. Files are located in '/home/nikos/www/data/apps' and they appear in > browser direcory

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 9:18:29 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > Νικόλαος Κούρας writes: > >>> from collections import Counter > >>> stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( > >>> fullpath, )" > >>> chars_count = Counter(stmt) > >>> print("Number of '(': %d"

RE: Source code as text/plain

2013-06-04 Thread Carlos Nepomuceno
Thank you! > Date: Tue, 4 Jun 2013 17:51:08 +0200 > From: andiper...@gmail.com > To: python-list@python.org > Subject: Re: Source code as text/plain > > On 04.06.2013 00:34, Carlos Nepomuceno wrote: > > > >> Date: Mon, 3 Jun 2013 09:06:46 +1000 > >> From:

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 8:53:38 μ.μ. UTC+3, ο χρήστης Chris "Kwpolska" Warrick έγραψε: > On Tue, Jun 4, 2013 at 7:23 PM, Νικόλαος Κούρας wrote: > > > What on eart is this damn error: Michael tried to explain to me about > > surrogates but dont think i understand it. > > > > > > Encoding givi

Re: create new python file

2013-06-04 Thread rusi
On Jun 4, 11:09 pm, kakararunachalserv...@gmail.com wrote: > Thank you so much! Why didn't i thought about that. So, can i program within > just by the print > statement? Or do i have to do something else. I'm sorry, i just learning > python. Thanks again! If you are just learning python, you al

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

2013-06-04 Thread Lele Gaifax
Νικόλαος Κούρας writes: > root@nikos [~]# [Tue Jun 04 19:50:16 2013] [error] [client 46.12.95.59] > File "files.py", line 72 > [Tue Jun 04 19:50:16 2013] [error] [client 46.12.95.59] data = > cur.fetchone()#URL is unique, so should only be one > [Tue Jun 04 19:50:16 2013] [error]

Re: create new python file

2013-06-04 Thread kakararunachalservice
On Tuesday, June 4, 2013 11:14:32 PM UTC+5:30, Gary Herron wrote: > On 06/04/2013 09:07 AM, kakararunachalserv...@gmail.com wrote: > > > Hi, > > > Can anyone please tell me how to dynamically create a new python file > > within a program??? > > > > What do you mean by a "python file"? If yo

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

2013-06-04 Thread Chris “Kwpolska” Warrick
On Tue, Jun 4, 2013 at 7:23 PM, Νικόλαος Κούρας wrote: > What on eart is this damn error: Michael tried to explain to me about > surrogates but dont think i understand it. > > Encoding giving me trouble years now. > > [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] Original exception > w

Re: create new python file

2013-06-04 Thread Gary Herron
On 06/04/2013 09:07 AM, kakararunachalserv...@gmail.com wrote: Hi, Can anyone please tell me how to dynamically create a new python file within a program??? What do you mean by a "python file"? If you mean a text file containing python code, then create it like any other text file. For ins

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

2013-06-04 Thread Ian Kelly
On Tue, Jun 4, 2013 at 9:44 AM, Rick Johnson wrote: > It is my firm belief that truth testing a value that is not > a Boolean should raise an exception. If you want to convert > a type to Boolean then pass it to the bool function: > > lst = [1,2,3] > if bool(lst): > do_something >

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

2013-06-04 Thread Jason Swails
On Tue, Jun 4, 2013 at 11:44 AM, Rick Johnson wrote: > > This implicit conversion seems like a good idea at first, > and i was caught up in the hype myself for some time: "Hey, > i can save a few keystrokes, AWESOME!". However, i can tell > you with certainty that this implicit conversion is folly

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

2013-06-04 Thread Ned Batchelder
On 6/4/2013 12:19 PM, Rick Johnson wrote: On Jun 4, 11:00 am, Chris Angelico 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

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

2013-06-04 Thread Νικόλαος Κούρας
What on eart is this damn error: Michael tried to explain to me about surrogates but dont think i understand it. Encoding giving me trouble years now. [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] Original exception was: [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] Traceback

Re: Beginner question

2013-06-04 Thread Mitya Sirenef
On 06/04/2013 07:53 AM, Carlos Nepomuceno wrote: >On 4 Jun 2013 12:28, "Carlos Nepomuceno" 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 y

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 8:09:18 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Wed, Jun 5, 2013 at 3:02 AM, Νικόλαος Κούρας wrote: > > > I'm willing to let someone with full root access to my webhost to see > > thigns from the inside. > > > > > > Does someone want to take o allok or at ela

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 3:02 AM, Νικόλαος Κούρας wrote: > I'm willing to let someone with full root access to my webhost to see thigns > from the inside. > > Does someone want to take o allok or at elast tell me what else i need to > try, that hasn't been tried out yet? You need to read up on wh

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

2013-06-04 Thread Νικόλαος Κούρας
All these popel i host thei websiets are friend fo mine and their webpages all of them run witohut any problem. Only my perosnal webpage, which utilizes python has these kind of issues, the other pages re joomlas and dreamweavers. Please as you see i have been trying anyhting i thought of and

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

2013-06-04 Thread Νικόλαος Κούρας
Τη Τρίτη, 4 Ιουνίου 2013 6:07:19 μ.μ. UTC+3, ο χρήστης 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/" > >

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

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 2:19 AM, Rick Johnson wrote: > On Jun 4, 11:00 am, Chris Angelico 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 > type

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 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 to work consist

Re: create new python file

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 17:14, 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 file, you're good. -- http://ma

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 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 "type names" > >     if va

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" wrote: > > On Wed, Jun 5, 2013 at 1:44 AM, Rick Johnson > 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 > > rea

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: 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

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 John Gordon
In <1829efca-935d-4049-ba61-7138015a2...@googlegroups.com> mstagliamonte 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 = ('>scaffold_1'

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 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 believe that a symbol > name

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. > > > > > > I

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 re

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" 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

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? htt

  1   2   >