Hi,
I've got some kind of install problem with jpype ... It should just
work, but throws a dialog exception, that doesn't give a stack trace
so not very helpful.
This should be a simple install issue, but I've searched and haven't
seen any thing
import jpype
p = jpype.getDefaultJVMPath()
jpype.s
In article ,
Tim Chase wrote:
>On 08/18/10 21:47, Steven D'Aprano wrote:
>>
>> Frankly, I think the OP doesn't really know what he wants, other than
>> premature optimization. It's amazing how popular that is :)
>
>You see, the trick to prematurely optimizing is to have a good
>algorithm for pre
On 08/18/10 21:47, Steven D'Aprano wrote:
Frankly, I think the OP doesn't really know what he wants, other than
premature optimization. It's amazing how popular that is :)
You see, the trick to prematurely optimizing is to have a good
algorithm for prematurely optimizing...the real question th
On Wed, 18 Aug 2010 16:03:58 +0200, Frederic Rentsch wrote:
> On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote:
>> On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote:
>>
>> > How about
>> >
>> [obj for obj in dataList if obj.number == 100]
>> >
>> > That should create a lis
On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote:
> On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote:
>
> > How about
> >
> [obj for obj in dataList if obj.number == 100]
> >
> > That should create a list of all objects whose .number is 100. No need
> > to cycle through a
On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote:
> How about
>
[obj for obj in dataList if obj.number == 100]
>
> That should create a list of all objects whose .number is 100. No need
> to cycle through a loop.
What do you think the list comprehension does, if not cycle throug
On Sun, 2010-08-15 at 15:14 +0200, Peter Otten wrote:
> ChrisChia wrote:
>
> > dataList = [a, b, c, ...]
> > where a, b, c are objects of a Class X.
> > In Class X, it contains self.name and self.number
> >
> > If i wish to test whether a number (let's say 100) appears in one of
> > the object, a
On Sun, 15 Aug 2010 05:47:04 -0700, ChrisChia wrote:
> dataList = [a, b, c, ...]
> where a, b, c are objects of a Class X. In Class X, it contains
> self.name and self.number
>
> If i wish to test whether a number (let's say 100) appears in one of the
> object, and return that object,
> is that o
ChrisChia wrote:
dataList = [a, b, c, ...]
where a, b, c are objects of a Class X.
In Class X, it contains self.name and self.number
If i wish to test whether a number (let's say 100) appears in one of
the object, and return that object,
is that only fast way of solving this problem without iter
ChrisChia wrote:
> dataList = [a, b, c, ...]
> where a, b, c are objects of a Class X.
> In Class X, it contains self.name and self.number
>
> If i wish to test whether a number (let's say 100) appears in one of
> the object, and return that object,
> is that only fast way of solving this problem
dataList = [a, b, c, ...]
where a, b, c are objects of a Class X.
In Class X, it contains self.name and self.number
If i wish to test whether a number (let's say 100) appears in one of
the object, and return that object,
is that only fast way of solving this problem without iterating
through every
On Jul 31, 2:51 pm, Alexnb <[EMAIL PROTECTED]> wrote:
> Lets say we have this list:
>
> funlist = ['a', 'b', 'c']
>
> and lets say I do this:
>
> if funlist[4]:
> print funlist[4]
>
> I will get the exception "list index out of range"
>
> How can I test if the list item is empty without getting
Alexnb:
> How can I test if the list item is empty without getting that exception?
In Python such list cell isn't empty, it's absent. So you can use
len(somelist) to see how much long the list is before accessing its
items. Often you can iterate on the list with a for, so you don't need
to care of
--
View this message in context:
http://www.nabble.com/simple-problem-with-lists-I-am-just-forgetting-tp18762181p18762181.html
Sent from the Python - python-list mailing list archive at Nabble.com.
--
http://mail.python.org/mailman/listinfo/python-list
Robert Bossy wrote:
> Jules Stevenson wrote:
>>
>> Hello all,
>>
>> I'm fairly green to python and programming, so please go gently. The
>> following code
>>
>> for display in secondary:
>>
>> self.("so_active_"+display) = wx.CheckBox(self.so_panel, -1,
>> "checkbox_2")
>>
>> Errors, because of t
Brilliant. Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Robert Bossy wrote:
> Jules Stevenson wrote:
>
>> Hello all,
>>
>> I'm fairly green to python and programming, so please go gently. The
>> following code
>>
>> for display in secondary:
>>
>> self.("so_active_"+display) = wx.CheckBox(self.so_panel, -1, "checkbox_2")
>>
>> Errors, because of the
Jules Stevenson wrote:
>
> Hello all,
>
> I'm fairly green to python and programming, so please go gently. The
> following code
>
> for display in secondary:
>
> self.("so_active_"+display) = wx.CheckBox(self.so_panel, -1, "checkbox_2")
>
> Errors, because of the apparent nastyness at the beginnin
Hello all,
I'm fairly green to python and programming, so please go gently. The
following code
for display in secondary:
self.("so_active_"+display) = wx.CheckBox(self.so_panel, -1,
"checkbox_2")
Errors, because of the apparent nastyness at the beginning. What I'm trying
to do is
"mohan" wrote:
> At the end I had to close down my entire python compiler. I am using
> Python compiler with following specs in Windows XP OS.
>
> Pythonwin - Python IDE and GUI Framework for Windows.
> PythonWin 2.2.1 (#34, Feb 25 2003, 11:29:09) [MSC 32 bit (Intel)] on
> win32.
> Portions Copyri
Hello Guys,
I am a beginner with Python programming and would like to implement
some GUI functionalities along with my main work. So I was trying to
implement one basic program (available from books).
Here is the code,
import Tkinter
TopLevelWindowObj = Tkinter.Tk()
jr wrote:
>> >>> import locale
>> >>> locale.setlocale(locale.LC_ALL, 'English_United States.1252')
>> 'English_United States.1252'
> Just tried the first 2 commands on win XP, Python 2.5 under Idle.
> An Error is raised: "unsupported locale setting" (lib/locale.py in
> setlocale, line 476).
> Ac
Replace the conv function call with locale.localeconv.
--
Jerry
--
http://mail.python.org/mailman/listinfo/python-list
Hi, Bernard.
Just tried the first 2 commands on win XP, Python 2.5 under Idle.
An Error is raised: "unsupported locale setting" (lib/locale.py in
setlocale, line 476).
Actually I get the error also under Python 2.4.3
Any idea what I'm missing?
Thanks in advance.
Jürgen
Bernard wrote:
> >>> import l
Richard Kessler <[EMAIL PROTECTED]> writes:
> I am relatively new to Python. Love it, but I find things that I
> can do easily in .NET and cannot find a way to do in Python. I need
> to format a number as currency, for example 12343.56 to $12,343.56.
>
> In C# all I need to do is decimal x = 1234
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'English_United States.1252')
'English_United States.1252'
>>> conv = locale.localeconv()
>>> x = 1234567.8
>>> locale.format("%d", x, grouping=True)
'1,234,567'
>>> locale.format("%s%.*f", (conv['currency_symbol'], conv['int_frac_digits'],
>>>
I am relatively new to Python. Love it, but I find things that I can do
easily in .NET and cannot find a way to do in Python. I need to format a
number as currency, for example 12343.56 to $12,343.56.
In C# all I need to do is decimal x = 12343.56 then x.ToString("$###,###.00");
I cannot find
Dennis Lee Bieber wrote:
> That is probably the worst way to "fix" the problem -- as in the
> future, you may end up trying that method for something that may need to
> be quoted or escaped.
>
> cur.execute(template, (arg1,) )
>
> allows the DB-API spec to properly convert the argument
rdrink wrote:
> And yes I should prolly move to pysqlite2, but for now I was able to
> fix it this way...
> num = 200
> mess = "INSERT INTO foo (id) VALUES (%s)" % num
> cur.execute(mess)
>
> ... don't know why I didn't think of that last (oh wait, Yes I do...
> because 'last night' was actually
Thanks everyone!
But... RTFM? Ouch. It's not like I don't know what I'm doing :-(
... rather, that I *am* using the older sqlite module
> print sqlite.paramstyle = pyformat
> print sqlite.version = 1.0.1
which does not support the qmark sytax. (and I fell victim of
someone elses tutor
Fredrik Lundh wrote:
> John Machin wrote:
> >> So this has to be something stupidly simple... but for the life of me I
> >> can't see it.
> >
> > With the '?' paramstyle, the 2nd arg to cursor.execute() should be a
> > *sequence* (typically a tuple) of the values that you are inserting.
> >
> > Tt
John Machin wrote:
>> So this has to be something stupidly simple... but for the life of me I
>> can't see it.
>
> With the '?' paramstyle, the 2nd arg to cursor.execute() should be a
> *sequence* (typically a tuple) of the values that you are inserting.
>
> Tty this:
> cur.execute("INSERT INTO foo
rdrink wrote:
> I am just getting into pysqlite (with a fair amount of Python and MySQL
> experience behind me) and have coded a simple test case to try to get
> the hang of things...
> yet have run into a 'stock simple' problem...
>
> I can create a database 't
"rdrink" <[EMAIL PROTECTED]> wrote:
>I am just getting into pysqlite (with a fair amount of Python and MySQL
> experience behind me) and have coded a simple test case to try to get
> the hang of things...
>
> yet have run into a 'stock simple' problem..
rdrink schrieb:
> num = 200
> cur.execute("INSERT INTO foo (id) VALUES (?)", num)
Hi!
``num`` must be an iterable object (tuple, list, ...).
num = (200,)
cur.execute("INSERT INTO foo (id) VALUES (?)", num)
Regards,
Gerold
:-)
--
__
I am just getting into pysqlite (with a fair amount of Python and MySQL
experience behind me) and have coded a simple test case to try to get
the hang of things...
yet have run into a 'stock simple' problem...
I can create a database 'test.db', add a table 'foo' (
Hi looking for help with what should be a fairly simple Python problem, relating to VB inter-operability.
Got a great response from a fellow named Matt at [EMAIL PROTECTED], pointed me in some good directions - some areas, concerns still foggy on, the below thread is included any feedbac
Hi looking for help with what should be a fairly simple Python problem, relating to VB inter-operability.
Got a great response from a fellow named Matt at [EMAIL PROTECTED], pointed me in some good directions - some areas, concerns still foggy on, the below thread is included any feedbac
Tom wrote:
> Peter Hansen wrote:
>> Where do you think those double quotation marks came from? What
>> happens if you try the following instead of using the variables you
>> were trying to use?
>>
>> os.rename("e:\\music\\Joni Mitchell\\ogg-8",
>> "e:\\music.ogg\\Joni Mitchell\\ogg-8")
>>
>
Peter Hansen wrote:
> Tom wrote:
>
>>Drive E: is removable, so I was careful to verify that that was a factor
>>in the problem.
>>
>>Yes, I can do the same renaming, with the same drive, at the command line.
>>
>>I think I put the emphasis in the wrong place in my question. This
>>isn't really
Tom wrote:
> Drive E: is removable, so I was careful to verify that that was a factor
> in the problem.
>
> Yes, I can do the same renaming, with the same drive, at the command line.
>
> I think I put the emphasis in the wrong place in my question. This
> isn't really about os.rename(). It is
Yes, I am sure about those things.
I've tried shutil.move and got the same result.
Forward slash? I'll give that a try and report back here if it works.
Thanks,
Tom.
Larry Bates wrote:
> Are you sure the source directory exists and you
> have rights to rename it? Because the rename works
> for
Peter Hansen wrote:
> Tom wrote:
>
>>I'm having a problem using a path with spaces as a parameter to
>>os.rename() in a program on WinXP.
>>
>>This works fine at the command line (where the folder "c:\aa bb" exists)
>>
>> > os.rename( "c\aa bb", "c:\cc dd" );
>> >
>>
>>But, I can't get it to work
Tom wrote:
> I'm having a problem using a path with spaces as a parameter to
> os.rename() in a program on WinXP.
>
> This works fine at the command line (where the folder "c:\aa bb" exists)
>
> > os.rename( "c\aa bb", "c:\cc dd" );
> >
>
> But, I can't get it to work in my program, eg.
>
>
Are you sure the source directory exists and you
have rights to rename it? Because the rename works
for me.
But you may want to look at shutil.move and/or
use forward slashes (they work under Windows)
-Larry Bates
Tom wrote:
> I'm having a problem using a path with spaces as a parameter to
> o
I'm having a problem using a path with spaces as a parameter to
os.rename() in a program on WinXP.
This works fine at the command line (where the folder "c:\aa bb" exists)
> os.rename( "c\aa bb", "c:\cc dd" );
>
But, I can't get it to work in my program, eg.
print SrcDir
print NewDir
os.rena
Thank you all for your replies. The repr() solution wasn't exactly what
I was looking for, as I wasn't planning on eval()ing it, but the
(en|de)code solution was exactly what I was looking for. An extended
thanks to Jp for informing me of the version compatibility :)
Have a GREAT day :)
-Wes
--
On 24 Jul 2005 18:14:13 -0700, ncf <[EMAIL PROTECTED]> wrote:
>I know I've seen this somewhere before, but does anyone know what the
>function to escape a string is? (i.e., encoding newline to "\n" and a
>chr(254) to "\xfe") (and visa-versa)
>
>Thanks for helping my ignorance :P
Python 2.4.1 (
ncf wrote:
> I know I've seen this somewhere before, but does anyone know what the
> function to escape a string is? (i.e., encoding newline to "\n" and a
> chr(254) to "\xfe") (and visa-versa)
In [1]: s = "foo\n\xfe"
In [2]: s.encode("string_escape")
Out[2]: 'foo\\n\\xfe'
In [3]: repr(s)[1:-1]
"ncf" <[EMAIL PROTECTED]> writes:
> I know I've seen this somewhere before, but does anyone know what the
> function to escape a string is? (i.e., encoding newline to "\n" and a
> chr(254) to "\xfe") (and visa-versa)
repr(s)
--
http://mail.python.org/mailman/listinfo/python-list
By any chance are you speaking about the function "repr" ?
Cyril
On 24 Jul 2005 18:14:13 -0700, ncf <[EMAIL PROTECTED]> wrote:
I know I've seen this somewhere before, but does anyone know what thefunction to escape a string is? (i.e., encoding newline to "\n" and achr(254) to "\xfe") (and visa-vers
I know I've seen this somewhere before, but does anyone know what the
function to escape a string is? (i.e., encoding newline to "\n" and a
chr(254) to "\xfe") (and visa-versa)
Thanks for helping my ignorance :P
-Wes
--
http://mail.python.org/mailman/listinfo/python-list
52 matches
Mail list logo