On Mon, Jan 23, 2012 at 06:43:50PM +0530, Shreesh bhat wrote:
> The program should check the islucky condition between range of (1,10**18)
> numbers and iterate over that 10**5 times.
How is the islucky condition defined?
The only version I have found is based on something quite similar to
prim
On Mon, Jan 23, 2012 at 10:01:33PM +, Alan Gauld wrote:
> Just to be clear this has nothing to do with Python. It doesn't matter
> what programming language you choose there is not a PC on Earth that can
> do what you want using the technique you are using in 16 seconds.
I don't believe tha
Nitish Mahajan wrote:
I use Python 2.5 and hence consequently use the file
P4Python-1.0.win32-py2.5.exe in order to add the Perforce APIs. I would
like to create a silent installation for them.
Hello Nitish,
This mailing list is for people interested in learning the language Python,
not for
Joel Goldstick wrote:
First of all, always remember to reply to all on the list. That keeps
everyone in the loop.
Second, don't 'top post'. Write your comments at the end of the
thread so that people can follow the conversation. Sometimes its
useful to intersperse comments in someone's previo
Steven D'Aprano wrote:
(And yes, I deliberately had one fewer answer than question in the
second case. Top posting makes it MUCH easier to miss questions.)
Gah! Brain fart! Please ignore the comment in parentheses.
--
Steven
___
Tutor mai
spa...@gmail.com wrote:
Hello,
My code is -
l = len(m)
item = str(m[1])
for i in range(2,l):
item = item + "-" + str(m[i])
This code is part of a bigger function. It works fine. But I am not happy
with the way I have written it. I think there is a better (Pythonic) way to
rewrite it.
If an
amt wrote:
I don't get it. If you don't close input and output it works exactly
the same as if you would close them, so why do you have to do
output.close() and input.close()?
(1) It is a matter of good programming practice. If you don't close them
yourself, Python will eventually close them
Surya K wrote:
can anyone write a program for me? please...
Certainly. My rate is AUD$80 per hour. Please write to me privately to discuss
financial arrangements.
--
Steven
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscr
Navneet wrote:
One more thing I want to add here is, I am trying to create the GUI
based chat server.(Attached the programs.)
Please do not send large chunks of code like this, unless asked. Instead, you
should try to produce a minimal example that demonstrates the problem. It
should be:
Michael Lewis wrote:
I am trying to round a float to two decimals, but I am getting the
following error:
Traceback (most recent call last):
File "", line 1, in
PaintingProject()
File "C:/Python27/Homework/Labs/Lab 03_5.py", line 42, in PaintingProject
print 'That will cost you $%f.'
Surya K wrote:
I am actually using a activestate wrapper for calculating execution time of my
program.
[...]
I tested it for a puzzle and that showed me around 1385.33 usec/sec..However, as its from facebook hackers cup where I got a penalty time of 28.32.00 (not exactly, forgot)..
what units
Alan Ting wrote:
Hello,
How do I get the characters to separate?
It isn't clear what you mean. Do you mean this?
"JOON" => "J O O N"
If so:
' '.join('JOON')
will do it.
--
Steven
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
Alan Ting wrote:
Hello,
How do I get the characters to separate?
This is what I did.
def personalNote(name):
'Print a personalized love note'
x = (name)
Oh, I forgot to mention... the line x = (name) is utterly pointless. Instead
of wasting time with x=name, just use name everywhere yo
Evert Rol wrote:
hi everyone,
I want to make a web page which has to include some python script and html tags as well, am not getting how to do that .
I searched some articles but cant understand them .
is there anything like linking an external html file into python script ?
Can u please hel
George Nyoro wrote:
class Table:
def delete_this(self):
#code to delete this object or assign it null or None
pass
def do_something(self):
pass
x=Table()
x.delete_this()
#at this point, I want such that if I try to use x I get some sort of error
e.g.
x.do_something()
#Error: x is definitely
Surya K wrote:
I am on windows. So, as msvcrt is for windows, I wonder if there
is any module that works for both,
http://code.activestate.com/recipes/577977
--
Steven
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opt
George Nyoro wrote:
Hey all, again:
Thanks for the delete thing. Helped with that problem a lot. Especially the
getattr thing came in handy.
Question 1:
How do you guys indent and put in the triple greater than signs and all
that when sending mail? Manually? Coz the last mail I sent was using th
On Wed, Feb 01, 2012 at 09:26:00PM -0500, Shane wrote:
> Do I have to rewrite my code directly into wxpython frame
> or can i just copy and paste it somehoe
I don't know. If you try to copy and paste it, what happens?
I'm afraid your question doesn't make much sense to me, and unless
there happe
shane wrote:
i was trying to put the math.py into a frame Ive watched many tutorials.
But cant seem to find out how to or where to place the code
the files I want combined are attached.
Do you mean you want to show the code in the GUI? You need to know the
location of the file, then read the
Stayvoid wrote:
Hi!
Could you provide some examples (easy and hard ones) and comments on the topic?
I'm trying to understand how this thing works.
When you do an attribute lookup on an object, say obj.attr, Python uses
something like a search path to find the attribute: it tries various thing
Alan Gauld wrote:
On 04/02/12 00:30, Stayvoid wrote:
Could you provide some examples (easy and hard ones) and comments on
the topic?
I'm trying to understand how this thing works.
Commenting on the topic... It's not one most beginners(*) should be
worrying about you rarely need to use it. B
Michael Lewis wrote:
Why don't I have to import str or list to access their attributes like I do
with the math or random or any other library?
Because they are built-in. That means they live inside the Python
compiler/interpreter itself.
They are built-in because str, list, etc. are fundame
Debashish Saha wrote:
INPUT:
*for n in range(2, 1000):*
*for x in range(2, n):*
*if n % x == 0:*
Please don't add junk characters to your code. There is no need to add
asterisks to each line, we can recognise Python code when we see it. Your code
cannot run because of the ju
Debashish Saha wrote:
[...]
why did i get different values for the same input?
Please choose a sensible subject line when posting.
The problem is with the division. Watch:
py> 21/2
10
py> 21.0/2
10.5
By default, division in Python 2 is integer division: any remainder is
ignored. To use f
Debashish Saha wrote:
*PROGRAM TO FIND FACTORIAL OF A NUMBER(I HAVE WRITTEN IT ON GEDIT)*
This program is irrelevant. Your question has nothing to do with factorial of
numbers. It is about getting input from the user. As you ask:
HOW TO ASK INPUT FROM USER THEN?
The answer is:
Do not use
Sivaram Neelakantan wrote:
While trying out code, I have trouble following the difference between
return True vs print True and the same with False. If I use return
for the True/False statements, nothing gets printed. Why?
Probably because you aren't printing anything. Python can't read your
Sivaram Neelakantan wrote:
def palin(text):
if first(text) == last(text):
# print first(text), last(text), middle(text), len(middle(text))
if len(middle(text)) == 0:
print True
else:
palin(middle(text))
else:
print False
Every br
Nate Lastname wrote:
Hey List,
I am thinking about making a sandbox game. Where should I start? Has
anyone done this before? I'm having trouble in MANY places, and
This mailing list is for learning the Python programming language, not for
answering arbitrary questions about anything vague
On Mon, Feb 06, 2012 at 09:13:48AM -0500, Nate Lastname wrote:
> Hello List,
>
> I am quite sorry for my attitude. I will look more thoroughly into the
> search results. Thanks for the link to Epik. I had found this, but I
> didn't realize that it was Python. I apologize once again, and thank
On Mon, Feb 06, 2012 at 04:54:57PM -0800, William Stewart wrote:
> Hello everyone, I am making a calculator and I need to know how to make it do
> exponents and remainders
> How can I input this info in python?
> Any help would be appreciated
You can do exponents either with the ** operator or th
On Mon, Feb 06, 2012 at 08:17:05PM -0500, Greg Nielsen wrote:
[...]
> So here is the problem, to create an object, you need to assign it to
> a variable, and you need to know what that variable is to call upon it
> later, so to have a object build a second object, it would need to somehow
> cr
myles broomes wrote:
Im trying to code a program where the user enters a message and it is returned
backwards. Here is my code so far:
message = input("Enter your message: ")
backw = ""
counter = len(message)
while message != 0:
backw += message[counter-1]
counter -= 1
print(backw
Steve Willoughby wrote:
On 06-Feb-12 07:25, Kapil Shukla wrote:
i tried writing a small code to calculate option price using the
binomial tree model. I compared my results with results of the same
program in excel. There seems to be a minor difference due to decimal
precision as excel is using 1
Col,
I think you wrote to me personally by accident, instead of to the Tutor list.
Nothing you said seems to be private, so I've taken the liberty of answering
back on the list.
col speed wrote:
Just an idea - I'm not an expert by any means, just a dabbler, but:
many years ago, when I was l
Peter Otten wrote:
Garland W. Binns wrote:
Could someone please tell me a common or semi-frequent scenario in which a
person would use a backspace escape sequence?
Does
$ python -c 'print "this is b\bbo\bol\bld\bd"' | less
qualify? If you are using (e. g.) Linux this technique is used to sh
Sarma Tangirala wrote:
Is is better to use pow() against **?
Advantages of **
- it is shorter to type x**y vs pow(x, y)
- being an operator, it is slightly faster than calling a function
- you can't monkey-patch it
Disadvantages of **
- being an operator, you can't directly use it as a fun
ken brockman wrote:
Really close to it Robert. No delete but an error msg. Something akin to file
dosen't exist, not found , or words to that effect .
Something "akin to"?
How about if you copy and paste the actual error message, instead of asking us
to guess?
That means the full traceba
ken brockman wrote:
I have been trying to post all afternoon to no avail. I keep getting
bounced back...
Ken, I don't suppose you have another email address that you sometimes use?
Because if you do, that may be the problem.
If you are subscribed to this list as krush1...@yahoo.com, and you
daedae11 wrote:
import re
re.match("^hello", "hello")
re.match("hello", "hello")
Please give a string that matches RE "^hello" but does not match RE
"hello", or matches RE "hello" but does not match RE "^hello".
re.match always matches the beginning of the string, so
re.match("^hello", so
David Craig wrote:
Hi,
I'm trying to write a function that will either take arguments when the
function is called, such as myFunc(x,y,z) or if the user does not enter
any arguments, myFunc() the raw_input function will ask for them. But I
dont know how to check how many arguments have been ent
bob gailer wrote:
Today is the third time Pam (connecting to the web site for event
publication) has run into an inexplicable Access error.
I don't think this has anything to do with learning Python.
--
Steven
___
Tutor maillist - Tutor@python.or
Debashish Saha wrote:
actually a i ran a progam in python which is sufficiently large . so i
want to stop the execution of the program now . how can i do this?
Control-C should work on every operating system. Obviously you have send the
Ctrl-C to the Python process, not some other application.
William Stewart wrote:
this is the code I have
str1 = raw_input("Type in a String: ")
str2 = raw_input("Type in a String: ")
int1 = raw_input("Type in a integer variable: ")
int2 = raw_input("Type in a integer variable: ")
print str1 + str2 + int1 + int2
import math
int1 = int(raw_input(""))
p
daedae11 wrote:
What's the difference between Queue(in module Queue) and list(build_in class)?
I think that when I pass a same queue object to two different threads, the change in each thread will affect each other as same as Queue. So why don't we use list or other variable object?
Have you r
David Craig wrote:
Hi,
I use emacs with ipython (or I would like to) on a GNU/linux machine. To
be able to use it from the ipython shell through %ed I added the
following lines to my .bashrc file,
export LESS="-R"
export EDITOR=emacs
this seemed to work as when I try %ed filename it opens an
Debashish Saha wrote:
TypeError: grid_source() takes exactly 3 arguments (4 given)
Is this error not clear enough? The function expects 3 arguments, you have
given it 4. You need to give one fewer.
The only tricky thing to remember is that when you have a method, one argument
is the autom
Nicholas Palmer wrote:
I am fairly experienced in java and I was wondering how to use java in
python code, if you could give me any tips.\
My first tip is to learn how to use email effectively. Doing so will increase
the chances that volunteers on mailing lists will answer your questions with
Leam Hall wrote:
I'm building a program that uses one of my own modules for a bunch of
formula defs and another module for the tkinter GUI stuff. There are
half a dozen input variables and about the same in calculated variables.
Is it better/cleaner to just build a global dict and have everythi
Bill Allen wrote:
Generally speaking, are list comprehensions more efficient that the
equivalent for loop with interior conditionals for a given task? Do they
compile down to the same Python byte code?
It depends, and no.
For-loops are more general, so there are loops that can't be written as
Michael Lewis wrote:
Error I got when __name == ' __main__' was outside of any function:
Traceback (most recent call last):
File "C:/Python27/Homework/Homework5_1.py", line 24, in
if __name == '__main__':
NameError: name '__name' is not defined
You have misspelled __name__ as __name.
Alan Gauld wrote:
On 20/02/12 21:17, Do Nguyen (donguye) wrote:
command1 = "plink -ssh -pw myPassword myUserName@myServerIP"
p1 = subprocess.Popen(command1)
p2 = subprocess.Popen('ls')
I could verify that command1 was executed successfully, ie. the ssh to
myServer worked, but command2 was trea
Tony Pelletier wrote:
Missing a return statement in the case of an exception.
Can you explain this? Why would I want the return on the exception?
Because if you don't, it will return None.
--
Steven
___
Tutor maillist - Tutor@python.org
To un
William Stewart wrote:
hello
I need to rewrite area.py program so that it has separate functions for the perimeter and area of a square, a rectangle, and a circle (3.14 * radius**2).
I am horrible at math and I cannot even figure out what I need to do for this
Any help would be appreciated
Ha
On Wed, Feb 22, 2012 at 01:01:50AM +, Alan Gauld wrote:
> I seem to recall it was written in Borland's Delphi.
> There is FreePascal which is very Delphi like, although not quite a
> clone, it might be possible to port it to FreePascal if somebody was
> keen enough!
There is also GNU Pascal
On Tue, Feb 21, 2012 at 07:00:40PM -0800, Michael Lewis wrote:
> It seems that the .isdigit() function that I use doesn't recognize the .5
> as a number and therefore doesn't multiply it. How can I get my code to
> recognize numbers such as .5, 1.75 as numbers?
As the saying goes, it is often Eas
On Wed, Feb 22, 2012 at 06:10:57AM +0530, Sukhpreet Sdhu wrote:
> hi
> i m working on Python assignment to convert roman numericals to arabic and
> vice versa.I had tried many different codes but those are not working.
> Can you please suggest me the code to do this by using while , if and else
>
On Wed, Feb 22, 2012 at 04:44:57PM +1100, Elaina Ann Hyde wrote:
> So, Python question of the day: I have 2 files that I could normally just
> read in with asciitable, The first file is a 12 column 8000 row table that
> I have read in via asciitable and manipulated. The second file is
> enormous,
David Craig wrote:
I have been trying to write them to a text file but it is difficult to
organise them into rows and columns with appropriate spacing to make it
readable. I would like something like,
Stations Station1 Station2
Station1 0.033.57654
Station2 33
David Craig wrote:
Hi,
I have a function that calculates the distance between two points on a
sphere. It works but I cant get it to return a float for use in another
script. Anyone know how I do that??
You are going to have to explain what you mean in more detail.
If you mean, how can you pa
On Wed, Feb 22, 2012 at 07:29:42PM -0800, Michael Lewis wrote:
> First, thanks to everyone who helped me out regarding my Recognizing real
> numbers post. I gained a lot of knowledge over the past two days!
>
> I've noticed that after I execute some of my .py files, a Compiled Python
> File is aut
On Wed, Feb 22, 2012 at 07:00:57PM -0600, Tamar Osher wrote:
>
> Hi. I am still having trouble installing and using Python on my (new)
> Windows 7 computer, but I plan to contact Microsoft forums and see if they
> can help me, since this is a Windows problem and not a Python problem.
>
> My qu
David Craig wrote:
Hi,
I am trying to write some code that will solve the 2D wave equation by
the finite difference method, but it just returns an array full of zeros
and NaN's. Not sure where I am going wrong, the code is attached so if
could someone point me in the right direction I'd apprec
Anthony Papillion wrote:
class Manager(object):
def __init__(self):
builder = gtk.Builder()
builder.add_from_file("winMain.glade")
builder.connect_signals(self)
self.window = builder.get_object("winMain")
self.window.show()
conn = None
Carolina Dianne LaCourse wrote:
[...]
I understand that I need to ask for raw input from the user and that I
need to be able to use the if elif else to tell the user whether their
number matches or id too high or to low but am just not sure what to
do first. Any advice would be greatly appreciat
Chris Kavanagh wrote:
I know this will sound stupid, but why would the method care which
instance it's called on?? I think this is where my confusion is coming
in. . .I hope I've made sense here. . .
Typical use for class instances is to store per-instance information. For
example, both "sp
JOSEPH MARTIN MPALAKA wrote:
Hullo to you All,
Has any one used IronPython studio from microsoft Visual Studio.
Am so new into IronPython please.
It’s missing a help menu Tutorial link of "HOW TO" along the menu bar,
so as to be used in learning and knowing how make out something. Could
one be
justin fargus wrote:
Hello,
I'm new to Python. Just started a few weeks ago and I've been learning some
basic things that I would like to put together but I don't even know where
to began. I am trying to do the following:
Make a program using two sentences of about 8 words (total between the t
On Mon, Feb 27, 2012 at 07:22:20AM -0800, John Jensen wrote:
> Hi All,
>
> I'm new to programming and wondering about an IDE for Python on Linux.
> I'd appreciate any feedback on this and good tutorials or books on
> Python 3 and the IDEs suggested. There are many available and I'm
> wondering
Brad Hudson wrote:
Can someone assist in a very basic task of retrieving a '.txt' file
from a sharepoint document library using Python 2.4 standard
libraries?
What's a sharepoint document library?
How would you retrieve a text file from it *without* using Python?
[...]
Note: url is changed
Brad Hudson wrote:
Still no response on this one, but I did find a 'rather ugly' solution
using subprocess for wget to get a file from sharepoint...
#!/usr/bin/env python
import getpass
import re
import shlex
from subprocess import Popen, PIPE
# build sharepoint user/pw
# note: shlex.split req
Christopher Conner wrote:
I've got some free time and I feel like I should pick an open source
project and begin contributing, but the options are just staggering.
I've narrowed things down to the Python language - maybe the Plone
project? maybe helping with documentation at first? Maybe testi
On Sun, Mar 04, 2012 at 12:02:37PM +0530, Ejaj Hassan wrote:
> Hello,
> I am a novice in python development. I just came across this "Python
> porting 2.7 to 3.x" .
> I am just confused with this. Please tell me the whole meaning of it.
Programmers talk about "porting" when they take code writt
nivedita datta wrote:
Hi,
Can anyone send me a working code of BBS pseudorandom number generator.
I'll do even better than send you working code for BBS -- I'll send you a link
to how you can find working code for nearly ANYTHING!
https://duckduckgo.com/html/?q=download+%22blum+blum+shub%22
Marko Limbek wrote:
Thank you!
That was easy. Now I have another problem.
I use RPy and read the spss database with method read.spss inside a
nested R code in Python, that looks like that:
import rpy
r("""
library(foreign)
baza <- read.spss(""" + analysis[0] + """)
print(baza$demo_izob0)
""")
Alan Gauld wrote:
On 05/03/12 21:25, Dave Angel wrote:
It's not clear what __add__() should mean for physical files.
My guess would be similar to the cat operator in Unix:
$ cat file1, file2 > file3
is equivalent to
file3 = file1 + file2
But of course, thats just my interpretation of file
On Tue, Mar 06, 2012 at 05:26:26PM -0800, Abhishek Pratap wrote:
> I have this one big string in python which I want to print to a file
> inserting a new line after each 100 characters. Is there a slick way to do
> this without looping over the string. I am pretty sure there shud be
> something it
Marko Limbek wrote:
I put the recommended code
savFileName =
"C:/dropbox/Exc_MarkoL_Zenel/Valicon/crosstabs/Tabela/ipk108_kosovo_data_finale_c1-1.sav"
with SavReader(savFileName) as sav:
header = sav.next()
for line in sav:
process(line)
but I am get errors
Will you tell u
Sudip Bhattacharya wrote:
s=(1,2,3)
s=s+(4,5,6)
s
(1,2,3,4,5,6)
The tuple has changed.
No it hasn't. You have created a *new* tuple, and assigned it to the same
name. Consider:
py> s = (1, 2, 3)
py> id(s)
3083421332
py> t = s
py> id(t)
3083421332
This shows that both s and t are names fo
col speed wrote:
I was just thinking about the immutability of things and tried this
(which -at least I- find interesting:
id(1)
154579120
a = 1
id(a)
154579120
a += 2
id(a)
154579096
id(3)
154579096
a is 3
True
Although there is probably no other logical way of doing it - I learnt
so
col speed wrote:
On 8 March 2012 18:51, Steven D'Aprano wrote:
This makes sense, and is easy to understand. Now for the real boggle:
py> a = 9912346; b = 9912346
py> a is b
True
Can you guess what is going on here?
(Answer will follow later.)
Because it's on the same li
Ejaj Hassan wrote:
Hi,
I have been hearing this refactoring of code. Well does it have
any thing like this in Python and if it is then what is it all about.
"Refactoring" is a general technique that applies to any language, not just
Python. Refactoring means to take a program which is writ
Bozra Moses wrote:
Hi all,
I have just finished installing python on a centos machine but I don't know
where to begin learning this language.
Do you know how to search the internet? You should always try searching the
Internet first for an answer.
https://duckduckgo.com/html/?q=python%20tut
Flynn, Stephen (L & P - IT) wrote:
All pretty standard stuff. I did however notice that the
dir(x) told me about __class__, __reduce__ and __reduce_ex__ where the
help(x) made no mention of them. Why is this difference? I presume the
two commands using different means of getting
On Thu, Mar 08, 2012 at 09:07:46PM -0500, brandon w wrote:
> I have noticed the difference in terminals when using the Python
> interpreter.
> I am able to up-arrow to get the last typed command using rxvt but when I
> use konsole and I press the up-arrow I get the symbols: ^[[A
> Why is that? Is t
On Fri, Mar 09, 2012 at 02:09:23PM +0100, Válas Péter wrote:
> Hi,
>
> I use a tkinter-based editor that ran properly earlier on English Windows
> XP. Now I use Hungarian Windows 7 with Python 2.7.2. You must know that in
> Hungary decimal fractions are marked with a decimal comma, not a dot (e.g.
On Sat, Mar 10, 2012 at 08:03:18PM -0500, Dave Angel wrote:
> There are just 256 possible characters in cp1252, and 256 in cp932.
CP932 is also known as MS-KANJI or SHIFT-JIS (actually, one of many
variants of SHIFT-JS). It is a multi-byte encoding, which means it has
far more than 256 characte
On Sun, Mar 11, 2012 at 07:02:11PM -0700, Michael Lewis wrote:
> Why do I have to use "self.example" when calling a method inside a class?
>
> For example:
>
> def Play(self):
> '''find scores, reports winners'''
> self.scores = []
> for player in range(self.players):
On Mon, Mar 12, 2012 at 02:56:36AM +0100, Robert Sjoblom wrote:
> In the file I'm parsing, I'm looking for specific lines. I don't know
> the content of these lines but I do know the content that appears two
> lines before. As such I thought that maybe I'd flag for a found line
> and then flag the
On Mon, Mar 12, 2012 at 05:46:39AM +0100, Robert Sjoblom wrote:
> > You haven't shown us the critical part: how are you getting the lines in
> > the first place?
>
> Ah, yes --
> with open(address, "r", encoding="cp1252") as instream:
> for line in instream:
Seems reasonable.
> > (Also, you
Alan Gauld wrote:
On 15/03/12 22:39, Tamar Osher wrote:
try:
import os
# my program
finally:
input ('\n\t\t\tPress the enter key to continue.')
os.system ('pause')
It's more conventional to put the import at the very top, before the
try: line.
True, but in this case, if there is an import
Luke Thomas Mergner wrote:
Hi,
I am having trouble comparing two datetime objects.
No you're not. You're having trouble comparing a datetime and a date object.
[...]
But when I compare them, it always returns false because datetime.date does
not seem to compare to datetime.datetime...
Use
Michael Lewis wrote:
Hi everyone,
If I've created a folder, why would I receive a permissions error when
trying to copy the file. My source code is here:
http://pastebin.com/1iX7pGDw
The usual answer to "why would I receive a permissions error" is that you
don't actually have permission to ac
Abhishek Pratap wrote:
Hi Guys
I want to utilize the power of cores on my server and read big files
(> 50Gb) simultaneously by seeking to N locations.
Yes, you have many cores on the server. But how many hard drives is each file
on? If all the files are on one disk, then you will *kill* perf
leam hall wrote:
Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
but it doesn't seem to work like I thought.
res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
uname = res.stdout.read().strip()
For future reference, you should identify the shortest possible am
Please keep your reply on the list, unless you have something private to say.
That way others can help, or learn from your questions. I've taken the liberty
of putting this back into the list.
Leam Hall wrote:
On 04/01/2012 09:40 PM, Steven D'Aprano wrote:
leam hall wrote:
Pytho
Greg Christian wrote:
I am just wondering if anyone can explain how the return statement in this
function is working (the code is from activestate.com)? Where does x come
from – it is not initialized anywhere else and then just appears in the
return statement. Any help would be appreciated.
re
Michael Lewis wrote:
On 05/04/12 05:59, Michael Lewis wrote:
Hi everyone,
I am researching how to automatically run some of my scripts after I log
into my Windows machine. I don't want to have to manually run the script
or setup a windows task.
The same way you run any Windows program on star
Karim wrote:
Hello all,
I have :
def foo():
print( getattr(foo, 'func_name'))
Why not this?
def foo():
print 'foo'
You already know the name of the function.
There is no portable way of retrieving the name of the current function from
within that function.
--
Ste
Khalid Al-Ghamdi wrote:
hi all,
I'm reading this book that says when creating a socket you have to use the
socket.socket() *function *as in :
ss=socket.socket()
but whey i check they type it says it's a class which makes sense cause
you're creating a socket object.
type(ss)
so, which is i
John Fabiani wrote:
Hi,
I want to create a class that inherits two other classes.
class NewClass( A,B)
But both "A" and "B" contain a method with the same name ("onKeyDown").
If my "NewClass" does not contain something to override the methods which one
would be called if
myinstance = NewC
1201 - 1300 of 3304 matches
Mail list logo