Alan Gauld wrote:
> Why remove them?
I think they might be confusing; unless perhaps you gave
them special names.
> How are you using the prompt?
I tend to cut and paste individual lines.
Incidentally the lack of readline is the reason why large
amounts of output are such a big deal.
I think we
"Olivier Lefevre" <[EMAIL PROTECTED]> wrote
>> Then assign the return value to a variable and never use it.
>
> That feels obfuscated; definitely not an elegant solution.
> When I'm done with interactive development and save the
> substance to a script I'd have to chase these bogus
> assignments
> Sounds like you need a better interactive development tool.
> You should try emacs. :-)
With jython the options are limited: even readline is a luxury,
but I'll look into it.
-- O.L.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mai
Olivier Lefevre wrote:
>> Then assign the return value to a variable and never use it.
>>
>
> That feels obfuscated; definitely not an elegant solution.
> When I'm done with interactive development and save the
> substance to a script I'd have to chase these bogus
> assignments to junk variabl
> Then assign the return value to a variable and never use it.
That feels obfuscated; definitely not an elegant solution.
When I'm done with interactive development and save the
substance to a script I'd have to chase these bogus
assignments to junk variables and remove them; not a
smooth workflow
I would always use the os functions to find the basename, but
You could exploit the fact that Windows considers the extension to be
whatever is after the last "." character.
fn = fn[:fn.rfind(".")]
>> > What I found is this:
>> > import os
>> > myfile_name_with_path = 'path/to/my/testfile.txt'
>
johnf wrote:
> On Friday 11 January 2008 11:45:36 am you wrote:
> Let's start over!
Thank you.
> import psycopg2
>
> conn = psycopg2.connect("host='192.168.1.201' dbname='aName' user ='UserName'
> password ='**'")
> tempCursor= conn.cursor()
> custnum = 'ABC123'
> mysql ="Select ccustno fro
"Olivier Lefevre" <[EMAIL PROTECTED]> wrote
>> But if you refer to a loop when would you ever be evaluating
>> expressions inside a loop without assigning them?
>
> Some method calls return a value that you may not be interested
> in but which will still be printed, e.g., Set.add in Java (if
>
Olivier Lefevre wrote:
>> Are you talking about the >>> prompt?
>>
>
> Yes.
>
>
>> But if you refer to a loop when would you ever be evaluating
>> expressions inside a loop without assigning them?
>>
>
> Some method calls return a value that you may not be interested
> in but which w
johnf wrote:
> On Friday 11 January 2008 11:19:43 am you wrote:
>> Can you post a small, complete program containing both the working and
>> non-working variants and show the complete output of the program?
Jeez, you might want to try to get this to work with something simple!
This is still not
On Friday 11 January 2008 11:19:43 am you wrote:
> johnf wrote:
> > I spoke to soon. Where can I find the DB-API for postgres? Because the
> > only way I can get this to work is using ('%s') and it does not work with
> > (%s).
>
> What module are you using to connect to postgres? That module shou
> Are you talking about the >>> prompt?
Yes.
> But if you refer to a loop when would you ever be evaluating
> expressions inside a loop without assigning them?
Some method calls return a value that you may not be interested
in but which will still be printed, e.g., Set.add in Java (if
you are
johnf wrote:
> I spoke to soon. Where can I find the DB-API for postgres? Because the only
> way I can get this to work is using ('%s') and it does not work with (%s).
What module are you using to connect to postgres? That module should
implement DB-API as documented here:
http://www.python.or
On Friday 11 January 2008 10:20:13 am Alan Gauld wrote:
> "johnf" <[EMAIL PROTECTED]> wrote
>
> > and should be doing
> > tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> > seq", ( 'public.arcust', 'pkid' ) )
> >
> > which prevented SQL injection.
>
> The syntax of the execute st
On Friday 11 January 2008 09:14:25 am Simone wrote:
> johnf ha scritto:
> > But the above does not work when I use variables instead of strings as in
> >
> > tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> > seq", ( tableName, fieldName ) )
> >
> > So how am I suppose to prevent
On Friday 11 January 2008 10:20:13 am Alan Gauld wrote:
> "johnf" <[EMAIL PROTECTED]> wrote
>
> > and should be doing
> > tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> > seq", ( 'public.arcust', 'pkid' ) )
> >
> > which prevented SQL injection.
>
> The syntax of the execute st
"johnf" <[EMAIL PROTECTED]> wrote
> and should be doing
> tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> seq", ( 'public.arcust', 'pkid' ) )
>
> which prevented SQL injection.
The syntax of the execute statement varies by database
Which DB are you using. For example SQLit
"Olivier Lefevre" <[EMAIL PROTECTED]> wrote
> This is stupid but my python is rusty I can neither
> remember nor find out anew how to enter an expression
> that returns a value w/o being seeing the result printed.
I don;t understand the question.
Are you talking about the >>> prompt?
That is the
Kent Johnson wrote:
>I guess counters is iterable but not a sequence. Try this:
> for vCounter in reversed(list(counters)):
Hi Kent,
Thanks for your help. This solves my problem:
vPos = pygame.mouse.get_pos()
for vCounter in reversed(list(counters)):
if vCounter.rect.collidep
James Newton wrote:
> I have created a series of pygame sprites. Visually, these sprites
> represent counters and may overlap. I want to determine which sprite
> the user clicked on.
>
> This seems to me to be a fairly standard feature of a game interface, so
> I imagine that there is already a
johnf ha scritto:
> But the above does not work when I use variables instead of strings as in
>
> tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> seq", ( tableName, fieldName ) )
>
> So how am I suppose to prevent SQL injections?
Try tu use '?' instead of %s, like this
Hi Pygamers,
I have created a series of pygame sprites. Visually, these sprites
represent counters and may overlap. I want to determine which sprite
the user clicked on.
This seems to me to be a fairly standard feature of a game interface, so
I imagine that there is already a standard technique
johnf wrote:
> Hi,
> I was recently told I was doing something wrong with my python sql statements.
> I was doing
> tempCursor.execute("Select pg_get_serial_sequence('%s','%s') as seq
> " % ('public.arcust','pkid'))
>
> and should be doing
> tempCursor.execute ( "Select pg_get_serial_sequence (
Hi,
I was recently told I was doing something wrong with my python sql statements.
I was doing
tempCursor.execute("Select pg_get_serial_sequence('%s','%s') as seq
" % ('public.arcust','pkid'))
and should be doing
tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
seq", ( 'publi
> If you follow the discussion thread look through the link I provided,
> I believe this is addressed a bit later.
Yes and no. They do discuss possible hooks a bit further in
http://mail.python.org/pipermail/edu-sig/2007-August/008161.html
but merely to suggest toggling between echo and no-echo. I
"Tony Cappellini" <[EMAIL PROTECTED]> wrote
>> The source also says, "Consider this example code rather than the
>> ultimate tool" so maybe you should just copy it and make a version
>> that
>> does what you want. See shutil.py in your Python lib directory.
>
> Yes, I did read that and was shock
On Jan 11, 2008 9:48 AM, Olivier Lefevre <[EMAIL PROTECTED]> wrote:
> Thanks for both suggestions. The displayhook trick would
> be OK if there was a way to retrieve what _would_ have
> been printed last if the display had not been changed:
> something like a modified '_'. As it stands, it's a bit
Tony Cappellini wrote:
>> The source for copytree says, "The destination directory must not
>> already exist." I suppose that is why you have a problem but I don't
>> know the specific cause. Did you get a traceback?
>>
>> The source also says, "Consider this example code rather than the
>> ultimat
Tony Cappellini wrote:
>> The source also says, "Consider this example code rather than the
>> ultimate tool" so maybe you should just copy it and make a version that
>> does what you want. See shutil.py in your Python lib directory.
>
> Yes, I did read that and was shocked. Is everything in pytho
Thanks for both suggestions. The displayhook trick would
be OK if there was a way to retrieve what _would_ have
been printed last if the display had not been changed:
something like a modified '_'. As it stands, it's a bit
radical.
-- O.L.
___
Tutor mai
> The source for copytree says, "The destination directory must not
> already exist." I suppose that is why you have a problem but I don't
> know the specific cause. Did you get a traceback?
>
> The source also says, "Consider this example code rather than the
> ultimate tool" so maybe you should j
Olivier Lefevre wrote:
> This is stupid but my python is rusty I can neither
> remember nor find out anew how to enter an expression
> that returns a value w/o being seeing the result printed.
If you assign the expression to a variable, the value will not be printed.
Kent
You may want to check here:
http://mail.python.org/pipermail/edu-sig/2007-August/008154.html
André
On Jan 11, 2008 7:26 AM, Olivier Lefevre <[EMAIL PROTECTED]> wrote:
> This is stupid but my python is rusty I can neither
> remember nor find out anew how to enter an expression
> that returns a val
This is stupid but my python is rusty I can neither
remember nor find out anew how to enter an expression
that returns a value w/o being seeing the result printed.
I would have expected something
expr;
as opposed to
exp
to do the trick but no dice and I haven't had any luck
with Google or t
"brindly sujith" <[EMAIL PROTECTED]> wrote
> i am developing a GUI application using TKINTER
>
> in my applicaton i dont want the window title bar(including MAX,MIN
> and
> CLOSE)
I can't see a way to do this and it doesn't really surprise me because
it varies so much between GUI systems.
On
"Allen Fowler" <[EMAIL PROTECTED]> wrote
> I must say that I'm a bit surprised that the Python Std
> library does not have a module for this.
To be honest I've never used a language that does have
a special library for turning programs/processes into
daemons. The tools are in the modules and
Kent Johnson wrote:
> Tony Cappellini wrote:
>> I'm using shutils for the first time, and I've un into a problem.
>> The docs for copytree are pretty sparse and don't mention any problem
>> situations
>>
>> Under WinXP, I'm trying to copy a directory tree to a USB device using
>> copytree, but cop
hi
i am developing a GUI application using TKINTER
in my applicaton i dont want the window title bar(including MAX,MIN and
CLOSE)
how to do this
plz send me the code for this
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/list
38 matches
Mail list logo