On 23 Sep, 18:24, Damjan <[EMAIL PROTECTED]> wrote:
> > I want to create a program that reads input from stdio that can prompt
> > a user for input while doing so without getting into problems.
> ...
>
> The trick (which works on Linux for sure) is to open /dev/tty and ask
> question/get input on/f
Hi,
I want to create a program that reads input from stdio that can prompt
a user for input while doing so without getting into problems.
A simplified version of what I want:
I have an input file
***>cat input.txt
foo bar baz
fubar barooba xyxxyt
raboof txet
black knight
And a file that replaces
Hi python people,
I am trying to figure out the best way to encrypt files in python.
I've build a small script (see below) that encrypts the ubuntu 7.04
iso file in 2 minutes (I like python :) ).
But I have some thoughts about it. By pure luck (?) this file happened
to be N*512 bytes long so I d
ererikstrandberg.se
work: www.incf.org
also: www.spongswedencare.se
>
> On Jun 4, 2:43 pm, per9000 <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I recently started working a lot more in python than I have done in
> > the past. And I discovered something that tota
On 4 Juni, 10:19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
> [...]
>
> Now I'm a little confused. What does this have to do with magic names? I
> thought you are talking about names that start and end with two
> underscores (`__magic__`)!?
Indeed I am talking about two things at onc
On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, per9000 wrote:
> >
> > [...]
> >
> > So another question emerges:
> > * is the use of magic names encouraged and/or part of good coding
> >
Hi,
I recently started working a lot more in python than I have done in
the past. And I discovered something that totally removed the pretty
pink clouds of beautifulness that had surrounded my previous python
experiences: magic names (I felt almost as sad as when I discovered
the strange pink worm
On 2 Maj, 05:19, "Robert Rawlins - Think Blue"
<[EMAIL PROTECTED]> wrote:
[...]
I like comp.lang.python - it is a friendly place. See this post on the
C-list and compare:
http://groups.google.se/group/comp.lang.c/browse_thread/thread/0a4e2e194a6da45b
[:)]-|--<
/Per
--
Per Erik Strandberg
.NET
[This might be a double posting, if it isn't my previous post was
lost]
Look up "restype" in the ctypes library - it sets the return type from
a function. You may want to set it to c_void_p of something similar,
instead of the default int.
I made a similar discovery in my blog -
http://www.pereri
On 12 Apr, 09:42, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
>
>
> > In f.x. the C-family of languages I guess something like this would
> > call B.spin:
> > ((B)myC).spin("Lancelot"); // almost forgot the ';'
>
> Try this in Python:
> B.spin(myC, "Lancelot")
>
>
>
>
Thanks, that was exac
Hi,
can I reach a hidden method when doing ugly inheritance in python?
>>> class A:
... def spin(self, n): print "A", n
...
>>> class B:
... def spin(self, m): print "B", m
...
>>> class C(A,B):
... def spin(self, k): print "C", k
...
>>> myC = C()
>>> dir(myC)
['__doc__', '__module__'
Stefan Behnel wrote:
> victor wrote:
> > I want to generate a report and the PDF fits perfectly. Though there is
> > an issue of using different encoding in the doc. I tried PyPS with no
> > success. I need a lib that can make PDFs with an arbitrary set of fonts
> > (possibly embed them into the do
uess, I don't know why, but it works...)
The file had to be named filetitle + ".cgi" because of some setting at
my web hotel.
Good luck!
/Per9000
--
http://mail.python.org/mailman/listinfo/python-list
Update:
I have found a holy handgrenade.
I found something that seems to work fine for me - I've only tried it
for 5 minutes but seems to work very smoothly. Open-source, Mozilla
license, you know the drill...
http://www.py2exe.org/
py2exe (the name makes me fall in love) creates some dll's for
Hi python people,
I am working with .NET (in C++/CLI and C#) but since I really love
python I'd like to do things for .NET (or whatever) from python.
Has anyone tried it?
What (costless) compilers are good?
Are there any (costless) editors like MS Visual Express you have tried?
Is the newest I
Nick Maclaren wrote:
> |> just a thought: if you *always* work with "floats" with two decimals,
> |> you are in fact working with integers, but you represent them as a
> |> floats - confusing for the internal representation.
>
> No, you aren't - you are working with fixed-point
Nick, your answer h
oops, should be something like this:
"int / int" = "int / int, int % int"
/per9000
--
http://mail.python.org/mailman/listinfo/python-list
ndoffs etc when dividing.
"int (+|-|*) int" = int
"int / int" = int / int + int % int
Integers are nice, me like integers.
/per9000
--
http://mail.python.org/mailman/listinfo/python-list
Ooops,
w must be 'w' - sorry for adding more confusion :-D
I would also like to add that this is a more realistic useage
appendix = '.txt' # or '.csv' or whatever
# some code
c += 1
filetitle = 'result_' + zeropadding(c) + str(c)
myfile = open(filetitle+appendix,'w')
# etc
Hope that was a l
Hi,
This is what I often do:
somekindofoutput = ''
somekindofoutput += somefunk(somearg) + '\n'
# w is for writing
myfile = open('theoutfile',w)
myfile.write(somekindofoutput)
myfile.close()
also see
http://www.python.org/doc/2.3.5/tut/node9.html
or some other documentation
/P9k
--
http://ma
ndomchoice(["is","could be"]) a great book.
Please read and/or add if you are one of the nice guys.
Ciao,
PER9000
"It is a gift. A gift to the foes of 'the Terrorists'. Why not use this
'terrorism'? Long has my father, 'George Bush', kept
also se topic named
'problem(s) with import from parent dir: "from ../brave.py import
sir_robin" '
I use this every day now:
sys.path.append("../../py_scripts")
best wishes,
Per
--
http://mail.python.org/mailman/listinfo/python-list
I can't wait to get my hands on version PAL9000, then we will all have
to deallocate memory *the hard way*.
/per9000
---
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it.
I can feel it. My mind is going. There is no question about it.
I
Dear shrub-makers,
if you are want to plot networks (fx. genetic networks) I can recommend
Cytoscape: http://cytoscape.org/ (some kind of openware).
The in-syntax is clean:
node1 linktype1 node2
node2 linktype1 node3
node3 linktype2 node1
etc.
But in general you are going to want to change the l
Dear counters,
I have also encountered the above problem, and I frequently use the two
blocks of code below.
The first one is commented already - except that this version does not
start from an empty dict.
The second "inverts" the first one. Meaning that a dict in word2hits
style:
my_dict['the'
...and there was much rejoicing... Even better, thanks - you guys are
the best.
import string, time, sys
sys.path.append("../../py_scripts")
Works just nice, and yes, I removed the env.variable before I tried it
:-D
/Per9000
--
http://mail.python.org/mailman/listinfo/python-list
Thanks,
I added an environment variable PYTHONPATH and added the holy folder
with my script in. Works just perfectly.
But still: is there a way around this? (It is a lot easier to add
"../../" in my code than make everyone else add this variable).
/per9000
--
http://mail.python.o
se give me, not a bucket with the desert(s) on top, but
just the thin chocolate?
/per9000 (per nine thousand at gmail dot com)
LONG VERSION:
Since I do not want to use absoute paths I want to import a file from
two folders up and then one down.
This problem seems to be discusse
28 matches
Mail list logo