I need some advice/help on running my scripts

2005-01-01 Thread Sean
For the last couple of months I have been reading and working throught the examples in Magnus Lie Hetland's Book "Practical Python" This for all practical purposes is the first computer programming language I have spent any time at learning, so much of what I have covered in the book was for the f

? about file() and open()

2005-01-02 Thread Sean
Was wondering if there was any difference between these two functions. I have read some text that said file() wasn't introduced until 2.2 and that it was synonymous with open(). Does this mean that I should be using file() where I used open() before? Sean Morris -- http://mail.pytho

Re: list item's position

2005-01-19 Thread Sean
Not sure if this is what you are looking for but... >>> li = ['this','is','a','list','of','strings'] >>> li = [l for l in li if li.index(l) >= li.index('a')] >>> li ['a', 'list

Calling a function from module question.

2005-02-15 Thread Sean
Is there any way I could have the following work? First I would have a module define a function to do something like print some data. - module_name.py - [snip] def print_this(data): print "This is the data: %s" %data [/snip] - Then I would have a scri

Re: Calling a function from module question.

2005-02-15 Thread Sean
> Sean wrote: > >> Then I would have a script that uses the >> print_this function defined in the module >> without using the module name in the call. > > > > from module_name import print_this > > or, even: > > from module_name import print_this

Re: Calling a function from module question.

2005-02-15 Thread Sean
>>>from module_name import print_this >>> >>>or, even: >>> >>>from module_name import print_this as other_nice_name >> >> So what if I have a whole bunch of functions - say 25 of them. >> Is there a way to do this without naming each function? > > Yes [1], but it's basically deprecated and you shou

Re: Rookie Question: Passing a nested list into a function?

2005-04-14 Thread Sean
Brett, Hard to tell exactly what you're trying to do here, but it looks like you'd be better served using one of the built in python data structures. For example: If you're trying to compare some elements of these textfiles that are broken into titles, and contents for each file, try something li

python's library support

2006-02-03 Thread Sean
I am a newbie in python, and I have a feeling that python provides less library support than perl www.cpan.org This seems a big discussion topic. I want to know if there is extensive algorithm library support in python. I know there is a pretty neat module in perl to implement graph theory. Is th

help reading cookie values

2007-07-13 Thread Sean
I am trying to read a cookie I set but I am not sure if I really set it correctly or I am not reading it correctly. I was given the following instructions to set the cookie. It appears to be working because in Firefox browser I see the cookie listed for my domain > you set a cookie in a pythonsc

Re: Python dictionary size/entry limit?

2009-02-21 Thread Sean
that access to the database uses the same methods as python dictionaries. Sean -- http://mail.python.org/mailman/listinfo/python-list

3.0 - bsddb removed

2009-03-22 Thread Sean
Anyone got any thoughts about what to use as a replacement. I need something (like bsddb) which uses dictionary syntax to read and write an underlying (fast!) btree or similar. Thanks. Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: very large dictionary

2008-08-01 Thread Sean
open, the programing interface is identical to a normal dictionary. http://docs.python.org/lib/bsddb-objects.html Sean -- http://mail.python.org/mailman/listinfo/python-list

Python Web App

2010-12-22 Thread Sean
Anybody know where I can find a Python Development Environment in the form of a web app for use with Chrome OS. I have been looking for a few days and all i have been able to find is some old discussions with python developers talking about they will want one for the OS to be a success with them. -

Re: Python Web App

2010-12-22 Thread Sean
is on test, what kind of app do you want create? > > 2010/12/22, Sean : > > > Anybody know where I can find a Python Development Environment in the > > form of a web app for use with Chrome OS. I have been looking for a > > few days and all i have been able to fin

Re: Python Web App

2010-12-22 Thread Sean
Forgot to point out that Chrome OS has no local storage accessable to the user. Hence why I need a web based solution. On Dec 22, 8:51 pm, Sean wrote: > I am wanting to learn python and I am test a Chrome OS notebook at the > same time so I need something that will atleast tell me if I ha

Re: Python Web App

2010-12-26 Thread Sean
my mom because all she really does is check her email and Facebook so it was perfect for her. Thank You for all the responses they were a great help with me testing the notebook. On Dec 25, 9:02 pm, Katie T wrote: > On Wed, Dec 22, 2010 at 9:43 PM, Sean wrote: > > Anybody know w

Best way to add a "position" value to each item in a list

2009-07-09 Thread Sean
I have a huge list, 10,000,000+ items. Each item is a dictionary with fields used to sort the list. When I have completed sorting I want to grab a page of items, say 1,000 of them which I do easily by using list_data[x:x+1000] Now I want to add an additional key/value pair to each dictionary in

Re: Best way to add a "position" value to each item in a list

2009-07-09 Thread Sean
On Jul 9, 1:16 pm, Sean wrote: > I have a huge list, 10,000,000+ items.  Each item is a dictionary with > fields used to sort the list.  When I have completed sorting I want to > grab a page of items, say 1,000 of them which I do easily by using > list_data[x:x+1000] > > No

Re: Best way to add a "position" value to each item in a list

2009-07-09 Thread Sean
On Jul 9, 1:16 pm, Sean wrote: > I have a huge list, 10,000,000+ items.  Each item is a dictionary with > fields used to sort the list.  When I have completed sorting I want to > grab a page of items, say 1,000 of them which I do easily by using > list_data[x:x+1000] > > No

Re: Timsort in Cpython

2013-06-19 Thread sean . westfall
On Sunday, June 16, 2013 1:16:02 PM UTC-7, Dennis Lee Bieber wrote: > On Sun, 16 Jun 2013 09:15:11 -0700 (PDT), alphons...@gmail.com declaimed > > the following: > > > > >sorry about that. I'm new to google groups. I'm trying to make sense of > >python's implementation of timsort through cpyth

Re: Timsort in Cpython

2013-06-19 Thread sean . westfall
On Sunday, June 16, 2013 1:33:17 PM UTC-7, Ian wrote: > On Sat, Jun 15, 2013 at 10:05 PM, wrote: > > > Yes I've read it. Very interesting read. There are other resources too > > online that make it very clear, for instance the wikipedia articles is > > pretty good. > > > > > > Though, if any

Re: rmtree message

2017-09-13 Thread Sean DiZazzo
On Wednesday, September 13, 2017 at 12:06:20 PM UTC-7, larry@gmail.com wrote: > I have a script that creates a tmp dir, create a lot of files in it, > and when done, does a rmtree on the dir. When it does that I get this > message: > > shell-init: error retrieving current directory: getcwd: c

Re: Python dress

2017-09-13 Thread Sean DiZazzo
On Tuesday, September 12, 2017 at 9:18:12 AM UTC-7, larry@gmail.com wrote: > Not too many females here, but anyway: > > https://svahausa.com/collections/shop-by-interest-1/products/python-code-fit-flare-dress > > (And if any guys want to wear this, there's nothing wrong with that.) I'm going

Re: Python dress

2017-09-13 Thread Sean DiZazzo
On Wednesday, September 13, 2017 at 3:02:18 PM UTC-7, bream...@gmail.com wrote: > On Wednesday, September 13, 2017 at 10:43:47 PM UTC+1, Sean DiZazzo wrote: > > On Tuesday, September 12, 2017 at 9:18:12 AM UTC-7, larry@gmail.com > > wrote: > > > Not too many

Re: A good way to unpack a matrix

2017-09-13 Thread Sean DiZazzo
On Wednesday, September 13, 2017 at 7:53:25 PM UTC-7, Andrew Zyman wrote: > hello, > is there a better approach to populating a function in this situation? > > res = self.DB.getPrice(): # returns array of 3x2 always. symbol_id, > symbol, price. > > var1 = self.AFunction(symbols=res[0][2] + '.'

Re: the core values of the Python "platform"

2017-09-13 Thread Sean DiZazzo
On Wednesday, September 13, 2017 at 6:16:58 AM UTC-7, leam hall wrote: > On Wed, Sep 13, 2017 at 9:08 AM, Darin Gordon wrote: > > > Bryan Cantrill gave an interesting talk recently at a Node conference about > > "platform values" [1]. The talk lead me to think about what the core values > > of th

Re: "tkinter"

2017-09-13 Thread Sean DiZazzo
On Wednesday, September 13, 2017 at 7:21:25 PM UTC-7, Grant Edwards wrote: > On 2017-09-13, Ben Finney wrote: > > > The toolkit in question is named “tk”, which I have only ever known to > > be pronounced “tee kay”. > > > > The rest of the word is an abbreviation of “interface”. > > > > So, to me

Create an alias to an attribute on superclass

2018-02-01 Thread Sean DiZazzo
Hi! I basically just want to create an alias to an attribute on an item's superclass. So that after I create the subclass object, I can access the alias attribute to get the value back. class Superclass(object): def __init__(self, value): """ I want to pass x by refere

Re: Create an alias to an attribute on superclass

2018-02-01 Thread Sean DiZazzo
On Thursday, February 1, 2018 at 10:37:32 AM UTC-8, Chris Angelico wrote: > On Fri, Feb 2, 2018 at 5:22 AM, Sean DiZazzo wrote: > > Hi! > > > > I basically just want to create an alias to an attribute on an item's > > superclass. So that after I create the s

Re: Create an alias to an attribute on superclass

2018-02-01 Thread Sean DiZazzo
On Thursday, February 1, 2018 at 10:23:06 AM UTC-8, Sean DiZazzo wrote: > Hi! > > I basically just want to create an alias to an attribute on an item's > superclass. So that after I create the subclass object, I can access the > alias attribute to get the value back. >

Re: a simple question

2021-07-29 Thread Sean DiZazzo
On Tuesday, July 27, 2021 at 5:05:27 AM UTC-7, Terry Reedy wrote: > On 7/26/2021 6:19 PM, Glenn Wilson via Python-list wrote: > > I recently downloaded the latest version of python, 3.9.6. Everything works > > except, the turtle module. I get an error message every time , I use basic > > command

Re: [Errno 2] No such file or directory:

2021-07-30 Thread Sean DiZazzo
On Thursday, July 29, 2021 at 7:42:58 AM UTC-7, joseph pareti wrote: > indeed. There are better options than the one I attempted. Thanks for the > advice > > Am Mi., 28. Juli 2021 um 18:19 Uhr schrieb Chris Angelico >: > > On Thu, Jul 29, 2021 at 2:10 AM joseph pareti > > wrote: > > > > > >

Re: Defining a Python enum in a C extension - am I doing this right?

2021-08-03 Thread Sean DiZazzo
On Tuesday, August 3, 2021 at 3:04:19 AM UTC-7, Bartosz Golaszewski wrote: > On Sat, Jul 31, 2021 at 3:01 PM Bartosz Golaszewski wrote: > > > > On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > > > > > 23.07.21 11:20, Bartosz Golaszewski пише: > > > > I'm working on a Python C exte

Re: Farewell to Rob Collins

2016-11-16 Thread Sean Son
Rest in Peace Rob On Wed, Nov 16, 2016 at 12:48 PM, Ben Finney wrote: > "M.-A. Lemburg" writes: > > > Rob was a true Pythonista from the heart. He will always be remembered > > for his humor, great spirit and kindness. > > Robert and I had many conversations about the Bazaar version control > s

python 2 urlopen vs python 3 urlopen

2018-08-27 Thread Sean Darcy
gt; from urllib.request import urlopen >>> res = urlopen('https://api.ipify.org').read() >>> print(res) b'ww.xxx.yyy.zzz' I'm expecting the python 2 result, just the ip address. How can I get python 3 just to give the address, and not include b'

Strange Python related errors for androwarn.py. Please help!

2016-05-24 Thread Sean Son
hello all I am testing out a script called androwarn.py, which I downloaded from: https://github.com/mz/androwarn using the instructions found on: https://github.com/mz/androwarn/wiki/Installation When I ran the following commands to test the APK for AirBNB: python androwarn.py -i S

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-24 Thread Sean Son
Thanks for the reply. Looks like I am screwed on this one lol On Tue, May 24, 2016 at 3:31 PM, MRAB wrote: > On 2016-05-24 20:04, Sean Son wrote: > >> hello all >> >> I am testing out a script called androwarn.py, which I downloaded from: >> >> https://git

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-26 Thread Sean Son
no idea how I should fix this error. All help is greatly appreciated! Thanks On Tue, May 24, 2016 at 3:46 PM, Sean Son wrote: > Thanks for the reply. > > Looks like I am screwed on this one lol > > On Tue, May 24, 2016 at 3:31 PM, MRAB wrote: > >> On 2016-

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-26 Thread Sean Son
: https://github.com/mz/androwarn/blob/master/androwarn.py Hopefully those help in any troubleshooting steps that you all recommend to me! Thank you! On Thu, May 26, 2016 at 1:25 PM, Sean Son wrote: > Hello all > > From what I can tell from the error message that I received, line 257

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-27 Thread Sean Son
Hello Thank you for your reply. So the error isnt due to a bug in function itself? It is due to a possible error in the Android APK file? If that is the case, it would take a while to figure this out. I tried contacted the author of the project but I have yet to hear back from him . Thanks On

best Pythonic way to do this sort: Python newb

2005-10-09 Thread Sean Berry
Hello all I have build a list that contains data in the form below -- simplified for question -- myList = [[value1, value2, value3],[value1, value2, value3], ...] I have a function which takes value3 from the lists above and returns another value. I want to use this returned value to sort the li

Re: best Pythonic way to do this sort: Python newb

2005-10-09 Thread Sean Berry
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Sean Berry" <[EMAIL PROTECTED]> writes: >> myList = [[value1, value2, value3],[value1, value2, value3], ...] >> >> I have a function which takes value3 from the

question about timestamp and MySQLdb

2005-10-19 Thread Sean Berry
I am using MySQLdb to connect to a database and retrieve a timestamp from a table. The problem is I want the timestamp as a long, unformatted and all. In the table I have a timestamp like this 20051019111617 But, when I retrieve the value and print it I get 2005-10-19 11:16:17 I want the nume

tkinter blues (greens, reds, ...)

2005-10-28 Thread Sean McIlroy
hi all i recently wrote a script that implements a puzzle. the interface mostly consists of a bunch of colored disks on a tkinter canvas. the problem is that the disks change their colors in ways other than the way they're supposed to. it certainly isn't just a bug in my script, since i can someti

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Sean McIlroy
i'm using the canned colors ("pink", "orange", etc). should i try changing to explicit color specifications to see if that makes a difference? i'm not sure what the other guy meant by a "soft toy", but i take it the idea is to try and construct a correctness proof for the script, and see what keeps

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Sean McIlroy
hi ron changing from english words to hexadecimal numerals did the trick for me, so everything's cool now. thanks for looking at it. peace -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of "self."

2005-01-07 Thread Sean Ross
"BJörn Lindqvist" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Thank you for your replies. But they don't deal with my original question. :) I have read the thousands of posts all saying "self is good" and they are right. But this time I want to be different m-kay? I figure that ther

Re: tuples vs lists

2005-01-08 Thread Sean Dolan
Synthesis System to learn pronunciations sometimes. The American english voice is quite accurate. -- Sean Dolan -- http://mail.python.org/mailman/listinfo/python-list

mysterious buggy behavior

2005-01-08 Thread Sean McIlroy
While fiddling with a little script I ran into a problem that baffles me completely. Maybe I'm missing something completely obvious, and somebody out there can diagnose the problem at a glance. Anyway, that's the hope. Here's the code (it plays tic tac toe): """ Something goes wrong with the "tim

Old Paranoia Game in Python

2005-01-10 Thread Sean P.Kane
nostalgia. I may get around to posting this at http://homepage.mac.com/spkane/ or http://www.spkane.org/, but for now here it is. Improvements or corrections, welcome. Thanks, Sean -Cut Here- #!/usr/bin/env python # # # -*- encoding = 

unicode mystery

2005-01-10 Thread Sean McIlroy
I recently found out that unicode("\347", "iso-8859-1") is the lowercase c-with-cedilla, so I set out to round up the unicode numbers of the extra characters you need for French, and I found them all just fine EXCEPT for the o-e ligature (oeuvre, etc). I examined the unicode characters from 0 to 90

reusing Tkinter Canvases

2005-01-14 Thread Sean McIlroy
I'd like to save one Tkinter Canvas in order to use it on another Canvas later. The problem is that it gets saved as EPS but it needs to be GIF to be reuseable. How can I convert that format? Peace, STM -- http://mail.python.org/mailman/listinfo/python-list

Re: Java Integer.ParseInt translation to python

2005-01-31 Thread Sean Blakey
> > Has anyone ported any java programs to python and has translated this? > > any help would be greatly appreciated. > > thanks. > > josé > buffer[0] = int(string, 16) http://docs.python.org/lib/built-in-funcs.html -- Sean Blakey Saint of Mild Amusement, Ev

Re: How do you do arrays

2005-02-01 Thread Sean Blakey
gt; listvalues = [1, 2, 3, 4] >>> while index < majorlop1: ... index = index + 1 ... k = random.choice(listvalues) + 1 ... iMatrix.append(k) ... >>> iMatrix array('b', [3, 5]) >>> You should probably look at the wealth of information at http://www

Save the Canvas!

2005-02-01 Thread Sean McIlroy
I'd like to be able to save a Tkinter Canvas in a format other than postscript (preferably gif). Is there a tool out there for accomplishing that? Any help will be much appreciated. Peace, STM -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions on lambda:

2005-06-24 Thread Sean McIlroy
def PRINT(x): print x f = lambda: PRINT("hello") ### def let(x,y): globals()[x] = y return True f = lambda x: let('y',x*x) and y+y -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Sean McIlroy
Tom Anderson wrote: > So, if you're a pythonista who loves map and lambda, and disagrees with > Guido, what's your background? Functional or not? glad you asked. personally i don't know lisp (or scheme), but now i've decided to learn it, because eventually it will no longer be possible in python

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Sean McIlroy
Peter Hansen wrote: > Sean, what gave you the impression this would change? just inductive reasoning. i've been wrong before (like anyone who makes that claim), and i'm a former python enthusiast, so my judgement must be colored to some extent by bitterness. maybe they have soli

keywords for optional args in extension modules

2005-08-11 Thread Sean Richards
[3]: test(1,two=2) In [4]: test(1,two=2,three=3) In [5]: test(1,three=3,two=2) In [6]: test(1,three=3) --- exceptions.TypeError Traceback (most recent call last) /home/sean/research/cod

Re: python code with indention

2005-02-09 Thread Sean Blakey
end-block comments and no indentation into a correctly indented python script. -- Sean Blakey Saint of Mild Amusement, Evil Genius, Big Geek Python/Java/C++/C(Unix/Windows/Palm/Web) developer quine = ['print "quine =",quine,"; exec(quine[0])"'] ; exec(quine[0]) -- http://mail.python.org/mailman/listinfo/python-list

two questions - no common theme

2005-02-09 Thread Sean McIlroy
And now for a pair of questions that are completely different: 1) I'd like to be able to bind callbacks to presses of the arrow buttons on the keyboard. How do you say that in Tkinter? 2) The function 'listdir' in os.path returns a list of all the files in the given directory - how do I get hold

'modal dialogs' with Tkinter

2005-02-22 Thread Sean McIlroy
s, without success. Any assistance would be greatly appreciated. Peace, Sean McIlroy -- http://mail.python.org/mailman/listinfo/python-list

Re: String Replace Problem...

2005-02-28 Thread Sean McIlroy
I can't claim to have studied your problem in detail, but I get reasonable results from the following: filename = 'Errors.txt' S = open(filename,'r').read().split() f = lambda x: (x[0]=='@' and x[6:] + '.0') or (x=='/' and x + '\n') or x open(filename,'w').write(' '.join(map(f,S))) HTH -

canvassing for assistance

2005-02-28 Thread Sean McIlroy
Hi all! I've written a utility for making diagrams. It could also be a good environment for experimenting with a Tk canvas, so I'm including the code here (see below). The problem is that, when I save a canvas and include the resulting postscript file in a LaTeX document, I often find that the rig

Re: String Replace Problem...

2005-02-28 Thread Sean McIlroy
Alright, now it's too much. It's not enough that you're eliminating it from the language, you have to stigmatize the lambda as well. You should take some time to reflect that not everybody thinks the same way. Those of us who are mathematically inclined like the lambda because it fits in well with

Re: Need direction to kill a virus

2005-03-02 Thread Sean Blakey
d file. 6) With the filename you gave, it shouldn't be that hard to find some notes on this virus with google. 7) When the system is running away with background processes like you describe, use the task manager to find out which process is using the resources. Use this information in your researc

Re: canvassing for assistance

2005-03-03 Thread Sean McIlroy
EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Sean, nice work on canvasser! One question: what is the purpose of > 'scale'? I notice that if you have already drawn a line on the canvas, > then 'scale' can be used t

seeking tree-browser widget for use with Tkinter

2005-03-06 Thread Sean McIlroy
I'm looking for a widget, to be used with Tkinter, that displays a tree whose leaves are strings. I thought there was something like that in the Python Megawidgets, but when I look at the documentation (http://pmw.sourceforge.net/doc/refindex.html), it doesn't seem to be there. Any advice will be m

Re: Python docs [was: function with a state]

2005-03-08 Thread Sean Blakey
ever you can. > > Xah > [EMAIL PROTECTED] > http://xahlee.org/PageTwo_dir/more.html > > -- > http://mail.python.org/mailman/listinfo/python-list > Have you submitted a patch? I'm curious how you would document "global". -- Sean Blakey Saint of Mild Amusement, Evil Genius, Big Geek Python/Java/C++/C(Unix/Windows/Palm/Web) developer quine = ['print "quine =",quine,"; exec(quine[0])"'] ; exec(quine[0]) -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Who Knows of a Good Computational Physics Textbook?

2005-03-13 Thread Sean Richards
This may be of interest http://farside.ph.utexas.edu/teaching/329/lectures/lectures.html Cheers, Sean -- "Hver sin smak", sa vintapperen, han drakk mens de andre sloss." -- http://mail.python.org/mailman/listinfo/python-list

Re: Good use for Jython

2005-03-16 Thread Sean Blakey
nd redeploy a Jython script file into a running system than it is to do the same with a session EJB. -- Sean Blakey Saint of Mild Amusement, Evil Genius, Big Geek Python/Java/C++/C(Unix/Windows/Palm/Web) developer quine = ['print "quine =",quine,"; exec(quine[0])"'] ; exec(quine[0]) -- http://mail.python.org/mailman/listinfo/python-list

how to use structured markup tools

2005-03-19 Thread Sean McIlroy
I'm dealing with XML files in which there are lots of tags of the following form: xy (all of these letters are being used as 'metalinguistic variables') Not all of the tags in the file are of that form, but that's the only type of tag I'm interested in. (For the insatiably curious, I'm talking abo

Re: how to use structured markup tools

2005-03-19 Thread Sean McIlroy
Exactly what I was looking for. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

tkinter manual question

2004-11-29 Thread Sean McIlroy
The 'Canvas Methods' section of the online Intro to Tkinter (http://www.pythonware.com/library/tkinter/introduction/x2102-methods.htm) refers (without explanation) to something called "bbox". What is this? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: access to generator state

2004-12-02 Thread Sean Ross
#x27;: 0} >>> gen.next() 1 >>> gen.gi_frame.f_locals {'i': 1} >>> gen.next() Traceback (most recent call last): File "", line 1, in ? StopIteration >>> HTH, Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: question on regular expressions

2004-12-03 Thread Sean Ross
> Darren from os.path import basename import urllib url = 'file://C:%5Cfolder1%5Cfolder2%5Cmydoc1.pdf' print './%s'%basename(urllib.url2pathname(url)) HTH, Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: Book Recommendations

2004-12-03 Thread Sean Dolan
Nathan Weston wrote: I'm new to Python and am looking for a book to get me up to speed quickly. I'm an experienced programmer and very proficient with Ruby, so Python is coming easily to me and I don't need a gentle introduction -- I just need a quick way to get familiar with common Python idioms a

Re: Mean, median, and mode

2004-12-05 Thread Sean McIlroy
>>> mean = lambda x: sum(x)/len(x) >>> median = lambda x: (max(x)-min(x))/2 >>> mode = lambda x: max([(x.count(y),y) for y in x])[1] "Robert Brewer" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > (now that we have a meaningful subject line) > > Alfred Canoy wrote: > > >> I'm

Find index of item in list

2004-12-07 Thread Sean Berry
Given myList = ['cat', 'dog', 'mouse' ... 'bear'] what is the easiest way to find out what index 'dog' is at? -- http://mail.python.org/mailman/listinfo/python-list

example code sought

2004-12-18 Thread Sean McIlroy
There's something quite simple I'd like to do, but I'm hampered by lack of knowledge regarding Tkinter. If someone could help me out with a snippet of maximally-simple code showing, in general terms, how to do this, that would be really great. What I want to do is simply to move a shape around on t

Re: Jython performance

2004-12-22 Thread Sean Blakey
g Jython embedded in a large Web Application, with Struts actions defined in Jython working with Java Beans managed by a Hibernate back end. The Jython-beans interoperability makes this very simple, and I'm not seeing an appreciable performance difference between the Jython actions and the pure Jav

cosmetic Tkinter question

2004-12-26 Thread Sean McIlroy
I've got a bunch of Frames, all packed into the root window with side=TOP, and in each Frame I've got a Checkbutton packed with side=LEFT. I expected the Checkbuttons to be flush with the left edge of the window, but they're not, and it looks a little gross. How do I get them to align? -- http://m

Re: built-in 'property'

2004-12-30 Thread Sean Ross
e default get/set/del methods. That being said, while I appreciate that there are people who like this recipe (and others who don't), I think it's important to point out that this is *not* the recommended property idiom. Moreover, Guido doesn't like it and he would prefer that it not

mysteriously nonfunctioning script - very simple

2005-03-25 Thread Sean McIlroy
Can anybody help me make sense of the fact that the following script doesn't work? It's so simple I can't imagine what I'm missing. Any help will be much appreciated. Peace, STM ## ALARM CLOCK: from time import sleep,time,localtime wakeuptime = input('hours: '), input('minutes: ') onehourlater

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Sean McIlroy
ACHES THIS POINT ## Peter Hansen <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Sean McIlroy wrote: > > Can anybody help me make sense of the fact that the following script > > doesn't work? It's so simple I can't imagi

Re: mysteriously nonfunctioning script - very simple

2005-03-27 Thread Sean McIlroy
Heiko Wundram <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Why not try the following: I did try it, and it didn't work either. It appears there must be something wrong with my computer, hopefully something benign. Thanks anyway. Peace, STM -- http://mail.python.org/mailm

Re: newbie question

2005-03-28 Thread Sean Blakey
ps if you gave a higher-level description of what you are trying to accomplish, I could give better pointers in the right direction. -- Sean Blakey Saint of Mild Amusement, Evil Genius, Big Geek Python/Java/C++/C(Unix/Windows/Palm/Web) developer quine = ['print "quine =",quine,"; exec(quine[0])"'] ; exec(quine[0]) -- http://mail.python.org/mailman/listinfo/python-list

Re: doing "checksum" in python

2005-03-28 Thread Sean Blakey
/python-list/2004-January/204983.html http://mail.python.org/pipermail/python-list/2004-January/204998.html -- Sean Blakey Saint of Mild Amusement, Evil Genius, Big Geek Python/Java/C++/C(Unix/Windows/Palm/Web) developer quine = ['print "quine =",quine,"; exec(quine[0])"'] ; exec(quine[0]) -- http://mail.python.org/mailman/listinfo/python-list

IMAP4.search by message-id ?

2005-03-29 Thread Sean Dodsworth
Can anyone tell me how to get a message's number from the message-id using IMAP4.search? I've tried this: resp, items = server.search(None, 'HEADER', '"Message-id"', msgID) but it gives me a 'bogus search criteria' error Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: IMAP4.search by message-id ?

2005-03-30 Thread Sean Dodsworth
Max M wrote: > Sean Dodsworth wrote: >> Can anyone tell me how to get a message's number from the message-id >> using IMAP4.search? >> I've tried this: >> resp, items = server.search(None, 'HEADER', '"Message-id"', msgID) &g

Re: initialize a dictionary

2005-03-30 Thread Sean Blakey
be problematic if you ever need to iterate values "by row" or "by column". There is a python F.A.Q. on this, which you may find useful: http://www.python.org/doc/faq/programming.html#how-do-i-create-a-multidimensional-list -- Sean Blakey Saint of Mild Amusement, Evil Geniu

RE: IMAP4.search by message-id ?

2005-03-31 Thread Sean Dodsworth
Tony Meyer wrote: >> Can anyone tell me how to get a message's number from the message-id >> using IMAP4.search? >> I've tried this: >> resp, items = server.search(None, 'HEADER', >> '"Message-id"', msgID) but it gives me a 'bogus search criteria' error > import imaplib i = imaplib.

Re: Ternary Operator in Python

2005-04-01 Thread Sean Kemplay
You could use condition and consequent or alternative I use it Sean On Apr 1, 2005 5:24 PM, praba kar <[EMAIL PROTECTED]> wrote: > Dear All, > I am new to Python. I want to know how to > work with ternary operator in Python. I cannot > find any ternary operator in

Re: Ternary Operator in Python

2005-04-01 Thread Sean Kemplay
On Apr 1, 2005 8:10 PM, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Sean Kemplay wrote: > > > You could use > > > > condition and consequent or alternative > > > > I use it > > You should do so cautiously, since if consequent is false, it will

the bugs that try men's souls

2005-04-03 Thread Sean McIlroy
This needs some background so bear with me. The problem: Suppose p is a permutation on {0...n} and t is the transposition that switches x and y [x,y in {0...n}]. A "stepup pair" (just a term I invented) for p is a pair (a,b) of integers in {0...n} with a> k = 18 moved = [i for i in range(l

Re: the bugs that try men's souls

2005-04-03 Thread Sean McIlroy
d I find out the question's been answered. Thanks very much. I'll let you know how it turns out. Peace, Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: the bugs that try men's souls

2005-04-03 Thread Sean McIlroy
hould have remembered that python "plays fair", and looked a little harder to find my mistake. Thanks again, Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: within a class, redefining self with pickled file

2005-04-07 Thread Sean Blakey
; a.change() >>> a <__main__.A instance at 0x009DCD00> Note, however, that you can MODIFY self in-place within a method. You can probably hack together a solution that modifies self.__dict__, self.__class__, self.__class__.__dict__, or some other magic properties. -- Sean Blakey S

Debugging on the Mac question.

2014-01-03 Thread Sean Murphy
and had a full debugger that worked at the console level. Sean -- https://mail.python.org/mailman/listinfo/python-list

Re: Debugging on the Mac question.

2014-01-03 Thread Sean Murphy
PETER, thanks Peter, I have already found the PDB module and have had a play with it. It will do for now. On 03/01/2014, at 8:08 PM, Paul Rudin wrote: > Sean Murphy writes: > > >> I am a Vision Impaired programmer on the Mac and Window platforms. I have >> started

  1   2   3   4   5   >