Thanks, everyone.
I will give it a try. Don't know a lot about mySQL (or any flavor SQL)
but from some minute exposure to the ODBC connector I am guessing that
jdbc provides a connector.
Wish me luck
jh
--
http://mail.python.org/mailman/listinfo/python-list
>... ruining the
> output?
>
? None.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks,
jh
--
http://mail.python.org/mailman/listinfo/python-list
I want to print a count down timer on the same line. I tried
print '\r', timeLeft,
which just appends to the same line.
thanx,
jh
--
http://mail.python.org/mailman/listinfo/python-list
I thought I had a winner mySql-python but it require2 python 2.3-5 and
the tool I am using (maxq) is based on jython 2.2. Is there another
way that I could perform queries from python?
thanx,
jh
--
http://mail.python.org/mailman/listinfo/python-list
Could you recommend an html parser that works with python (jython
2.2)? HTMLParser does not seem to be in this library. To test some
of our browser based (mailnly php) code I seek for field names and
values associated with them.
Thanks,
jh
--
http://mail.python.org/mailman/listinfo/python-l
Thanks.
That will work. The 2nd, smaller lst starts out empty but this is
easily adapted.
jh
--
http://mail.python.org/mailman/listinfo/python-list
Just wondered if there was some python idiom for moving a few items
from one list to another. I often need to delete 2 or 3 items from one
list and put them in another. Delete doesn't seem to have a return
value. I don't care which items I get so now I just use a couple of
pops or a for loop for m
Thanks folks!
jh
--
http://mail.python.org/mailman/listinfo/python-list
How does one effect a goto in python? I only want to use it for debug.
I dasn't slap an "if" clause around the portion to dummy out, the
indentation police will nab me.
Thanx,
jh
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the explaination. It didn't seem natural and from the
tutorial I read:
A value can be assigned to several variables simultaneously:
>>> x = y = z = 0 # Zero x, y and z
Maybe I infer too much
thanks again,
jh
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the reloads folks. This is a big help as I am running a
jython based tool (maxq) and re-starting takes awhile.
Can't seem to make reload work using the form "from dvTime
import ...". So I am prefacing my calls with the module name now.
thanx,
jh
--
http://mail.python.org/mailman/lis
I thought if I could do this:
>>> a = b = ''
>>> a = 'a'
>>> a
'a'
>>> b
''
then this would behave similarly:
>>> la = lb = []
>>> la.append('a')
>>> la
['a']
>>> lb
['a']
I thought wrong! But don't know why.
Inquiring minds want to know.
thanx,
jh
--
http://mail.python.org/mailman/lis
I imported a set of functions from a file I wrote to interpreter
shell:
from myFile import *
Now if I change functions in this file how can I make python forget it
so I can force a fresh import?
thanx,
jh
--
http://mail.python.org/mailman/listinfo/python-list
Thank you all.
jh
--
http://mail.python.org/mailman/listinfo/python-list
>
> Why not use grep?
With Windows XP?
jh
--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
Could someone point my muddled head at a/the python repository. I know
that one exists but cannot find it again. In particular I am looking
for a standalone search tool that given a path searches files for a
text string.
Thanks,
jvh
--
http://mail.python.org/mailman/listinfo/python
In the file snippet below the value for the global hostName is
determined at runtime. Functions imported from the parent baseClass
file such as logon also need access to this variable but cannot see it
the with the implementation I have attempted here.
Also, functions in this file and in the imp
I am trying to understand the 'if' statement and the exec statement in
the code below. I would like to add several common routines to this
class and then inherit it into a class in another file. This other
class would need to access these common functions as well as inherit
the PyHttpTestCase clas
On May 17, 7:51 am, Dustan <[EMAIL PROTECTED]> wrote:
> On May 16, 4:22 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
>
>
>
> > HMS Surprise wrote:
> > > I read in the ref man that try-except-finally did not work in earlier
> > > versions, I am u
On May 17, 9:34 am, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-05-16, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
> > No haven't had to endure Pascal. Mostly C/C++, Tcl, and assembler.
>
> I must have you mixed up with somebody else who recently
> menti
On May 16, 6:48 pm, Matimus <[EMAIL PROTECTED]> wrote:
> On May 16, 9:57 am, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
> > I looked in the language but did not find a switch for requiring
> > variables to be declared before use.
>
> > Is such an option availa
I read in the ref man that try-except-finally did not work in earlier
versions, I am using jython 2.2. Does this imply that try-except
without finally does not work either? I get a syntax error on the else
below. Some of the functions embedded in the try section try to
convert strings to ints, etc
No haven't had to endure Pascal. Mostly C/C++, Tcl, and assembler. Oh
yeah, and a (thankfully) short stint of Ada.
But I glad to hear of the proofing tools. Working a lot of data parsed
from web pages and the developer there a different naming convention
from what I am accustomed so sometimes I i
I looked in the language but did not find a switch for requiring
variables to be declared before use.
Is such an option available?
Thanks,
jvh
--
http://mail.python.org/mailman/listinfo/python-list
On May 15, 5:13 pm, Paul McGuire <[EMAIL PROTECTED]> wrote:
> On May 15, 4:59 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
> > Is there a way that a function may access the doc string or func_name
> > of the caller?
>
> > Thanks,
>
> > jvh
>
&
Is there a way that a function may access the doc string or func_name
of the caller?
Thanks,
jvh
--
http://mail.python.org/mailman/listinfo/python-list
Thanks everyone. The shell's display really threw me off. Don't really
understand why it looks different typing t vs print t. Now that I can
see past that split works just as advertised. Not real clear on triple
quotes but I have seen it used and I can see where triple is needed to
differentiate fr
On May 15, 2:04 pm, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote:
> On May 15, 2:28 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
>
>
> > The string s below has single and double qoutes in it. For testing I
> > surrounded it with triple single quotes. I want to
I found my problem, the backslash isn't really there. It is just the
way it was displayed in the shell after being split from a larger
string.
Printing it yields
D132259','','status=no,location=no,width=630,height=550,left=200,top=100')"
target="_blank" class="dvLink" title="Send an Email to select
>
> > Would like to use pickle but it is apparently unavailable in the
> > package I am using, Jython 2.2.
>
> I am pretty sure some version of pickle or cPickle is available in Jython 2.1,
> though. I'd take a second look, to be sure.
Many thanks Boris!
import cPickle
caused no errors!
--
ht
The string s below has single and double qoutes in it. For testing I
surrounded it with triple single quotes. I want to split off the
portion before the first \, but my split that works with shorter
strings does not seem to work with this one.
Ideas?
Thanks,
jvh
s = D132258\',\'\',
\'status=
Thanks folks. Was unaware of enumerate , still have a lot to learn
about python.
Sorry for the poorly phrased request, but you gathered the gist of it.
My wonderment is how to write the following 2 lines and make sure they
are saved as separate records or lines so that I pull in only one at a
time
I need to write 2 member lists to a file. For each record the number
of these lists can be different. I think a good way to handle that may
be to make each record a list of lists. I am restricted to using
version 2.2. That being the case what is a good standard record
separator to use to ensure th
Snippet 1 below doesn't do much but works (more code is inserted by a
generator). In the next to last line the class name is also used as
argument. I have seen this construct before and have had error
messages tell me that the name is expected. Why is this so? In snippet
2 that I concocted is not r
>
> Do you mean 12 Noon or 12 Midnight? 12AM and 12PM don't exist,
> do they?
>
>>> t = (2007, 5, 14, 12, 0,0,0,0,0)
>>> strftime('%p', t)
'PM'
>>> t = (2007, 5, 14, 0,0,0,0,0,0)
>>> strftime('%p', t)
'AM'
>>>
--
http://mail.python.org/mailman/listinfo/python-list
On May 14, 9:22 am, HMS Surprise <[EMAIL PROTECTED]> wrote:
> > if t[2] == 'PM':
> > hrMn[0] = int(hrMn[0]) + 12
>
> Oops, should be:
> hrMn[0] = int(hrMn[0]
> if t[2] == 'PM':
> hrMn[0] += 12
Oops +=1, should be:
hrMn[0] = int(hr
On May 14, 9:09 am, [EMAIL PROTECTED] wrote:
> On May 14, 9:00 am, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for posting. I sure am sorry that I wasted your time. I should
> > have started the post stating I am using jython 2.2.3 and apparently
> &
> if t[2] == 'PM':
> hrMn[0] = int(hrMn[0]) + 12
>
Oops, should be:
hrMn[0] = int(hrMn[0]
if t[2] == 'PM':
hrMn[0] += 12
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for posting. I sure am sorry that I wasted your time. I should
have started the post stating I am using jython 2.2.3 and apparently
it has no datetime module. But I will keep datetime in mind for future
reference.
Since I had no datetime I cobbled out the following. Seems to work
thus far.
Sorry, reading a little closer I see that the time tuple is apparently
an ordinary list.
jvh
--
http://mail.python.org/mailman/listinfo/python-list
>
> Could you point to an example of a python time_t struct?
>
Or maybe that should be a tm struct???
--
http://mail.python.org/mailman/listinfo/python-list
I need to convert the string below into epoch seconds so that I can
perform substractions and additions. I assume I will need to break it
up into a time_t struct and use mktime. Two questions if you will
please:
Is there a way to use multiple separator characters for split similar
to awk's [|] st
If file writing has no return value (http://docs.python.org/lib/bltin-
file-objects.html), how do you know if the write was successful?
Should one assume that if the open was successful then write are also?
Thanks,
jvh
--
http://mail.python.org/mailman/listinfo/python-list
On May 10, 7:11 pm, Jon Pentland <[EMAIL PROTECTED]> wrote:
> I don't really see the use for being able to do that. Have you tried
>
Well, I think I found a reason and it probably happens quite a bit.
I open the file and read it into a list. I pop some elements from the
list for processing and th
On May 11, 10:45 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> HMS Surprise wrote:
> > I suppose a one liner would look better, but I am alway leery of these
> > things 'breaking'.
>
> > t = s.split('">')[-1].split('<')[0]
&g
I suppose a one liner would look better, but I am alway leery of these
things 'breaking'.
t = s.split('">')[-1].split('<')[0]
s ='G132153'
jh
--
http://mail.python.org/mailman/listinfo/python-list
Greetings.
Given the string s below and using only python built-in capabilities,
I am trying to isolate the substring G132153. This string may have any
number of digits but the pieces around it will not change. I have
accomplished this with split but there must be a more elegant and
compact way t
After reading a file is it possible to write to it without first
closing it? I tried opening with 'rw' access and re-winding. This does
not seem to work unless comments are removed.
Also, does close force a flush?
Thanks,
jh
#~~
f = open('c:\\tempMaxq\\incidents.tx
>
> Do you really mean syntax?
>
Thought so?
A few sources I bookmarked to avoid future google two-steps.
http://www.diveintopython.org/native_data_types/lists.html
http://en.wikibooks.org/wiki/Python_Programming/Lists
http://infohost.nmt.edu/tcc/help/pubs/python22.pdf
Thank you all.
jh
--
Found list popping at
http://en.wikibooks.org/wiki/Python_Programming/Lists :)
--
http://mail.python.org/mailman/listinfo/python-list
Trying not to be a whiner but I sure have trouble finding syntax in
the reference material. I want to know about list operations such as
append. Is there a pop type function? I looked in tutorial, language
reference, and lib for list, append, sequence. Is there a place where
us doofi ( who may not
I have two files apparently identical until I open them with winMerge
which reports that they use different EOL characters. They are both
jython scripts built using the maxq tool. When the one would not work
I stripped it down to bare minimums and then duplicated it. The
duplicate works, the origin
> [lst.append(list(line.split())) for line in file]
Thanks, this is the direction I wanted to go, BUT I must use v2.2 so
the line above gives me the error:
AttributeError: __getitem__
But the write format will be helpful.
Thanks again,
jh
--
http://mail.python.org/mailman/listinfo/python-l
If one has a list of lists such as
lst = [['a','1'],['b','2']]
is there a standard python idiom for writing and reading the pairs to/
from a file?
Thanks,
jh
--
http://mail.python.org/mailman/listinfo/python-list
Just wanted a input routine that would let me pause my jython program
until I press enter. Searched tutorial, lang ref, and lib and found
input and raw_input. Both hang the program and it must be killed.
s = raw_input('--> ')
What has Mr Duh done wrong now?
jh
--
http://mail.python.org/mailman
BTW, here's what I used, the other ideas have been squirreled away in
my neat tricks and methods folder.
for el in data.splitlines():
if el.find('LastUpdated') <> -1:
s = el.split("=")[-1].split('"')[1]
print 's:', s
Thanks
> This looks to be simple HTML (and I'm presuming that's a type on
> that ?> ending). A quick glance at the Python library reference (you do
> have a copy, don't you) reveals at least two HTML parsing modules...
>
No that is not a typo and bears investigation. Thanks for the find.
I foun
Thanks all.
Carsten, you are here early and late. Do you ever sleep? ;^)
--
http://mail.python.org/mailman/listinfo/python-list
On May 8, 9:19 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
> Yes it could, after I isolate that one string. Making sure I that I
> isolate that complete line and only that line is part of the problem.
>
It comes in as one large string...
--
http://mail.python.org/mailman/listinfo/python-list
Yes it could, after I isolate that one string. Making sure I that I
isolate that complete line and only that line is part of the problem.
thanks for posting.
jh
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for posting. Could you reccommend an HTML parser that can be
used with python or jython?
john
--
http://mail.python.org/mailman/listinfo/python-list
The string below is a piece of a longer string of about 2
characters returned from a web page. I need to isolate the number at
the end of the line containing 'LastUpdated'. I can find
'LastUpdated' with .find but not sure about how to isolate the
number. 'LastUpdated' is guaranteed to occur o
> Press the cursor-up key.
>
> Martin
Should have mentioned that I tried that hunting around earlier and it
did not work.
jh
--
http://mail.python.org/mailman/listinfo/python-list
In a python Tk shell in Windows, what is the equivalent of unix's pwd?
In a python Tk shell in Windows, is there an easy way to reoeat an
earlier command, similar to Tcl/Tk's hist?
--
http://mail.python.org/mailman/listinfo/python-list
On May 8, 3:06 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Tue, 2007-05-08 at 12:54 -0700, HMS Surprise wrote:
> > Tried executing os.chdir("c:\twill") from a python Tk shell and got
> > the error message:
>
> > WindowsError: [Error 123] The filen
Tried executing os.chdir("c:\twill") from a python Tk shell and got
the error message:
WindowsError: [Error 123] The filename, directory name, or volume
label syntax is incorrect: 'c:\twill'.
I have the directory exists as I copied the name from the explorer
window that was open to it.
What is
Great idea Dennis, I will look into that.
Thanks,
jh
--
http://mail.python.org/mailman/listinfo/python-list
PS
> Add this directly after the ``import`` to see what's happening:
>
> print urllib.__file__
> print dir(urllib)
>
C:\maxq\bin\testScripts\.\urllib.py
['__doc__', '__file__', '__name__', 'string']
--
http://mail.python.org/mailman/listinfo/python-list
On May 8, 11:37 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, HMS Surprise
> wrote:
>
> > The snippet below causes an attribute error.
>
> > AttributeError: module 'urllib' has no attribute 'urlopen
On May 8, 10:40 am, Klaus Alexander Seistrup <[EMAIL PROTECTED]> wrote:
> HMS Surprise wrote:
> > Have I misused .extend?
>
> The .extend() method expects an iterable, try .append() instead.
>
> Cheers,
>
> --
> Klaus Alexander Seistruphttp://klaus.seistru
The snippet below causes an attribute error.
AttributeError: module 'urllib' has no attribute 'urlopen'
I am using python 2.2.3. According to the documentation at C:
\Python22\Doc\lib urllib has a function called urlopen.
#~~~
import urllib
class logi
Is sys.path setup differnently in jython vs python? I have environment
variables pythonpath and jythonpath set to include C:\python22 but the
initial printout indicates it is being ignored. Also when I used
sys.path.extend, the added pathname shows up as a series of single
characters. Have I misus
On May 8, 9:13 am, HMS Surprise <[EMAIL PROTECTED]> wrote:
> > To summarize the summary, are you sure you need to use Jython instead of
> > standard CPython?
>
> Thanks for all your help Carsten, you have been more than patient with
> me.
>
> To answer your quest
> To summarize the summary, are you sure you need to use Jython instead of
> standard CPython?
>
Thanks for all your help Carsten, you have been more than patient with
me.
To answer your question I must admit I do not know. I am trying to use
a tool called maxq (maxq.tigris.org) that has limited
On May 7, 6:54 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Mon, 2007-05-07 at 16:24 -0700, HMS Surprise wrote:
> > Since sys.path = ['.', 'C:\\maxq\\lib\\Lib', 'C:\\maxq\\jython'] I
> > copied urllib to c:\maxq\lib\Lib.
>
> > Now I
On May 7, 6:31 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> HMS Surprise <[EMAIL PROTECTED]> writes:
> > Since sys.path = ['.', 'C:\\maxq\\lib\\Lib', 'C:\\maxq\\jython'] I
> > copied urllib to c:\maxq\lib\Lib.
>
> > Now I get the e
Since sys.path = ['.', 'C:\\maxq\\lib\\Lib', 'C:\\maxq\\jython'] I
copied urllib to c:\maxq\lib\Lib.
Now I get the error -
Traceback (innermost last):
File "", line 5, in ?
File "C:\maxq\lib\Lib\urllib.py", line 1148
_hextochr = dict(('%02x' % i, chr(i)) for i in range(256))
On May 7, 6:00 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On May 8, 8:06 am, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
> > I edited environment varialbes and have added C:\Python25\Lib to
> > PYTHONPATH but get the no module message when the statement
>
>
On May 7, 5:45 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> HMS Surprise <[EMAIL PROTECTED]> writes:
> > Perhaps I should have put qoutes in my sentence.
>
> Or I should have read it slowly. ;-)
>
> > I get the "no module message named urllib".
>
On May 7, 5:29 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> HMS Surprise <[EMAIL PROTECTED]> writes:
> > I edited environment varialbes and have added C:\Python25\Lib to
> > PYTHONPATH but get the no module message when the statement
>
> > import urllib
>
&g
I edited environment varialbes and have added C:\Python25\Lib to
PYTHONPATH but get the no module message when the statement
import urllib
is executed.
Even tried copying the urllib file to my working directory.
Any suggestions?
Thanks,
jh
--
http://mail.python.org/mailman/listinfo/python-l
Thanks for posting.
pythonpath = .;c:\maxq\bin\testScripts; c:\maxq\bin;c:\maxq\jython
Both files are in c:\maxq\bin\testScripts. Also I do not get the
message "no module named...:
File nCreateIncident.py, the importer:
from PyHttpTestCase import PyH
Greetings.
What is the implication of the error message 'cannot import
name .'? It occurs when executing the line:
from nBaseTest import nBaseTest
The file exists and the class within it exists. Changing it to
from nBaseTest import x
gives me the same result so it is as though th
On May 2, 12:03 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, HMS Surprise
> wrote:
>
> > I wish to generate a datetime string that has the following format.
> > '05/02/2007 12:46'. The leading zeros a
On May 2, 12:00 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
> I wish to generate a datetime string that has the following format.
> '05/02/2007 12:46'. The leading zeros are required.
>
> I found '14.2 time' in the library reference and have pulled in
I wish to generate a datetime string that has the following format.
'05/02/2007 12:46'. The leading zeros are required.
I found '14.2 time' in the library reference and have pulled in
localtime. Are there any formatting functions available or do I need
to make my own? Perhaps there is something s
> hi,
> download this module:http://sourceforge.net/projects/mysql-python
> and look at the tutorial here:http://www.kitebird.com/articles/pydbapi.html
Done, thank you too.
jh
--
http://mail.python.org/mailman/listinfo/python-list
On May 1, 2:58 pm, "Greg Donald" <[EMAIL PROTECTED]> wrote:
> On 1 May 2007 12:40:20 -0700, HMS Surprise <[EMAIL PROTECTED]> wrote:
>
> > I need to peform some simple queries via MySQL. Searching the list I
> > see that folks are accessing it with python. I
Greetings,
I need to peform some simple queries via MySQL. Searching the list I
see that folks are accessing it with python. I am very new to python
and pretty new to MySQL too. Would appreciate it if you could point me
to some documentation for accessing MySQL via python. Something of the
"Pytho
On Mar 16, 6:44 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> HMS Surprise wrote:
> > Seems to me that one should be able to put the names of several
> > functions in a list and then have the list executed. But it seems the
> > output of the functions is hidden, only th
Seems to me that one should be able to put the names of several
functions in a list and then have the list executed. But it seems the
output of the functions is hidden, only their return value is visible.
Is this because the list execution is another scope?
Thanx,
jh
~~~
Thanks for posting. I continued to read and realized the instantiation
was not a function call soon after I posted. Oh well...
Still unsure about the best way to break up the large #start - #end
section. I appreciate your answers and try to digest them more fully.
Then maybe I will have a better i
Greetings,
First I will admit I am new to Python but have experience with C++ and
some Tcl/Tk. I am starting to use a tool called MaxQ that uses
jython. I have been studying Rossum's tutorial but still am unclear on
importing, the use of self, and calling functions with their own name
in quotes.
94 matches
Mail list logo