p(1)
print 'Done'
sys.exit(0)
When x is typed, everything does shut down but the main script never
fully ends. Is there any way to get it to quit?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Is there a module that can pull str values for say the last 3 months?
Something like:
print lastMonths(3)
['Sep', 'Aug', 'Jul']
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Is there a module that can pull str values for say the last 3 months?
Something like:
print lastMonths(3)
['Sep', 'Aug', 'Jul']
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Cant believe I have to post this and get help... and can't believe I
couldnt Google it reasonably well enough... I need to take a float
variable and have it display as a string to always have two decimal
places:
12. -> 12.33
1.0 -> 1.00
etc...
Anyone willing to help with this one?
thanks,
H
g it with Linux/Unix, cx_freeze is the only way i know to get this
done and even then it may have the same limitations. If you're trying
to hide/proprietize code, you may want to use pyobfuscate.
Good Luck
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Is there a Python odbc module that will work on Linux? I have a jdbc
connection to a DB2 server. I am looking hopefully for an open source
solution and not a commercial one.
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Is there any type of lame_enc.dll wrapper for Python that's available?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 23, 9:42 am, [EMAIL PROTECTED] wrote:
> On Mar 23, 8:16 am, "Harlin Seritt" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Using the code below:
>
> > ---BEGIN CODE---
>
> > value = raw_input("Type a divisor: ")
> > try:
>
Using the code below:
---BEGIN CODE---
value = raw_input("Type a divisor: ")
try:
value = int(value)
print "42 / %d = %d" % (value, 42/value)
except ValueError:
print "I can't convert the value to an integer"
except ZeroDivisionError:
print "Your value should not be zero"
ex
On Feb 21, 7:12 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
> Harlin Seritt wrote:
> > Hi...
>
> > I would like to take a string like 'supercalifragilisticexpialidocius'
> > and write it to a file in binary forms -- this way a user cannot read
> &g
On Feb 21, 7:02 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote:
> Harlin Seritt wrote:
> > Hi...
>
> > I would like to take a string like 'supercalifragilisticexpialidocius'
> > and write it to a file in binary forms -- this way a user cannot re
Hi...
I would like to take a string like 'supercalifragilisticexpialidocius'
and write it to a file in binary forms -- this way a user cannot read
the string in case they were try to open in something like ascii text
editor. I'd also like to be able to read the binary formed data back
into string
Is there any way to automatically log errors that occur within an
executed script to a file?
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
How does one get the name of a class from within the class code? I
tried something like this as a guess:
self.__name__
Obviously it didn't work.
Anyone know how to do that?
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
I have a script that I want to import called upper.py. It is 2
directories above the script that will call it - i'll call that one
main.py. How am I able to import a script in a directory that is above
it?
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Hi Ed,
Generally checking the sources give a very good clue as to what
exceptions the interpreter can raise. Look around _builtins_ for this.
Harlin Seritt
Ed Jensen wrote:
> I'm really enjoying using the Python interactive interpreter to learn
> more about the language. It'
Hi Frank,
Usually "Python" is installed in /usr/lib/python[VER] but you should be
able to call up /usr/bin/python without any difficulty.
Harlin Seritt
Frank Potter wrote:
> I installed fedora core 6 and it has python installed.
> But the question is, where is the executable
Is there any way to fetch a website's host/version headers using
Python?
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
I am using the exact same query string generated and it works when i
type it in the MySQL client but doesn't work when using the MySQLdb
module.
:(
--
http://mail.python.org/mailman/listinfo/python-list
ot;, line 33,
in defau
lterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your
SQL syntax
; check the manual that corresponds to your MySQL server version for
the right s
yntax to use near 'values) values('Sat Apr 15 08:5
I have this string that I am sending via a Cursor.execute() using
MySQLdb:
insert into table Ping82_eb13__elearn__ihost__com (`dateTime`,
`values`) values(
"Fri May 12 11:39:02 2006", "1")
Does anyone see anything wrong with this SQL syntax?
Thanks,
Harlin Seritt
--
ht
I have some code here:
groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
I want to add another key: 'ITALIAN' : 'orange'
How do I append this to 'groups'?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Was actually going to throw in jEdit for the category of what's good on
both platforms... For someone who despises Java, I actually like it.
:-)
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
"Why not just use static HTML for the static content ?"
Makes sense... now, what about for having the portal capabilities
(users log in, save profiles, etc)... what would be best for that? I
really don't think though that a CMS is necessary. Does anyone know of
a Python forum package similar to ph
know... strange choices (especially Kate) but they both do what
I need them to do. :-)
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
"memory."
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
with this or should they use
something more robust like DB2 (IBM shop)?
Any suggestions are welcome.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
You'll almost certainly need to take a look at mascyma's support
facilities: support web page, forum, etc (provided they do indeed
exist).
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
sudo is something of a quick fix.
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Ack... I'm an idiot... Thanks Richard -- You're the Man!
--
http://mail.python.org/mailman/listinfo/python-list
n a Firefox window:
[OUTPUT]
http://server1.com";>
[/OUTPUT]
Is there anything I can do to fix this?
Also, is there a redirect command somewhere within Python CGI that can
get this done instead as I would actually prefer to have the CGI code
execute this rather than depe
\Python24\lib\ftplib.py", line 327, in ntransfercmd
resp = self.sendcmd(cmd)
File "C:\Python24\lib\ftplib.py", line 241, in sendcmd
return self.getresp()
File "C:\Python24\lib\ftplib.py", line 216, in getresp
raise error_perm, resp
ftplib.error_perm: 500 Syntax error, command unrecognized.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Hi Simon,
Honestly, any type of application can be programmed with Python. Python
is extremely "wrappable" as it can be wrapped around virtually any type
of platform that exists. You can create GUI, system, and web apps
easily. The main niche that Python holds is the fact it exists for the
benefit
done, I am open to
suggestions.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Reasons why it still won't work:
* Firewall
* Unknown-modes-operating-systems-get-into
Yeah, I dont think these things can be avoided. Nonetheless, if I can
come up with some way (via help from this group--thank God!) to find if
the node is up (barring the two aforementioned reasons), I am doing
ection on a
specific port, but this is just a way to tell if something is up or
down (and perhaps the only real way to do it running from a Win32
platform). Thanks for the help. However, if you do have suggestions on
how to get this done better, I am more than glad to hear it!
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
tried:
except socket.error, (10061, 'Connection refused'):
and
except (socket.error, 10061, 'Connection refused'):
to no avail. What do I need to do to catch each one specifically?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
ng way too many machines and this either takes too long or causes
severe memory leakage due to MS's horrible ping client). Also, I am
unable to use Jeremy Hylton's Python ping client because it does little
more than call gethostbyaddr(). Thanks for taking a look at this.
Harlin Seritt
--
http:
How can I take a time given in milliseconds (I am doing this for an
uptime script) and convert it to human-friendly time i.e. "4 days, 2
hours, 25 minutes, 10 seonds."? Is there a function from the time
module that can do this?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailma
Thanks Dan, that would be perfect or close enough I should say. :-)
Regards,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
I would like to take milliseconds and convert it to a more
human-readable format like:
4 days 20 hours 10 minutes 35 seconds
Is there something in the time module that can do this? I havent been
able to find anything that would do it.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman
I am trying to pull data from a web page at https://localhost/wps.
While this would work if the url was http://localhost/wps, it doesn't
work with 'https.'
I can do this:
import urllib
data = urllib.urlopen('http://localhost/wps').read()
But not with https. How can I pull data from a https url?
T INFORMATION: Pinging '+ip+' at '+time.asctime()
AttributeError: 'str' object has no attribute 'asctime'
Press any key to exit
I'm sure this is something simple but for this I am having trouble
figuring it out.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Mike,
that will work just as well... just disappointed in myself that i lack
the creativity to think of something that simple ;-)
thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Is there a function that allows one to get the name of the same script
running returned as a string?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
g:
try:
open(file, 'r').read()
flag = 1
except:
pass
This may seem nice on paper but I hate to run a while for an
indeterminate amount of time. Is there anything else that can be done
that would be better?
Thanks,
Harlin Seritt
--
http://mail.python.org/mai
You can do the following:
import os
data = os.popen('ping machineName').read()
if 'request timed out' in data or 'unknown host' in data:
Ping Failed Code
else:
Ping Returned Something Good Code
This is the quickest and really most effective way to g
Hi DH,
Thanks for this blurb from ASPN. I am really looking, however, to do
this on a Windows machine as opposed to a Unix one at this point. This
will come in handy down the road I am sure.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
I am looking for a module that will render html to console but
formatted much like one might see with Lynx. Is there such a module
already out there for this?
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is anyone aware of an available open-source/free search engine app
(something similar to HTDig) written in Python that is out there?
Googling has turned up nothing. Thought maybe I'd mine some of you
guys' minds on this.
thanks,
Harlin Seritt
Internet Villa: www.seritt.org
x27;s like 30USD but it does a great job and adds a few extra features.
HTH,
Harlin Seritt
Internet Villa: www.seritt.org
--
http://mail.python.org/mailman/listinfo/python-list
What are you getting in your smtpd logs? Are you using postfix?
sendmail? or are you running this against a Windows stmp service?
Harlin Seritt
Internet Villa: www.seritt.org
--
http://mail.python.org/mailman/listinfo/python-list
Is it possible to use Python to create snapins for the MMC?
Thanks,
Harlin Seritt
Internet Villa: www.seritt.org
--
http://mail.python.org/mailman/listinfo/python-list
shake a stick at :-).
Harlin Seritt
Internet Villa: www.seritt.org
--
http://mail.python.org/mailman/listinfo/python-list
Is there any reason why you wouldn't want to do this using the the
threading class? To each his own I suppose. You can try the following
though you'll at least need to use functions:
import time
import thread
def myfunction(string,sleeptime,*args):
while 1:
print string
time
How does one get the machine name with Python that the actual script is
running on? Obviously, one could parse the hosts file but I was
wondering if there was a quick way to get it done?
thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Forgive another question here, but what is the 'r' for when used with
expression: r'\w+...' ?
--
http://mail.python.org/mailman/listinfo/python-list
Ahh that's it Frederik. That's what I was looking for. The regular
expression problems I will take care of, but first wanted to walk
before running. ;)
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
d out how to output the matches for this expression
of my 'wordList' into a neat list variable. How do I get this done?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
I have a remote linux server where I can only access it via ssh. I have
a script that I need to have run all the time. I run like so:
python script.py &
It runs fine. When I log off ssh I notice that the script died when I
logged off. How do I make sure it stays running?
thanks,
Harlin Se
This is perfect. Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
t '\n' is not being used.
Is there anything I can do to make sure paragraphs show up properly?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
as needing something for web apps, CherryPy is great -- just learn
Python first. PHP is good but it has fallen out of favor with me though
there are a ton of people out there who think it is the greatest thing
since sliced bread.
Take a look at the Python tutorial: http://docs.python.org/tut/tut.html.
Good luck,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
?
--
http://mail.python.org/mailman/listinfo/python-list
the way to open files and read
lines in Java."
If anyone cares to give an intelligence answer to my question, I'll be
happy to take it in without ridicule but I just don't see it. Sorry for
the rant (and somewhat off-topic but I hear you guys are tolerant of
that in this group ;-)), but
?
--
http://mail.python.org/mailman/listinfo/python-list
_()
method. This is useful whenever you want to use 'color' as a private
variable.
The same also goes for methods. Hopefully, you see how useful this can
be down the road. This way you won't have to use variable/method access
modifiers like Public, Private, Protected and so forth. If this doesn't
make sense or you want more clarity, please let me know.
Good luck,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Not a grid widget necessarilly but a 'grid' method you can use instead
of pack(). Take a look at
http://www.pythonware.com/library/tkinter/introduction/grid.htm. If
this isn't what you mean, come back.
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
s easy to parse with Python on your own!
Thanks for the help,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to use SGMLlib module to extract all links from some data I
pulled from the web (via urllib). I have looked at the documentation
online and can not make sense of it. As a quick example, how would I
get the hyperlinks for an html file?
thanks,
Harlin
--
http://mail.python.org/mailman
Does anyone know if there are any Python Active Directory Modules out
there? I looked at LDAP module but there is no version for Python 2.4
and it's support for Active Directory seems to be lacking a bit.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
George that is what I'm looking for. Thanks, Harlin
--
http://mail.python.org/mailman/listinfo/python-list
Try EasyDialog:
http://www.talkaboutprogramming.com/group/comp.lang.python/messages/314003.html
It should also be on Vaults of Parnassus.
--
http://mail.python.org/mailman/listinfo/python-list
I've used multiple listboxes in the past. Also, you can build a widget
that contains multiple listboxes as well. As far as there being one
ready to go, I don't know of one.
--
http://mail.python.org/mailman/listinfo/python-list
ket text. What I would like to do is to
.split() using something akin to this:
textdata.split('{*}') # The '*' being a wildcard
Is this possible to do? If so, how is it done?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
e showing the message box. If you find a more elegant way to
accomplish this, please post back !
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
I actually tried mapping the PID to an integer value and it still
didn't work. At any rate, I found another way to do it. Thanks anyways.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have a script.py that is converted to .exe using py2exe. From another
script I call script.exe and would like to be able to run this
script.exe in the background (as well as in console -- giving the user
some simple options). How can I make this happen?
thanks,
Harlin
--
http://mail.pyth
I am looking for a way for my script to write to a log file saying
something like this:
I was killed at time.asctime()
I would like to be able to do this if/when the script is killed by
means rather than my own. How in the world would I accomplish this?
Thanks,
Harlin
--
http://mail.python.or
I think I need something besides TerminateProcess(). Is there anyway
possible to terminate a process by just passing a string value to the
function? Honestly, I am not interesting in terminating a process by
its handle.
--
http://mail.python.org/mailman/listinfo/python-list
Yeah I've kind of figured that. I was just wanting to know what I could
use to kill a pid that is a string value. Thanks though.
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
I am using os.getpid() to get the pid value for a script running. I
store that value (as a string) to a file. Later when I try to kill that
pid (i pull this from the file as a string value) I get errors.
Using the following lines I get the subsequent error.
(pid is a string value)
win32api.Termi
Let's say I have a simple script on Windows NT. I would like for that
script to find its own PID once it's started and store that as a value
within the script. Also, down the road I'd like to kill that process by
its PID. How is this done?
Thanks,
Harlin Seritt
--
http://
pacity.
If you would like to obfuscate your code (disguise it) without an
executable you can try pyobfuscate as well. Just Google for these two
and you'll find easily.
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
utton1.pack()
button2 = Button(root, text='Button 2', command=say_hello)
button2.pack()
root.mainloop()
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Thank you Mr. Stroud.
--
http://mail.python.org/mailman/listinfo/python-list
I have three tuples of the same size: tup1, tup2, tup3
I'd like to do something like this:
for a,b,c in tup1, tup2, tup3:
print a
print b
print c
Of course, you get an error when you try to run the pseudocode above.
What is the correct way to get this done?
Thanks,
Harlin
--
http://
I am trying to do the following:
import urllib
url = 'http://www.website.com/file.shtml'
dat = urllib.urlopen(url, 'r').read()
print dat
When I do so, I get the following data:
405 Method Not Allowed
Method Not Allowed
The requested method POST is not allowed for the URL
Apache/1.3.27 Se
Kartic,
Thanks for the help. It's good to get a different perspective on
something (i.e. MSDN, dir() etc).
--
http://mail.python.org/mailman/listinfo/python-list
down to me.
What I am hoping to do is to work on some Python versions of PSTools. I
think the win32 modules will be perfect for helping me do this,
however, I am having a (more than it should be) difficult time making
sense of the win32process module.
Any help would be appreciated.
Thanks,
Har
'dellserver.gif')
photo = ImageTk.PhotoImage(im)
label = Label(master, image=photo)
label.pack()
if __name__ == '__main__':
root = Tk()
app = App(root)
root.mainloop()
---END of CODE---
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Max,
Thanks and good job!
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
No reason why they shouldn't be.
-Harlin
--
http://mail.python.org/mailman/listinfo/python-list
ully functional :-)
Seriously though, you can use the Listbox for almost anything you would
need a combobox for. In my mind, it's good for tight spaces (I'm sure
someone on this fine board will add something or disagree with me),
looks and little else.
Regards,
Harlin Seritt
--
http://mail.py
Benedict,
Best to hand-code your code ;-) -- even GUI. This is kind of why I like
Tkinter so much. Good luck.
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Hi Raghul,
If possible, run your program as root.
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
If anyone has time, would you mind explaining the code that Dan Bishop
was so kind as to point out to me:
int(''.join(num1))
This worked perfectly for me, however, I'm not sure that I understand
it very well.
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
I have the following:
num1 = ['1', '4', '5']
How can I combine the elements in num1 to produce an integer 145?
thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
When using try... except... errors don't show up. Is there a way to
force stderr despite using try...except?
thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
nsole=["helloform.py"])
---
I run the setup like this: python setup.py py2exe.
Is there anything else I need to do to get this converted into a *.exe
file successfully?
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 176 matches
Mail list logo