Earl Eiland wrote:
In Linux, if I make the first line #!/path/to/Python, all I have to do
to execute the program is type ./FileName (assuming my pwd is the same
as FileName). what's the Windows equivalent?
Earl
On Mon, 2005-03-07 at 13:36, F. Petitjean wrote:
Le Mon, 07 Mar 2005 13:25:35 -0700, Ea
Earl Eiland wrote:
How does one make a Python program auto-execute in Windows?
Use any of the mechanisms to make an arbitrary program auto-execute
(do you want on boot, on login, or what?), and use
c:\pythonXY\python.exe as the executable name; use the script name
as the first argument.
Regards,
Ma
O.K. I stand corrected. "auto-execute is the wrong term.
Earl
On Mon, 2005-03-07 at 14:03, rbt wrote:
> Earl Eiland wrote:
> > How does one make a Python program auto-execute in Windows?
> >
> > Earl
> >
>
> No program (python or other) can just arbitrarily execute. A user has to
> click it
rbt wrote:
> How do I enable the hidden attribute when creating files on Windows
> computers? I'd *really* prefer to do from the standard Python
installer
> (no win32 extensions). Any tips?
>
> Thanks
Breaking your problem down a bit:
1. How is that done from the command line in Windows?
2. How t
"Serge Orlov" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> I've never used tkinter, but I heard good things about it. Are you
> sure it's not you who made it to return byte string sometimes?
Yes, I used a Tkinter.StringVar to keep track of the contents of an
Entry widget; a
M.N.A.Smadi grads.ece.mcmaster.ca> writes:
> I need to have a varaible that will contain a value that will be
> modified in one file, and when coming back to the same file it
> should retain the same value.
You must import the module in which the variable lives and qualify it
appropriately.
There's a bug in the tokenizer that's triggered by the long
lines generated by makepy. See
http://sourceforge.net/tracker/index.php?func=detail&aid=1085454&group_id=78018&atid=551954
and
www.python.org/sf/1089395
Roger
"Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote in message
news:
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
> Michael Hoffman wrote:
> > Joe wrote:
> >
> >> I want the script to decide whether to fall back to the interactive
> >> prompt. You solution makes it ALWAYS fall back to the interactive prompt.
> >
> >
> > Actually, usi
In article <[EMAIL PROTECTED]>,
"Bob Swerdlow" <[EMAIL PROTECTED]> wrote:
> We have some users of our application getting error messages like:
> IOError: zipimport: can not open file
> /Volumes/MyApp/MyApp.app/Contents/Resources/Modules.zip
> This only happens on our Mac version - the Window
[EMAIL PROTECTED] wrote:
> Sheesh... I didn't actually pull the type(None) comparison out of my
> code.
Sheesh yourself. Newsgroup readers can't do inspect.hasaclue('J. Random
Poster'); they rely on duck-typing or goose-typing.
> I was simply throwing together a possible situation. Had I
> thou
> Heiko wrote:
> SETUP = object()> ELSE =
object()> BREAK = object()
>
> machine = {"WAITING FOR ACTION":>
{customer_drops_coin:"COIN HAS BEEN DROPPED",>
customer_selects_beverage:"ORDER RECEIVED",>
customer_cancels_order:"ACCOUNT CLOSURE IS
Earl Eiland wrote:
> How does one make a Python program auto-execute in Windows?
>
> Earl
You need to have files with .py or .pyo or .py registered to open with
the python interpreter. In Windows Explorer, choose the menu item
Tools->Folder Options and select the File Types tab to see how
registe
[Joerg Schuster]
> I am looking for a method to "shuffle" the lines of a large file.
>
> I have a corpus of sorted and "uniqed" English sentences that has been
> produced with (1):
>
> (1) sort corpus | uniq > corpus.uniq
>
> corpus.uniq is 80G large.
Since the corpus is huge, the python portion s
I see lots of others have made suggestions, but here is a method
that I use frequently:
define a dictionary that contains references to your functions:
def foo():
.
. whatever it does
.
def bar():
.
. whatever it does
.
xfer={'foo', foo, 'bar', bar}
Then you can write
for fname in fnames:
The pyconfig.h file (/usr/include/python2.3/pyconfig.h) should begin
something like this
/* pyconfig.h. Generated by configure. */
/* pyconfig.h.in. Generated from configure.in by autoheader. */
and shouldn't cause problems.
If it starts in a wildly different way than that, then it's p
I had occasion to look back at a project I did over a year ago
and needed to make one small change. I use py2exe to package
it for distribution via Inno Setup. After making my change
I tried to run my setup script that worked fine before and
get the following message:
F:\SYSCON\WTS\HTMLmenu>pyth
[EMAIL PROTECTED] wrote:
I'm trying to get mxDateTime working on a Mac so that I can use pyscopg
and cx_Oracle. The Egenix base package builds and installs quite
happily, but then when I try to import it I get
import mx.DateTime
Fatal Python error: Interpreter not initialized (version mismatch?)
A
Le lundi 7 Mars 2005 21:54, "Martin v. LÃwis" a ÃcritÂ:
Hi,
Thank you for your very informative answer. Some interspersed remarks follow.
>
> I personally would write my applications so that they put the signature
> into files that cannot be concatenated meaningfully (since the
> signature simp
I have installed Python-2.3.3 in the SUSE Linux 9.1 system and am
trying to rebuild an application rpm that was implemented in Python, I
am getting the following error,
/usr/Python-2.3.3/Include/pymem.h In function '__declspec'
/usr/Python-2.3.3/Include/pymem.h:51: error: parse error before
'__dec
Steven Reddie wrote:
Hi,
Thanks, that seems to be what I was missing. I'm having some further
related trouble though. I want to do something like this:
MODULES = [ 'module1', 'module2' ]
def libinfo():
for m in MODULES:
__import__('libinfo.'
On Monday 07 March 2005 17:51, M.-A. Lemburg wrote:
> [EMAIL PROTECTED] wrote:
> > I'm trying to get mxDateTime working on a Mac so that I can use
pyscopg
> > and cx_Oracle. The Egenix base package builds and installs quite
> > happily, but then when I try to import it I get
> >
> >
> >>>import
On Mon, Mar 07, 2005 at 11:56:57PM +0100, Francis Girard wrote:
> BTW, the python "unicode" built-in function documentation says it returns a
> "unicode" string which scarcely means something. What is the python
> "internal" unicode encoding ?
The language reference says farily little about unic
On Mon, Mar 07, 2005 at 11:51:20PM +0100, M.-A. Lemburg wrote:
[EMAIL PROTECTED] wrote:
I'm trying to get mxDateTime working on a Mac so that I can use pyscopg
and cx_Oracle. The Egenix base package builds and installs quite
happily, but then when I try to import it I get
import mx.DateTime
Fatal
You most likely need to construct your script using OOP. Can give you
give an example of code you're using when you get this error? This
helps a lot.
Regards,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> 2) added to MakeFile after config:
> EXTRA_CFLAGS=-DEAPI
You can do this, but it should be to "src/Makefile" and added
to "CFLAGS" and not "EXTRA_CFLAGS" as the latter doesn't exist.
--
http://mail.python.org/mailman/listinfo/python-list
I have installed Python-2.3.3 in the SUSE Linux 9.1 system and am
trying to rebuild an application rpm that was implemented in Python, I
got the following error when compiling the application extension
module,
/usr/Python-2.3.3/Include/pymem.h: In function '__declspec'
/usr/Python-2.3.3/Include/py
What does this command print?
gcc -c -I/usr/Python-2.3.3/Include -x c -o /dev/null \
/usr/Python-2.3.3/Include/pymem.h
If it prints an error like the one you included in this message, then
the set of header files in /usr/Python-2.3.3/Include is damaged,
incomplete, or wrong for your com
I have a string variable say “8023 “ and
I want to get rid of the beginning
And ending quotes.
I’ve tried different things
But haven’t had any success.
I’m definitely a python hacker and
Not an expert. Thanks.
Mark
--
http://mail.
Leif K-Brooks wrote:
> from IndexedCatalog.Shelf import Shelf
> shelf = Shelf(('localhost', 1234), [Class1, Class2])
Is it also possible to connect via socket instead of port? I've tried to
pass '/tmp/zeosocket' instead of ('localhost', 1234), but it isn't
successfull. Is is any way to do that?
c.l.p-
I am having trouble understanding how one is supposed to correctly
utilize try:...except:...finally: in real code. If I have a block of
code like:
def foo():
try:
... some code that can raise an exception ...
finally:
... do some cleanup ...
djw wrote:
c.l.p-
I am having trouble understanding how one is supposed to correctly
utilize try:...except:...finally: in real code. If I have a block of
code like:
def foo():
try:
... some code that can raise an exception ...
finally:
... do some cleanup ...
retu
I have a data file that has lines like "foo\n\0" where the \n\0 is acutally
backslash+n+backslash+0. I.E. a repr of the string from python would be
"foo\\n\\0". I'm trying to convert this string into one that contains
actual newlines and whatnot. I feel like there has to be a better and safer
wa
Grant Olson wrote:
I have a data file that has lines like "foo\n\0" where the \n\0 is acutally
backslash+n+backslash+0. I.E. a repr of the string from python would be
"foo\\n\\0". I'm trying to convert this string into one that contains
actual newlines and whatnot.
r"foo\n\0".decode("string_escap
Francis Girard wrote:
Well, no text files can't be concatenated ! Sooner or later, someone will use
"cat" on the text files your application did generate. That will be a lot of
fun for the new unicode aware "super-cat".
Well, no. For example, Python source code is not typically concatenated,
nor
There is very likely a more reasonable solution than this, but it was
the first one that came to mind:
IDLE 1.0.3
>>> string = "foo\\n\\0"
>>> string = string.replace( "\\n" , "\n" )
>>> string = string.replace( "\\0" , "\0" )
>>> string
'foo\n\x00'
>>> print string
foo
Hope this helps.
-
If you simply wanted to get rid of quotes entirely, you could use:
"\"Hello!\"".replace( "\"" , "" )
However, since you only want the beginning and ending quotes removed:
>>> string = "\"If thou wert my fool, nuncle...\""
>>> print string
"If thou wert my fool, nuncle..."
>>> if string.startswi
Leeds, Mark wrote:
I have a string variable say “8023 “ and
I want to get rid of the beginning
And ending quotes.
I’ve tried different things
But haven’t had any success.
I’m definitely a python hacker and
Not an expert. Thanks.
>>> x = '"This is a quoted string"'
>>> print x
"This is a
Hi
How can I select a random entry from a dictionary, regardless of its
key-values?
regards tores
--
http://mail.python.org/mailman/listinfo/python-list
> How can I select a random entry from a dictionary, regardless of its
> key-values?
>>> import random
>>> d = {1:'a', 2:'b', 3:'c'}
>>> a = random.choice(d.keys())
>>> a, d[a]
(2, 'b')
(etc)
=Tony.Meyer
--
http://mail.python.org/mailman/listinfo/python-list
>From the Python 2.4 quickreference:
d.popitem() Removes and returns an arbitrary (key, value) pair from
d
If this isn't random enough, then you can generate a random number in
range(len(d))
--
http://mail.python.org/mailman/listinfo/python-list
import random
print d[d.keys()[int(random.random()*len(d.keys()))]]
HTH
-c
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 07 Mar 2005 16:20:30 -0600, Larry Bates <[EMAIL PROTECTED]> wrote:
> I had occasion to look back at a project I did over a year ago
> and needed to make one small change. I use py2exe to package
> it for distribution via Inno Setup. After making my change
> I tried to run my setup script
When I'm using pyunit and want to stop in a point during the test
(skipping all the framework initialization), I just start the debugger:
import pdb
pdb.set_trace()
You'll get the debugger prompt.
--
http://mail.python.org/mailman/listinfo/python-list
Tony Meyer wrote:
How can I select a random entry from a dictionary, regardless of its
key-values?
a = random.choice(d.keys())
a, d[a]
Or even:
key, value = random.choice(d.items())
or:
value = random.choice(d.values())
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailm
On Mon, 07 Mar 2005 19:24:43 -0500, "Grant Olson" <[EMAIL PROTECTED]> wrote:
>I have a data file that has lines like "foo\n\0" where the \n\0 is acutally
>backslash+n+backslash+0. I.E. a repr of the string from python would be
>"foo\\n\\0". I'm trying to convert this string into one that contain
[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2005-02-15_2005-02-28.html]
=
Summary Announcements
=
Status of the candidates
It looks like all three candidates for taking
Martin v. Löwis wrote:
> There are several solutions, but one is to install Visual Studio .NET
> 2003 (which is different from Visual Studio .NET, also referred to
> as VS.NET 2002). Microsoft managed to rename the C library (CRT)
between
> 2002 (msvcr7.dll) and 2003 (msvcr71.dll), and you need to
Hello Everyone,
I have been using this piece of code to start an
exec and "process" its stdout/stderror
import sysimport popen2
executable = r'execfile -arg1 -arg2'r, w, e =
popen2.popen3(executable)r.flush()w.flush()e.flush()
x=0
# just print the 1000 first lineswhile
x<1000:
sys.std
I'd like to associate certain lists with keywords, and
retrieve them. But this is not possible as lists are
not hashable.
What is the best workaround? I don't mind making my
lists immutable. Is there a way to tupelize them?
I tried mydict[mykey]=([a for a in list]) but it
didn't seem to work.
gf gf wrote:
I'd like to associate certain lists with keywords, and
retrieve them. But this is not possible as lists are
not hashable.
You can convert them to tuples with the `tuple' function:
aDictionary[tuple(aList)] = aKeyword
> What is the best workaround? I don't mind making my
> lis
gf gf wrote:
I'd like to associate certain lists with keywords, and
retrieve them. But this is not possible as lists are
not hashable.
Do you want
mydict[mylist] = mykey
or
mydict[mykey] = mylist
?
The former is not possible with lists for the reason you noted. The
latter, however, works just
> I'd like to associate certain lists with keywords, and
> retrieve them. But this is not possible as lists are
> not hashable.
A dictionary's values don't have to be hashable, so if the keywords are the
keys in the dictionary, this would work.
>>> d = {}
>>> d['key1'] = [1,2,3]
>>> d['key2'] =
On Monday 07 March 2005 11:09 pm, gf gf wrote:
> I'd like to associate certain lists with keywords, and
> retrieve them. But this is not possible as lists are
> not hashable.
>
> What is the best workaround? I don't mind making my
> lists immutable. Is there a way to tupelize them?
> I tried my
Dear list,
If you ask: why do you choose these names? The answer is: they need to
be conformable with other functions, parameter names.
I have a function that pretty much like:
def output(output=''):
print output
and now in another function, I need to call output function, with again
keyword p
I am having problems with programming even simple "Hello World"
programs from books and tutorials that use Python GUI libraries. Such
Programs cause python to throw "Attribute Errors" even when the
"attributes" being asked for by the errors exist in the source code.
This has happened to me in both
Tony Meyer wrote:
[a for a in list] (or a[:]) makes a copy of a list.
or list(a)
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
Coral Snake wrote:
I am having problems with programming even simple "Hello World"
programs from books and tutorials that use Python GUI libraries. Such
Programs cause python to throw "Attribute Errors" even when the
"attributes" being asked for by the errors exist in the source code.
This has happ
Bo Peng wrote:
Dear list,
If you ask: why do you choose these names? The answer is: they need to
be conformable with other functions, parameter names.
I have a function that pretty much like:
def output(output=''):
print output
and now in another function, I need to call output function, with a
In mid-October 2004, Jeff Epler helped me here with this string iterator:
def chars(s):
"""
This generator function helps iterate over the characters in a
string. When the string is unicode and a surrogate pair is
encountered, the pair is returned together, regardless of whether
Hello,
I've stumbled over a behavior related to default function arguments which
appears to be a bug, from what I can tell. See this snippet:
>>> from kdecore import KURL
>>> u = KURL( "http://www.example.org/test/../"; )
>>> u.cleanPath()
Traceback (most recent call last):
File "", line 1,
Steven Bethard wrote:
>> If you ask: why do you choose these names? The answer is: they need
>> to be conformable with other functions, parameter names.
Is this a style guide thing?
>> I have a function that pretty much like:
>>
>> def output(output=''):
>> print output
>>
>> and now in anot
Frans Englich wrote:
> Apparently, cleanPath /requires/ a boolean argument, but the C++
> function definition says:
>
> void cleanPath(bool cleanDirSeparator = true);
Most likely that cleanPath's default parameter hasn't been declared to
*Python*. If so, I expect this is a KURL bug. Raise a bu
"Johan Kohler" <[EMAIL PROTECTED]> wrote:
>
>I'm using CGIHTTPServer (via its test() method) to test some CGI on my
>Windoze 98 box. I find that the execution is very slow. Is there
>anything I can do to make sure I'm getting the best performance out of
>CGIHTTPServer?
Compared to what, and on w
Larry Bates <[EMAIL PROTECTED]> writes:
> I had occasion to look back at a project I did over a year ago
> and needed to make one small change. I use py2exe to package
> it for distribution via Inno Setup. After making my change
> I tried to run my setup script that worked fine before and
> get
101 - 164 of 164 matches
Mail list logo