>
>First thing -- DON'T put quotes around the %s place-holders... The
> whole purpose of using the parameterized .execute() is to let the
> database adapter properly escape the parameters before putting them into
> the SQL (since MySQL didn't have prepared statements before v5, it was
> produci
On 10 dec, 16:34, w...@mac.com wrote:
> On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote:
>
> [byte]
>
>
>
>
>
>
>
>
>
> > As you can see this approach suffers from the same "buffer problem" as
> > the approach with readline did. One now good argue as a workaround:
> > get rid of the first data pair
On Mon, Dec 10, 2012 at 8:48 PM, Dave Cinege wrote:
> Thesaurus: A different way to call a dictionary.
>
> Thesaurus is a new a dictionary subclass which allows calling keys as
> if they are class attributes and will search through nested objects
> recursively when __getitem__ is called.
>
> You w
On 12/10/2012 02:18 PM, noydb wrote:
> Follow-on question to this earlier topic -
> https://groups.google.com/d/topic/comp.lang.python/wnUlPBBNah8/discussion
>
> Was curious to know if there was a way to handle different user computers
> with different operating system set date formats. 2/10/2
> Thesaurus is a new a dictionary subclass which allows calling keys as
> if they are class attributes and will search through nested objects
> recursively when __getitem__ is called.
Good stuff. You might consider:
1) Licensing under an OSI-approved license
(http://opensource.org/licenses/index.
Thesaurus: A different way to call a dictionary.
Thesaurus is a new a dictionary subclass which allows calling keys as
if they are class attributes and will search through nested objects
recursively when __getitem__ is called.
You will notice that the code is disgusting simple. However I have fou
On Mon, 10 Dec 2012 16:36:37 -0500, Dave Angel wrote:
> When accepting input from a user, consider their environment. Perhaps
> they're in a different timezone than your program (or your native
> location), or use some other ordering for the date (for example, the
> Japanese sensibly put year fir
On 11/12/2012 8:39 AM, bitbucket wrote:
On Monday, December 10, 2012 3:58:33 PM UTC-5, Terry Reedy wrote:
I believe the easiest way to do that is to install the pywin
extensions
http://sourceforge.net/projects/pywin32/?source=directory
I assume it can handle out params.
That definitely looks
> You're using a parametrised query (which is good :-)), but you've included
> quotes around the placeholders. There's no need to do that. They'll be
> quoted automatically when necessary:
>
> sql = "INSERT INTO product_description (product_id, language_id, name,
> description) VALUES (%s,%s,%s,%s)
On 2012-12-11 00:04, Anatoli Hristov wrote:
Hi all,
I'm facing an issue inserting an html code into the DB, it comes out
with a syntax error but I face it only when I have html code. Could
help me escape the error somehow ?
Here is my code
def InsertSpecsDB(product_id, spec, lang, name):
On 11/12/2012 00:29, Anatoli Hristov wrote:
As much use as a chocolate teapot, all you've given is a function/method
definition. No indication of your OS, Python version, calling code, what
you expect to happen, what actually happened, apart from that your request
for assistance is perfect. Usu
On Tue, Dec 11, 2012 at 1:29 AM, Anatoli Hristov wrote:
>> As much use as a chocolate teapot, all you've given is a function/method
>> definition. No indication of your OS, Python version, calling code, what
>> you expect to happen, what actually happened, apart from that your request
>> for assi
> As much use as a chocolate teapot, all you've given is a function/method
> definition. No indication of your OS, Python version, calling code, what
> you expect to happen, what actually happened, apart from that your request
> for assistance is perfect. Usually I'd be able to help but sadly my
On 11/12/2012 00:04, Anatoli Hristov wrote:
Hi all,
I'm facing an issue inserting an html code into the DB, it comes out
with a syntax error but I face it only when I have html code. Could
help me escape the error somehow ?
Here is my code
def InsertSpecsDB(product_id, spec, lang, name):
On Tue, Dec 11, 2012 at 11:05 AM, Jabba Laci wrote:
> Hi,
>
>> If this is for use on somebody else's system, *please don't*. My
>
> This is for me. I have a simple GUI that produces some URL that I want
> to open in the current tab. Since I want to verify several URLs, I
> don't want to open dozen
Hi all,
I'm facing an issue inserting an html code into the DB, it comes out
with a syntax error but I face it only when I have html code. Could
help me escape the error somehow ?
Here is my code
def InsertSpecsDB(product_id, spec, lang, name):
db = MySQLdb.connect("localhost","getit","openc
Hi,
> If this is for use on somebody else's system, *please don't*. My
This is for me. I have a simple GUI that produces some URL that I want
to open in the current tab. Since I want to verify several URLs, I
don't want to open dozens of new tabs.
Here is my working solution. It requires the Moz
On Tue, Dec 11, 2012 at 9:38 AM, wrote:
> I need help with a program i am doing. it is a cryptography program. i am
> given a regular alphabet and a key. i need to use the user input and use the
> regular alphabet and use the corresponding letter in the key and that becomes
> the new letter. i
2012/12/10 :
> I need help with a program i am doing. it is a cryptography program. i am
> given a regular alphabet and a key. i need to use the user input and use the
> regular alphabet and use the corresponding letter in the key and that becomes
> the new letter. i have the basic code but nee
On Tue, Dec 11, 2012 at 9:27 AM, Jabba Laci wrote:
> Hi,
>
> With the webbrowser module you can open a URL in a new tab. But how
> could I tell Firefox from Python to open a URL in the _current_ tab?
If this is for use on somebody else's system, *please don't*. My
current tab is my business, not
In qbai...@ihets.org
writes:
> """ crypto.py
> Implements a simple substitution cypher
> """
> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> key = "XPMGTDHLYONZBWEARKJUFSCIQV"
> def main():
> keepGoing = True
> while keepGoing:
> response = menu()
> if response == "1":
> plain
Thanks. I've found something interesting since then:
https://addons.mozilla.org/en-US/firefox/addon/mozrepl/
https://github.com/bard/mozrepl/wiki
It allows you to connect to your Firefox via telnet. Then changing the URL:
content.location.href =
However, for this you need to install this add-o
Don't think that it's possible with webbrowser, you should try with Selenium.
For example with sst (Simple Selenium Test), it open url in current
tab or create a new one if no one exists:
from sst.actions import *
go_to('http://www.ubuntu.com/')
2012/12/10 Jabba Laci :
> Hi,
>
> With the webbrow
I need help with a program i am doing. it is a cryptography program. i am given
a regular alphabet and a key. i need to use the user input and use the regular
alphabet and use the corresponding letter in the key and that becomes the new
letter. i have the basic code but need help with how to mai
On Mon, Dec 10, 2012 at 5:27 PM, Jabba Laci wrote:
> Hi,
>
> With the webbrowser module you can open a URL in a new tab. But how
> could I tell Firefox from Python to open a URL in the _current_ tab?
>
>
The docs say this:
webbrowser.open_new(*url*)
Open *url* in a new window of the default brow
Hi,
With the webbrowser module you can open a URL in a new tab. But how
could I tell Firefox from Python to open a URL in the _current_ tab?
Thanks,
Laszlo
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, December 10, 2012 3:58:33 PM UTC-5, Terry Reedy wrote:
> I believe the easiest way to do that is to install the pywin extensions
>
> http://sourceforge.net/projects/pywin32/?source=directory
>
> I assume it can handle out params.
That definitely looks like a good starting point. Just
On 12/10/2012 04:18 PM, noydb wrote:
> Follow-on question to this earlier topic -
> https://groups.google.com/d/topic/comp.lang.python/wnUlPBBNah8/discussion
For those who avoid googlegroups with a passion, and/or don't have
internet access, the subject of that thread is "date-time comparison,
a
NTFS partition
Windows 7
Python 2.7
--
http://mail.python.org/mailman/listinfo/python-list
>
> >
>
> >
>
> http://docs.python.org/2/library/datetime
>
> """ An object of type *time* or *datetime* may be naive or *aware"
>
>
>
> aware refers to time-zone and daylight savings time, such political
>
> ephemerals. Two times can only be changed if one knows they're both in
>
> the
Follow-on question to this earlier topic -
https://groups.google.com/d/topic/comp.lang.python/wnUlPBBNah8/discussion
Was curious to know if there was a way to handle different user computers with
different operating system set date formats. 2/10/2006 vs 2-10-2006, for
example. Not an issue f
On 12/10/2012 03:52 PM, Steven D'Aprano wrote:
> On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
>
>> I want to compare a user entered date-and-time against the date-and-time
>> of a pdf file. I posted on this (how to get a file's date-time) before,
>> was advised to do it like:
>>
>> import date
On Monday, December 10, 2012 3:52:55 PM UTC-5, Steven D'Aprano wrote:
> On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
>
>
>
> > I want to compare a user entered date-and-time against the date-and-time
>
> > of a pdf file. I posted on this (how to get a file's date-time) before,
>
> > was a
On 12/10/2012 2:13 PM, bitbucket wrote:
I have an existing Windows application which provides an OLE
Automation (IDispatch) interface. I'm not able to change that
interface. I'd like to call it from a scripting language. I figure
this would provide a nice quick way to invoke on the app.
I be
On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
> I want to compare a user entered date-and-time against the date-and-time
> of a pdf file. I posted on this (how to get a file's date-time) before,
> was advised to do it like:
>
> import datetime, os, stat
> mtime = os.lstat(filename)[stat.ST_MT
On Mon, 10 Dec 2012 08:36:22 -0800, moonhkt wrote:
> Hi All
>
> I am new in Python. When using open and then for line in f .
>
> Does it read all the data into f object ? or read line by line ?
Have you read the Fine Manual?
http://docs.python.org/2/library/stdtypes.html#file-objects
If you h
Dear Group,
I am trying to enumerate few interesting errors on pylab/matplotlib.
If any of the learned members can kindly let me know how should I address them.
I am trying to enumerate them as follows.
i) >>> import numpy
>>> import pylab
>>> t = numpy.arange(0.0, 1.0+0.01, 0.01)
>>> s = numpy
Found this, and it solved my problem
http://blogs.law.harvard.edu/rprasad/2011/09/21/python-string-to-a-datetime-object/
--
http://mail.python.org/mailman/listinfo/python-list
In <21eb3e6f-9a82-47aa-93ff-8f4083d18...@googlegroups.com> noydb
writes:
> I want to compare a user entered date-and-time against the date-and-time of
> a pdf file. I posted on this (how to get a file's date-time) before, was
> advised to do it like:
> import datetime, os, stat
> mtime = os.ls
I want to compare a user entered date-and-time against the date-and-time of a
pdf file. I posted on this (how to get a file's date-time) before, was advised
to do it like:
import datetime, os, stat
mtime = os.lstat(filename)[stat.ST_MTIME] // the files modification time
dt = datetime.dateti
Hello Jean-Claude!
Thank you for your post, it helped me a lot!
I'm not too new to Python but still struggling to make use of that great
language's features.
I haven't tested it but since you are interested in syntactic subtleties, I
think you can save one iterator (k):
for j in popconnection.
I have an existing Windows application which provides an OLE Automation
(IDispatch) interface. I'm not able to change that interface. I'd like to
call it from a scripting language. I figure this would provide a nice quick
way to invoke on the app.
I initially tried this with Windows Powershe
Dave Angel wrote:
> On 12/10/2012 11:36 AM, moonhkt wrote:
>> Hi All
>>
>> I am new in Python. When using open and then for line in f .
>>
>> Does it read all the data into f object ? or read line by line ?
>>
>>
>> f=open(file, 'r')
>>for line in f:
>> if userstring in
On 12/10/2012 11:36 AM, moonhkt wrote:
> Hi All
>
> I am new in Python. When using open and then for line in f .
>
> Does it read all the data into f object ? or read line by line ?
>
>
> f=open(file, 'r')
>for line in f:
> if userstring in line:
> print
On 12/10/2012 12:42 PM, andrea crotti wrote:
So I implemented a simple decorator to run a function in a forked
process, as below.
It works well but the problem is that the childs end up as zombies on
one machine, while strangely
I can't reproduce the same on mine..
I know that this is not the p
Hi All
I am new in Python. When using open and then for line in f .
Does it read all the data into f object ? or read line by line ?
f=open(file, 'r')
for line in f:
if userstring in line:
print "file: " + os.path.join(root,file)
brea
On 12月5日, 下午11時01分, Michael Torrie wrote:
> On 12/04/2012 05:54 PM, moonhkt wrote:
>
> > Our SMTP can send file more than 60MB. But our notes server can
> > configured 100MB,30MB or 10MB. My notes Mail box can receive 100MB.
>
> > In UNIX, by below command send smtp mail.
> > uuencode $xfn $xfn |
On Dec 10, 2012, at 8:31 AM, Jean Dubois wrote:
[byte]
> As you can see this approach suffers from the same "buffer problem" as
> the approach with readline did. One now good argue as a workaround:
> get rid of the first data pair and add an extra measure command for
> the missing data pair, how
On 2012-12-10 04:24:00 +, Steven D'Aprano said:
On Sun, 09 Dec 2012 20:13:43 -0500, Alex Clark wrote:
import other
The Zen of Zope, by Alex Clark
I expect that I would find that hilarious if I knew anything about Zope :)
Well, you are in luck! Because it's a tutorial too:
https://gi
On 7 dec, 14:46, Jean Dubois wrote:
> On 6 dec, 21:15, w...@mac.com wrote:
>
> > On Dec 6, 2012, at 2:41 PM, Jean Dubois wrote:
>
> > > On 6 dec, 15:50, w...@mac.com wrote:
> > >> On Dec 6, 2012, at 8:50 AM, Jean Dubois wrote:
>
> > >> [byte]
>
> > >>> It seems there is some misunderstanding her
水静流深 wrote:
> i wnat to get the number of a atrributes in a xpath,here is my code,why i
> can not get the number ? import urllib
> import lxml.html
> down="http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html";
> file=urllib.urlopen(down).read()
> root=lxml.html.document_fromstring(f
i wnat to get the number of a atrributes in a xpath,here is my code,why i can
not get the number ?
import urllib
import lxml.html
down="http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html";
file=urllib.urlopen(down).read()
root=lxml.html.document_fromstring(file)
for order,node i
http://techcrunch.com/2012/12/07/dropbox-guido-van-rossum-python/
--
http://mail.python.org/mailman/listinfo/python-list
Am 05.12.2012 21:24, schrieb Owatch:
> Thanks a TON for your answer thought, this is exactly what I really hoped for.
> The problem for me is that I don't actually know anything about writing a
> function that opens a network socket, and "connects to that plugin und asks
> it for the
> informati
On Dec 10, 3:03 pm, Jean-Michel Pichavant
wrote:
> - Original Message -
> > On Dec 7, 6:46 pm, Marco wrote:
> > > Hi all, do you think this code:
>
> > > $ more myscript.py
> > > for line in open('data.txt'):
> > > result = sum(int(data) for data in line.split(';'))
> > > print(
- Original Message -
> On Dec 7, 6:46 pm, Marco wrote:
> > Hi all, do you think this code:
> >
> > $ more myscript.py
> > for line in open('data.txt'):
> > result = sum(int(data) for data in line.split(';'))
> > print(result)
> >
> > that sums the elements of the lines of this
56 matches
Mail list logo