On Mar 17, 11:34 am, Bruno Desthuilliers wrote:
> Wes Santee a écrit :
>
> > I am very new to Python, and trying to figure out how to create an
> > object that has values that are accessible either by attribute name,
> > or by index. For example, the way os.stat()
On Mar 17, 11:14 am, Christian Heimes wrote:
> Wes Santee wrote:
> > I am very new to Python, and trying to figure out how to create an
> > object that has values that are accessible either by attribute name,
> > or by index. For example, the way os.stat() ret
ng an answer.
Cheers,
-Wes
--
http://mail.python.org/mailman/listinfo/python-list
it might help:
http://plastex.sourceforge.net/plastex/sect0025.html
-wes
--
http://mail.python.org/mailman/listinfo/python-list
>
>
> NEW QUESTION if y'all are still reading:
>
> Is there an integer increment operation in Python? I tried
> using i++ but had to revert to 'i = i + 1'
i+=1
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Feb 18, 2010 at 12:32 PM, Wes James wrote:
> On Thu, Feb 18, 2010 at 8:18 AM, Tim Chase
> wrote:
>> Wes James wrote:
>
>
>>
>> Just to add to the list of solutions I've seen, letting the built-in csv
>> module do the heavy lifting:
>
On Thu, Feb 18, 2010 at 8:18 AM, Tim Chase
wrote:
> Wes James wrote:
>
> Just to add to the list of solutions I've seen, letting the built-in csv
> module do the heavy lifting:
>
> >>> s = "['a','b']"
> >>> import
On Wed, Feb 17, 2010 at 4:53 PM, Wes James wrote:
> When I try to join #python on irc.freenode.net it keeps saying:
>
> You need to identify with network services to join the room "#python"
> on "irc.freenode.net".
>
> Server Details:
> Cannot join chan
When I try to join #python on irc.freenode.net it keeps saying:
You need to identify with network services to join the room "#python"
on "irc.freenode.net".
Server Details:
Cannot join channel (+r) - you need to be identified with services
What does this mean?
h "['a','b']" I have tried and get:
a="['a','b']"
b=a[1:-1].split(',')
returns
[ " 'a' "," 'b' " ]
when I want it to return ['a','b'].
How can I do this?
thx,
-wes
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 16, 3:53 pm, Irmen de Jong wrote:
> Tim Roberts wrote:
> > Wes McKinney wrote:
> >> I noticed the flag socket.MSG_WAITALL seems to have crept its way into
> >> Python 2.5 on Windows (it's in 2.5.4, but not in 2.5.1, not sure about
> >> inter
ailable in the socket module.
Does anyone know more about this?
Thanks,
Wes
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 21, 2009 at 12:46 PM, SKYLAB wrote:
> Greetings..
>
> First , my english is not good .
>
> I heard that was written in python ( Youtube Programming Language :
> PYTHON :S ) Correct ?
>
> That's not correct ? Then youtube is PHP application ?
>
> That's correct ; Which python web framew
Anyone know if there is a twit for python? I did
http://twitter.com/python, but nope on that I was looking for
twit py announcements, etc...
thx,
-wj
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 24, 2009 at 4:32 PM, Wes James wrote:
> On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels
> wrote:
>> Atul. wrote:
>
>
>
>> In your case, '\r' is a return (a single character), not two
>> characters long. I think its sad that 'C:\Th
On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels
wrote:
> Atul. wrote:
> In your case, '\r' is a return (a single character), not two
> characters long. I think its sad that 'C:\Thesis' doesn't cause
> an error because there is no such character as '\T', but I am
> probably excessively peda
On Mon, Mar 2, 2009 at 2:53 PM, Rey Bango wrote:
> Hi,
>
> I'd like to upgrade the installed version of Python that came standard
> on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot
> in it, I just wanted to get a better understanding of the process.
I'd recommend you put your
Steven. Thx
(see my question below...)
On Mon, Feb 23, 2009 at 9:47 PM, Steven D'Aprano
wrote:
> On Mon, 23 Feb 2009 21:35:38 -0700, Wes James wrote:
>
>> I have this line:
>>
>> navs.append(A(' '+str(i+1)+'
>> ',_href=self.action(arg
On Mon, Feb 23, 2009 at 9:35 PM, Wes James wrote:
> I have this line:
>
> navs.append(A(' '+str(i+1)+'
> ',_href=self.action(args=request.args,vars={'_page':i,'_query':request.vars._query
> or ''})))
>
> How do I do somethi
I have this line:
navs.append(A(' '+str(i+1)+'
',_href=self.action(args=request.args,vars={'_page':i,'_query':request.vars._query
or ''})))
How do I do something like this:
vars={'_page':i, if request.vars._query not None then insert this
key/value pair ('_query':request.vars._query) else insert
If I read a windows registry file with a line like this:
"{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program
Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted
Multicast|Edge=FALSE|"
with this code:
f=open('fwrules.reg2
Max,
def GeneticNextGen(self):
numsets = len(self.WtSets)
numwts= len(self.WtSets[0].Lis)
self.WtSets.sort(CompByCurrentFitness)
index_lis = []
K = 100.0
N= float(numwts)
#if RISE(slope) is too high, concentration occ
Bruno Ferreira wrote:
> Hi,
>
> I wrote a very simple python program to generate a sorted list of
> lines from a squid access log file.
>
> Here is a simplified version:
>
> ##
> 1 logfile = open ("squid_access.log", "r")
> 2 topsquid = [["0", "0", "0", "0", "0"
. Ive been stuck on this all
> week and have read numerous tutorials, the DB-API specification sheet, the
> MySQL manual, the MySQLdb documentation, and a few books... none of which
> seem to adress my problem since they are all only assigning variables to
> the table name OR the values of the query, not both. Please help me figure
> this out.
Luke,
It would be most helpful if you assigned the sql to
a string, printed the string, executed the string, and
posted the error message.
sql = "INSERT INTO %s (name, gender, job, level, str, dex, intel, cha, luc)
VALUES \
(%s, %s, %s, %s, %s, %s, %s, %s, %s) \
" % (CharAccount, CharName, CharGender, CharJob, CharLevel, Strength,\
Dexterity, Inteligence, Charm, Luck)
print "sql=",sql
cursor.execute(sql)
-then show the error message here
wes
--
http://mail.python.org/mailman/listinfo/python-list
Steve wrote:
> I'm currently working on a little database type program is which I'm
> using a dictionary to store the information. The key is a component a and
> the definition is a list of parts that make up the component. My problem
> is I need to list out several components, but not all, and
No, but before I signed up with them I asked if it was available
and they said yes.
wes
mbstevens wrote:
> I keep chatting with the tech support people at Earthlink, asking where
> the location of the Python interpreter is. They don't seem to know where
> it is. They don'
from HTMLParser import HTMLParser
class MyHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.TokenList = []
def handle_data( self,data):
data = data.strip()
if data and len(data) > 0:
self.TokenList.append(data)
Andrew Robert wrote:
> wes weston wrote:
>> Andrew Robert wrote:
>>> Hi Everyone,
>>>
>>> I am having a problem with a class and hope you can help.
>>>
>>> When I try to use the class listed below, I get the statement that self
>>> is
Andrew Robert wrote:
> Hi Everyone,
>
> I am having a problem with a class and hope you can help.
>
> When I try to use the class listed below, I get the statement that self
> is not defined.
>
> test=TriggerMessage(data)
self is not known here; only inside the class.
> var = tes
with:
for x in range(100):
if random.randint(0,1) == 0:
heads += 1
else:
tails += 1
Inside the loop you need to "flip" on each pass.
You're "flipping" once before the start of the loop now.
wes
--
http://mail.python.org/mailman/listinfo/python-list
nting it prior to the fetchone() w/o effect.
>
> Thanks for any pointers.
>
> Jeff Elkins
>
>
>
>
>
>
Jeff,
You just check for a fetchone return of None. "list" is a list
of tuples here.
...
cursor.execute( sql )
list = []
while
[EMAIL PROTECTED] wrote:
I'm trying to come up with a good algorithm to do the following:
Given a list 'A' to be operated on, and a list 'I' of indices into 'A',
rotate the i'th elements of 'A' left or right by one position.
Here's are some examples:
A = [a, b, c, d, e, f]
I = [0, 3, 4]
rotate(A, I
phil,
Could you do a circlular buffer where the front
starts at 'a' (0) and rotate left increments front.
The i'th element is gotten as mod 6 (front+i) where
6 would be the length of the list.
wes
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
On Thu, 17 Mar 2005 16:45:57 GMT, wes weston <[EMAIL PROTECTED]> declaimed
the following in comp.lang.python:
str = "INSERT INTO produkt1 (MyNumber) VALUES(%d)" % (MyNumber)
cursor.execute(str)
Think you meant "MyValue" for the second item
nyone trying to
help you.
Why have transactions not associated with accounts?
All transactions are related to an account; have
a self.TransActList in Account.
You have "amount" in both Withdrawl and Deposit
both derived from Transaction. If Transactions always
have an amou
1
(MyNumber)
VALUES(MyValue)
""")
#
Program says
OperationalError: (1054, "Unknown column 'MyValue' in 'field list'")
Where is a problem. Thanks for help
Lad.
Lad,
Try
str = "INSERT INTO produkt1 (MyNumber) VALUES(%d)" % (MyNumber)
cursor.execute(str)
wes
--
http://mail.python.org/mailman/listinfo/python-list
spawning so many threads -
but it's the simplest solution to this problem :) ).
PR,
I notice there's a resource module with a
getrusage(who) that looks like it would support
a test to get what you need.
wes
--
http://mail.python.org/mailman/listinfo/python-list
ut in "keywords.reverse()" after getting
keywords, things may work better. Though not a good
fix, it illustrates part of the problem. If you replace
"@PERMX1" you also replace part of "@PERMX10".
Wouldn't it be better to read the file as lines
instead of strings?
wes
--
http://mail.python.org/mailman/listinfo/python-list
is? If I put it in a common
location in my Python path, should I call it willsutil.py?
TIA,
Will McGugan
Will,
See
http://www.boost.org/libs/python/doc/tutorial/doc/html/python/techniques.html
'about page 30 of google search. It gives an example
that should help.
wes
--
http://mai
e!
Regards,
Philippe
Phillipp,
Might you be getting the wrong header file/tk version?
http://wiki.tcl.tk/3669 talks about it.
wes
--
http://mail.python.org/mailman/listinfo/python-list
t with
for x in jMatrix:
print x
Is it basic that indexes from 1 vs. 0? 'just about
completely forgotten basic.
wes
Thomas Bunce wrote:
Tryed it and this is what I got (I did go to the web sight)
tom(h=500)$ /tmp/501/Cleanup\ At\ Startup/ptesting-128981347.87.py.command; exit
Input the
1
k = random.choice(listvalues) + 1
iMatrix[index] = k
The book statement of
array(typecode, initializer) does not make sence
to me how it henerates ore relaes to the org name
for the array.
Thank You
Tom
Thomas,
You can do
>>> m = [4]
>>> m
[4]
wes
--
http://mail.python.org/mailman/listinfo/python-list
have figured out I can do
list.sort.__doc__
'L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1'
Grant,
For a quick, short doc string list: >>> help(list)
wes
--
http://mail.python.org/mailman/listinfo/python-list
as all the pieces you use most
often.
wes
--
http://mail.python.org/mailman/listinfo/python-list
modules don't
make much sence to me...
Amir
Amir,
>>> import tkSimpleDialog
>>> ch = tkSimpleDialog.askstring("","ch?")
wes
--
http://mail.python.org/mailman/listinfo/python-list
Sean Berry wrote:
Given
myList = ['cat', 'dog', 'mouse' ... 'bear']
what is the easiest way to find out what index 'dog' is at?
Sean,
>>> myList = ['cat', 'dog', 'mouse','bear']
>>> myList.index('dog')
1
>>>
wes
--
http://mail.python.org/mailman/listinfo/python-list
have a function name as an arg. You
could do:
def mycompare(s1,s2):
#return -1 to put s1's at front; 1 to put s1's at back; 0 for a tie
#if s1=="" and s2<>"": return 1
lines.sort(mycompare)
wes
--
http://mail.python.org/mailman/listinfo/python-list
47 matches
Mail list logo