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

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: from calendar import* doesn't import everything

2012-04-24 Thread Justin Ezequiel
see http://docs.python.org/tutorial/modules.html#importing-from-a-package http://stackoverflow.com/questions/2187583/whats-the-python-all-module-level-variable-for I know the 1st link is for importing from a package but the same applies for modules -- http://mail.python.org/mailman/listinfo/pytho

Re: send function keys to a legacy DOS program

2011-03-29 Thread Justin Ezequiel
On Tue, Mar 29, 2011 at 9:59 PM, Alexander Gattin wrote: > I'm not sure regarding the ASCII part. I think it > might need to be set to 0x00 for all functional > keys instead of 0x3F/0x3C/0x41, but probably no > application actually cares. > > Another thing is that you may need to send key > releas

Re: send function keys to a legacy DOS program

2011-03-20 Thread Justin Ezequiel
On Mar 20, 7:30 am, Alexander Gattin wrote: > On Sun, Mar 20, 2011 at 12:52:28AM +0200, > > You need to place 2 bytes into the circular buffer > to simulate key press. Lower byte is ASCII code, > higher byte is scan code (they are the same for > functional keys, whe using default keycode set#1): >

send function keys to a legacy DOS program

2011-03-10 Thread Justin Ezequiel
Greetings, We have an old barcode program (MSDOS and source code unavailable.) I've figured out how to populate the fields (by hacking into one of the program's resource files.) However, we still need to hit the following function keys in sequence. F5, F2, F7 Is there a way to pipe said keys into

Re: FTP problem

2011-01-15 Thread Justin Ezequiel
'indexftp.barcap.com' only (sans the 'ftp.' prefix) allows me to connect to an FTP server >ftp indexftp.barcap.com Connected to usftp.barcap.com. 220-Connected to usftp.barcap.com. 220 FTP server ready. User (usftp.barcap.com:(none)): -- http://mail.python.org/mailman/listinfo/python-list

Re: SAX unicode and ascii parsing problem

2010-11-30 Thread Justin Ezequiel
can't check right now but are you sure it's the parser and not this line d.write(csv+"\n") that's failing? what is d? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3: Is this a bug in urllib?

2010-10-26 Thread Justin Ezequiel
''' C:\Documents and Settings\Administrator\Desktop>python wtf.py 301 Moved Permanently b' \n301 Moved\n301 Moved\nThe document has mo ved\nhttp://www.google.de/";>here.\r\n\r\n' foo 5.328 secs 301 Moved Permanently bar 241.016 secs C:\Documents and Settings\Administrator\Desktop> ''' import http.

Re: Python3: Is this a bug in urllib?

2010-10-20 Thread Justin Ezequiel
On Oct 20, 8:32 pm, Justin Ezequiel wrote: > On Oct 20, 12:47 am, Johannes Bauer wrote: > > > > > >>> from urllib import request; request.URLopener().open("http://google.de";) > > aren't you supposed to call read on the return value of open? >

Re: Python3: Is this a bug in urllib?

2010-10-20 Thread Justin Ezequiel
On Oct 20, 12:47 am, Johannes Bauer wrote: > > >>> from urllib import request; request.URLopener().open("http://google.de";) > aren't you supposed to call read on the return value of open? i.e., request.URLopener().open("http://google.de";).read() -- http://mail.python.org/mailman/listinfo/pytho

Re: I don't get why sys.exit(1) doesn't exit the while loop in the follow case

2010-10-04 Thread Justin Ezequiel
your bare except is catching the SystemExit raised by sys.exit(1) -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleHTTPServer, external CSS, and Google Chrome

2010-09-19 Thread Justin Ezequiel
LOL. twas http://bugs.python.org/issue839496 -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleHTTPServer, external CSS, and Google Chrome

2010-09-19 Thread Justin Ezequiel
On Sep 18, 2:54 am, MrJean1 wrote: > FWIW, > > There is a blue text on a red background in all 4 browsers Google > Chrome 6.0.472.59, Safari 5.0.1 (7533.17.8), FireFox 3.6.9 and IE > 6.0.2900.5512 with Python 2.7 serving that page on my Windows XP > SP 3 machine. > > /Jean > Hmm. Will downloa

SimpleHTTPServer, external CSS, and Google Chrome

2010-09-17 Thread Justin Ezequiel
I am running "python -m SimpleHTTPServer 80" on Windows XP Pro SP 3 (Python 2.5.4) browsing http://localhost/ using IE8 and FireFox 3.6, I get blue text on red background on Google Chrome 6.0 however, I get blue text on white background placing index.htm and styles.css (see below) under IIS, I get

Re: automate minesweeper with python

2010-06-30 Thread Justin Ezequiel
On Jul 1, 7:39 am, Jay wrote: > I would like to create a python script that plays the Windows game > minesweeper. > > The python code logic and running minesweeper are not problems. > However, "seeing" the 1-8 in the minesweeper map and clicking on > squares is. I have no idea how to proceed. you

Re: Python DXF import library?

2010-04-20 Thread Justin Ezequiel
On Apr 20, 9:19 pm, Stodge wrote: > Is anyone aware of a Python DXF import library? I think I remember > seeing converters but so far I haven't found a library. I need to > write a tool that reads DXFs so I'm not yet sure if a converter would > be of any use. Thanks http://lmgtfy.com/?q=Python+DX

Re: remove element with ElementTree

2010-03-09 Thread Justin Ezequiel
On Mar 9, 11:35 am, tdan wrote: > I have been using ElementTree to write an app, and would like to > simply remove an element. > But in ElementTree, you must know both the parent and the child > element to do this. > There is no getparent() function, so I am stuck if I only have an > element. > s

Re: how to do filetransfer using usrp.

2010-02-19 Thread Justin Ezequiel
On Feb 19, 7:38 pm, sarosh wrote: > how to do filetransfer using usrp. > can i make lan interface between two computers connected to usrp each and > then transfer files (images/video) between them? > how to transfer files? > is there any example of such kind in gnuradio? > > sarosh am not sure wh

Re: Extracting text from html

2009-08-04 Thread Justin Ezequiel
http://tinyurl.com/kpoweq -- http://mail.python.org/mailman/listinfo/python-list

Re: guessing file type

2009-07-17 Thread Justin Ezequiel
On Jul 17, 8:39 pm, VanL wrote: > Seldon wrote: > > Hello,  I need to determine programmatically a file type from its > > content/extension (much like the "file" UNIX command line utility) > > > I searched for a suitable Python library module, with little luck. Do > > you know something useful ? >

Re: Something weird about re.finditer()

2009-04-15 Thread Justin Ezequiel
On Apr 15, 4:46 pm, Gilles Ganault wrote: > re_block = re.compile('before (.+?) after',re.I|re.S|re.M) > > #Here, get web page and put it into "response" > > blocks = None > blocks = re_block.finditer(response) > if blocks == None: >         print "No block found" > else: >         print "Before b

Re: soap request includes a hyphenated field, don't know how to set it

2009-03-27 Thread Justin Ezequiel
On Mar 27, 3:33 pm, straycat...@yahoo.com wrote: > Working my way through suds, I have something like this: > > >>> event = client.factory.create('ns0:UserVerifiedEvent') > >>> print event > > (UserVerifiedEvent){ >    event-id = None >    user-verified-content[] = >    domain-specific-attributes

Re: Uploading a file using POST

2009-03-18 Thread Justin Ezequiel
On Mar 19, 8:50 am, Thomas Robitaille wrote: > I am trying to upload a binary file (a tar.gz file to be exact) to a   > web server using POST, from within a python script. > > What I would like is essentially the equivalent of > > enctype="multipart/form-data"> > > have you seen http://code.ac

Re: How to convert between Japanese coding systems?

2009-02-19 Thread Justin Ezequiel
import email from email.Header import decode_header from unicodedata import name as un MS = '''\ Subject: =?UTF-8?Q? romaji=E3=81=B2=E3=82=89=E3=81=8C=E3=81=AA=E3=82=AB=E3=82=BF?= Date: Thu, 19 Feb 2009 09:34:56 - MIME-Version: 1.0 Content-Type: text/plain; charset=EUC-JP Content-Transfer-Enco

Re: How to convert between Japanese coding systems?

2009-02-19 Thread Justin Ezequiel
On Feb 19, 2:28 pm, Dietrich Bollmann wrote: > Are there any functions in python to convert between different Japanese > coding systems? > > I would like to convert between (at least) ISO-2022-JP, UTF-8, EUC-JP > and SJIS.  I also need some function to encode / decode base64 encoded > strings. > >

Re: How do i add body to email.mime.multipart.MIMEMultipart instance?

2009-02-05 Thread Justin Ezequiel
On Feb 4, 2:48 pm, srinivasan srinivas wrote: > Hi, > Could someone tell me the way to add body to the instance > email.mime.multipart.MIMEMultipart instance which has attachments? > > Thanks, msg = MIMEMultipart() msg.preamble = 'This is a multi-part message in MIME format.\n' msg.epilogue = ''

Re: How do i add body to 'email.mime.multipart.MIMEMultipart' instance?

2009-02-04 Thread Justin Ezequiel
On Feb 4, 2:50 pm, srinivasan srinivas wrote: > Hi, > Could someone tell me the way to add body content to > 'email.mime.multipart.MIMEMultipart' instance? > > Thanks, > Srini excerpt from one of the modules I use: def build_body(html, text=''): text = text.strip() and text or html2text(htm

Re: Module/Library That is Able To Use Cookies + Proxies?

2009-01-29 Thread Justin Ezequiel
On Jan 30, 12:06 pm, blackcapsoftw...@gmail.com wrote: > I would like to do is be able to log into a site that uses cookies to > store information about the user when logging in. This works fine and > dandy with ClientCookie. Now, I want to be able to do so with a proxy, urllib2 http://docs.pytho

Re: file tell in a for-loop

2008-11-18 Thread Justin Ezequiel
On Nov 19, 7:00 am, Magdoll <[EMAIL PROTECTED]> wrote: > I was trying to map various locations in a file to a dictionary. At > first I read through the file using a for-loop, but tell() gave back > weird results, so I switched to while, then it worked. > > The for-loop version was something like: >

Re: Sending multi-part MIME package via HTTP-POST

2008-11-04 Thread Justin Ezequiel
have you tried using the def request(self, method, url, body=None, headers={}) method instead of putrequest, endheaders, send methods? where body is --===1845688244== Content-Type: application/vnd.cip4-jmf+xml MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-ID: beginning

Re: download image from flickr.com

2008-10-30 Thread Justin Ezequiel
##compile_obj = re.compile(r'dyn.Img\(".*?",".*?",".*?","(.*?)"') compile_obj = re.compile(r'\http://mail.python.org/mailman/listinfo/python-list

Re: Newbie, list has no attribute iteritems

2008-07-04 Thread Justin Ezequiel
def handle_starttag(self, tag, attrs): # <-- attrs here is a list if 'a' != tag: self.stack.append(self.__html_start_tag(tag, attrs))# <-- attrs here is still a list return attrs = dict(attrs)# <-- now attrs is a dictionary -- http://mail.python

Re: how to send a "Multiline" mail with smtplib?

2008-06-19 Thread Justin Ezequiel
perhaps change html body=MIMEText('hello,\r\n ok',_subtype='html',_charset='windows-1255') to plain body=MIMEText('hello,\r\n ok',_subtype='plain',_charset='windows-1255') -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling some isolated iso-8859-1 characters

2008-06-03 Thread Justin Ezequiel
On Jun 4, 2:38 am, Daniel Mahoney <[EMAIL PROTECTED]> wrote: > I'm working on an app that's processing Usenet messages. I'm making a > connection to my NNTP feed and grabbing the headers for the groups I'm > interested in, saving the info to disk, and doing some post-processing. > I'm finding a few

Re: how to use subprocess.Popen execute "find" in windows

2008-05-06 Thread Justin Ezequiel
On May 6, 5:19 pm, [EMAIL PROTECTED] wrote: > In cmd, I can use find like this. > > C:\>netstat -an | find "445" > TCP0.0.0.0:4450.0.0.0:0 LISTENING > UDP0.0.0.0:445*:* > > C:\> > > And os.system is OK.>>> import os > >>> os.system('netstat -an | fin

Re: parsing json output

2008-03-18 Thread Justin Ezequiel
FWIW, using json.py I got from somewhere forgotten, >>> import json >>> url = >>> 'http://cmsdoc.cern.ch/cms/test/aprom/phedex/dev/gowri/datasvc/tbedi/requestDetails' >>> params = {'format':'json'} >>> import urllib >>> eparams = urllib.urlencode(params) >>> import urllib2 >>> request = urllib2.R

Re: Image to browser

2008-01-15 Thread Justin Ezequiel
On Jan 16, 1:19 pm, [EMAIL PROTECTED] wrote: > On Jan 16, 12:16 am, [EMAIL PROTECTED] wrote: > > > Im using mod_python and apache2 using psp for output of page, i open a > > file and resize it with the following code > > > <% > > import Image, util > > > fields = util.FieldStorage(req) > > filename

Re: Python CGI - Presenting a zip file to user

2008-01-02 Thread Justin Ezequiel
On Jan 3, 1:35 pm, jwwest <[EMAIL PROTECTED]> wrote: > Thanks! That worked like an absolute charm. > > Just a question though. I'm curious as to why you have to use the > msvcrt bit on Windows. If I were to port my app to *NIX, would I need > to do anything similar? > > - James not needed for *NIX

Re: Python CGI - Presenting a zip file to user

2008-01-02 Thread Justin Ezequiel
[ "Content-type: %s;", "Content-Disposition: attachment; filename=%s", "Content-Title: %s", "Content-Length: %i", "\r\n", # empty line to end headers ] ) if __name__ == '__main_

Re: MySQLdb: ValueError Something Stupid

2007-09-09 Thread Justin Ezequiel
On Sep 7, 10:39 pm, mcl <[EMAIL PROTECTED]> wrote: > On 7 Sep, 14:11, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > > > On Fri, 2007-09-07 at 05:52 -0700, mcl wrote: > > > > ValueError: invalid literal for int(): 0- > > > > args = ('invalid literal for int(): 0-',) > > > > >

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: 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: 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: 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: 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: 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: 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-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: 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: 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

Re: python newbie beautifulSoup question

2007-04-11 Thread Justin Ezequiel
On Apr 12, 4:15 am, Jon Crump <[EMAIL PROTECTED]> wrote: > Is it possible to feed findAll() a list of tags WITH attributes? >>> BeautifulSoup.__version__ '3.0.3' >>> s = '''\nboo\nhello\n>> a="bar">boo\nhi\n''' >>> soup = BeautifulSoup.BeautifulSoup(s) >>> def func(tag): ... if tag.name not i

UDT wrappers

2007-04-11 Thread Justin Ezequiel
Found a couple of papers that mention Python wrappers for UDT have been written but Google fails me. Do any of you know of such wrappers? Have downloaded UDT SDK but source is in C++. http://udt.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup vs. Microsoft

2007-03-29 Thread Justin Ezequiel
On Mar 29, 6:11 pm, "Justin Ezequiel" <[EMAIL PROTECTED]> wrote: > > FWIW, seehttp://tinyurl.com/yjtzjz > hmm. not quite right. http://tinyurl.com/ynv4ct or http://www.crummy.com/software/BeautifulSoup/documentation.html#Customizing%20the%20Parser -- http://mail.py

Re: BeautifulSoup vs. Microsoft

2007-03-29 Thread Justin Ezequiel
On Mar 29, 4:08 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > John Nagle <[EMAIL PROTECTED]> wrote: > > title="

Re: wxPython, Syntax highlighting

2007-03-27 Thread Justin Ezequiel
On Mar 28, 2:56 pm, "Eric von Horst" <[EMAIL PROTECTED]> wrote: > I am looking for wx widget that has the ability to show text, edit the > text (like a TextCtrl) but also does syntax highlighting (if the text > is e.g. XML or HTML). > I have been looking in the latest wxPython version but I could

Re: shutil.copy Problem

2007-03-26 Thread Justin Ezequiel
On Mar 27, 11:10 am, David Nicolson <[EMAIL PROTECTED]> wrote: > Hi, > > I wasn't exactly sure where to send this, I don't know if it is a bug > in Python or not. This is rare, but it has occurred a few times and > seems to be reproducible for those who experience it. > > Examine this code: > >>>

Re: getting local system information with python

2007-03-15 Thread Justin Ezequiel
On Mar 16, 2:27 pm, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a python script and I want to check what operating system it is > on and what the current local machine name is. > How do I do it with python? > Thanks! > Astan import platform platform.uname() -- http://mail.python.org/mai

Re: how to store and still search special characters in Python and MySql

2007-02-15 Thread Justin Ezequiel
On Feb 12, 12:26 pm, "ronrsr" <[EMAIL PROTECTED]> wrote: > I have an MySQL database called zingers. The structure is: > > I am having trouble storing text, as typed in latter two fields. > Special characters and punctuation all seem not to be stored and > retrieved correctly. > > Special apostroph

Re: Convert raw data to XML

2007-01-29 Thread Justin Ezequiel
On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote: > For example the raw data is as follows > > SomeText Description>PassorFail > > without spaces or new lines. I need this to be written into an XML > file as > > > > > > > SomeText >

Re: os.popen() not executing command on windows xp

2007-01-11 Thread Justin Ezequiel
> import os > a = os.popen('"c:\Program Files\Grisoft\AVG Free\avgscan.exe" > "c:\program files\temp1\test1.txt"') > print a.read() > use raw strings e.g., instead of '"c:...\avgscan...' use r'"c:...\avgscan...' http://www.ferg.org/projects/python_gotchas.html#contents_item_2 -- http://mail.py

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: 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: 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: 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
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: 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: 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: 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: 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: 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: web app breakage with utf-8

2006-07-07 Thread Justin Ezequiel
replacing connection.character_set_name instance method seems to work but is this the correct/preferred way? >>> import MySQLdb >>> MySQLdb.get_client_info() '4.1.8' >>> import sys >>> sys.version '2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]' >>> sys.platform 'win32' >>> cred =

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: 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: 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: 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: Convert Word .doc to Acrobat .pdf files

2006-03-28 Thread Justin Ezequiel
"When you create a PostScript file you have to send the host fonts. Please go to the printer properties, "Adboe PDF Settings" page and turn OFF the option "Do not send fonts to Distiller". kbperry, sorry about that. go to "Printers and Faxes" go to properties for the "Adobe PDF" printer go to the

Re: Obtaining the remote ip address

2006-03-27 Thread Justin Ezequiel
os.environ['REMOTE_ADDR'] os.environ['REMOTE_HOST'] -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread Justin Ezequiel
## this creates a postscript file which you can then convert to PDF ## using Acrobat Distiller ## ## BTW, I spent an hour trying to get this working with ## win32com.client.Dispatch ## (the save file dialog still appeared) ## Then I remembered win32com.client.dynamic.Dispatch ## ## Can somebody ple

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: 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: 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

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

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