Hello.

2016-01-17 Thread Hmood Js
cmd won't recognize python at all I've checked several times , and I don't understand what's wrong Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Python 2.4

2011-12-20 Thread Maverick JS
I'd recommend starting with http://learnpythonthehardway.org/book/ by "Zed Shaw" or Beginning Python Using Python 2.6 and Python 3.1 by "James Payne" I'd say learning Python 2.6 would be better than 2.4, since it's really old. -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I customize builtin module search path to prefix/lib to prefix/lib64?

2008-09-30 Thread js
In addition to that, .pth cannot prepend search path. All thing it can do is appending to it. In my case, I have to put lib64 before lib/. On 9/26/08, js <[EMAIL PROTECTED]> wrote: > For 64bit python, there's no need to look at lib/lib-dynload because > libraries for 64bit sho

Re: How can I customize builtin module search path to prefix/lib to prefix/lib64?

2008-09-25 Thread js
wrote: > On Sep 25, 10:41 am, js <[EMAIL PROTECTED]> wrote: >> Hi list, >> >> Is it possible to change module search path (PYTHONPATH) built-in to >> Python interpreter? >> I thought I can change it with configure --libdir but it didn't work for me. >&

How can I customize builtin module search path to prefix/lib to prefix/lib64?

2008-09-25 Thread js
Hi list, Is it possible to change module search path (PYTHONPATH) built-in to Python interpreter? I thought I can change it with configure --libdir but it didn't work for me. I also tried patching around python source tree replacing lib to lib64 but it didn't work either. Adjusting sys.path direc

Re: How do I convert a PyObject to string in C++?

2008-09-22 Thread js
PyString_AsString returns a c string. Just feed it to std::string http://docs.python.org/api/stringObjects.html#l2h-472 On Tue, Sep 23, 2008 at 11:32 AM, <[EMAIL PROTECTED]> wrote: > I have a PyObject, say 'Hello World' , a string, > How do I convert it to a string in C++? > Thanks in advance! >

Quality of Standard Modules

2008-08-08 Thread js
I read an interview with Guido at http://www.techworld.com.au/article/255835/a-z_programming_languages_python and that's very interesting. In that article, he said "there are also a lot of modules that aren't particularly well thought-out, or serve only a very small specialized audience, or don't

Py_BuildValue for char **?

2008-07-09 Thread js
Hi, I'm writing a wrapper module of C API. To make a C struct data avaiable to Python, I need to map C struct into a PyObject. I'm thinking that I use a tuple or dict to represent the struct but a problem is one of the members of the struct is char **, which is not supported by Py_BuildValue. Is t

Re: The best way to package a Python module?

2008-06-17 Thread js
Thanks everyone for details. I'll try stealing some of the good bits of python-central of debian for my purpose. On Mon, Jun 16, 2008 at 10:43 AM, Ben Finney <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > >> >What has changed is that the tools in common use for Debi

Re: The best way to package a Python module?

2008-06-15 Thread js
By "package", I meant APT, Ports for BSD, MacPorts, etc. On Mon, Jun 16, 2008 at 1:16 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 16 Jun 2008 01:01:47 +0900, js <[EMAIL PROTECTED]> wrote: >> >> Hi list, >> >> I'm trying to bui

The best way to package a Python module?

2008-06-15 Thread js
Hi list, I'm trying to build a package for python modules. When I just wanted to have a package for Python2.5, this is an easy task, but in most cases, it's not enough. Sometimes I need python2.4, 2.5, 2.6 or 3.0 etc. The problem is coming from the fact that python installs its modules into versi

Re: TextWrapper keepking line breaks?

2008-03-11 Thread js
Hi Arnaud, Great. Thanks for your help! On Tue, Mar 11, 2008 at 10:27 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > On Mar 10, 11:31 pm, js <[EMAIL PROTECTED]> wrote: > > Hi list, > > > > Can I make TextWrapper keep line breaks in the text? > >

TextWrapper keepking line breaks?

2008-03-10 Thread js
Hi list, Can I make TextWrapper keep line breaks in the text? For example, >>> s = "spam\nham" >>> print wrap(s) spam ham As far as I can tell, there seems no way to do this, but before writing my own solution, I want to know whether the solution already exists or not. Thanks. -- http://mail.

Beautiful Code in Python?

2008-03-02 Thread js
Hi, Have you ever seen Beautiful Python code? Zope? Django? Python standard lib? or else? Please tell me what code you think it's stunning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Book Recomendations

2008-03-01 Thread js
I wonder why nobody mension Python Cookbook yet. http://www.oreilly.com/catalog/pythoncook2/ Web version: http://aspn.activestate.com/ASPN/Cookbook/Python/ and Python Standard Library http://www.oreilly.com/catalog/pythonsl/ http://effbot.org/zone/librarybook-index.htm On Sun, Mar 2, 2008 at 4:09

Re: Official IRC channel for Python?

2008-02-28 Thread js
I saw bad guys on IRC a few days ago, but it was not a problem because Ignore user function in IRC client makes his/her messages invisible. BTW,who's the maintainer of the channel? On 27 Feb 2008 11:34:54 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Guilherme Polo" <[EMAIL PROTECT

Re: Official IRC channel for Python?

2008-02-27 Thread js
> You can't join #python on freenode without identifying with nickserv > first. Why is that? I can join #perl, #php, #ruby, #mysql, #postgres without registration. What advantage does it have? and the advantage really worth? If #python were the developer's room, I'd say it's reasonable, but that

Re: Official IRC channel for Python?

2008-02-23 Thread js
No. Actually, i'm very new to IRC. On Sun, Feb 24, 2008 at 2:55 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > js wrote: > > Really? maybe I'm been blocked from it... > > thanks. > > > Currently 479 users. Have you been blocked from many channels? >

Re: Official IRC channel for Python?

2008-02-23 Thread js
Really? maybe I'm been blocked from it... thanks. On 23 Feb 2008 20:37:42 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > js <[EMAIL PROTECTED]> writes: > > I tried #python irc.freenode.net > > That has always worked for me. > > -- &

Official IRC channel for Python?

2008-02-23 Thread js
Howdy, I was wondering if there's official IRC channel for Python. I tried #python irc.freenode.net and irc.openproject.net with no luck. Could you please give me some suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread js
Great... I guess I should have learned more about ElementTree. In anyway, Thanks all. You all convinced me, really. On 2/14/08, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Torsten Bronger wrote: > > js writes: > > > >> Trivial? > >> More than XML::A

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread js
Trivial? More than XML::Atom::Feed? http://search.cpan.org/~miyagawa/XML-Atom-0.28/lib/XML/Atom/Feed.pm On 2/14/08, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > > Terran Melconian writes: > > > On 2008-02-11, js <[EMAIL PROTECTED]> wrote: > &

Is there any Generic RSS/ATOM generator in Python?

2008-02-11 Thread js
Hi, I'm looking for RSS/ATOM generator I can use in Python. I searched on pypi and the other places but I couldn't find any options on this. (I found many parsers, though) Is there any de-fact standard RSS/ATOM generator? (especially, I'd like to create Atom's) Do I have to do it myself from scrat

Re: TheSchwartz in Python?

2008-02-06 Thread js
Cool, but sched saves job in memory... cron can't be an option. It's just a scheduler not a job queue. On Feb 7, 2008 1:36 AM, Larry Bates <[EMAIL PROTECTED]> wrote: > > js wrote: > > Hi, > > > > I'm looking for a job queue manager in Python, like The

TheSchwartz in Python?

2008-02-06 Thread js
Hi, I'm looking for a job queue manager in Python, like TheSchwartz.[1]. I found there's TheSchawrtz server, RPC server powered by Gearman, to which Python/Ruby can connect [2], but setting up two languages env is a little cumbersome to me. Is there any alternative to that in Python? The requirem

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-02 Thread js
And why the HELL people prefer answering this kind of question to normal ones? (Including me...) On Jan 31, 2008 9:40 AM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > I do not understand why no one has answered the following question: > > Has anybody worked with Gene Expression Programming

Re: urllib supports javascript

2008-02-01 Thread js
AFAIK, nothing. How abount letting a browser do it? By using pamie [1] or selenium, you can drive a browser from python. [1] http://pamie.sourceforge.net/ On Feb 2, 2008 11:07 AM, J. Peng <[EMAIL PROTECTED]> wrote: > hello, > > Which useragent lib supports javascript? > I know something about the

Re: Looking for web software in Python.

2007-09-18 Thread js
http://wiki.python.org/moin/WebApplications?highlight=%28%28PythonWikiEngines%29%29 Hope this helps On 9/18/07, Kevin Ar18 <[EMAIL PROTECTED]> wrote: > > Are any of the following pieces of web software available in Python (under a > non-copyleft license like BSD or MIT or Python license)? > > >

Re: A short question about non-ascii characters in list

2007-09-17 Thread js
Thank you for your quick reply. > It's intentional. __str__ of a list uses the __repr__ of its > elements. This helps reduce confusion (e.g., between ['a', 'b, c'] > and ['a, b', 'c']). That's make sence, but it's also true that sometimes we want to see the contents of a list in pretty format. S

A short question about non-ascii characters in list

2007-09-16 Thread js
>>> print u"äöü" äöü >>> print [u"äöü"] [u'\xe4\xf6\xfc'] Python seems to treat non-ASCII chars in a list differently from the one in the outside of a list. I think this behavior is so inconvenient and actually makes debugging work harder. Is this an intentional? Is there any doc discussing about

RFC-3986 or 2396 implementation in Python?

2007-09-15 Thread js
Hi list. Is there any module that is compatible with RFC-3986 or 2396, which is like Perl's URI module(http://search.cpan.org/~gaas/URI-1.35/URI.pm)? I like to normalize lots of URIs I've got in my database to make them all unique ones. Thank you in advance. -- http://mail.python.org/mailman/l

Re: How to get headers in urllib2 response

2007-09-15 Thread js
How about using httplib? http://docs.python.org/lib/httplib-examples.html HTTPResponse has getheaders() method, too. On 9/15/07, Johny <[EMAIL PROTECTED]> wrote: > Can anyone provide an example how to find out the return code and > header from an urllib2 request? > For example > response = url

Re: how to join array of integers?

2007-09-15 Thread js
print ''.join([str(i) for i in [1,2,3]]) On 9/15/07, Summercool <[EMAIL PROTECTED]> wrote: > i think in Ruby, if you have an array (or list) of integers > > foo = [1, 2, 3] > > you can use foo.join(",") to join them into a string "1,2,3" > > in Python... is the method to use ",".join() ? but the

Encryption recommendation

2007-07-31 Thread JS
Can someone help me find the proper way to do AES encryption/decryption using Python? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you htmlentities in Python

2007-06-04 Thread js
Thanks you Matimus. That's exactly what I'm looking for! Easy, clean and customizable. I love python :) On 6/5/07, Matimus <[EMAIL PROTECTED]> wrote: > On Jun 4, 6:31 am, "js " <[EMAIL PROTECTED]> wrote: > > Hi list. > > > > If I'm not m

How do you htmlentities in Python

2007-06-04 Thread js
Hi list. If I'm not mistaken, in python, there's no standard library to convert html entities, like & or > into their applicable characters. htmlentitydefs provides maps that helps this conversion, but it's not a function so you have to write your own function make use of htmlentitydefs, probabl

Re: howto check does module 'asdf' exist? (is available for import)

2007-05-21 Thread js
Why not just use try? Trying to import a module is a python idiom. http://www.diveintopython.org/file_handling/index.html On 21 May 2007 06:17:16 -0700, dmitrey <[EMAIL PROTECTED]> wrote: > howto check does module 'asdf' exist (is available for import) or no? > (without try/cache of course) > Thx

Re: Closing socket file descriptors

2007-05-20 Thread js
Hi Yang. > Hi, thanks for your answer. Should I just use that object's close() > method? Is it safe to assume that objects that have fileno() also have > close()? (Statically typed interfaces would come in handy now.) > I'm writing a simple asynchronous I/O framework (for learning purposes - > I'm

Re: Closing socket file descriptors

2007-05-20 Thread js
Hello, Yang. You're not supposed to use os.open there. See the doc at http://docs.python.org/lib/os-fd-ops.html Is there any reason you want to use os.close? On 20 May 2007 04:26:12 GMT, Yang <[EMAIL PROTECTED]> wrote: > Hi, I'm experiencing a problem when trying to close the file descriptor > f

Re: Popen and wget, problems

2007-05-13 Thread js
Hi Jesse. > cmd_set = ['wget', '-nv', '-O dir/cpan.txt', 'http://search.span.org'] [snip] >proc = Popen(cmd_set, stdout=PIPE, stderr=PIPE) wget will treat this as $ wget -nv '-O dir/cpan.txt' "http://search.cpan.org"; And will emit the following error because there's no pathname ' dir/cpan.txt'.

Re: file.read() returns an emtpy even if its currenet position is not at the end

2007-04-22 Thread js
e: > On Apr 22, 6:51 pm, "js " <[EMAIL PROTECTED]> wrote: > > Hi list. > > > > I'm writing a tail -f like program in python > > and I found file.read() doesn't work as I think it should. > > > > Here's the code illustrating

file.read() returns an emtpy even if its currenet position is not at the end

2007-04-22 Thread js
Hi list. I'm writing a tail -f like program in python and I found file.read() doesn't work as I think it should. Here's the code illustrating my problem. ### #!/usr/bin/env python import os, sys filename = "test.out" f = open(filename, "w+") f.write("Hello") f.flush() f.seek(0, 2) statinfo =

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread js
The only way you can do is rermove python2.4.4's files manually. I suggest you to use MacPorts or Fink. With MacPort, you can uninstall python2.4 by doing $ port uninstall python24 And Installation is $ port install python25 On 24 Mar 2007 10:30:28 -0700, Robert Hicks <[EMAIL PROTECTED]> wrot

Re: print a ... z, A ... Z, "\n"' in Python

2007-03-03 Thread js
> > Maybe we don't want char range If string constants would be rich > > enough. > > But as soon as we want a string that doesn't correspond to any > pre-defined constants, we're hosed. For example, there isn't > a constant that would correspond to this Perl-ism: > > print l ... w, e ... j, L ..

Re: print a ... z, A ... Z, "\n"' in Python

2007-03-03 Thread js
I forgot to cc pythonlist... # Thanks for you quick reply. I didn't know any string constants. >From Python Library reference, 4.1.1 String constants: letters The concatenation of the strings lowercase and uppercase described below. The specific value is locale-dependen

Re: print a ... z, A ... Z, "\n"' in Python

2007-03-03 Thread js
> But note that you return the last item of the range too, and that goes > against the semantic of the usual Python range/xrange, so you may want > to call this function with another name. That makes sense. 100% agree with you. > Maybe there are better ways to solve this problem. Maybe a way to >

print a ... z, A ... Z, "\n"' in Python

2007-03-03 Thread js
HI guys, How do you write Perl's print a ... z, A ... Z, "\n"' in Python In Python? A way I came up with is the following, but I'm sure this is ugly. ''.join(chr(c) for c in (range(ord('a'), ord('z')+1) + range(ord('A'), ord('Z')+1))) or crange = lambda c1, c2: [ chr(c) for c in

Re: How to find out if another process is using a file

2007-01-18 Thread js
How about using lock? Let writing process locks the files before writing, and unlock after the job's done. I think it'd work file in most environment. On 1/19/07, Tom Wright <[EMAIL PROTECTED]> wrote: > I'm writing a program which reads a series of data files as they are dumped > into a director

Can I beat perl at grep-like processing speed?

2006-12-29 Thread js
Just my curiosity. Can python beats perl at speed of grep-like processing? $ wget http://www.gutenberg.org/files/7999/7999-h.zip $ unzip 7999-h.zip $ cd 7999-h $ cat *.htm > bigfile $ du -h bigfile du -h bigfile 8.2Mbigfile -- grep.pl -- #!/usr/local/bin/perl open(F, 'bigfile

Re: regular expression

2006-12-24 Thread js
I'm a great fan of regexp because it has great power and flexibility. if you don't like it I suggest you to read "Mastering Regular Expressions". http://www.oreilly.com/catalog/regex3/ Yes, sometimes it might be hard to understand bites you but if you use it correctly, it works great. On 18 Dec 2

Where can I find good python code?

2006-10-13 Thread js
Hi, I've learned basics of Python and want to go to the next step. So I'm looking for good python examples I steal good techniques from. I found Python distribution itself contains some examples in Demo directory. I spent some time to read them and I think they're good but seemed not so practica

Re: prefix search on a large file

2006-10-13 Thread js
recursive-function to fix up my big-messed-list. It stops immediately because of 'RuntimeError: maximum recursion limit exceeded' I hope this trial-and-errors getting me good place... anyway, thank you. On 10/13/06, Peter Otten <[EMAIL PROTECTED]> wrote: > js wrote: > > > By

Re: prefix search on a large file

2006-10-12 Thread js
By eliminating list cloning, my function got much faster than before. I really appreciate you, John. def prefixdel_recursively2(alist): if len(alist) < 2: return alist first = alist.pop(0) unneeded = [no for no, line in enumerate(alist) if line.startswith(first)] adjust=0

Re: prefix search on a large file

2006-10-12 Thread js
Thank you for the quick reply. Here're the exact code I executed. (including your code) #!/usr/bin/env python from pprint import pprint as pp data = [ 'foo bar baz', 'foo bar', 'foo', 'food', 'food', # duplicate 'xyzzy', 'plugh', 'xyzzy and plugh are magic', '',

Re: python's newbie question

2006-10-12 Thread js
http://mail.python.org/pipermail/python-list/2004-May/221591.html HTH -- http://mail.python.org/mailman/listinfo/python-list

prefix search on a large file

2006-10-12 Thread js
Hello, list. I have a list of sentence in text files that I use to filter-out some data. I managed the list so badly that now it's become literally a mess. Let's say the list has a sentence below 1. "Python has been an important part of Google since the beginning, and remains so as the system

Re: Sort by domain name?

2006-10-02 Thread js
> How about sorting the strings as they are reversed? > > urls = """\ > http://mail.google.com > http://reader.google.com > http://mail.yahoo.co.uk > http://google.com > http://mail.yahoo.com""".split("\n") > > sortedList = [ su[1] for su in sorted([ (u[::-1],u) for u in urls ]) ] > > for url in so

Re: Sort by domain name?

2006-10-02 Thread js
On 2 Oct 2006 08:56:09 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > js: > > All I want to do is to sort out a list of url by companyname, > > like oreilly, ask, skype, amazon, google and so on, to find out > > how many company's url the list contain. &

Re: Sort by domain name?

2006-10-02 Thread js
> Gentle reminder: is this homework? And you can expect better responses > if you show youve bootstrapped yourself on the problem to some extent. Sure thing. First I tried to solve this by using a list of domain found at http://www.neuhaus.com/domaincheck/domain_list.htm I converted this to a li

Re: Sort by domain name?

2006-10-02 Thread js
Thanks for your quick reply. yeah, it's a hard task and unfortunately even google doesn't help me much. All I want to do is to sort out a list of url by companyname, like oreilly, ask, skype, amazon, google and so on, to find out how many company's url the list contain. -- http://mail.python.org/

Sort by domain name?

2006-10-02 Thread js
Hi list, I have a list of URL and I want to sort that list by the domain name. Here, domain name doesn't contain subdomain, or should I say, domain's part of 'www', mail, news and en should be excluded. For example, if the list was the following --