Re: Video: Professor of Physics Phd at Cal Tech says: 911 Inside Job

2007-04-29 Thread Gordon
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

compatible image type

2008-07-04 Thread gordon
? 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

origin of error message

2008-07-04 Thread gordon
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

problem with Tix in Python2.5

2008-08-26 Thread gordon
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

Re: problem with Tix in Python2.5

2008-08-26 Thread gordon
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

newbie doubt about MVC,tkinter

2008-08-27 Thread gordon
om my controller.If anyone can help/ advise please do thanks gordon -- http://mail.python.org/mailman/listinfo/python-list

Tkinter event loop question

2008-08-27 Thread gordon
() 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

Re: Tkinter event loop question

2008-08-28 Thread gordon
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

Re: Tkinter event loop question

2008-08-29 Thread gordon
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

Re: Tkinter event loop question

2008-08-30 Thread gordon
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

ctypes exception in callback handlind

2009-11-05 Thread Gordon
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

Gedcom and Genealogy

2009-07-23 Thread Gordon
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

Re: python backup script

2013-05-06 Thread John Gordon
; > > 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

Re: Get filename using filefialog.askfilename

2013-05-07 Thread 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...

Re: @staticmethods called more than once

2013-05-21 Thread John Gordon
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

Re: @staticmethods called more than once

2013-05-21 Thread John Gordon
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

Re: lstrip problem - beginner question

2013-06-04 Thread John Gordon
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_

Re: How to increment date by week?

2013-06-04 Thread John Gordon
=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

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-05 Thread John Gordon
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

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread John Gordon
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

Re: Natural Language Processing with Python .dispersion_plot returns nothing

2013-06-17 Thread John Gordon
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

Re: Updating a filename's counter value failed each time

2013-06-17 Thread John Gordon
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

Re: Updating a filename's counter value failed each time

2013-06-17 Thread John Gordon
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

Re: Updating a filename's counter value failed each time

2013-06-17 Thread John Gordon
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

Re: Problem with the "for" loop syntax

2013-06-19 Thread John Gordon
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

Re: n00b question on spacing

2013-06-21 Thread John Gordon
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:

Re: How can i fix this?

2013-06-22 Thread John Gordon
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

Re: Loop Question

2013-06-24 Thread John Gordon
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

Re: Loop Question

2013-06-24 Thread John Gordon
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

Re: What's wrong with this code? (UnboundLocalError: local variable referenced before assignment)

2013-06-24 Thread John Gordon
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

Re: What's wrong with this code? (UnboundLocalError: local variable referenced before assignment)

2013-06-24 Thread 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

Re: Python HTTP POST

2013-07-17 Thread John Gordon
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

Re: Find and Replace Simplification

2013-07-19 Thread John Gordon
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

Re: Newbie: Python 3 and web applications?

2013-07-26 Thread John Gordon
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 --

Re: embedded python and threading

2013-07-26 Thread John Gordon
;", 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

Re: dump a multi dimensional dictionary

2013-07-26 Thread John Gordon
> {'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

Re: PEP8 79 char max

2013-07-29 Thread John Gordon
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

Re: binary key in dictionary

2013-07-31 Thread 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

Re: script to Login a website

2013-07-31 Thread John Gordon
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

Re: how to compare below 2 json structure in python

2012-06-21 Thread John Gordon
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

Re: code review

2012-07-03 Thread John Gordon
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

Re: Adding to a List and displaying quantity in the list

2012-07-10 Thread John Gordon
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

Re: adding a simulation mode

2012-07-12 Thread John Gordon
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

Re: adding a simulation mode

2012-07-12 Thread John Gordon
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.) -

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
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

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
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.

Re: the meaning of rユ.......ï¾

2012-07-23 Thread John Gordon
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

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread John Gordon
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

Re: Objects in Python

2012-08-22 Thread John Gordon
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

Re: ctypes - python2.7.3 vs python3.2.3

2012-08-28 Thread John Gordon
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

Re: ctypes - python2.7.3 vs python3.2.3

2012-09-07 Thread John Gordon
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 **

Re: Python presentations

2012-09-13 Thread John Gordon
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.

Re: Installing Pip onto a mac os x system

2012-09-20 Thread John Gordon
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

Re: Print Function

2012-09-21 Thread John Gordon
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

Re: Reducing cache/buffer for faster display

2012-09-27 Thread John Gordon
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

Re: How to get progress in python script.

2012-09-28 Thread 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

Re: how to insert random error in a programming

2012-10-15 Thread John Gordon
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

Re: Exception Messages

2012-10-15 Thread John Gordon
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

Re: How to only get a list of the names of the non-directory files in current directory ('.')?

2012-11-06 Thread John Gordon
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

Re: How to only get a list of the names of the non-directory files in current directory ('.')?

2012-11-13 Thread John Gordon
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, &

Re: Generate unique ID for URL

2012-11-13 Thread John Gordon
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

Re: Robust regex

2012-11-19 Thread John Gordon
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

Re: 10 sec poll - please reply!

2012-11-20 Thread John Gordon
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

Re: List problem

2012-12-03 Thread John Gordon
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'),

Re: Conversion of List of Tuples

2012-12-03 Thread John Gordon
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.

Re: Conversion of List of Tuples

2012-12-03 Thread John Gordon
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.)

Re: mini browser with python

2012-12-05 Thread John Gordon
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

Re: mini browser with python

2012-12-06 Thread John Gordon
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...@

Re: date-time comparison, aware vs naive

2012-12-10 Thread John Gordon
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

Re: String manipulation in python..NEED HELP!!!!

2012-12-10 Thread John Gordon
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

Re: MySQLdb compare lower

2012-12-11 Thread John Gordon
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

Re: Why Doesn't This MySQL Statement Execute?

2012-12-18 Thread John Gordon
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

Re: Evaluate postgres boolean field

2013-01-04 Thread John Gordon
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] --

Re: new to python and programming at large.

2013-01-09 Thread John Gordon
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

Re: Why BOM in logging message?

2013-01-09 Thread John Gordon
: [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

Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database

2013-01-09 Thread John Gordon
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. --

Re: Thought of the day

2013-01-14 Thread John Gordon
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

Re: Uniquely identifying each & every html template

2013-01-18 Thread John Gordon
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

Re: Uniquely identifying each & every html template

2013-01-22 Thread John Gordon
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

Re: Using filepath method to identify an .html page

2013-01-22 Thread John Gordon
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

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread John Gordon
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

Re: Using filepath method to identify an .html page

2013-01-22 Thread John Gordon
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

Re: Importing class from another file

2013-01-22 Thread John Gordon
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...@

Re: Converting a string to a number by using INT (no hash method)

2013-01-22 Thread John Gordon
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

Re: Search log for string and display hourly/daily report

2013-01-23 Thread John Gordon
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,

Re: Arent these snippets equivalent?

2013-01-23 Thread John Gordon
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

Re: The best, friendly and easy use Python Editor.

2013-01-24 Thread 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

Re: The best, friendly and easy use Python Editor.

2013-01-24 Thread John Gordon
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

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread John Gordon
;> person['name'] = 'John' >>> person['age'] = 40 >>> person['occupation'] = 'Programmer' >>> print person['age'] 40 Dictionaries can also be created with some initial values, like so: >

Re: Weird newbie question

2012-01-26 Thread John Gordon
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

Re: Reading files in from the proper directory

2012-02-07 Thread John Gordon
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,

Re: Reading files in from the proper directory

2012-02-07 Thread John Gordon
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

How can I catch misnamed variables?

2012-02-10 Thread John Gordon
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: datetime module and timezone

2012-02-10 Thread John Gordon
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

Re: log and figure out what bits are slow and optimize them.

2012-02-10 Thread John Gordon
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

Re: Python code file prototype

2012-02-17 Thread John Gordon
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

Re: list comprehension question

2012-02-29 Thread John Gordon
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

Re: Project

2012-03-07 Thread 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

Re: What's the best way to write this regular expression?

2012-03-08 Thread John Gordon
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

Best way to disconnect from ldap?

2012-03-21 Thread John Gordon
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   2   3   4   5   6   7   >