For the same problem,
The solution, I found is to install package spicy. Then *import spicy*
along with *import pandas. *
It really works -
But the instructions should be -
*import spicy*
*import pandas*
On Fri, 24 Apr 2020, 01:12 MRAB, wrote:
> On 2020-04-23 18:57, Amit Jain wr
Dear Sir/Madam,
After *successful installation of PIP for PANDAS *when I try to *import
pandas*, It gives error as given below -
>>> import pandas as pd
Traceback (most recent call last):
File "", line 1, in
import pandas as pd
File
"C:\Users\Amit\AppData\Local\
ards
*
*Amit Kumar Jain*
*Jaipur, Rajasthan*
*India*
--
*Thanks & Regards
*
*Amit Kumar Jain*
*PGT(CS)*
*KVS, (Under **Ministry of HRD)*
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
I’m Amit Laish, a security researcher from GE Digital.
During one of our assessments we discovered something that we consider a bug
with security implications which can cause a denial of service by disk
exhausting, and we would like to share it with you, and hear you opinion about
it
Yes pylauncher was installed when I installed 3.6.4.
Moreover, the python in externals\pythonx86 is supposed to be able to parse
it's own code but it errors out in my case.
Can you provide me the list of all the external modules with it's dependencies
if possible ?
I will pull those separately a
nto the same trap though it goes ahead and
compiles but then compiler throws error due to half-baked external modules.
Any help will be highly appreciated !
--Amit Kumar Singh
--
https://mail.python.org/mailman/listinfo/python-list
You open the file more than once for which row with score greater than 3.
Every time you open a file for writing it truncates an existing one with
the same name.
On 13/03/17 13:25, Madhusudhanan Sambath wrote:
hi to all,
this is madhu...i am new to python
this is my python code, where i label
On 10/03/17 04:38, Pablo Lozano wrote:
Good day,
I would like to unsubscribe this e-mail to the Python e-mail list.
Kind regards
You can set "Mail Delivery" to "disable" if you want to read posts on
the Usenet, but not to receive e-mails.
--
https://mail.python.org/mailman/listinfo/python-li
On 11/02/17 09:47, boB Stepp wrote:
On Sat, Feb 11, 2017 at 1:00 AM, Amit Yaron wrote:
On 10/02/17 21:15, Peter Pearson wrote:
On Fri, 10 Feb 2017 13:59:45 +0200, Amit Yaron
wrote:
On 10/02/17 04:33, adam14711...@gmail.com wrote:
My computer programming professor challenged me to
On 10/02/17 21:15, Peter Pearson wrote:
On Fri, 10 Feb 2017 13:59:45 +0200, Amit Yaron wrote:
On 10/02/17 04:33, adam14711...@gmail.com wrote:
Hello,
My computer programming professor challenged me to figure out a way
to manipulate my program to display one error message if the user
input is
On 10/02/17 04:33, adam14711...@gmail.com wrote:
Hello,
My computer programming professor challenged me to figure out a way to
manipulate my program to display one error message if the user input is a zero
or a negative number, and a separate error message if the user input is a
decimal numbe
On 10/02/17 10:35, loial wrote:
I need to be able to extract a single file from a .zip file in python.
The zip file will contain many files. The file to extract will be the only .csv
file in the zip, but the full name of the csv file will not be known.
Can this be done in python?
Yes, you can
Can I find those modules in the FreeBSD ports?
--
https://mail.python.org/mailman/listinfo/python-list
r
program to decide what to do with the arguments it receives (So in
your examples, rm would actually try to remove the "foo" directory).
And although stripping the '--' is easy, why should the user of
argparse need to handle it? Still unclear to me.
Cheers,
Amit
--
https://mail.python.org/mailman/listinfo/python-list
t easy to check for it and remove it if it exists, but it
still seems like it shouldn't be there - it is not really an argument,
just a delimiter.
Am I doing anything wrong, or is this a bug? I hope someone here can
shed some light on this.
Thanks,
Amit
--
--
https://mail.python.org/mailman/listinfo/python-list
Hi Laura,
Thanks a Lot for the reply.
I wanted to know if calling a Python script from SAP HANA database is
possible.
Thanks!
On Jun 3, 2015 9:43 PM, "Laura Creighton" wrote:
> In a message of Wed, 03 Jun 2015 15:17:16 +0530, Amit Goutham writes:
> >Hi All,
> >I a
,
Amit Goutham
Ph:+91-8867801035
--
https://mail.python.org/mailman/listinfo/python-list
http://www.techdarting.com/2014/03/why-different-flavors-of-python.html
--
https://mail.python.org/mailman/listinfo/python-list
line 1
> Hello there
> ^
> SyntaxError: unexpected EOF while parsing
In Python 2, input() expects valid Python as it's input. If you
provide your input as 'Hello there' (a Python string), it won't
complain.
HTH,
Amit.
--
http://echorand.me
--
https://mail.python.org/mailman/listinfo/python-list
elf writing
> something.
>
> if you guys ( others ) got something else for Redhat Linux rpm creation do
> let me know.
I played with creating a RPM SPEC file "generator" for Sphinx documentation:
https://github.com/amitsaha/sphinx_doc_packaging
It's written in Python, so
haps you
would be better off using MIME types instead.
Assuming you go ahead with using MIME type, how about using
python-magic to detect the type and then look in your dictionary
above, if there is a corresponding file_opener object. If you get a
KeyError, you can raise an exception saying t
have to
convert the input into a data type such as an integer or a float and
then try to do any mathematical operation:
>>> int(age) - 10
0
>>> float(age)-10
0.0
Hope that helps.
Best,
Amit.
--
http://echorand.me
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Sep 29, 2012 at 10:37 PM, Dave Angel wrote:
> On 09/29/2012 08:23 AM, Amit Saha wrote:
>> On Sat, Sep 29, 2012 at 10:18 PM, Georg Brandl wrote:
>>>
>>>
>>> For a more extensive list of changes in 3.3.0, see
>>>
>>> http://docs
ons such as "sendfile()"
> * Hash randomization, introduced in earlier bugfix releases, is now
>switched on by default
>
> In total, almost 500 API items are new or improved in Python 3.3.
> For a more extensive list of changes in 3.3.0, see
>
> http://docs.python.org/3.3/whatsnew/3.3.html
Redirects to http://docs.python.org/py3k/whatsnew/3.3.html: 404 Not Found.
Cheers,
Amit.
--
http://echorand.me
--
http://mail.python.org/mailman/listinfo/python-list
Its an indentation error
--
A-M-I-T S|S
--
http://mail.python.org/mailman/listinfo/python-list
Hi everyone,
I am really stuck in a very simple problem and wanted to know if you
could take some time to check it out -
My code is simple. Using BaseHTTPServer and ThreadInMix I want to run
a python script (Script1.py) for every request made simultaneously.
My code->
from subprocess import PIPE
oup/comp.lang.java.programmer/browse_thread/thread/1927322accdb6e6e/223e1c7cd208a86c
Please suggestion...
regards, Amit J.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 28, 12:51 pm, Ian Kelly wrote:
> On Sun, Aug 28, 2011 at 9:34 AM, Amit Jaluf wrote:
> > hello group
>
> > i have one question about this
>
> > if __name == '__main__':
sorry dear for this
and thanks all of you for this
--
http://ma
hello group
i have one question about this
if __name == '__main__':
is it same as other languages like[c,c++] main function. because of i
google and read faqs
and also "
http://docs.python.org/faq/programming#how-do-i-find-the-current-module-name";
this and i am confused.
thanks
--
http://m
On Aug 11, 8:15 am, MRAB wrote:
> On 11/08/2011 13:56, Amit Jaluf wrote:> Hello Group,
> > i just start python is it necessary indentation in python ?
>
> Yes, indentation is part of the language.
>
> Even in programming languages where it isn't necessary, it's
Hello Group,
i just start python is it necessary indentation in python ?
thanks in advance ...
--
http://mail.python.org/mailman/listinfo/python-list
ng in pure
python code (Eg. if ' '.join(biglist)) etc.
Regards,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
;|^USER\\>'
amdev 6906 0.0 0.1 3508 1424 p0 R+9:57PM 0:00.00 egrep
\\<6903\\>|^USER\\> (sh)
Regards,
Amit
On Thu, Mar 17, 2011 at 3:21 AM, Dan Stromberg wrote:
>
> On Wed, Mar 16, 2011 at 8:38 AM, Amit Dev wrote:
>>
>> I'm observing a strange m
sum(map(len, l)) => 8200 for 1st case and 9100 for 2nd case.
Roughly 100MB as I mentioned.
On Wed, Mar 16, 2011 at 11:21 PM, John Gordon wrote:
> In Amit Dev
> writes:
>
>> I'm observing a strange memory usage pattern with strings. Consider
>> the followi
he string size, it remains high till it reaches around
1000. In that case it is back to 100MB usage.
Python 2.6.4 on FreeBSD.
Regards,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
ppears to be a cycle
(between method m2 and A). I would expect this to behave the same as
having another method "def m2(self): self.m1()", but unfortunately its
not.
In above case m2 seems to be in a.__dict__ which is causing the cycle.
Any idea why this is so?
Regards,
Amit
--
http://ma
On Sun, Feb 27, 2011 at 10:26 AM, Rohan Malhotra
wrote:
> BeautifulSoup library only fetches source of page. I need the access
> to DOM after js execution with url as input parameter.
>
> Any pointers?
>
I am not sure but in case you need to make some ajax requests
mechanize might help.
http://
On Thu, Jun 3, 2010 at 9:12 PM, Shashwat Anand wrote:
> I have not much idea but Online Judges like SPOJ/codechef have regular
> programming-contests and python is one of allowed languages. So yes, it's
I am trying to make an online test for Python .
P.S Sorry ,I did not realize I sent the mail
Hi ,
I wish to execute some user submitted python code and have absolutely
no other way out . I saw that there used to be a module called rexec
which could define which modules can be imported and which cannot
however exec doesn't have that kind of feature . Please if you could
tell me what would
On Sat, Apr 24, 2010 at 08:22:14AM +0530, Kushal Kumaran wrote:
[snip]
>
> Run a shell (cmd.exe, I think) using subprocess and send it the
> commands you want to run using the communicate() method.
>
Actually, I ended up using stdin.write('...\n'), and it works as expected:
#
#
On Thu, Apr 22, 2010 at 10:12:47PM -0400, Dave Angel wrote:
> amit wrote:
> >How does one go about calling multiple programs using subprocess?
> >
> >This is the program flow:
> >
> >C:\> wrenv.exe
> >C:\> make clean
> >..
> >..
> &
n
the 'make clean' command.
Any help is appreciated.
Thanks,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
Hello
I want to intsall python on my AIX 6.1 Box.
I couldn't get any rpm for python 2.5.x for AIX 6.1.
THen I decided to compile python 2.5.4 on my AIX box. I downloaded the
python source code from www.python.org and tried to compile on my AIX
both using gcc.
step 1 ./configure --with-gcc
config
classA, "attr-1", "val-1")
dict['a']= classA
print classA
''' Desired output: {'attr-1': 'val-1'}'''
print dict
''' Actual output: {'a': <__main__.MyClass instance at 0x79cfc8>}'''
Thanks,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
ctypes.cdll.LoadLibrary("A.so"), it gives errors
about the undefined Symbols. Even if I load B.so before loading A.so,
the error remains the same (which is expected). Can someone help me to
find out, how to load A.so by telling it to look for undefined symbols
in B.so as well?
Thanks, Amit
--
http://mail.
and the following versions.
>>> xml.__version__
'0.8.4'
>>> fpconst.__version__
'0.7.2'
>>> SOAPpy.__version__
'0.12.0'
Regards,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
have to be in the same directory. For example,
project/
util/
config/
tests/
start.py
I have a module in util/console.py, how do I import that. In start.py
I have:
from project.util.console import filetest
but I get an ImportError.
Thanks!
Amit
--
http://mail.python.org
The code is attached below. Basically I am taking a substring of
variable m, and using "buffer" instead of slicing.
However, the application of int on that buffer start correctly from
the offset, but it scans all the way to the end, instead of stopping
at the length of the buffer.
It works howeve
>> to meet your listed requirements, without need of external
> >> dependencies.
>
> > Hmm..Yeah I didn't realize python had its own standard logging
> > facility. I took a look at it and it seems to do the job. However, the
> > output seems to be syslog style o
>> to meet your listed requirements, without need of external
> >> dependencies.
>
> > Hmm..Yeah I didn't realize python had its own standard logging
> > facility. I took a look at it and it seems to do the job. However, the
> > output seems to be syslog style o
stores all the output of the commands being run (e.g. tcl
scripts, etc). Will this be possible using the built in python logging
module?
Thanks,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
ogging?
Thanks,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
ma:
>
> print "whatever",
> sys.stdout.flush()
>
> 2. Run Python in unbuffered mode, by using the -u switch:
>
> python -u yourscript.py
>
> Carl Banks
Thanks for the reply. This worked as expected. I did not know about
the -u switch, this is good stuff.
Amit
--
http://mail.python.org/mailman/listinfo/python-list
On May 16, 4:02 pm, Hans Nowak <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] wrote:
> > Hey there,
>
> > I have a simple question about python print statement. Take the
> > following code snippet for example...
>
> > 1 print "-#- executing: %s" % section,
> > 2 tests[section] = test.testcase(name=
he
"-#- executing: 0053" statement.
e.g.
-#- executing: 0053 FAIL
Some tests take a long time to finish thus the screen is blank until
the entire test finishes and the above statement is outputted.
Thanks for any help.
Amit
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 31, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
>
> What about creating a setup.py and using the distutils command to
> build rpms or tarballs?
>
> http://docs.python.org/dist/built-dist.html
>
> Mike
My quick look: The link you sent is under the header "Distributing
Python Modules".
On Mar 31, 11:00 am, xkenneth <[EMAIL PROTECTED]> wrote:
> Yeah, this is what I'm talking about:
>
> > def __eq__(self, other) :
> > try :
> > return <>
> > except AttributeError:
> > return False
>
> That seems a bit nasty to me.
One thing about python (IMO); you can't just say this
ays it
works for python until version 2.4. I am using 2.5.1. Not sure if it
will work seamlessly, but I will try.
If anyone has experience to share on using pyinstaller on 2.5.1 or
higher, please share.
Amit
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 31, 10:37 am, John Henry <[EMAIL PROTECTED]> wrote:
> On Mar 31, 10:24 am, Amit Gupta <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi
>
> > I am looking for a some tool that can convert python scripts to
> > executable on Linux.
>
> > I found f
On Mar 31, 10:23 am, xkenneth <[EMAIL PROTECTED]> wrote:
>
> class A:
> def __eq__(self,other):
> return self.a == other.a and self.b == other.b
>
> class B:
> def __eq__(self,other):
> return self.a == other.a and self.c == other.c
>
> Thanks!
>
> Regards,
> Kenneth Mille
python on linux
(ActiveState has nothing)?
Any other related commets are also welcome.
Thanks
Amit
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 20, 8:51 pm, Miki <[EMAIL PROTECTED]> wrote:
> Hello Amit,
>
>
>
> > python testname.py : the unitests runs as usual and I get the
> > following results:
> > -
> "CL(?P[a-z]+)XY(?:AB)[aeiou]+(?PCD(?P..)\?EF)"
>
> Good luck.
>
> --
> Steven
This is what I did in the end (in principle). Thanks.
A
--
http://mail.python.org/mailman/listinfo/python-list
do "python -m pdb testnames.py": I get
ython -m pdb testnames.py
> /s/nd6/amit/pyiglu/testnames.py(1)()
-> import unittest
(Pdb) c
--
Ran 0 tes
Before I read the message: I screwed up.
Let me write again
>> x = re.compile("CL(?P[a-z]+)")
# group name "name1" is attached to the match of lowercase string of
alphabet
# Now I have a dictionary saying {"name1", "iamgood"}
# I would like a function, that takes x and my dictionary and return
"C
Hi
I wonder if python has a function to pack things back into regexp,
that has group names.
e.g:
exp = ([a-z]+)
compiledexp = re.compile(exp)
Now, I have a dictionary "mytable = {"a" : "myname"}
Is there a way in re module, or elsewhere, where I can have it match
the contents from dictionary to
Python'ites
Is there an environment variable or some settings, that python can use
to know the directory name for dumping .pyc files.
Not a hard-requirement, I just don't like pyc files alongwith py files
in my work area.
Thanks
A
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 7, 10:38 am, Amit Gupta <[EMAIL PROTECTED]> wrote:
> Python'ites
>
> I searched around "google" to find the answer to this question, but I
> can't:
>
> I have a named regexp : x = re.compile("(?P[a-z]+)")
>
> What I want is an
On Feb 7, 12:28 am, grflanagan <[EMAIL PROTECTED]> wrote:
> On Feb 6, 11:07 pm, Amit Gupta <[EMAIL PROTECTED]> wrote:
>
> > Hi
>
> > How do I get user defined attributes of a class? e.g
>
> > Class A(object) :
> > self.x = 1
> > ---
Python'ites
I searched around "google" to find the answer to this question, but I
can't:
I have a named regexp : x = re.compile("(?P[a-z]+)")
What I want is an iterator, that can return me both the "groupname"
and the matched string, e.g:
m = x.search("aa")
Somehow, I want to get
{"me" : "aa"
On Feb 6, 5:33 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> Amit Gupta <[EMAIL PROTECTED]> writes:
> > Need a python trick, if it exists:
>
> > I have a file that stores key, value in following format
> > --
> > "v1" : "k1",
> > &
Need a python trick, if it exists:
I have a file that stores key, value in following format
--
"v1" : "k1",
"v2" : "k2"
--
Is there a way to directly load this file as dictionary in python. I
could do (foreach line in file, split by ":" and then do dictionary
insert). Wondering, if some python bu
On Feb 6, 2:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Amit Gupta schrieb:
>
>
>
> > On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> >> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote:
> &
On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote:
> > Class A(object) :
> > self.x = 1
>
> This is not valid Python code.
>
> > I want something like:
> > for u
Hi
How do I get user defined attributes of a class? e.g
Class A(object) :
self.x = 1
--
I want something like:
for userattrib in A.getAllUserAttribute() :
print userattrib
My question is, is there a builtin function, called
getAllUserAttributes?
Thanks
--
http://mail.p
On Dec 3, 11:10 am, Amit Gupta <[EMAIL PROTECTED]> wrote:
>
>
> Thanks Frank. But again, this results into stack-track when the
> exception is caught. On the other hand, I would like the debug-trace
> just before throwing the exception. As a case, I might be debugging
> co
On Dec 1, 11:14 pm, Frank Millman <[EMAIL PROTECTED]> wrote:
> See this post from less than a week ago.
>
> http://tinyurl.com/2zyr7u
>
> I think that the message from Diez B. Roggisch has what you are
> looking for.
>
> Frank Millman
Thanks Frank. But again, this results into stack-track when the
Py'ites
I am using pdb to check my code, and I would like to put a statement
like equivalent of "C++gdb>catch throw".
Basically, I would like debugger to start as soon as an exception is
thrown. How may I do it?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
rator or whatever it's called, with a passed in
> operation?
Well I think what you want is to use "()" instead of "[]"
>>> l = (i for i in range(1,20))
>>> l
Cheers,
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
On 11/17/07, Cope <[EMAIL PROTECTED]> wrote:
>
> In our place we eat pythons for curry. Its delicious.
> And how about your python?
>
> Cope
Not much of the difference here, it is just a bit more flexible. My
python goes and brings me whatever I wish to eat.
Cheers,
--
--
On 11/7/07, Cameron Walsh <[EMAIL PROTECTED]> wrote:
> Amit Khemka wrote:
>
> > Cut image by "m X m" grid (bigger the m, the more varied shapes you
> > would be able to generate), this will give you m*m square pieces. With
> > each piece store a vector whic
uot; operations can be optimized calculating a factor "m*m/N"
and doing all merges together.
2. You can also maintain a 'size' attribute with each piece, so that
all the pieces generated are of approximately same size.
Please let me know if you have other ideas.
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
at each of the variables namely a, b,
> c, ## can take value from 1 to 9.
> How do I go about this ?
An ugly code for it would be ;-) :
for (a, b, c, d, e, f) in zip(*[range(1, 10)]*6):
print a, b, c, d, e, f
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
nction (c.insert?).
>
> Is there some other interface/database that I might like better?
Why you can always look at some "pure" database solutions. If
persistence is all you require, have a look at "anydbm" and or
"shelve" modules .
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
age'] = ['line noise', 'cryptic']
> keywords['python'].append('readable')
>
To add you may want to have a look at "shelve" module , in case you
want to store this object to a file. It can be useful if the data set
is large and does not change frequently and you would want to save on
some startup time .
cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
ine 1 hi line 2 how r u"..
> How can i protect \n characters ?
I don't think the issue has anything to do with python.
I guess while you are displaying the text into an HTML page the "\n"
characters should be replaced by "" to appear as newlines.
Cheers,
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
7;t it surprise you if the code that you posted goes in
infinite loop ?!
2. why do you use condition: n < 100
3. How do you think that your function will calculate the factorial ?
4. Instead of "input" use "raw_input", and then "cast" the input as integer .
Cheers,
amit.
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
ches in my existed cluster at my college. Just
> look for python development held in this area.
> Hey i was active member of this from last 2 year, i had just changed my
> email address.
Have a look at : http://cheeseshop.python.org/pypi?%3Aaction=browse
Cheers,
--
Amit Khemka
--
http://mail.
ven if the poll results do not accurately reflect the
intended purpose, they may be, just may be, give an idea of size of
community and just how much that 'one' lie they will live with to see
'their' language ahead ;-) !
cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
> backitems=heapq.nlargest(1000, backitems, operator.itemgetter(1))
> a=[ backitems[i][0] for i in range(0,len(backitems))]
> a.reverse()
> return a
>
Btw, there are specialized algorithms called "Selection Algorithms"
for finding k largest items in a collection.
http://en.wikipedia.org/wiki/Selection_algorithm
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
> Rather than spelling out the final result, I'll give you hints: Look at
> itertools.cycle and itertools.izip.
>
Why not just use enumerate ?
clvalues = ["Even", "Odd"]
for i, (id, name) in enumerate(result):
stringBuffer.write('''
%d
%s
'''
%
(clvalues[i % 2], id, name))
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
ike this:
import loadee
if __name__ == "__main__":
l = loadee.loadee()
Alternatively you can directly import the objects defined in a module by :
from loadee import loadee
if __name__ == "__main__":
l = loadee()
cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
bc_file'):
data = line.strip().split('#')
# add the numbers to the 'alphabet' key as a list
d[data[0]] = d.get(data[0], []) + [data[1]]
Now you can just iterate over the dictionary and write it into a file
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
uting a linux command "dmesg>>stat.txt")?
Since subprocess module allow you to call programs through (linux)
shell , you can use the same syntax in your command.
example:
>>> from subprocess import call
>>> call("echo foo >> bar.txt", shell=True)
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
gument.
Have a look at subprocess module
http://docs.python.org/lib/module-subprocess.html
If there is some else that you meant, please specify .
Cheers,
--
--
Amit Khemka
--
http://mail.python.org/mailman/listinfo/python-list
doing this please?
> Well the basic trouble is that the yield statement you see there
> causes it to print the list over and over again when a string
> containing "msgid" is found and the subsequent conditions are
> satisfied. I just want the last list the yield sta
e that you like and suits your needs.
If you still get struck , please post specific issues.
I wish and hope learning python would be a pleasing experience !
Cheers,
amit.
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
--
http://mail.python.org/mailman/listinfo/python-list
comprehension, for more have a look at
http://docs.python.org/tut/node7.html#SECTION007140000
Cheers,
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
--
http://mail.python.org/mailman/listinfo/python-list
On 9/24/07, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Mon, 2007-09-24 at 16:53 +0530, Amit Khemka wrote:
> > On 9/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > >>> l = ["1", "11", "2", "22"]
>
Hi,
>>> l = ["1", "11", "2", "22"]
>>> sorted(l, cmp = lambda x, y: cmp(int(x), int(y))) # provide your
own compare function !
>>> l
['1', '2', '11', '22']
Cheers,
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 196 matches
Mail list logo