gaius hammond Wrote:
>Hi all,
>
>
>I am having a very strange problem with cx_Oracle, has anyone
>seen this kind of behavior before:
>
>
>
>ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
>Python 2.5.2 (r252:60911, Mar 27 2008, 18:53:24) [C] on sunos5
>Type "help", "copyright", "credits"
jlist wrote:
>
> I found out why. I set a proxy in IE and I didn't know
> ActiveState Python use IE proxy!
>
> > I'm running ActiveState Python 2.5 on Windows XP. It used
> > to work fine. Today however I get (10061, 'Connection refused')
> > for any site I try with urllib.urlopen().
>
switching
[EMAIL PROTECTED] wrote:
>
> [EMAIL PROTECTED] wrote:
>
> > 1. return string names of required methods in getAllMethod
> > return ['method1', 'method2', 'method3']
> > 2. use gettattr on self and then exetute methods in applyAll
> > def applyAll(self):
> > for method_name in self.
[EMAIL PROTECTED] wrote:
> Hi,
>
> Is the following code is ok. who to call all method.
> It is working but the call to m() without a reference to self seems
> strange
>
> Thanks for your help
>
> class CustomMethod:
> def method1(self):
>
> def method2(self):
> ...
> -Original Message-
> From: Madari, Edwin
> Sent: Monday, August 18, 2008 3:03 PM
> To: 'len'; python-list@python.org
> Subject: Re: Newbie problem inserting into MySQL
>
> > -Original Message-
> > From:
> [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > yt
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> ython.org]
> On Behalf Of len
> Sent: Monday, August 18, 2008 11:55 AM
> To: python-list@python.org
> Subject: Newbie problem inserting into MySQL
>
>
> Hi All
>
> I have started a little pet project to learn py
running this snippet, is blanking out ^abdc$.. what is the issue ?
abcd
efg
hijk
lmn
$
efg
hijk
lmn
regards
Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Peng Yu
Sent: Sunday, August 17, 2008 11:47 PM
To: python-list@python.org
Subject: How to de
do the ESX server provide any api's or an interactive session may ?
thx. Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Eric Wertman
Sent: Sunday, August 17, 2008 2:43 PM
To: python-list@python.org
Subject: Re: Vmware api
I would also be intereste
source in or execute .profile (or .bash_profile which ever is applicable to
you) as a first thing in the cron to get environment variables.
hope that helps.
Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Eric Wertman
Sent: Sunday, August 17, 2008
has any one out there succeeded in compiling/installing mod_python for apache2
and python 2.5. I am using python 2.5 on cygwin.
thanks in advance
Edwin
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
produc
by the way, iterating over bar will throw KeyError if that key does not exist
in foo. to see that in action, simply set another key in bar after
copy.deepcopy stmt in this example..
bar['xtra'] = 0
and re-run
fun learning with python...
Edwin
-Original Message-
From: Madari, Edwin
if the values for any of the keys are None, both do not work as can be seen
below!!.
since both loops are iterating over keys(), 'get' method which would return a
'0' for non existing key does not encounter any non-existing keys.
impo
for someMethod(Field1 ArrayOf_xsd_string, other_parameters)
a call someMethod( ['str1', 'str2', 'str3'], other_parameters) *works for me*
with SOAPpy 0.12.0. yes sir it does.
in PERL, let alone array types, even for simple types it was hard for me with
all the '->', and '$' prefixing for obje
afraid not.. simple to create your own, NOTE that key words can be supplied
more than once. Hence...
import urllib
def urldecode(query):
d = {}
a = query.split('&')
for s in a:
if s.find('='):
k,v = map(urllib.unquote, s.split
1. check out the Caveats for thread module:
http://docs.python.org/lib/module-thread.html
Threads interact strangely with interrupts: the KeyboardInterrupt exception
will be received by an arbitrary thread. (When the signal module is available,
interrupts always go to the main thread.)
i.e.,
#your thought is right.
===
def sizes2fields(sizes):
d = []
begin = 0
for i in sizes:
if begin:
end = begin + i
else: end = i
d.append((begin, end))
begin += i
return tuple(d)
def slicestring(s, field
db module properly formats arguments, if input arguments are separated from
table_name and colum_names.
columns = ('tID', 'tNote')
table_name = 'tmp'
sql = 'select %s from %s where tID=:1' % ( ', '.join(columns), table_name)
cursor.execute(sql, (1,))
# sql is now 'select tID, tNote from tmp
replace the name of table before calling *.execute.
s.dbptr.execute(str % (e[0]))
good luck.
Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Evan
Sent: Thursday, August 14, 2008 11:27 AM
To: python-list@python.org
Subject: a question about mysqldb
here is a working code snippet to read from MySQL db.
python tutorial has examples of reading from files.
put them together to do your task.
===
import MySQLdb
con = MySQLdb.connect(host='127.0.0.1',
port=4321, user='joe', passwd='shmoe', db='t
save following code in script.py, and run it as 'python script.py
'
with your sample data this prints out following which is what you are looking
for (i think)
3.08333 9.05526 3.13581
4.08322 4.02526 3.95891
import sys
data = []
row = []
f
use songs.extend( asongs ) #append is for single item - where ever it might be.
>>> l1 = range(5)
>>> l2 = range(5,10)
>>> l1
[0, 1, 2, 3, 4]
>>> l2
[5, 6, 7, 8, 9]
>>> l1.extend(l2)
>>> l1
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>>
good luck.
Edwin
-Original Message-
From: [EMAIL PROT
os.paht.gmtime(path) returns the last modification of path.
check out http://docs.python.org/lib/module-os.path.html
regards
Edwin
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of William Purcell
Sent: Tuesday, August 12, 2008 1:47 PM
To: Python List
Subject:
sounds like *soundex* is what you are looking for. google soundex
regards
Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Marc 'BlackJack' Rintsch
Sent: Monday, August 11, 2008 3:09 AM
To: python-list@python.org
Subject: Re: for x,y in word1, word2
for similar tasks, I use pexpect http://pypi.python.org/pypi/pexpect.
spawning bash process and simulate an interactive session. Here sending ls
command, retrieving results and exiting. In the spawned process ssh or any
other command, is just another command.
actual session
if its *NOT* an exercise in re, and if input is a bunch of lines within '{'
and '}' and each line is key="value" pairs, I would not go near re. instead
simply parse keys and array of values into a dictionary, and process them from
the dictionary as below, and the key option correctly has 2 entr
>>> round(76.1, -2)
100.0
>>> round(76.1, -1)
80.0
>>> round(76.1)
76.0
>>>
builtin function round, will work for you..
Help on built-in function round in module __builtin__:
round(...)
round(number[, ndigits]) -> floating point number
Round a number to a given precision in
since choice of dbm used by shelve http://docs.python.org/lib/node327.html
depends on os, and whats available on it, shevle files saved on one os, most
likely do not work on another os, sometimes on similar os but different
machines might not work either - goes back to what's available on that m
from each line separate out url and request parts. split the request into
key-value pairs, use urllib to unquote key-value pairs..as show below...
import urllib
line = "GET
/stat.gif?stat=v&c=F-Secure&v=1.1%20Build%2014231&s=av%7BNorton%20360%20%28Symantec%20Corporation%29+69%3B%7Dsw%7BNorto
since I do not have access to xterm, here is the interactive session for
spawning bash(another session if you will), sending ls command to it, and
retrieving the results.
things to note are:
1. after spawning expect for the prompt, timeout, and eof #which ever happens
first
2. return value is th
delete the extra 'tries += 1' after
else:
print "Higher..."
tries += 1 #delete this
while at it, and add this line as the first line in function ask_number()
global the_number, tries
good luck.
Edwin
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMA
use re module
import re
template = '^My name is alex'
astring = 'My name is alex, and I like pie'
if re.match(template, astring):
print 'Found it'
else: print '%s does not begin with %s' % (astring, template)
good luck.
Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EM
#this is a better way of testing a string for float
def isFloat(s):
try:
s = float(s)
except:
return False
return True
-Original Message-
From: Madari, Edwin
Sent: Wednesday, August 06, 2008 10:22 PM
To: 'Wei Guo'; python-list@python.org
Subject: RE: A question
type(s) == type(float())
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Wei Guo
Sent: Wednesday, August 06, 2008 9:23 PM
To: python-list@python.org
Subject: A question about string and float number
Hi all,
I am new of python. Could anyone help me a quest
can you edit the xml and add the dtd/scheama ?
.Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Ben Finney
Sent: Wednesday, August 06, 2008 7:07 PM
To: python-list@python.org
Subject: Re: Using an DTD not specified in XML file for validation
Brian
use SOAP::Lite;
use Data::Dumper;
$ENV{HTTP_proxy} = "my_proxy_server_not_soap_proxy_server";
$ENV{HTTP_proxy_user} = ""; #set correct value
$ENV{HTTP_proxy_pass} = ""; #set correct value
my $soap = SOAP::Lite ->service('file:./local_file_copy_of_wsdl.wsdl');
my $som = $soap->soapMethod("method",
unable to get past local proxy server with SOAPpy client. In the code below
using 'thproxy' or 'httpproxy' variable for http_proxy fails.
from SOAPpy import WSDL
proxyuser='..'
proxypass='..
httpproxy="a.b.c.com:1234"
theproxy='http://'+proxyuser+':'+proxypass+'@'+httpproxy
wsdl='sample
hi,
any hints/pointers appreciated if you have succeeded in making a soap call
through a firewall.
other than this http://www.ibm.com/developerworks/xml/library/x-tipfire.html
cannot find much.
thanks in advance
Edwin
The information contained in this message and any attachment may be
propr
if you can print out values of 'filemask', and 'thefile' variables, when it
crashes, I can help.
thx. Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Jorgen Bodde
Sent: Monday, August 04, 2008 2:24 PM
To: python-list@python.org
Subject: UnicodeDec
here is working code that will read & display contents of all rows & columns
in all the sheets, you need xlrd 0.6.1
import xlrd, os, sys
book = xlrd.open_workbook(sys.argv[1])
print "The number of worksheets is", book.nsheets
for shx in range(book.nsheets):
sh = book.sheet_by_index(shx)
p
for nth square root: use math.sqrt n times for example
>>> import math
>>> num = 625
>>> how_many_sqrt = 2
>>> for i in range(how_many_sqrt):
.. num = math.sqrt(num)
..
>>> num
5.0
all comparisons work fine for arbitrary floating point numbers...
For readability print them with required prec
updated creature running in its own thread will get you started. try it for
yourself, change sleep times per your need.
import os, sys, threading, time
class Creature:
def __init__(self, status):
self.status = status
self.state = 'run'
def start(self):
self.athread = thr
appreciate hints or pointers for building python on HP.
running 'make test' fails with following cryptic message, after running
configure, & make. Attempting to build python from source on HP-UX
B.11.11 U 9000/800 3314646674 unlimited-user license
*** Error exit code 1
Stop.
not sure if out
42 matches
Mail list logo