want to show list of available options and arguments in my command line utility

2012-09-15 Thread Santosh Kumar
I have a script that takes an which basically takes a command line argument and prints after processing. If I don't give the argument to the script, it gives me a ValueError: ValueError: need more than 1 value to unpack I was trying to utilizing this space, if there is no argument I want it to sh

Re: Standard Asynchronous Python

2012-09-15 Thread Bryan
Dustin J. Mitchell wrote: > Thanks for the second round of responses.  I think this gives me some > focus - concentrate on the API, talk to the framework developers, and > start redrafting the PEP sooner rather than later. That's mostly what you came in with, but talking to the framework developer

Re: datetime issue

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 11:28:47 μ.μ. UTC+3, ο χρήστης MRAB έγραψε: > On 2012-09-15 20:26, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ wrote: > > > οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 15 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2012 > > 10:05:49 οΏ½.οΏ½. UTC+3, οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ Chris Rebert

Re: unit test strategy

2012-09-15 Thread Aaron Brady
On Friday, September 14, 2012 10:32:47 PM UTC-5, David Hutto wrote: > On Fri, Sep 14, 2012 at 11:26 PM, Dwight Hutto wrote: > > > On Fri, Sep 14, 2012 at 10:59 PM, Aaron Brady wrote: > > >> Hello, > > >> > > >> I've developing a test script. There's a lot of repetition. I want to > >> intr

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 4:10 AM, Νικόλαος Κούρας wrote: > ah yes in the index.html page yes...yes i totally forgot about that, that > bwas before creating the python counter logging when i was thinking other > ways of solving this matter. So it's like I was saying, redundant. :) > What about t

Re: using text file to get ip address from hostname

2012-09-15 Thread Dan Katorza
בתאריך יום רביעי, 12 בספטמבר 2012 17:24:50 UTC+3, מאת Dan Katorza: > hello , > > > > i'm new to Python and i searched the web and could not find an answer for my > issue. > > > > i need to get an ip address from list of hostnames which are in a textfile. > > > > this is what i have so far

Re: datetime issue

2012-09-15 Thread MRAB
On 2012-09-15 20:26, Νικόλαος Κούρας wrote: Τη Σάββατο, 15 Σεπτεμβρίου 2012 10:05:49 μ.μ. UTC+3, ο χρήστης Chris Rebert έγραψε: On Sat, Sep 15, 2012 at 10:33 AM, Νικόλαος Κούρας wrote: > Hello again, > > one small matter too. > # get some enviromental values > locale.setlocale(locale.LC_ALL,

Re: datetime issue

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 10:05:49 μ.μ. UTC+3, ο χρήστης Chris Rebert έγραψε: > On Sat, Sep 15, 2012 at 10:33 AM, Νικόλαος Κούρας > wrote: > > > Hello again, > > > > > > one small matter too. > > > > > # get some enviromental values > > > locale.setlocale(locale.LC_ALL, 'el_GR') >

Re: datetime issue

2012-09-15 Thread Chris Rebert
On Sat, Sep 15, 2012 at 10:33 AM, Νικόλαος Κούρας wrote: > Hello again, > > one small matter too. > > # get some enviromental values > locale.setlocale(locale.LC_ALL, 'el_GR') > date = datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S' ) > > although iam setting greek as locale Locales don't

Re: datetime issue

2012-09-15 Thread Jason Friedman
> # get some enviromental values > locale.setlocale(locale.LC_ALL, 'el_GR') > date = datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S' ) > > although iam setting greek as locale the time is 8 hours before, like in > texas, us > How can i change this to save the correct Greek time in variable

Re: using text file to get ip address from hostname

2012-09-15 Thread Hans Mulder
On 15/09/12 18:20:42, Dan Katorza wrote: > בתאריך יום רביעי, 12 בספטמבר 2012 17:24:50 UTC+3, מאת Dan Katorza: >> hello , >> >> >> >> i'm new to Python and i searched the web and could not find an answer for my >> issue. >> >> >> >> i need to get an ip address from list of hostnames which are in a

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 9:03:00 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Sun, Sep 16, 2012 at 3:59 AM, Νικόλαος Κούρας > wrote: > > > What hidden form value? > > > > > > you mean page variable does not needed? please clarify. > > > > > > Also i dont know what to do if someo

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 3:59 AM, Νικόλαος Κούρας wrote: > What hidden form value? > > you mean page variable does not needed? please clarify. > > Also i dont know what to do if someone enters a false entry as content for > htmlpage. You have this: What is that for? Is it needed? ChrisA -- ht

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
What hidden form value? you mean page variable does not needed? please clarify. Also i dont know what to do if someone enters a false entry as content for htmlpage. -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 3:26 AM, Νικόλαος Κούρας wrote: > aahhh! alo it needed change to > > page = form.getvalue('htmlpage') > > now its working! at last! > > but can you please tell me what was wrong? > > Tha names of the variables was the same both in counter.py and the .htaccess > > But why wa

datetime issue

2012-09-15 Thread Νικόλαος Κούρας
Hello again, one small matter too. # get some enviromental values locale.setlocale(locale.LC_ALL, 'el_GR') .. .. date = datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S' ) although iam setting greek as locale the time is 8 hours before, like in texas, us How can i change

Re: Some Silly Questions

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 3:18 AM, Subhabrata wrote: > Dear Group, > > I am going to ask two very silly questions, if any one can kindly tell me why > this structure is taken? > > classifier.pseudocode(depth=4) > > from nltk.corpus import brown Not sure what your question means. The first one is a

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 8:22:39 μ.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε: > Τη Σάββατο, 15 Σεπτεμβρίου 2012 7:56:31 μ.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: > > > On Sun, Sep 16, 2012 at 2:53 AM, Νικόλαος Κούρας > > wrote: > > > > > > > The 'page' form field is of couse ne

Re: pythonOCC examples doesn't work?

2012-09-15 Thread MRAB
On 2012-09-15 05:40, Dwight Hutto wrote: On Fri, Sep 14, 2012 at 11:53 PM, Chris Angelico wrote: On Sat, Sep 15, 2012 at 1:47 PM, Dwight Hutto wrote: That's no problem, But some suported ad some opposed, it's a democracy, but a dictatorship by the moderators. How much did I err in their opini

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 7:56:31 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Sun, Sep 16, 2012 at 2:53 AM, Νικόλαος Κούρας > wrote: > > > The 'page' form field is of couse neccessary because how else the python > > counter.py script would know which html file triggered it so to pr

Some Silly Questions

2012-09-15 Thread Subhabrata
Dear Group, I am going to ask two very silly questions, if any one can kindly tell me why this structure is taken? classifier.pseudocode(depth=4) from nltk.corpus import brown Sorry to ask you these. Actually everytime I get confused with the answers. Regards, Subhabrata -- http://mail.

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 2:53 AM, Νικόλαος Κούρας wrote: > The 'page' form field is of couse neccessary because how else the python > counter.py script would know which html file triggered it so to present it > and do its log thing?(i intend to create a few html files) > > I still do not see why

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 7:25:15 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: First, decide whether or not you need the 'page' form > > field. Either it's redundant or it's necessary. > > > > 1) If it's redundant: Easy. Delete it. Your page will begin working again. > > 2) If it's nece

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Gonnerman
On 09/15/2012 10:23 AM, Νικόλαος Κούρας wrote: I swicthed back my code to: f = open( '../' + page ) and http://superhost.gr works which means that line gets parsed correctly. Only when i post data to the text area boxes iam getting the error: cannot concatenate 'str' and 'list' objects how i

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 2:04 AM, Νικόλαος Κούρας wrote: > I'am not sure what to do and i didnt quite understand what the problem is. > > Can you please tell me what parts need fixe so for the users to be able to > leave remakrs in he text area boxes? Your question demonstrates a more fundamental

Re: using text file to get ip address from hostname

2012-09-15 Thread Dan Katorza
בתאריך יום רביעי, 12 בספטמבר 2012 17:24:50 UTC+3, מאת Dan Katorza: > hello , > > > > i'm new to Python and i searched the web and could not find an answer for my > issue. > > > > i need to get an ip address from list of hostnames which are in a textfile. > > > > this is what i have so far

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Gonnerman
I moved to HostGaot because i heard there were the best in the hosting business. They are pretty good. However, you have to understand the site layout to do CGI safely. So long as your script are .cgi, putting them in ~/public_html is fine. If you need to deploy .py files, you need to pu

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
I'am not sure what to do and i didnt quite understand what the problem is. Can you please tell me what parts need fixe so for the users to be able to leave remakrs in he text area boxes? -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 1:33 AM, Νικόλαος Κούρας wrote: > You are right but iam a new python learner and i created this logging system > script as a poject to better learn the lalguage itself. > > I can always use google analytics for serious visitor logging. > > Apart from that i enjoy reading

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 1:23 AM, Νικόλαος Κούρας wrote: > I swicthed back my code to: f = open( '../' + page ) > > and http://superhost.gr works which means that line gets parsed correctly. > > Only when i post data to the text area boxes iam getting the error: > > cannot concatenate 'str' and 'l

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
You are right but iam a new python learner and i created this logging system script as a poject to better learn the lalguage itself. I can always use google analytics for serious visitor logging. Apart from that i enjoy reading my logs by typing: http://superhost.gr/?show=log :-) -- http://m

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
I swicthed back my code to: f = open( '../' + page ) and http://superhost.gr works which means that line gets parsed correctly. Only when i post data to the text area boxes iam getting the error: cannot concatenate 'str' and 'list' objects how is this possible to work before and NOT work when

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 1:06 AM, Νικόλαος Κούρας wrote: > Previous webhost has the same flaw as well, look: > > http://www.errorweb.gr/~nikos/cgi-bin/ > > giving away all my scripts. > > Webhost misconfiguration in both hosts! And when I look at the scripts, I see things that do not fill me with

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Previous webhost has the same flaw as well, look: http://www.errorweb.gr/~nikos/cgi-bin/ giving away all my scripts. Webhost misconfiguration in both hosts! -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Roy Smith
In article , Íéêüëáïò Êïýñáò wrote: > I cant beleive that my source code can be seen form ANYONE this easily Which is why I pointed it out. I mean no disrespect, but you appear to be in over your head. That's fine (we're all in over our heads at some point, that's how we learn new thing

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
The .htaccess file works with HostGator because the page was working all day rediecting all html requests fine to the counter.py script. Only when i tried to post data to the text area boxes this problem made its appearance. -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Thank i will do that, ill inform the support right away! -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 12:51 AM, Νικόλαος Κούρας wrote: > in my case an .htaccess file gives redirects all html requests to > /cgi-bin/counter.py by also provide as an argument to the counter.py script > the initical html file request > > RewriteEngine On > RewriteCond %{REQUEST_FILENAME} -f >

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
in my case an .htaccess file gives redirects all html requests to /cgi-bin/counter.py by also provide as an argument to the counter.py script the initical html file request RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^/?(.+\.html) /cgi-bin/counter.py?page=$1 [L,PT,QSA] so th

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 12:44 AM, Νικόλαος Κούρας wrote: > Τη Σάββατο, 15 Σεπτεμβρίου 2012 5:21:22 μ.μ. UTC+3, ο χρήστης Roy Smith > έγραψε: >> Do you realize that the hosting service you're using (HostGator) is so >> mis-configured that it is exposing your source code and credentials to >> the e

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 5:21:22 μ.μ. UTC+3, ο χρήστης Roy Smith έγραψε: > In article , > > > > > i see you try to extract only the 1st element of the list, i tried that too > > > but it gives me now this weird message: > > > > > > if you visit my website http://superhost.gr > > >

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Peter Otten
Νικόλαος Κούρας wrote: > Τη Σάββατο, 15 Σεπτεμβρίου 2012 4:38:51 μ.μ. UTC+3, ο χρήστης Chris > Angelico έγραψε: >> On Sat, Sep 15, 2012 at 11:28 PM, Νικόλαος Κούρας >> wrote: >> >> > Iam not using frameworks just plain python code written in Notepad++ >> >> > >> >> > Can you please tell me how

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Roy Smith
In article , > i see you try to extract only the 1st element of the list, i tried that too > but it gives me now this weird message: > > if you visit my website http://superhost.gr Do you realize that the hosting service you're using (HostGator) is so mis-configured that it is exposing your so

Re: Decorators not worth the effort

2012-09-15 Thread 88888 Dihedral
David Hutto於 2012年9月15日星期六UTC+8下午6時04分28秒寫道: > On Sat, Sep 15, 2012 at 5:45 AM, 8 Dihedral > > wrote: > > > Steven D'Aprano於 2012年9月15日星期六UTC+8上午7時39分28秒寫道: > > >> On Fri, 14 Sep 2012 15:16:47 -0600, Ian Kelly wrote: > > >> > > >> > > >> > > >> > If only there were a conceptually simple

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 4:38:51 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Sat, Sep 15, 2012 at 11:28 PM, Νικόλαος Κούρας > wrote: > > > Iam not using frameworks just plain python code written in Notepad++ > > > > > > Can you please tell me how to switch this line in order for

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sat, Sep 15, 2012 at 11:28 PM, Νικόλαος Κούρας wrote: > Iam not using frameworks just plain python code written in Notepad++ > > Can you please tell me how to switch this line in order for this line to work? f = open( '../' + page[0]) will possibly work. But do try to understand what's happen

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Сахнов Михаил
f = open( '../' + page.pop() ) 15.09.2012 17:32 пользователь "Νικόλαος Κούρας" написал: > Τη Σάββατο, 15 Σεπτεμβρίου 2012 3:34:34 μ.μ. UTC+3, ο χρήστης Chris > Angelico έγραψε: > > On Sat, Sep 15, 2012 at 10:22 PM, Νικόλαος Κούρας > wrote: > > > > > Hello, > > > > > > > > > > I recently changed

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Τη Σάββατο, 15 Σεπτεμβρίου 2012 3:34:34 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Sat, Sep 15, 2012 at 10:22 PM, Νικόλαος Κούρας > wrote: > > > Hello, > > > > > > I recently changed webhost and in the new one iam getting this error you > > can see if you visit http://superhost.gr whe

Re: subprocess call is not waiting.

2012-09-15 Thread paulstaten
That's a habit I'll make sure to avoid, then. Thanks, Chris! -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sat, Sep 15, 2012 at 10:22 PM, Νικόλαος Κούρας wrote: > Hello, > > I recently changed webhost and in the new one iam getting this error you can > see if you visit http://superhost.gr when program execution reaches the line: > >f = open( '../' + page ) > > In the previous host i wasn't gett

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Sorry the problem appears when you try to input data botton down the page in the text area boxes and click submit. this is the error apperaing: A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /home/nikos/public

cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Νικόλαος Κούρας
Hello, I recently changed webhost and in the new one iam getting this error you can see if you visit http://superhost.gr when program execution reaches the line: f = open( '../' + page ) In the previous host i wasn't getting this error. page's contents is: page = form.getvalue('page') --

Re: Moving folders with content

2012-09-15 Thread Hans Mulder
On 15/09/12 10:00:16, Nobody wrote: > On Sat, 15 Sep 2012 04:36:00 +, jyoung79 wrote: > >> I am working in both OS X Snow Leopard and Lion (10.6.8 and 10.7.4). >> I'm simply wanting to move folders (with their content) from various >> servers to the hard drive and then back to different dir

Re: Decorators not worth the effort

2012-09-15 Thread Dwight Hutto
On Sat, Sep 15, 2012 at 5:45 AM, 8 Dihedral wrote: > Steven D'Aprano於 2012年9月15日星期六UTC+8上午7時39分28秒寫道: >> On Fri, 14 Sep 2012 15:16:47 -0600, Ian Kelly wrote: >> >> >> >> > If only there were a conceptually simpler way to do this. Actually, >> >> > there is. I give you: muman than humanetadec

Re: Decorators not worth the effort

2012-09-15 Thread 88888 Dihedral
Steven D'Aprano於 2012年9月15日星期六UTC+8上午7時39分28秒寫道: > On Fri, 14 Sep 2012 15:16:47 -0600, Ian Kelly wrote: > > > > > If only there were a conceptually simpler way to do this. Actually, > > > there is. I give you: metadecorators! > > [code snipped but shown below] > > > Which I think is certain

Re: Batching HTTP requests with httplib (Python 2.7)

2012-09-15 Thread Cameron Simpson
On 14Sep2012 10:53, Chicken McNuggets wrote: | On 14/09/2012 03:31, Cameron Simpson wrote: | > On 13Sep2012 19:34, Chicken McNuggets wrote: | > | I'm writing a simple library that communicates with a web service and am | > | wondering if there are any generally well regarded methods for batching

Re: Least-lossy string.encode to us-ascii?

2012-09-15 Thread wxjmfauth
Le vendredi 14 septembre 2012 22:45:05 UTC+2, Terry Reedy a écrit : > On 9/14/2012 12:15 PM, wxjmfa...@gmail.com wrote: > > > > > PS Avoid Py3.3 :-) > > > > pps Start using 3.3 as soon as possible. It has Python's first fully > > portable non-buggy Unicode implementation. The second releas

Re: Moving folders with content

2012-09-15 Thread Nobody
On Sat, 15 Sep 2012 04:36:00 +, jyoung79 wrote: > I am working in both OS X Snow Leopard and Lion (10.6.8 and 10.7.4). > I'm simply wanting to move folders (with their content) from various > servers to the hard drive and then back to different directories on the > servers. > > I want to

Re: Decorators not worth the effort

2012-09-15 Thread Thomas Rachel
[Sorry, my Firefox destroyed the indent... Am 14.09.2012 22:29 schrieb Terry Reedy: In other words def make_wrapper(func, param): def wrapper(*args, **kwds): for i in range(param): func(*args, **kwds) return wrapper def f(x): print(x) f = make_wrapper(f, 2) f('simple') # is simpler, at least

Re: Decorators not worth the effort

2012-09-15 Thread Dieter Maurer
Dwight Hutto wrote at 2012-9-14 23:42 -0400: > ... >Reduce redundancy, is argumentative. > >To me, a decorator, is no more than a logging function. Correct me if >I'm wrong. Well, it depends on how you are using decorators and how complex your decorators are. If what you are using as decorating fu