On Thu, 26 Apr 2007 00:33:19 GMT, "Bill Habr"
<[EMAIL PROTECTED]> wrote:
>
><[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Cal Tech is the ELITE of ELITE in physics.
>>
>> If Feynman were alive, he would point his finger straight at the 911
>> criminal operators, the yank bastards
? should i check 'extn' to a
list of compatible image type extensions(something like
[''jpg','jpeg','png','gif'...] ) or is there a better way?
gordon
--
http://mail.python.org/mailman/listinfo/python-list
oImage__photo'" in > ignored
My belief was that the message
'total time: 0:00:00.341000 seconds '
should have been the last output message .I don't know where the
Exception exceptions.AttributeError: etc comes from. Already i am
catching the exception when creating Photo
eans that Tix wasn't installed properly."
why is this happening?Do i have to reinstall python2.5? or can i
reinstall Tix alone to my existing python installation?Can someone
help?
thanks
gordon
--
http://mail.python.org/mailman/listinfo/python-list
think i have to
reinstall python.
i also have numpy and PIL installed.If i reinstall python on top of
the current python directory will i lose them?
gordon
--
http://mail.python.org/mailman/listinfo/python-list
om my controller.If anyone can help/
advise please do
thanks
gordon
--
http://mail.python.org/mailman/listinfo/python-list
()
but it only gets executed after i close the the ui window.Is there a
way to get this message passing while gui is running ?
(forgive me ,it is a repeat question..but i am a bit desperate)
thanks
gordon
--
http://mail.python.org/mailman/listinfo/python-list
gets called only
after the event loop is finished(when i close gui window).
is there a way to keep the gui window open and have the controller
send a message to the gui instance so that i can pass the processed
result value to the gui instance?
thanks
gordon
--
http://mail.python.org/mailman/listinfo/python-list
destroy()
def updateDisplay(self,resultValue):
message='result is='+str(resultValue)
self.canvresult.delete(ALL)
self.canvresult.create_text(1, 40, anchor=W, text=message,
width=280)
self.okButton.configure(state=NORMAL)
self.myParent.mainloop() # resumes event loop
On Aug 29, 10:46 pm, "Russell E. Owen" <[EMAIL PROTECTED]> wrote:
you
> can safely compute stuff with a background thread and display it from> the
> main thread). But cross that bridge later.>
> -- Russell
thanks Russel
gordon
--
http://mail.python.org/mailman/listinfo/python-list
This post concerns the situation where Python code calls C code via
ctypes, the C code then calls a callback back into Python code which
in turn raises an exception.
Currently as I understand things when the callback finishes and
control is returning to C land ctypes will catch and print the
excep
We have many small libraries in JAVA or Ruby that need to be ported to
Python. Actually it's so simple a rewrite is possible too.
--
http://mail.python.org/mailman/listinfo/python-list
;
> > stdin=cmd1.stdout)
> Thank you Enrico. I've just tried your script and got this error:
> stdin=cmd1.stdout)
> ^
> SyntaxError: invalid syntax
Looks like you need a comma after 'stdout=filename'.
--
John Gordon
ile)
And it will display documentation for using objects of that type.
You can also use this command:
>>> dir(file)
And it will display all the members and methods that the object provides.
--
John Gordon A is for Amy, who fell down the stairs
gor...
y what the problem is.
However, I have a guess. Does MyLogger.set_logger() contain a call to
addHandler()? Each call to addHandler() adds another handler to your
logger, and when you call log.critical() [or any other log function] you
get one line of output for each handler.
You should only cal
In John Gordon writes:
> You should only call addHandler() once.
...for each intended logging output destination, of course. If you want
logging output to appear in a file and on-screen, then you would call
addHandler() once with a file handler and once with a screen handler.
But I think
x27;re telling python to remove all of the characters in '>contig-100_' from
the base string, which leaves nothing remaining.
The reason it "worked" on your first example was that the character '1'
didn't occur in your sample header string 'scaffold_
=7)
print "%d. %s" % (n, the_date)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
x27;No such file or directory'
or 'Command not found' error if they begin with a shebang line which refers
to a nonexistent program.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
n't matter to me. Thoughts?
It looks like the code is mistakenly interpreting 'user:A' as a port
specifier instead of a username and password. Can you supply the credentials
another way, perhaps in a header?
--
John Gordon A is for Amy, who fell down th
last line I typed.
How long did you wait for results before interrupting the command?
How large is text4? It might just take a while to process.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for B
y. There are no results to be fetched.
If you want to get results, execute a query (usually a SELECT.)
Also, that print statement is an obvious syntax error. Please post
the actual code you're running; don't type it in from memory.
--
John Gordon A is for Amy, who fell dow
thing, so you will at least
know if the UPDATE statement is ever executed.
Print the cur.rowcount attribute, which contains the number of rows that
were affected by the update. If it's zero, that should tell you something.
--
John Gordon A is for Amy, who fell down the s
eplase
> if cur.rowcount:
> print( " database has been affected" )
> with print cur.rowcount()
rowcount isn't a method call; it's just an attribute. You don't need
the parentheses.
--
John Gordon A is for Amy, who fell down the st
you sure that's
a real blank space, and not some weird character that *looks* like a space?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The
ase %s/%s"
> %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']),
> level=log.DEBUG, spider=spider)
> Is this ok? Are there any rules in Python when it comes to breaking up
> long lines of code?
There are guidelines in the PEP8 document:
print "Hello Master!"
> > break
> > > else: print "error"
> this doesent help me at all
Then you'll have to explain why, exactly, it doesn't help. Simply saying
"this doesn't help me" is very unhelpfu
hile statement belong?
while True:
username = raw_input("Please enter your username: ")
password = raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
print "Login Successful&q
x27;s right, therefore I did not test it? I don't understand.
If the code has a bug, please point it out.
> And note that the getpass module is what you should use for that second
> thing in real life, for the security of your users.
I'm sure this is just an exercise for the O
cky to explain,
but I'll do my best. :-)
The problem is that change() isn't being executed here; instead it's being
executed from within root.mainloop(), whenever the user presses button-1.
And within root.mainloop(), there is no variable called isWhite.
--
John Gordon
se global or nonlocal
> declarations.
Quite right. I should have verified my answer before posting. Thanks
for setting me straight. :-)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
the google form search input box is named 'q'
data = { 'q': 'Pie' }
response = urllib2.urlopen('http://google.com', urllib.urlencode(data))
print response.read()
--
John Gordon A is for Amy, who fell down the stairs
go
x27;,', '', 'DATA')
> DATA = re.sub('\'', '', 'DATA')
> DATA = re.sub('(', '', 'DATA')
> DATA = re.sub(')', '', 'DATA')
If your actual use-case is this simple, you might w
o
learn, but frameworks handle a ton of low-level details for you and make
web development overall much easier.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
--
;", line 6, in main
> 9: AttributeError: 'builtin_function_or_method' object has no attribute
> 'sleep'
> ==
You must have a file named 'time.py' in the current directory, and the
import statement is getting that module instead of the
> {'3': ('1', '2')}
> or should I just write my own dump function that can hanle thiS?
I think you have the arguments to pickle.dump() in the wrong order.
The data to be dumped should come first, then the file object.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
screen sizes.
And even if you're on a device that can display more than 80 characters, it
can be convenient to have several windows display side-to-side.
> Would following this recommendation improve script performance?
No, but it improves human readability.
--
John Gordon
to it. This
requires that tmpgndict[binmac] already exists, which it does not.
Make sure that tmpgndict[binmac] exists before you try appending to it.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
e contents of each file, be aware that the newlines
at the end of each line are included. If you don't want these, be sure
to call the rstrip() method to remove traling whitespace.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is f
2
>}
> }
Assuming you have valid json strings (which these aren't), I think you
could convert them into python objects with json.loads() and then compare
the python objects.
For example:
>>> import json
>>> json1 = '{"color": "blue", &qu
e if the (encrypted) password is stored in a database, you can't
exceed the table column width.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The
earlier code it appears to be a
function, but here you're appending it to leavelist. Did you really mean
to append a function object to leavelist?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
en(['notfouhd'], shell=True)
> copytree('sjkdf', 'dsflkj')
> except Exception as e:
> print("here")
> because if copytree fails it quits anyway.
> I also looked at the code but can't quite get why.. any idea?
copytree() coul
In andrea crotti
writes:
> Well that's what I thought, but I can't find any explicit exit
> anywhere in shutil, so what's going on there?
Try catching SystemExit specifically (it doesn't inherit from Exception,
so "except Exception" won't catch it.)
-
he current evidence indicates the universe will just keep
> expanding, it's more of a "deep freeze death..."
Heat death means *lack* of heat.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
ack of heat; in fact, it implies that there'll be
> rather more heat than there now is, because we currently have a whole
> lot of chemical energy available to be used.
*mind blown*
--
John Gordon A is for Amy, who fell down the stairs
gor.
bserved outside the U.S.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
own generator function that yields values
in whatever order you want:
def my_generator():
yield 9
yield 100
for i in range(200, 250):
yield i
yield 5
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com
encing the method object itself, instead of
calling it method. In other words, you've left off the parentheses.
I.e. you're doing something like this:
print my_object.foo
Instead of this:
print my_object.foo()
--
John Gordon A is for Amy, who fell down the stai
ich goes out of scope when myfunction()
exits. *_mydata ends up pointing to garbage.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies&quo
c char mydata[16];
That will solve the immediate problem, however it makes myfunction()
non-reentrant.
> (Btw.: I don't know why you use char ** _mydata, i would use
> char * _mydata, but then again, i'm not very familiar with
> ctypes)
He uses char **
In andrea crotti
writes:
> For my experience if I only see code in slides I tend not to believe
> that it works somehow
Presumably you will have some credibility with your audience so they won't
just assume you're making it up?
I think slides would be fine.
In John Mordecai Dildy
writes:
> Now it shows the error of:
> sudo: easy_instal: command not found
Try 'easy_install' instead of 'easy_instal'.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for
version 3, print was changed into a function.
Use this and it will work:
print("Game Over")
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Go
y 1-2
> > min or so.
> Yup! Just add a call to sys.stdout.flush() after each print.
Isn't terminal output line-buffered? I don't understand why there would
be an output delay. (Unless the "\r" is messing things up...)
--
John Gordon
't think file locking would be an issue.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
In Debashish Saha
writes:
> how to insert random error in a programming?
Open the program source file and replace the Nth character with a random
character.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted
vCamError inherit __str__() from Exception?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
In iMath
writes:
> how to get a list of names of everything in the current directory ?
Try os.listdir() .
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Go
In Chris Angelico
writes:
> It yields it? You mean Google is an iterator?
ITYM generator.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, &
x27;docs.python.org/library/uuid.html')
> 'ZG9jcy5weXRob24ub3JnL2xpYnJhcnkvdXVpZC5odG1s'
> I would prefer more concise ID's.
> What do you recommend? - Compression?
Does the ID need to contain all the information necessary to recreate the
original URL?
--
John Gordon A is for Amy, who
ng = 'key_1|||value_1key_2|||value_2'
pairs = string.split('')
for pair in pairs:
keyval = pair.split('|||')
print '%s=%s' % (keyval[0], keyval[1])
--
John Gordon A is for Amy
In <3d71f175-164e-494c-a521-2eaa5679b...@googlegroups.com> Michael Herrmann
writes:
> What, in your view, would be the most intuitive alternative name?
keyboard_input().
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is
In <8c0a3ea9-2560-47eb-a9c7-3770e41fe...@googlegroups.com>
subhabangal...@gmail.com writes:
> Dear Group,
> I have a list of the following pattern,
> [("''", "''"), ('Eastern', 'NNP'), ('Army', 'NNP'), ('Commander', 'NNP'), (=
> 'Lt', 'NNP'), ('Gen', 'NNP'), ('Dalbir', 'NNP'), ('Singh', 'NNP'),
n tup_list:
for item in t:
new_list.append(item)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.
In
subhabangal...@gmail.com writes:
> Thanks. But I am not getting the counter "5posts 0 views"...if
> moderator can please check the issue.
I logged in via Google Groups and all the replies were present. What
is your question?
(This group is not moderated.)
hing else?
What web standards does this mini browser need to support? Full HTML5?
Partial HTML? CSS? Javascript? Flash?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edw
In inq1ltd
writes:
> Right now I need some way to display
> 15 to 20 lines of html in its own window or
> as part of my screen.
Could you open a shell window and run a text web browser such as Lynx?
--
John Gordon A is for Amy, who fell down the stairs
gor...@
actual code you're using, instead of telling us about it.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
to go about doing
> that please help.
def encode(plain):
'''Return a substituted version of the plain text.'''
encoded = ''
for ch in plain:
encoded += key[alpha.index(ch)]
return encoded
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
sql = 'UPDATE product SET price=%s WHERE LOWER(sku)=%s'
cursor.execute(sql, (price, sku.lower())
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
fer single-quoted
strings (although that may be Oracle specific, as that's all I've really
worked with).
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
In
andydtay...@gmail.com writes:
> for row in cursor:
> row_count += 1
> if row[4] = True
> print row[1]
Since row[4] is a boolean value, you should be able to just say:
if row[4]:
print row[1]
--
the method from itself.
The argument to your method is called 'y' in the definition, but you refer
to it as 'Y' in the return statement. Variable names are case-sensitive.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is f
: [etc...]
I worked on an application that would insert a BOM in syslog messages if
the logged message contained unicode, but not if it was plain ascii.
Not sure if this relates to your issue, but it's similar enough that it
seemed worth mentioning.
--
John Gordon A is f
ar to have two very different versions of the tubecross table.
One version has three fields (id, num, data) and the other version has at
least four (station_code, SAJ, SPB, SOQ). Which one is correct?
Also, what is the 'cursor_to' variable? It doesn't appear to be defined
anywhere.
--
t the
> expression was first used with years ago. Probably applies to just
> about any technology. Including Java.
Steven cleverly worded it in such a way as to apply directly to threads.
The sentences are jumbled and interleaved, as if they were the output of
two threads that are not synchroni
ml
> nikos.html
> cool.html
> to HELP counter.py identify each webpage at a unique way.
Instead of inserting unique content in every page, can you use the
document path itself as the identifier?
--
John Gordon A is for Amy, who fell down the stairs
gor...@p
key.
(That seems fairly brittle though. For example if the disk crashes and is
restored from a backup, the inodes could easily be different.)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
ml 0002
/home/files/steve/recipes/chocolate-cake.html0003
/home/files/mary/payroll.html 0004
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
In <592233bd-3fc1-4e13-97f8-e11f89fbb...@googlegroups.com> Ferrous Cranus
writes:
> > pin int( htmlpage.encode("hex"), 16 ) % 1
> >
> > It'll give you your number, but there are no guarantees of uniqueness.
> You're looking at more blind random luck using that.
> Finally!! THANK YOU VER
In <4847a0e3-aefa-4330-9252-db08f2e99...@googlegroups.com> Ferrous Cranus
writes:
> And the .html files are not even close 10.000
You said you wanted a 4-digit number. There are 10,000 different 4-digit
numbers.
0001
0002
...
--
John Gordon A is for
ed Sub_Dir.My_Class
Is there a file named __init__.py in Sub_Dir? A directory must contain
that file in order to be considered a "module". (If you don't know what
to put in the file, just leave it empty.)
--
John Gordon A is for Amy, who fell down the stairs
gor...@
187 cursor.execute( '''INSERT INTO visitors(pin, host
, hits, useros, browser, date) VALUES(%s, %s, %s, %s, %s)''', (pin, hos
t, 1, useros, browser, date) )
The INSERT statement gives six column names but only five placeholders (%s)
in the VALUES clause.
Perhaps
t: ", daily_instances
This code assumes that log lines begin with a timestamp similar to
"2013-01-23T09:27:01". If the timestamp is in a different format, or
occurs elsewhere in the line, you'll have to adjust for that.
--
John Gordon A is for Amy,
valent to me (in terms of control flow).
But in the second example the fp.read() statement is duplicated, which is
undesirable. It would be all too easy for a maintenance programmer to go
into the code a year from now and change the first one but miss the second
one.
--
John Gordon
> complete/auto correct.
Try PyScripter.
http://code.google.com/p/pyscripter/
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashly
In Sharwan Joram
writes:
> use vim.
He said he wanted autocomplete. Does Vim have that?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gas
;> person['name'] = 'John'
>>> person['age'] = 40
>>> person['occupation'] = 'Programmer'
>>> print person['age']
40
Dictionaries can also be created with some initial values, like so:
>
version 2.x (and 1.x for that matter), "print" is a statement,
but it was changed to be a function in python version 3.x.
In other words, in python 2.x you can say this:
print x
print "hello there"
But in python 3.x you have to do it a little differently:
print(x)
pri
le "myfile.txt"), python
will attempt to open that file starting from the current working dir.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey,
In <9bfb3e39-2bc6-4399-90cc-1c53aa062...@h6g2000yqk.googlegroups.com>
smac2...@comcast.net writes:
> xls_files = glob.glob(in_dir + "*.xls")
You may want to put a directory separator character in between the
directory name and the filename glob patter
d it does catch some errors
such as incorrect indentation, but not errors like the above.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tin
re you asking for a list of
of all the possible timezone choices?
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list
e function to stop profiling!
So when I went to print the results, it was still profiling... endlessly.
(Okay, maybe it wasn't that funny.)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
pass
if __name__ == '__main__':
main()
Where $USERNAME, $DATE and $YEAR are expanded to the actual values.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
oing:
> > t = t.append(instansie)
append() modifies the list in-place. It doesn't return anything.
(and therefore its return value is None)
>>> x = [1, 2, 3]
>>> y = x.append(4)
>>> print x
[1, 2, 3, 4]
>>> print y
None
--
John Gordon
In Dev Dixit
writes:
> Please, tell me how to develop project on "how people intract with
> social networing sites".
First you need a more detailed description of exactly what you want.
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.co
or.png
> Now I have no idea what to do.
The first error on that screen is that "xslt-config" is not found
as a command.
Try a web search for "xslt-config not found", there seemed to be some
helpful results.
--
John Gordon A is for Amy, who fell down the
ms like a much cleaner solution, as I don't ever have to worry
about closing the connection; it gets done automatically.
I haven't ever used __del__ before. Are there any 'gotchas' I need to
worry about?
Thanks!
--
John Gordon A i
1 - 100 of 604 matches
Mail list logo