Re: Python and Math

2014-05-22 Thread Frank Millman
wrote in message news:281f5806-8793-4fd2-877c-214927dda...@googlegroups.com... > > pip looked and saw that you already had it, so did nothing -- what did it > report? In this caes: > > 'pip install -U ipython[notebook]' > > might have worked: -U means upgrade even if I already have it. > Indee

Re: tkinter errors out without clear message

2014-05-22 Thread Serhiy Storchaka
21.05.14 20:19, Terry Reedy написав(ла): There is also the issue that TkVersion == 8.5 is underspecied -- there are multiple bugfix releases. root.call('info', 'patchlevel') returns more detailed info. -- https://mail.python.org/mailman/listinfo/python-list

转发: hi,How much time can transition to python3

2014-05-22 Thread who2are2...@gmail.com
hi, i learn python is 0.5 year, i'm so much love python, i come from non English speaking countries, Python2 coding problem has been troubling me, I started to learn the python3 now, But many libraries do not support python3, I know python3 publishing for many years. Why do so many libraries or do

Re: 转发: hi,How much time can transition to python3

2014-05-22 Thread Ben Finney
"who2are2...@gmail.com" writes: > i learn python is 0.5 year, > i'm so much love python, Welcome, you have found a very good programming language. I'm glad you like it. > i come from non English speaking countries, > Python2 coding problem has been troubling me, > I started to learn the python3

Perhaps it is because of your home page, still in the striking position put python2 download link,

2014-05-22 Thread lovePython999999
hi, i learn python is 0.5 year, i'm so much love python, i come from non English speaking countries, Python2 coding problem has been troubling me, I started to learn the python3 now, But many libraries do not support python3, I know python3 publishing for many years. Why do so many libraries or do

Can Python do this? First steps, links to resources or complete software referals appreciated.

2014-05-22 Thread ed . cottam
Hi, I'm an academic and I want to find/adapt/create a script that will grab abstracts (150-250 words of text) from Google Scholar search results and sort them by relevance (e.g. keywords, keyword combinations, anything other way you can think of). Any of you guys know of a script that does thi

Python is horribly slow compared to bash!!

2014-05-22 Thread Chris Angelico
Figure some of you folks might enjoy this. Look how horrible Python performance is! http://thedailywtf.com/Articles/Best-of-Email-Brains,-Security,-Robots,-and-a-Risky-Click.aspx Actually, probably a lot of you folks already read TDWTF, but maybe some don't (yet). ChrisA -- https://mail.python.

hashing strings to integers for sqlite3 keys

2014-05-22 Thread Adam Funk
I'm using Python 3.3 and the sqlite3 module in the standard library. I'm processing a lot of strings from input files (among other things, values of headers in e-mail & news messages) and suppressing duplicates using a table of seen strings in the database. It seems to me --- from past experience

Re: 转发: hi,How much time can transition to python3

2014-05-22 Thread lovePython999999
在 2014年5月22日星期四UTC+8下午5时38分57秒,Ben Finney写道: > " > > > > > i learn python is 0.5 year, > > > i'm so much love python, > > > > Welcome, you have found a very good programming language. I'm glad you > > like it. > > > > > i come from non English speaking countries, > > > Python2 coding pr

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Peter Otten
Adam Funk wrote: > I'm using Python 3.3 and the sqlite3 module in the standard library. > I'm processing a lot of strings from input files (among other things, > values of headers in e-mail & news messages) and suppressing > duplicates using a table of seen strings in the database. > > It seems t

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Chris Angelico
On Thu, May 22, 2014 at 9:47 PM, Adam Funk wrote: > I'm using Python 3.3 and the sqlite3 module in the standard library. > I'm processing a lot of strings from input files (among other things, > values of headers in e-mail & news messages) and suppressing > duplicates using a table of seen strings

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Tim Chase
On 2014-05-22 12:47, Adam Funk wrote: > I'm using Python 3.3 and the sqlite3 module in the standard library. > I'm processing a lot of strings from input files (among other > things, values of headers in e-mail & news messages) and suppressing > duplicates using a table of seen strings in the datab

Re: Python is horribly slow compared to bash!!

2014-05-22 Thread wxjmfauth
Le jeudi 22 mai 2014 12:54:22 UTC+2, Chris Angelico a écrit : > Figure some of you folks might enjoy this. Look how horrible Python > > performance is! > > > > http://thedailywtf.com/Articles/Best-of-Email-Brains,-Security,-Robots,-and-a-Risky-Click.aspx > > > > Actually, probably a lot of y

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Adam Funk
On 2014-05-22, Peter Otten wrote: > Adam Funk wrote: > >> I'm using Python 3.3 and the sqlite3 module in the standard library. >> I'm processing a lot of strings from input files (among other things, >> values of headers in e-mail & news messages) and suppressing >> duplicates using a table of see

Re: Can Python do this? First steps, links to resources or complete software referals appreciated.

2014-05-22 Thread William Ray Wing
On May 22, 2014, at 6:03 AM, ed.cot...@gmail.com wrote: > Hi, I'm an academic and I want to find/adapt/create a script that will grab > abstracts (150-250 words of text) from Google Scholar search results and sort > them by relevance (e.g. keywords, keyword combinations, anything other way > yo

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Adam Funk
On 2014-05-22, Chris Angelico wrote: > On Thu, May 22, 2014 at 9:47 PM, Adam Funk wrote: >> I'm using Python 3.3 and the sqlite3 module in the standard library. >> I'm processing a lot of strings from input files (among other things, >> values of headers in e-mail & news messages) and suppressing

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Adam Funk
On 2014-05-22, Tim Chase wrote: > On 2014-05-22 12:47, Adam Funk wrote: >> I'm using Python 3.3 and the sqlite3 module in the standard library. >> I'm processing a lot of strings from input files (among other >> things, values of headers in e-mail & news messages) and suppressing >> duplicates usi

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Chris Angelico
On Thu, May 22, 2014 at 11:41 PM, Adam Funk wrote: > On further reflection, I think I asked for that. In fact, the table > I'm using only has one column for the hashes --- I wasn't going to > store the strings at all in order to save disk space (maybe my mind is > stuck in the 1980s). That's a p

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Chris Angelico
On Thu, May 22, 2014 at 11:54 PM, Adam Funk wrote: >> >>> from hashlib import sha1 >> >>> s = "Hello world" >> >>> h = sha1(s) >> >>> h.hexdigest() >> '7b502c3a1f48c8609ae212cdfb639dee39673f5e' >> >>> int(h.hexdigest(), 16) >> 703993777145756967576188115661016000849227759454L > > That tie

Re: daemon.DaemonContext

2014-05-22 Thread wonko
I know it's 4 years later, but I'm currently battling this myself. I do exactly this and yet it doesn't appear to be keeping the filehandler open. Nothing ever gets written to logs after I daemonize! -- https://mail.python.org/mailman/listinfo/python-list

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Adam Funk
On 2014-05-22, Chris Angelico wrote: > On Thu, May 22, 2014 at 11:41 PM, Adam Funk wrote: >> On further reflection, I think I asked for that. In fact, the table >> I'm using only has one column for the hashes --- I wasn't going to >> store the strings at all in order to save disk space (maybe my

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread alister
On Thu, 22 May 2014 12:47:31 +0100, Adam Funk wrote: > I'm using Python 3.3 and the sqlite3 module in the standard library. I'm > processing a lot of strings from input files (among other things, values > of headers in e-mail & news messages) and suppressing duplicates using a > table of seen stri

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Adam Funk
On 2014-05-22, Chris Angelico wrote: > On Thu, May 22, 2014 at 11:54 PM, Adam Funk wrote: >> That ties in with a related question I've been wondering about lately >> (using MD5s & SHAs for other things) --- getting a hash value (which >> is internally numeric, rather than string, right?) out as

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Chris Angelico
On Fri, May 23, 2014 at 12:47 AM, Adam Funk wrote: >> I don't know that there is, at least not with hashlib. You might be >> able to use digest() followed by the struct module, but it's no less >> convoluted. It's the same in several other languages' hashing >> functions; the result is a string, n

Re: daemon.DaemonContext and logging

2014-05-22 Thread wonko
On Saturday, April 10, 2010 11:52:41 PM UTC-4, Ben Finney wrote: > pid = daemon.pidlockfile.TimeoutPIDLockFile( > "/tmp/dizazzo-daemontest.pid", 10) Has pidlockfile been removed? (1.6) -brian -- https://mail.python.org/mailman/listinfo/python-list

Re: daemon.DaemonContext

2014-05-22 Thread wonko
On Thursday, May 22, 2014 10:31:11 AM UTC-4, wo...@4amlunch.net wrote: > I know it's 4 years later, but I'm currently battling this myself. I do > exactly this and yet it doesn't appear to be keeping the filehandler open. > Nothing ever gets written to logs after I daemonize! Ok, made it work, a

Re: hashing strings to integers for sqlite3 keys

2014-05-22 Thread Peter Otten
Adam Funk wrote: > On 2014-05-22, Chris Angelico wrote: > >> On Thu, May 22, 2014 at 11:54 PM, Adam Funk wrote: > >>> That ties in with a related question I've been wondering about lately >>> (using MD5s & SHAs for other things) --- getting a hash value (which >>> is internally numeric, rather

Re: daemon.DaemonContext

2014-05-22 Thread Ethan Furman
On 05/22/2014 07:31 AM, wo...@4amlunch.net wrote: I know it's 4 years later, but I'm currently battling this myself. I do exactly this and yet it doesn't appear to be keeping the filehandler open. Nothing ever gets written to logs after I daemonize! You didn't include any context (important a

shebang & windows: call an extensionless git hook

2014-05-22 Thread Albert-Jan Roskam
Hi, I wrote the git pre-commit hook below. It is supposed to reject commits that contain large files (e.g. accidental commits by inexperienced users, think of "git add .") Anyway, I tried this under Linux, but the target platform is Windows. As per Git design the hook name *must* be "pre-comm

Re: All-numeric script names and import

2014-05-22 Thread Xavier de Gaye
On 05/21/2014 03:46 PM, Chris Angelico wrote: > If I have a file called 1.py, is there a way to import it? Obviously I > can't import it as itself, but in theory, it should be possible to > import something from it. I can manage it with __import__ (this is > Python 2.7 I'm working on, at least for

Re: All-numeric script names and import

2014-05-22 Thread Xavier de Gaye
On 05/22/2014 12:32 PM, Xavier de Gaye wrote: > import 1.py as module_1 on Python 2.7 (module_1 is not inserted in sys.modules): > > >>> import imp > >>> module_1 = imp.new_module('module_1') > >>> execfile('1.py', module_1.__dict__) > >>> del module_1.__dict__['__builtins__'] Oups.. should

Re: All-numeric script names and import

2014-05-22 Thread Chris Angelico
On Thu, May 22, 2014 at 8:32 PM, Xavier de Gaye wrote: > import 1.py as module_1 on Python 2.7 (module_1 is not inserted in > sys.modules): > import imp module_1 = imp.new_module('module_1') execfile('1.py', module_1.__dict__) del module_1.__dict__['__builtins__'] Heh, I think

Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread Aseem Bansal
I am working on a hobby project - a Bookmarker https://github.com/anshbansal/Bookmarker. Basically bookmarks like in webbrowser stored in a app. The twist is storage by categories. I have spent some time on choosing the correct tech for making this project but it seems it would be better to ta

Re: daemon.DaemonContext and logging

2014-05-22 Thread Mark H Harris
On 5/22/14 10:28 AM, wo...@4amlunch.net wrote: On Saturday, April 10, 2010 11:52:41 PM UTC-4, Ben Finney wrote: pid = daemon.pidlockfile.TimeoutPIDLockFile( "/tmp/dizazzo-daemontest.pid", 10) Has pidlockfile been removed? (1.6) -brian "Have you released the inertial dampener?

Re: Python is horribly slow compared to bash!!

2014-05-22 Thread Mark H Harris
On 5/22/14 5:54 AM, Chris Angelico wrote: Figure some of you folks might enjoy this. Look how horrible Python performance is! http://thedailywtf.com/Articles/Best-of-Email-Brains,-Security,-Robots,-and-a-Risky-Click.aspx > From TDWTF: Most of the interesting physics analysis code here is bas

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread John Gordon
In <6a3c5b20-bce5-4c95-b27f-3840e9cc7...@googlegroups.com> Aseem Bansal writes: > But I hit a snag today that webbrowser's won't allow client to open > hyperlinks with file protocol. I have both offline and online bookmarks > so that was a problem for me. What do you mean by saying "webbrowser'

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread Mark H Harris
On 5/22/14 1:54 PM, Aseem Bansal wrote: I am working on a hobby project - a Bookmarker{snip} hi, no django is not really the correct tool-set. Django is for server-side content management, but who knows, you might come up with a great hack (I don't want to discourage you). But, a straight p

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread Ian Kelly
On Thu, May 22, 2014 at 1:28 PM, John Gordon wrote: > In <6a3c5b20-bce5-4c95-b27f-3840e9cc7...@googlegroups.com> Aseem Bansal > writes: > >> But I hit a snag today that webbrowser's won't allow client to open >> hyperlinks with file protocol. I have both offline and online bookmarks >> so that w

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread John Gordon
In Ian Kelly writes: > > My web browser works just fine with links such as this: > > > > foo.html > It works if the document that contains the link is also opened from > the local filesystem, but browsers will refuse to follow the link if > it was served over http. Aha! I didn't know that.

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread Ethan Furman
On 05/22/2014 11:54 AM, Aseem Bansal wrote: I am working on a hobby project - a Bookmarker https://github.com/anshbansal/Bookmarker. Take a look at delicio.us -- it seems to be a similar type of experience. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: All-numeric script names and import

2014-05-22 Thread Rustom Mody
On Wednesday, May 21, 2014 7:16:46 PM UTC+5:30, Chris Angelico wrote: > If I have a file called 1.py, is there a way to import it? Obviously I > can't import it as itself, but in theory, it should be possible to > import something from it. I can manage it with __import__ (this is > Python 2.7 I'm w

Re: All-numeric script names and import

2014-05-22 Thread Chris Angelico
On Fri, May 23, 2014 at 12:08 PM, Rustom Mody wrote: > $ cat ا.py > x = 1 > def foo(x): print("Hi %s!!" % x) Yeah, no thanks. I am not naming my scripts in Arabic. :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list