'SplitString' ]
>_reg_progid_ = "TestPythonCom.Application"
># NEVER copy the following ID
># Use "print pythoncom.CreateGuid()" to make a new one.
>_reg_clsid_ = "{93D78ABA-1F6C-4B1C-97C7-C3700511415A}"
>
>def SplitString(self, val):
>
o out in a very small number of ways. On a Unix system, you
can use SMTP, or you can call /usr/sbin/sendmail directly. On Windows, you
can use SMTP, or you can use MAPI.
There is no "magic" sink into which you can pour e-mail.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Bo
he
canonical csv application. It can read a UCS-16 csv file, but it
mishandles it. It doesn't split at the commas. It treats each line as a
single cell.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
s:
>
>www.greenzap.com/benefits
That web zite iz juzt too cutezy. I could never truzt it, even if I hadn't
learned about it through a newzgroup zpam.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
myMoney
6
(0, 25L)
Instead, we get:
myMoney
6
(0, -1794967296)
The value has wrapped at 2**31.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
me to
>jump ship (to mix my metaphors).
That is truly wonderous. Are you famliar with the phrase "jumping the
shark"? This chart might prove that, with Perl 6, Perl has now "jumped the
shark".
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
I'm
>planning to put the contents of UnxUtils.zip in a directory and then move
>the contents of UnxUpdates.zip, which has many of the same filenames, to
>the same directory. Should I just let Windows replace the old files with
>the updated ones?
Yes.
--
- Tim Roberts, [EMA
t, even not a
>># pi-sonnet, but it surely produces Pi!
>
>It sure does. When I ran it my jaw dropped. I had 7,947 CORRECT digits in
>2 minutes 0 seconds (by my stopwatch)!
How do you know? I think the 7,912th digit is wrong.
;)
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza &
It means that your function has "side effects" beyond just
returning a value or set of values. This kind of thing is a better
solution:
def change_filename():
return raw_input()
def change_path()
return raw_input()
filename = change_filename()
path = change_path()
--
-
>http=httplib.HTTP("https://www.abc.com/",443)
If you want https, you should use the HTTPS class.
http = httplib.HTTPS("https://www.abc.com/",443)
Or, even better, the HTTPSConnection class.
http://www.noah.org/python/https/
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
"Bob Then" <[EMAIL PROTECTED]> wrote:
>how can i change all files from one extension to another within a direcory?
In Windows, the quickest way is:
os.system( "rename *.old *.new" )
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
-
't do that. It always sends plain old
application/x-www-form-urlencoded data.
I think you're going to have to roll your own sender.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
;i1 = binascii.unhexlify(s1)
>i2 = binascii.unhexlify(s2)
>x = i1 ^i2
>
> TypeError: unsupported operand type(s) for ^: 'str' and 'str'
No imports at all:
s1 = '1C46BE3D9F6AA820'
s2 = '8667B5236D89CD46'
i1 = int(s1,16)
i2 = int(s2,16)
x =
I don't know IDLE, but it's probably something like File->Run.
>>>> exit
>'Use File/Exit or your end-of-file key to quit IDLE'
>>>> print "Hello"
>Hello
THAT'S the way you use IDLE.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
ur problem solved, but you should know there is a problem
with this line. The print statement automatically adds an end-of-line, so
this will actually end up producing TWO blank lines after the header. You
should use this:
print "Content-type: text/html\n"
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
ion did not really say "^L".
It gave me the symbol for female, which is code point 12 in the default
character set. I translated it to the VIM equivalent to make the point.)
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
t; much quicker. To do that with your
code, I have to type "m tab 2 2 2 2 2 2 tab 2005".
As an alternative, there are Javascript-based mini-calendars you can
download that popup a little window with the current month, and let you
click on the date.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
st of 1,000+ evils."
Or, paraphrasing Mark Twain, "Python is the worst possible programming
language, except for all the others."
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
ef="+FLT) % (3.0,4.5)
Are you trying to do currency? There are better ways, using the locale
methods.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
be answered with a 4-line application using Twisted, but now
it's grown even more?
Remember the Master Control Program from Tron? I think of Twisted as
Python's MCP.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
that the database provider inserts whatever quoting is
required; you don't have to remember to put single quotes around the
arguments, and protect single quotes within the arguments by doubling them,
and so on.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
; is just a normal function that creates the list
[0,1,2,3,4]. The "for" statement keeps running the loop until it runs out
of values in that list or tuple.
So, you CAN change the value of i, but it won't change the operation of the
loop.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
C:\\Program Files\\WinRK\\WinRK.exe -create ' +
or
Command_String = r'C:\Program Files\WinRK\WinRK.exe -create ' +
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
get around wtih this? I don't want to break down this
>comparison in two steps.
Sorry, you have to. Assignment statements are not expressions in Python.
m = self.macro_parser.match(d)
if m:
xxx
You know the outer parentheses are not necessary, right?
--
- Tim Roberts
th a lot of customization using
>Visual Basic.
The VB in Microsoft Office is not being discontinued.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
this:
a = (3 + 5) * 5
You really, really want (3 + 5) to be an integer, not a one-item tuple.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
m Microsoft, and (C) no human being really wants to do.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
you open a file to read
>& never close it?
A file is closed when the last reference to it is deleted. Since you never
save a reference to this file, the last reference is deleted as soon as the
readlines() call finishes.
So, the file will be closed when you move to the next stateme
t exist from the point of
view of the directory where the script is running this. You might do this:
print os.getcwd()
os.system('dir ' + InputDirectory)
just to prove that you are where you think you are.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
n i make rx_command of type 'int' if i am to use 2)?
Did you get an answer to this? I couldn't see any responses. The answer
is either:
rx_command = unpack('1B', rx_data_command)[0]
or
(rx_command,) = unpack('1B', rx_data_command)
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
get it in the python way ?
If you need to do this a lot, just keep two dictionaries, where the keys in
each are the values in the other.
reversephone = dict( zip( phone.values(), phone.keys() ) )
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
.
The statement
dir = []
does not actually change the list that was passed in. It creates a NEW
empty list and binds it to "dir".
If you want to empty the "dir" variable, try:
del dir[:]
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
Server for Win98,
although I think it's awfully hard to configure. thttpd and xitami are
good lightweight web servers.
Apache works quite well in Windows, but I don't think it is very happy on
Windows 98.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
as short:%d as int:%d sum:%d" % (inShort, inInt, outSum)
> outSum = inShort + inInt
>
># Add code so that when this script is run by
># Python.exe, it self-registers
>if __name__=='__main_ _':
> print "Registering COM server..."
> import win32
rom logilab.pylint import lint
>lint.Run(sys.argv[1:])
>
>
>DosExitLabel = """
>:exit
>rem """
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
>
>Tim Roberts wrote:
>>>Are inodes supported on Windows NTFS, FAT, FAT32?
>>
>> No. Inodes are strictly a Unix filesystem concept.
>
>I disagree. NTFS MFT records are so similar to inodes
>that thei
Patrick Useldinger <[EMAIL PROTECTED]> wrote:
>
>What does the above yield on Windows?
0.
>Are inodes supported on Windows NTFS, FAT, FAT32?
No. Inodes are strictly a Unix filesystem concept.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
htt
is lost. However, the variable zzz is still bound to [0,1,2].
If you need to create a new object and return it to the mainline, do that:
def xxx(yyy):
yyy = [ 3, 4, 5 ]
return yyy
zzz = [ 0, 1, 2 ]
zzz = xxx(zzz)
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boe
x27;m not seeing how to get at data that's not a named form parameter.
If you are using POST in some non-standard way, just skip using the cgi
module at all and read stdin yourself.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
u don't have to demean
yourself by working in PHP.
Sockets and pipe files are common methods of communicating with a daemon.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
single file along with
the interpreter. When the .exe is executed, it extracts the interpreter
and the scripts into a temp directory, and fires up the interpreter.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
tioned, you probaby shouldn't assume it.
>Can this behaviour of email be considered a bug?
Not in my opinion, no.
>Is there a good case to iterate over something useful in a message?
Well, if you don't have an answer to that question, then why would you
expect it to support it
o expose a command shell via CGI? Can you think of a
better way to allow hackers to wreak havoc on your system?
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
BOOGIEMAN <[EMAIL PROTECTED]> wrote:
>
>os = windows xp
>How do I make "myprogram.py" start fullscreen at windows command prompt ?
>Also I made it as "myprogram.exe" with py2exe,but how to start fullscreen ?
Which GUI toolkit are you using? wxPython? tk?
',
then you do 1D FFTs on all the columns of X'.
So, for a 32x32 2D FFT, you'll end up doing 64 1D FFTs.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
e on-the-fly. With a package like CherryPy, you
get a web server built-in. You fire up the server in the background, and
bring up Internet Explorer as "your" user interface.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
S box.
If you really want .pyc files to run without a DOS box, bring up a command
shell and type
assoc .pyc=Python.NoConFile
(Actually, you should type "assoc .pyw" to make sure that is its file
type.)
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
a procmail recipe can feed a message through a
filter, and then pass the results of that filter back in to the e-mail
system for further processing?
It seems to me that you should consider letting procmail do what it is good
at, and use your Python solution for the things that are beyond it.
--
- T
't overlook the simple
(and possibly more secure) answer:
lookup = {
'a': a,
'b': b,
'c': c,
}
if lookup.has_key(myFunction):
return lookup[myFunction]()
else:
print "Couldn't find", myFunction
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
I intend to actually have two separate keys invoke this menu
>to have it behave differently in different circumstances.
You can, of course, CHANGE the underlined character to match the
circumstances.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
gt; > >>> crsr.nextset()
If you are only issuing one SELECT, like most applications, then nextset()
serves no purpose. If you did something like this:
sql = "select * from wjtmp; select count(*) from wjtmp;"
That's when you need nextset(). Personally, I've never used it.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
on
Windows? The ONLY way to get small-integer microsecond responses in
Windows is to write a kernel driver, and even then there are no guarantees.
Windows is NOT a real-time system. If you have an environment where an
unexpected delay of a millisecond or more is going to cause damage, then
you n
son I
>should do both? When reading to the end of a file, won't tell() be just
>as accurate as os.path.getsize()?
On Windows, those two are not equivalent. Besides the newline conversion
done by reading text files, the solution in 2. will stop as soon as it sees
a ctrl-Z.
If you used
27;:1, 'deux':2}
>
>def print_value():
> print vardict['un']
># ok, that works
>
>
>
>#!/bin/python
>varint = 1
>
>def print_value():
> print varint
># ok, that failed
>
>python 2.3.4
han the
same file would be in, say, INI format.
I wrote a Python script to parse it, but it isn't terribly robust. I was
able to produce a dictionary, but I didn't do anything with the results.
You're welcome to take a look:
http://www.probo.com/timr/parsemsf.py
--
- Ti
s, I was thinking about threads... does anyone have other/better
>suggestion(s)? Does anyone see any difficulty/memory problems in using
>threads?
Yes. Threads are used to run multiple parts of your own program. To run
another program, you need to launch a new process.
You can still monitor i
Jacek Generowicz <[EMAIL PROTECTED]> wrote:
>
>I have some code, which makes copious use of the @decorator syntax
I'm very curious to know what kind of application you are writing in which
"copious use of the @decorator syntax" actually solved a problem
productively
ill no compelling reason to break the old
habits and type those 6 extra characters.
Once a person has a case where the new classes make a difference, I suspect
they catch the new habit and never look back. I haven't crossed that
threshhold yet.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza &
le that the creation
and destruction of an object might have useful side effects.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
elf):
exec(magic())
print hi
hi = "baby"
print hi
def other(self):
exec(magic())
print hi
a = A()
a.meth()
a.other()
That's way too fragile to be useful.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
. Everything else, including the From:
and To: lines, will be taken as part of the message body. I assume you
meant to use \r\n, but \n will work just as well and is less error prone.
>print "Message length is " + repr(len(msg))
Easier is:
print "Message length is", len(msg)
More efficient is:
print "Message length is %d" % len(msg)
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
27;t want to uninstall the old version. Red Hat installs packages
that are needed for its configuration scripts.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
JanC <[EMAIL PROTECTED]> wrote:
>Tim Roberts schreef:
>
>> I don't think that's fair. Visual C++ 7.1 is signficantly better at
>> compliance than their past compilers.
>
>AFAIK that's only for C++, not for C...?
Yes. Microsoft has largely chosen t
e compiler of the python.thanks a lot!!!
Perhaps you could ask your question in a different way. Python is designed
as an interpreted language, like Perl and Javascript. It isn't compiled to
machine language.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
sual C++ 7.1 is signficantly better at
compliance than their past compilers.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
n't, really. I don't think the percentage of true newbie
questions has really gone up. However, as you grow more knowledgeable, the
percentage of questions that SEEM like newbie questions goes up.
comp.lang.python has always been a bastion of kindness and tolerance in the
comp.lang hi
My problem with both Delphi and Kylix is in getting them to connect
>with PostgreSQL and SQLite. Any suggestions? From what I have read, ODBC or
>JDBC may do it, but I have experience with neither.
There are direct Delphi components for both databases. Google is your
friend.
--
- Tim Ro
script gets invoked, but command line arguments disappear.
>Any idea what to do?
Did you remember to pass the parameters when you created the file
association?
C:\TMP>assoc .py
.py=Python.File
C:\TMP>ftype Python.File
Python.File=C:\Apps\Python23\python.exe "%1" %*
C:\TMP>
--
901 - 968 of 968 matches
Mail list logo