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:
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
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
--
On Tue, Mar 29, 2011 at 9:59 PM, Alexander Gattin xr...@yandex.ru 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
On Mar 20, 7:30 am, Alexander Gattin xr...@yandex.ru 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
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
'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
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
'''
C:\Documents and Settings\Administrator\Desktoppython wtf.py
301 Moved Permanently
b'HTMLHEADmeta http-equiv=content-type content=text/
html;charset=utf-8
\nTITLE301 Moved/TITLE/HEADBODY\nH1301 Moved/H1\nThe
document has mo
ved\nA HREF=http://www.google.de/;here/A.\r\n/BODY/HTML\r\n'
foo 5.328
On Oct 20, 12:47 am, Johannes Bauer dfnsonfsdu...@gmx.de 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()
--
On Oct 20, 8:32 pm, Justin Ezequiel justin.mailingli...@gmail.com
wrote:
On Oct 20, 12:47 am, Johannes Bauer dfnsonfsdu...@gmx.de 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.,
.read
your bare except is catching the SystemExit raised by sys.exit(1)
--
http://mail.python.org/mailman/listinfo/python-list
LOL. twas http://bugs.python.org/issue839496
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 18, 2:54 am, MrJean1 mrje...@gmail.com 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.
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
On Jul 1, 7:39 am, Jay jayk...@yahoo.com 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
On Apr 20, 9:19 pm, Stodge sto...@gmail.com 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
On Mar 9, 11:35 am, tdan df.tr...@gmail.com 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
On Feb 19, 7:38 pm, sarosh sarosh.n...@hotmail.com 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?
http://tinyurl.com/kpoweq
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 17, 8:39 pm, VanL van.lindb...@gmail.com 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
On Apr 15, 4:46 pm, Gilles Ganault nos...@nospam.com 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
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[] = empty
domain-specific-attributes =
On Mar 19, 8:50 am, Thomas Robitaille thomas.robitai...@gmail.com
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
form name='proceedings' method='post'
On Feb 19, 2:28 pm, Dietrich Bollmann dir...@web.de 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
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
On Feb 4, 2:48 pm, srinivasan srinivas sri_anna...@yahoo.co.in
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
On Feb 4, 2:50 pm, srinivasan srinivas sri_anna...@yahoo.co.in
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
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
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:
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
##compile_obj = re.compile(r'dyn.Img\(.*?,.*?,.*?,(.*?)')
compile_obj = re.compile(r'\img src=([^]+?)')
--
http://mail.python.org/mailman/listinfo/python-list
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
--
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
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
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 | find 445')
TCP
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.Request(url,eparams)
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 =
,
\r\n, # empty line to end headers
]
)
if __name__ == '__main__':
os.chdir(r'C:\Documents and Settings\Justin Ezequiel\Desktop')
files = [
'4412_ADS_or_SQL_Server.pdf',
'Script1.py',
'html_files.zip',
'New2.html',
]
b = StringIO
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 as *NIX
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-',)
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
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
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(SELECT * FROM table1)
res = c.fetchall ()
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 clear
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
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)(?!\.thumbnail)\.jpe?g$
download and experiment
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(dst)
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 would
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
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
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
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 = '''x\nzboo/z\nz a=foo b=barhello/z\ny
a=barboo/y\ny a=foohi/y\n/x'''
soup = BeautifulSoup.BeautifulSoup(s)
def func(tag):
...
On Mar 29, 4:08 pm, Duncan Booth [EMAIL PROTECTED] wrote:
John Nagle [EMAIL PROTECTED] wrote:
title=!--http://www.microsoft.com/usability/information.mspx-
is supposed to be an HTML comment. But it's improperly terminated.
It is an attribute value, and unescaped angle brackets are
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.python.org/mailman/listinfo/python
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 not
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:
try:
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()
--
On Feb 12, 12:26 pm, ronrsr [EMAIL PROTECTED] wrote:
I have an MySQL database called zingers. The structure is:
snip
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 apostrophes and
On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote:
For example the raw data is as follows
?xml version=1.0 ?BlahABCId id=1/DescriptionSomeText /
DescriptionResultPassorFail/Result/ABC/Blah
without spaces or new lines. I need this to be written into an XML
file as
?xml version=1.0 ?
Blah
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
--
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 =
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
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:
Fredrik Lundh wrote:
Justin Ezequiel wrote:
from TaskQueue import TaskQueue
what Python version is this ?
/F
oops. forgot to note...
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475160
--
http://mail.python.org/mailman/listinfo/python-list
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
[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 =
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 times
already.
Did it work for you normally
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
[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 =
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 request containing the
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 = {'passwd':
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).hexdigest()
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
try,
if hasattr(sys, 'frozen'): me = sys.executable
else: me = sys.argv[0]
--
http://mail.python.org/mailman/listinfo/python-list
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
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 General
os.environ['REMOTE_ADDR']
os.environ['REMOTE_HOST']
--
http://mail.python.org/mailman/listinfo/python-list
## 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
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 data
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
have you seen http://www.pdfhacks.com/pdftk/
--
http://mail.python.org/mailman/listinfo/python-list
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 =
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
84 matches
Mail list logo