Modifying the global modules included with the distribution

2005-02-07 Thread Justin Standard
er, when I run the interpreter, my changes aren't reflected. Do I need to rebuild python to make these changes take? Or is there some other process to modify global modules. I realize that I _could_ have extended it, but this _seemed_ easier, and the work is already done. Thanks!

Re: Using PIL with py2exe

2005-02-27 Thread Justin Shaw
"John Carter" <> wrote in message news:[EMAIL PROTECTED] > Does anyone know how to embed PIL into a py2exe program. > > As far as I can tell PIL is not finding its plugins for Image I/O, > they are imported dynamically as required. So I cant load or save > pictures > > I tried making a copy of the

pickle and py2exe

2004-11-30 Thread Justin Straube
ntain \n and \t charaters but no other special characters or anything. Does anyone have any suggestions to what I can try to get around this? The pickle module works fine when the .pyw file is run. Its only when I compile this is there an issue. Thanks for any help, Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle and py2exe

2004-12-02 Thread Justin Straube
mention of protocol option in pickle. I hadnt specified anything for protocol, so it defaults to 0 though I dont know what that is. Its my first time using pickle and second with py2exe. Thanks for the suggestion, Ill keep trying at this and another idea without pickle. Justin >"Justin Strau

Re: pickle and py2exe

2004-12-02 Thread Justin Straube
ot;py2exe": { "packages": ["encodings"], } } > setup(windows= ["spam.py"], options= opts) > >in your setup.py. > >Hope it helps >/Johan Lindberg Thanks Johan, but unfortunately the same traceback is given in the log. I should have mentioned in my pre

Re: pickle and py2exe

2004-12-05 Thread Justin Straube
e added and the .exe did print the spam string. >Also you might want to try the py2exe-users list (see >http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/py2exe-users). Thanks, Ill check this out. Regards, Justin Straube -- http://mail.python.org/mailman/listinfo/python-list

how to close a gzip.GzipFile?

2005-04-01 Thread Justin Guerin
tire file contents into memory, so I can't use "for line in oldfileobj.readlines()" Thanks for the pointers. Justin Guerin -- http://mail.python.org/mailman/listinfo/python-list

Re: how to close a gzip.GzipFile?

2005-04-01 Thread Justin Guerin
On Friday 01 April 2005 11:54, Justin Guerin wrote: > Hello list, > > gzip documentation states that calling the .close() method on a GzipFile > doesn't really close it. If I'm really through with it, what's the best > way to close it? I'm using Python2.2 (bu

New Affiliate program 80% Commission

2005-04-14 Thread Justin Harrison
C A L L I N G... All Webmasters, Affiliates & Internet Entrepreneurs WOULD YOU LIKE TO Generate HUGE monthly commission cheques? == The MobileForLife.com 2 tier

Re: Question

2016-03-07 Thread justin walters
Unfortunately, it's difficult for the core devs to know every hardware and os combination there is. Maybe you could submit a bug report? On Mar 7, 2016 10:56 AM, "Jon Ribbens" wrote: > On 2016-03-07, mm0fmf wrote: > > On 07/03/2016 18:09, Jon Ribbens wrote: > >> It only appears to have downloads

Re: Question

2016-03-07 Thread justin walters
Well, from that error message, it seems like you may have a permissions issue. Also, the git shell is not the sane as a real shell. There are multiple windows terminal emulators. Why not use one of those? On Mar 7, 2016 5:46 PM, "Jon Ribbens" wrote: > On 2016-03-07, Ian Kelly wrote: > > On Mon,

Re: Question

2016-03-08 Thread justin walters
My apologies, but I really don't want to argue with you. You may want to be a bit more humble when asking for help. On Mar 8, 2016 2:31 AM, "Jon Ribbens" wrote: > On 2016-03-08, justin walters wrote: > > Well, from that error message, it seems like you may have a permi

Re: Pythonic love

2016-03-08 Thread justin walters
Correct me if I'm wrong, but don't python generators usually use the yield statement so they can be used in list comprehensions? On Mar 8, 2016 5:27 AM, "jmp" wrote: > On 03/07/2016 11:51 PM, Fillmore wrote: > >> >> learning Python from Perl here. Want to do things as Pythonicly as >> possible. >

Re: Pythonic love

2016-03-08 Thread justin walters
Sorry about the top posting. I'm new to mailing lists. I should just reply to the [email protected] address then? Also, thank you for the generator clarification. On Mar 8, 2016 9:09 AM, "jmp" wrote: > On 03/08/2016 05:49 PM, justin walters wrote: > >> Correct

Re:

2016-03-14 Thread justin walters
How did you install python? On Mar 14, 2016 1:30 AM, "Ezra Simms" wrote: > I cannot seem to get pymongo to find my python installation – keep getting > an error saying pythin has not been found in the registry? Why is this. > > Sent from Mail for Windows 10 > > -- > https://mail.python.org/mailma

retrieve source code from code object as returned by compile()

2014-04-23 Thread Justin Ezequiel
Is there a way to get the original source? I am trying to retrieve the main script from a py2exe'd old program. The programmer neglected to commit to SVN before leaving. Using "Easy Python Decompiler" I am able to get the source for the imported modules. Using "Resources Viewer" from PlexData and

Re: retrieve source code from code object as returned by compile()

2014-04-24 Thread Justin Ezequiel
On Thursday, April 24, 2014 1:53:38 PM UTC+8, Gregory Ewing wrote: > Alternatively you could create a .pyc file out of the code > object and then use Easy Python Decompiler on that. The > following snippet of code should do that: > > (Taken from: > > http://stackoverflow.com/questions/8627835/ge

Re: New to using re. Search for a number before a string.

2013-11-02 Thread Justin Barber
ry Ann' and also automatically matches characters only to the end of the line, since you have not flagged re.DOTALL. Justin -- https://mail.python.org/mailman/listinfo/python-list

Python write to spreadsheet?

2015-05-30 Thread Justin Thyme
Is it possible to write a Python program that will start MS Excel, create a spreadsheet and fill cells A1 to A10 (say) with the data in a Python array? The answer is surely yes, but is there an outline of how to do it somewhere? -- Shall we only threaten and be angry for an hour? When the st

Re: Is a with on open always necessary?

2012-01-20 Thread Justin Simms
As I understand it, with gives you a cleaner way of doing the following steps: 1) pre processing 2) actual work 3) post processing, where the __enter__ and __exit__ methods are used to take care of 1 and 3. So with is not always necessary, but it is the preferred was to do things like file proces

newbie: generate a function based on an expression

2005-12-12 Thread Ezequiel, Justin
>>> def genFun(expr, locs): ... return lambda x: eval('min(Max,max(Min,%s))' % expr, locs, {'x': x}) ... >>> fun = genFun("A*x+off", {'A': 3.0, 'off': -0.5, 'Max': 2.0, 'Min': -2.0} ) >>> fun at 0x011B1470> >>> fun(0) -0.5 >>> fun(-10) -2.0 >>> fun(10) 2.0 >>> -- http://mail.python.org/mai

Re: python coding contest

2005-12-25 Thread Justin Azoff
>>> c=open("seven_seg.py").read() >>> len(c) 251 >>> len(c.replace(" ","")) 152 :-) Knowing me, I'll forget to submit it. -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-26 Thread Justin Azoff
Tim Hochberg wrote: > In the 130's is definately possible, but I haven't heard of anyone doing > better than that. I have a version that is 127, but only if you strip extra whitespace :-( -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-27 Thread Justin Azoff
for most approaches, any space you save by using a string you lose after quoting it and using ord() to turn a character back into a number. I'm sure this particular method is a dead end, but it is a very intersting and probably unique solution :-) -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Number set type

2005-12-28 Thread Justin Azoff
You could use IPy... http://svn.23.nu/svn/repos/IPy/trunk/IPy.py is one location for it... I wonder where you get O(n) and O(n^2) from... CIDR blocks are all sequential.. All you need to store is the starting and ending address or length. Then any set operation only has to deal with 4 numbers, an

Re: Number set type

2005-12-28 Thread Justin Azoff
else : b = bi.next() except StopIteration: break return IP4Range(ret) -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Number set type

2005-12-28 Thread Justin Azoff
Justin Azoff wrote: > Yes.. if they are sorted, something like this should work: Oops, that was almost right, but it would skip some ranges. This should always work: ... while 1: try : if a.intersects(b): ret.append(a.intersectio

Re: About zipfile on WinXP

2006-01-04 Thread Justin Ezequiel
here's a small script I wrote and use note the line arcname = os.path.splitdrive(p)[-1].lstrip(os.sep) if I comment out `.lstrip(os.sep)`, I get a zip file like rzed describes ### import sys import zipfile import time import os if __name__ == '__main__': pths = sy

Re: Multiway Branching

2006-01-09 Thread Justin Azoff
ying > Environmental > Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy > Logic" > <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 Use a dictionary: byte_values = { (32,32) : 0, (36,32) : 'natural', (32,1 ) : 5, } row_value = byte_values[byte1,byte2] -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiway Branching

2006-01-09 Thread Justin Azoff
ying > Environmental > Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy > Logic" > <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 Use a dictionary: byte_values = { (32,32) : 0, (36,32) : 'natural', (32,1 ) : 5, } row_value = byte_values[byte1,byte2] -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: tools to manipulate PDF document?

2006-01-19 Thread Justin Ezequiel
have you seen http://www.pdfhacks.com/pdftk/ -- http://mail.python.org/mailman/listinfo/python-list

Line by line execution of python code

2006-07-13 Thread Justin Powell
Hi, I'm looking for suggestions on how to accomplish something in python. If this is the wrong list for such things, I appologize and please disregard the rest. My application needs to allow users to create scripts which will be executed in a statement-by-statement fashion. Here's a little pseud

Re: String handling and the percent operator

2006-07-13 Thread Justin Azoff
. >>> stuff = {'lang': 'python', 'page': 'typesseq-strings.html'} >>> print """I should read the %(lang)s documentation at ... http://docs.%(lang)s.org/lib/%(page)s""" % stuff I should read the python documentation at http://docs.python.org/lib/typesseq-strings.html -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression problem

2006-07-13 Thread Justin Azoff
ue(I dont know if it is good). No matter how good it is you should still use something that understands html: >>> from BeautifulSoup import BeautifulSoup >>> html='' >>> page=BeautifulSoup(html) >>> page.link.get('href') 'mystylesheet.css' -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression problem

2006-07-13 Thread Justin Azoff
Justin Azoff wrote: > >>> from BeautifulSoup import BeautifulSoup > >>> html='' > >>> page=BeautifulSoup(html) > >>> page.link.get('href') > 'mystylesheet.css' On second thought, you will probably want som

Re: Deferred imports

2006-07-14 Thread Justin Azoff
for someone else to understand :-) > Thanks! > > -tom! pypy has a neat lazy loading importer, you could see how they implement it, I think it is just something like class defer: def __getattr__(self, attr): return __import__(attr) defer = defer() then defer.foo will import foo for you. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling 2.3.5 on ubuntu

2006-07-16 Thread Justin Azoff
it's > not too far removed from the desktop edition but, clearly, I need to > tweak something or install some missling libs. Why are you compiling a package that is already built for you? -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling 2.3.5 on ubuntu

2006-07-17 Thread Justin Azoff
Steve Holden wrote: > I'm quessing because (s)he wants to test programs on less recent > versions of Python. Ubuntu 5.10 was already up to Python 2.4.2, so I > can't imagine there's anything older on Ubuntu 6.06. > > regards > Steve Both are ava

RFC: my iterthreader module

2006-07-17 Thread Justin Azoff
threading.Thread(target=self._handle_input) t.start() self.threads.append(t) try : for x in self.get_input(): self.Q.put((True, x)) except NotImplementedError, e: print e for x in range(self._numthreads):

Re: Dictionary question

2006-07-18 Thread Justin Azoff
hat kind of data you are expecting last[keytotal] = min(last.get(keytotal), valtotal) comes close to working - it would if you were doing max. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Howto Determine mimetype without the file name extension?

2006-07-18 Thread Justin Azoff
t to use gnome.vfs, just change the types list to be a dictionary like types = { 'application/msword': 'doc', 'application/vnd.ms-powerpoint': 'ppt', } and then def get_mime(filename): info = gnome.vfs.get_file_info(filename, gnome.vfs.

Re: Python newbie needs constructive suggestions

2006-07-21 Thread Justin Azoff
e most people would just write something like this: def something(): #local helper function to add one to a number def addone(x): one = 1 return x+one return map(addone, [5, 17, 49.5]) -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested function scope problem

2006-07-21 Thread Justin Azoff
27; % (splitters, chars) return re.findall(regex, s,re.VERBOSE) That should be able to be simplified even more if one were to use the character lists built into the regex standard. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested function scope problem

2006-07-22 Thread Justin Azoff
(foo.breakLine)' 10 loops, best of 3: 914 msec per loop [EMAIL PROTECTED]:/tmp$ python /usr/lib/python2.4/timeit.py -s'import foo' 'foo.test(foo.breakLineRE)' 10 loops, best of 3: 289 msec per loop -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested function scope problem

2006-07-22 Thread Justin Azoff
Bruno Desthuilliers wrote: > Justin Azoff a écrit : > > if len(tok) > 0: > > should be written as > > if(tok): > > > > actually, the parenthesis are useless. yes, that's what happens when you edit something instead of typing it over

Re: splitting words with brackets

2006-07-26 Thread Justin Azoff
faulkner wrote: > er, > ...|\[[^\]]*\]|... > ^_^ That's why it is nice to use re.VERBOSE: def splitup(s): return re.findall(''' \( [^\)]* \) | \[ [^\]]* \] | \S+ ''', s, re.VERBOSE) Much less error prone this w

Re: splitting words with brackets

2006-07-26 Thread Justin Azoff
"""snip""" return _compile(pattern, flags).findall(string) def compile(pattern, flags=0): """snip""" return _compile(pattern, flags) def _compile(*key): # internal: compile pattern cachekey = (type(key[0]),) + key

Re: Thread Question

2006-07-27 Thread Justin Azoff
ption to be > user-defined. [snip] See my post about the iterthreader module I wrote... http://groups.google.com/group/comp.lang.python/browse_frm/thread/2ef29fae28cf44c1/ for url, result in Threader(download_from_web, list_items): print url, result #... -- - Justin -- http://mai

Re: Thread Question

2006-07-28 Thread Justin Azoff
stand it fully, you should look at the example I showed you before. It is essentially the same thing, just wrapped in a class to be reusable. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: help - iter & dict

2006-08-03 Thread Justin Azoff
]:{'a': 1, 'c': 6, 'b': 3} In [159]:d=closer_finder(sample_data) In [160]:d.flat Out[160]:[(1, 'a'), (3, 'b'), (6, 'c')] In [161]:d[4] Out[161]:('b', 3) -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do I require an "elif" statement here?

2006-08-04 Thread Justin Azoff
Jim wrote: > Could somebody tell me why I need the "elif char == '\n'" in the > following code? > This is required in order the pick up lines with just spaces in them. > Why doesn't > the "else:" statement pick this up? No idea. Look at the profile of your program: for.. if.. for.. if.. else.. if

Re: Why do I require an "elif" statement here?

2006-08-06 Thread Justin Azoff
> return whitespace*NEW_INDENT + tail > else: return line# our default [snip] This function is broken. Not only does it still rely on global variables to work, it does not actually reindent lines correctly. Your function only changes lines that start with exactly OLD_INDEN

Re: variable creation

2006-08-08 Thread Justin Azoff
would you like to include? [6.9408, 10.811, 1.00794001] Now, since the information for a single element consists of more than just a single number, you'll probably want to make a class for them. Once you have an object for every element, you can add them to a class for t

Re: newb question: file searching

2006-08-08 Thread Justin Azoff
ven't said anything about images! The task of finding files by extension is pretty generic, so it shouldn't be concerned about the actual extensions. once that works, you can simply do def get_images(directory, include_hidden=False): image_exts = ('jpg','jpeg'

Re: newb question: file searching

2006-08-08 Thread Justin Azoff
able to replace those 3 lines with just dirnames[:] = [d for d in dirnames if not d.startswith('.')] -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: technique to enter text using a mobile phone keypad (T9 dictionary-based disambiguation)

2006-08-08 Thread Justin Azoff
phone() CPU times: user 1.65 s, sys: 0.00 s, total: 1.65 s Wall time: 1.66 In [15]:%time list(p.get_matching_words('43556')) CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s Wall time: 0.01 Out[15]:['hello', 'hellman', "hellman's", "hello's", 'hellos'] It seems the ruby version just posted takes a similar approach, but uses an actual tree.. using the bisect module keeps it simple. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to fill a form

2006-08-17 Thread Justin Ezequiel
Sulsa wrote: > On Tue, 15 Aug 2006 03:37:02 - > Grant Edwards <[EMAIL PROTECTED]> wrote: > > > On 2006-08-15, Sulsa <[EMAIL PROTECTED]> wrote: > > > > > I want to fill only one smiple form so i would like not to use > > > any non standard libraries. > > > > Then just send the HTTP "POST" reques

Re: istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-20 Thread Justin Azoff
orth adding it to itertool? yeah, but why on earth did you make it so complicated? def istep(iterable, step): a=[] for x in iterable: if len(a) >= step: yield a a=[] a.append(x) if a: yield a -- - Justin -- http://mail.python.org/mai

Re: trouble using "\" as a string

2006-08-20 Thread Justin Azoff
ay. sounds like you want import posixpath posixpath.basename(path) assuming you are on a windows box,otherwise the normal os.path.basename will do it. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Get EXE (made with py2exe) path directory name

2006-06-05 Thread Justin Ezequiel
try, if hasattr(sys, 'frozen'): me = sys.executable else: me = sys.argv[0] -- http://mail.python.org/mailman/listinfo/python-list

Re: Again, Downloading and Displaying an Image from the Internet in Tkinter

2006-06-05 Thread Justin Ezequiel
cannot help you with Tkinter but... save=open("image.jpg","wb") save.write(web_download.read()) save.close() perhaps this would let you open the file in Paint -- http://mail.python.org/mailman/listinfo/python-list

Re: Database read and write

2006-06-14 Thread Justin Ezequiel
Stan Cook wrote: > will ope, read, and write to a Dbase 3 or 4 file? I know I have one in VB6 that I've been meaning to translate to Python but... (do not have time/am lazy/does not work with indexes) did a google search for you though http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/3627

Re: Python SHA-1 as a method for unique file identification ? [help!]

2006-06-21 Thread Justin Ezequiel
EP wrote: > This inquiry may either turn out to be about the suitability of the > SHA-1 (160 bit digest) for file identification, the sha function in > Python ... or about some error in my script. > > This is on Windows XP. > > def hashit(pth): > fs=open(pth,'r').read() > sh=sha.new(fs).hex

Re: smtplib problem for newbie

2006-06-22 Thread Justin Azoff
use you to get errors like the above. see: >>> long('12') 12L >>> open("long.py",'w') >>> import long >>> long('12') Traceback (most recent call last): File "", line 1, in ? TypeError: 'module' object is not callable >>> -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread Justin Azoff
le uses the "POST" method instead:" Additionally, they probably need to use cookielib, otherwise the logged in state will not be persistant. -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Built-in Exceptions - How to Find Out Possible Errno's

2006-07-05 Thread Justin Azoff
E the numbers. furthermore, the object you get back from except has both the code and the string already: >>> e >>> print e [Errno 2] No such file or directory: 'foo' >>> dir(e) ['__doc__', '__getitem__', '__init__', '__module__', '__str__', 'args', 'errno', 'filename', 'strerror'] >>> e.strerror 'No such file or directory' -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: web app breakage with utf-8

2006-07-07 Thread Justin Ezequiel
32 bit (Intel)]' >>> sys.platform 'win32' >>> cred = {'passwd': 'secret', 'host': 'myhost', 'db': 'mydb', 'user': >>> 'justin'} >>> insert = 'insert into unicode

Re: how can I avoid abusing lists?

2006-07-07 Thread Justin Azoff
Thomas Nelson wrote: > This is exactly what I want to do: every time I encounter this kind of > value in my code, increment the appropriate type by one. Then I'd like > to go back and find out how many of each type there were. This way > I've written seems simple enough and effective, but it's ve

Re: Using "Content-Disposition" in HTTP download

2006-09-05 Thread Justin Ezequiel
[EMAIL PROTECTED] wrote: > What is the correct way to download a file through HTTP and save it to > the file name suggested by "Content-Disposition"? > Perhaps something along the lines of the following? >>> url = >>> r'http://www.4so9.com/cauca/files/ban-doc/francois/stingray/198%20lb%20stingra

Re: 22, invalid agument error

2006-09-06 Thread Justin Ezequiel
> sockobj.bind(('',40007)) tried on my N6600 with same error try using your phone's IP instead of the empty string '' tried sockobj.bind(('127.0.0.1',40007)) and did not get an error -- http://mail.python.org/mailman/listinfo/python-list

Re: 22, invalid agument error

2006-09-07 Thread Justin Ezequiel
Infinite Corridor wrote: > Justin Ezequiel wrote: > > > > tried sockobj.bind(('127.0.0.1',40007)) and did not get an error > > I didn't get an error either, but the whole thing hangs up, and I am > forced to abort the program. This has happend quite a few

Re: FtpUtils Progress Bar

2006-09-13 Thread Justin Ezequiel
[EMAIL PROTECTED] wrote: > > Does anyone have an example on how to show the progress of the > upload/download when using ftputil? > haven't used ftputil in quite a while ... but using ftplib... import ftplib class Callback(object): def __init__(self, totalsize, fp): self.totalsize =

Re: Multiple FTP download using Muliti thread

2006-12-04 Thread Justin Ezequiel
import ftplib, posixpath, threading from TaskQueue import TaskQueue def worker(tq): while True: host, e = tq.get() c = ftplib.FTP(host) c.connect() try: c.login() p = posixpath.basename(e) fp = open(p, 'wb') try:

Re: Multiple FTP download using Muliti thread

2006-12-04 Thread Justin Ezequiel
Fredrik Lundh wrote: > Justin Ezequiel wrote: > > > from TaskQueue import TaskQueue > > what Python version is this ? > > oops. forgot to note... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475160 -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple FTP download using Muliti thread

2006-12-04 Thread Justin Ezequiel
johnny wrote: > When I run the following script, with host and password and username > changed, I get the following errors: > raise error_temp, resp > error_temp: 421 Unable to set up secure anonymous FTP > > Dose the host should allow 4 simultaneous login at a time? > does it work using ftp.mic

Re: Script Error

2006-12-22 Thread Justin Ezequiel
ie.Navigate ('URL') ie.SetTextBox(username,'txtUserId',0) not sure but shouldn't you be waiting for navigate to actually finish loading the page before setting fields? see the ie.Busy or ie.readyState properties/methods -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing files in a zip to files on drive

2006-12-28 Thread Justin Ezequiel
kj7ny wrote: > compare a file on a hard drive to a file in a python created zip file > to tell if the file has changed? >>> fileondisk = r'C:\Documents and Settings\power\Desktop\ES3dc+Template.3f' >>> zipondisk = r'C:\Documents and Settings\power\Desktop\temps.zip' >>> import zipfile >>> z = zipf

Re: append to the end of a dictionary

2006-01-25 Thread Justin Azoff
> to test answers before posting them, unless you're sure about your > answer. A wrong answer might actually be worse than no answer at > all. I fear that newbies will just get scared off if they get bunch > a of replies to their questions, and most are wrong. indeed. -- - J

Re: regular expressions, unicode and XML

2006-01-25 Thread Justin Ezequiel
import codecs f = codecs.open(pth, 'r', 'utf-8') data = f.read() f.close() ## data = re.sub ... f = codecs.open(pth, 'w', 'utf-8') f.write(data) f.close() -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expressions, unicode and XML

2006-01-27 Thread Justin Ezequiel
>> when I replace it end up with nothing: i.e., just a "" character in my >> file. how are you viewing the contents of your file? are you printing it out to stdout? are you opening your file in a non-unicode aware editor? try print repr(data) after re.sub so that you see what you actually have in

Re: general coding issues - coding style...

2006-02-18 Thread Justin Azoff
Dylan Moreland wrote: > I would look into one of the many Vim scripts which automatically fold > most large blocks without the ugly {{{. Who needs a script? "set foldmethod=indent" works pretty well for most python programs. -- http://mail.python.org/mailman/listinfo/python-list

Tiny RML2PDF re rml_1_0.dtd download

2005-05-18 Thread Justin Ezequiel
Can somebody please give me a URL to where I can download the DTD? I've Googled and browsed all through http://openreport.org/ with no success. I've subscribed to the OpenReport mailing list but messages I send to [EMAIL PROTECTED] bounce back with an unknown user: "openreport-list" BTW, anyone h

Re: passing arguments to tcpserver classes

2007-06-13 Thread Justin Ezequiel
On Jun 13, 10:19 pm, Eric Spaulding <[EMAIL PROTECTED]> wrote: > Is there an easy way to pass arguments to a handler class that is used > by the standard TCPServer? > > normally --> srvr =SocketServer.TCPServer(('',port_num), TCPHandlerClass) > > I'd like to be able to: srvr =SocketServer.TCPServer

Re: ARM cross compile - one last problem

2007-06-19 Thread Justin T.
ould appear that they are exported by libpython, which I believe is > statically linked into the python executable? That's where I start to > get confused. What part of python is breaking? Where should I be > looking for problems? > > Thanks a lot! > > Justin Alright, I looked

Re: something similar to shutil.copytree that can overwrite?

2007-06-20 Thread Justin Ezequiel
On Jun 20, 5:30 pm, Ben Sizer <[EMAIL PROTECTED]> wrote: > I need to copy directories from one place to another, but it needs to > overwrite individual files and directories rather than just exiting if > a destination file already exists. What version of Python do you have? Nothing in the source w

Re: something similar to shutil.copytree that can overwrite?

2007-06-21 Thread Justin Ezequiel
def copytree(src, dst, symlinks=False): """Recursively copy a directory tree using copy2(). The destination directory must not already exist. XXX Consider this example code rather than the ultimate tool. """ names = os.listdir(src) if not os.path.exists(dst): os.makedirs(

Re: something similar to shutil.copytree that can overwrite?

2007-06-24 Thread Justin Ezequiel
On Jun 22, 9:07 pm, Ben Sizer <[EMAIL PROTECTED]> wrote: > That's the easy bit to fix; what about overwriting existing files > instead of copying them? Do I have to explicitly check for them and > delete them? It seems like there are several different copy functions > in the module and it's not cle

Re: regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread Justin Ezequiel
Why not ditch regular expressions altogether for this problem? [ p for p in os.listdir(dir) if os.path.isfile(os.path.join(dir,p)) and p.lower().find('.thumbnail.')==-1 ] -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expressions eliminating filenames of type foo.thumbnail.jpg

2007-06-24 Thread Justin Ezequiel
On Jun 25, 1:00 pm, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > [ p for p in os.listdir(dir) > if os.path.isfile(os.path.join(dir,p)) > and p.lower().find('.thumbnail.')==-1 ] if you really want a regexp solution, the following seems to work (?i)(?http://kodos.so

Re: Python & MySQL problem with input to table..!

2007-06-29 Thread Justin Ezequiel
On Jun 29, 4:26 pm, hiroc13 <[EMAIL PROTECTED]> wrote: > >>> import MySQLdb > >>> db = MySQLdb.connect (host = "localhost", user = "root", passwd = "pass", > >>> db = "base1") > >>> c = db.cursor () > >>> c.execute(""" INSERT INTO table1 (prvo, drugo) VALUES ('test', '1') """) > >>> c.execute("SEL

Re: The file executing

2007-07-02 Thread Justin Ezequiel
On Jul 3, 9:40 am, Benjamin <[EMAIL PROTECTED]> wrote: > How does one get the path to the file currently executing (not the > cwd). Thank you os.path.dirname(sys.argv[0]) -- http://mail.python.org/mailman/listinfo/python-list

Re: ignoring a part of returned tuples

2007-07-04 Thread Justin Ezequiel
On Jul 4, 4:08 pm, noamtm <[EMAIL PROTECTED]> wrote: > What I wanted is: > for (dirpath, , filenames) in os.walk(...): > > But that doesn't work. for (dirpath, _, filenames) in os.walk(...): -- http://mail.python.org/mailman/listinfo/python-list

Re: how to execute a system command?

2007-05-22 Thread Justin Ezequiel
On May 23, 2:25 pm, wrb <[EMAIL PROTECTED]> wrote: > i want to open a excel file in a button click event. > i found that os.popen4("excel.xls") would work but it is too slow have you tried os.startfile -- http://mail.python.org/mailman/listinfo/python-list

RDF Library / Py 2.5

2007-08-05 Thread Justin Donato
Hello, Can I install the win32 binaries for the Redland RDF library if I have Python 2.5 installed? The latest .exe that I can find is for Python 2.4. HYPERLINK "http://librdf.org/"http://librdf.org/ (I’m new to Python and this list.) -Justin No virus found in this outgoi

Stackless Integration

2007-08-09 Thread Justin T.
dopted. However, it hasn't been in what appears to be 7 years of existence, so I assume there's a reason. Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: Stackless Integration

2007-08-09 Thread Justin T.
ed a PEP asking > that it be made so. Doing so would mean a loss of control, so there is a > downside as well as the obvious upside of distribution. That's true. Though, hopefully, the powers that be would allow him to maintain it while it's in the stdlib. Maybe we should file a P

Re: Stackless Integration

2007-08-09 Thread Justin T.
> It's not Pythonic. > > Jean-Paul Ha! I wish there was a way to indicate sarcasm on the net. You almost got people all riled up! -- http://mail.python.org/mailman/listinfo/python-list

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > Here's how I have it designed so far. The main thread starts a > Watch(threading.Thread) class that loops and searches a directory for > files. It has been passed a Queue.Queue() object (watch_queue), and > as it finds new files in the watch folder

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 5:39 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if anyone can point me in the r

Re: Threaded Design Question

2007-08-09 Thread Justin T.
robably doing it right. Especially in trivial cases like the one above. Justin -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   >