Version 0.9 of RedNotebook has just been released.
You can get it at http://rednotebook.sourceforge.net
What is RedNotebook?
RedNotebook is a graphical *diary and journal* helping you keep track of
notes and thoughts. It includes a calendar navigation, customizable
I am pleased to announce version 2.21.0 of the Python bindings for GObject.
The new release is available from ftp.gnome.org as and its mirrors
as soon as its synced correctly:
http://download.gnome.org/sources/pygobject/2.21/
What's new since PyGObject 2.20.0?
- pygmainloop: fix
Hi,
I'm very pleased to announce the release of pylint 0.19 / astng 0.19.2 release!
More information / download on http://www.logilab.org/project/pylint/0.19.0.
This is a community release, including the work we've done during the pylint
bug day [1] and patches mostly from James Lingard and
Hi all,
I need to call an external executable from my calling_exe.py python
program.
Can we make a executable say-Final.exe from the calling_exe.py and the
external.exe
*calling_exe.py -(calling)- external.exe
||
blumenkraft vohs...@gmail.com wrote:
Hi,
I want to share dictionary between two distinct processes.
...
I have looked at POSH, but it requires master process that will fork
childs. I want read-only sharing between completely unrelated
processes.
Is it possible?
Depends on your exact
On Dec 18, 8:48 am, blumenkraft vohs...@gmail.com wrote:
Hi,
I want to share dictionary between two distinct processes.
Something like this:
first.py
import magic_share_module
def create_dictionary():
return {a: 1}
magic_share_module.share(shared_dictionary,
On Dec 17, 11:14 am, Joachim Dahl dahl.joac...@gmail.com wrote:
In the Ubuntu 9.10 version of Python 3.1 (using your patch), there's a
related bug:
foo(b='b')
will set the value of a in the extension module to zero, thus clearing
whatever
default value it may have had. In other words,
Hi Michael,
I'm new to the module multiprocessing, but at a first glance
it seems, that multiprocessing.Value can only be shared if
you create the second process from the first one.
Id like to start the first process from the command line and much later
the second process from the command line.
Have you tried this with
dip1 = [dp - 0.01 if dp == 90 else dp for dp in dipList]
Yes that is better! many thanks!
--
http://mail.python.org/mailman/listinfo/python-list
shrini wrote:
Hi,
I am trying to scrap the website 'http://service.ringcentral.com'
It has a form with three input boxes.
When trying to get the form with mechanize, it is throwing the
following error.
mechanize._mechanize.FormNotFoundError: no form matching name 'login'
but, the
static PyObject* foo(PyObject *self, PyObject *args, PyObject *kwrds)
{
int a=65, b=66;
char *kwlist[] = {a, b, NULL};
I am yet to understand what kwlist pointer does and why it is needed?
if (!PyArg_ParseTupleAndKeywords(args, kwrds, |CC, kwlist, a,
b))
return NULL;
return
char *kwlist[] = {a, b, NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwrds, |CC, kwlist, a,
b))
I am yet to understand what pointer kwlist[] does and why it is needed?
Regards,
Emeka
On Fri, Dec 18, 2009 at 8:17 AM, casevh cas...@gmail.com wrote:
On Dec 17, 11:14 am, Joachim Dahl
So I'm trying to send a file through webpy and urllib2 but I can't get
around these UnicodeErrors. Here's the code:
# controller
x = web.input(video_original={})
params = {'foo': x['foo']}
files = (('video[original]', 'test', x['video_original'].file.read
()),)
client.upload(upload_url, params,
I haven't tried it, but it sounds really cool. I suppose I should expect a
lot more overhead compared to try/except, since it's not built-in to python?
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm very pleased to announce the release of pylint 0.19 / astng 0.19.2 release!
More information / download on http://www.logilab.org/project/pylint/0.19.0.
This is a community release, including the work we've done during the pylint
bug day [1] and patches mostly from James Lingard and
Try the timelimited function from this recipe
http://code.activestate.com/recipes/576780/
Works perfect! Thanks a lot, Jean!
--
http://mail.python.org/mailman/listinfo/python-list
blumenkraft wrote:
Hi,
I want to share dictionary between two distinct processes.
Something like this:
first.py
import magic_share_module
def create_dictionary():
return {a: 1}
magic_share_module.share(shared_dictionary,
creator.create_dictionary)
while True:
pass
On Thu, Dec 17, 2009 at 23:48 -0800, blumenkraft wrote:
I want to share dictionary between two distinct processes.
Something like this:
first.py
import magic_share_module
def create_dictionary():
return {a: 1}
magic_share_module.share(shared_dictionary,
creator.create_dictionary)
I have a rather large Java package for the analysis of networks that I
would like to convert to Python. Many of the classes in the Java package
are Serializable.
Any recommendations on Java-to-Python (2.6) would be appreciated.
--V
--
http://mail.python.org/mailman/listinfo/python-list
On 17-Dec-09 20:00 PM, Nobody wrote:
On Mon, 14 Dec 2009 14:18:49 -0500, Terry Reedy wrote:
Many more people uses range objects (xrange in 2.x). A range object has
the same info as a slice object *plus* it is iterable.
This isn't quite true, as a range cannot have a stop value of None, i.e.
On 17-Dec-09 20:00 PM, Nobody wrote:
On Mon, 14 Dec 2009 14:18:49 -0500, Terry Reedy wrote:
Many more people uses range objects (xrange in 2.x). A range object has
the same info as a slice object *plus* it is iterable.
This isn't quite true, as a range cannot have a stop value of None, i.e.
On Fri, Dec 18, 2009 at 2:26 AM, Emeka emekami...@gmail.com wrote:
char *kwlist[] = {a, b, NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwrds, |CC, kwlist, a,
b))
I am yet to understand what pointer kwlist[] does and why it is needed?
Regards,
Emeka
foo is designed to accept two
Hi,
I'm trying to launch standard mail app in windows and after looking
around most look like this:
import urllib, webbrowser, win32api
def mailto_url(to=None,subject=None,body=None,cc=None):
encodes the content as a mailto link as described on
http://www.faqs.org/rfcs/rfc2368.html
I've written a Python 3 course that uses an Eclipse-based teaching
system. The school is telling me that their version of Eclipse/pydev
appears to have an input() function that appends a carriage return
character to the user's input. This makes several things go screwy, as
it's definitely not the
Hi Guys,
When python reads in a file, can lines be referred to via an index?
Example:
for line in file:
if line[0] == '0':
a.write(line)
This works, however, I am unsure if line[0] refers only to the first line or
the first character in all lines.
Is there an easy way to refer
Oscar Del Ben wrote:
So I'm trying to send a file through webpy and urllib2 but I can't get
around these UnicodeErrors. Here's the code:
# controller
x = web.input(video_original={})
params = {'foo': x['foo']}
files = (('video[original]', 'test', x['video_original'].file.read
()),)
Hello All - I have a very novice question for any of you out there. I need
to assign several parameters to a code in python. I have an example of a
code that was in DOS that I would need to set as parameters in my Python
script.
SetLocal EnableDelayedExpansion
SET OUTPUT=..\log
SET LOG=..\log
On Fri, 2009-12-18 at 15:44 +0100, Virgil Stokes wrote:
I have a rather large Java package for the analysis of networks that I
would like to convert to Python. Many of the classes in the Java package
are Serializable.
Any recommendations on Java-to-Python (2.6) would be appreciated.
I
On Dec 18, 3:42 pm, seafoid fitzp...@tcd.ie wrote:
Hi Guys,
When python reads in a file, can lines be referred to via an index?
Example:
for line in file:
if line[0] == '0':
a.write(line)
This works, however, I am unsure if line[0] refers only to the first line or
the
On Dec 18, 4:43 pm, Dave Angel da...@ieee.org wrote:
Oscar Del Ben wrote:
So I'm trying to send a file through webpy and urllib2 but I can't get
around these UnicodeErrors. Here's the code:
# controller
x = web.input(video_original={})
params = {'foo': x['foo']}
files =
Case,
Thanks so much! However, I am still confused. This is what I understood;
foo (a = a, b = b) so function , foo, has default values which are a
and b. pointer kwlist[] is a way of specifying default values .
Regards,
Emeka
On Fri, Dec 18, 2009 at 3:02 PM, Case Vanhorsen cas...@gmail.com
seafoid wrote:
Hi Guys,
When python reads in a file, can lines be referred to via an index?
Example:
for line in file:
if line[0] == '0':
a.write(line)
This works, however, I am unsure if line[0] refers only to the first line or
the first character in all lines.
On Fri, Dec 18, 2009 at 7:57 AM, Emeka emekami...@gmail.com wrote:
Case,
Thanks so much! However, I am still confused. This is what I understood;
foo (a = a, b = b) so function , foo, has default values which are a
and b. pointer kwlist[] is a way of specifying default values .
Regards,
Thanks for that Richard and Steve.
I have another question.
fname = raw_input('Please enter the name of the file: ')
# create file objects
blah = open(fname, 'r')
a = open('rubbish', 'w')
for line in blah:
if line.startswith(0):
a.write(line)
elif line.endswith(0):
On Dec 18, 11:44 am, Virgil Stokes v...@it.uu.se wrote:
I have a rather large Java package for the analysis of networks that I
would like to convert to Python. Many of the classes in the Java package
are Serializable.
Any recommendations on Java-to-Python (2.6) would be appreciated.
--V
Thanks for that Richard and Steve!
Below is my full code so far:
for line in file:
if line.startswith(1):
a.write(line)
elif line.endswith(0):
lists_a = line.strip().split()
print lists_a
elif line.startswith(2):
lists_b = line.strip().split()
Hello,
I've got a design problem for a classifier. To make it short: it maps
strings on strings.
Some strings have exactly one classification, some none and some more
than one.
There's a method classify(self, word) wich classifies a word. For the
first case there's no problem:
- one
I wrote my last message late last night. When I said I am unable to
import a module from the package without an import error., I did mean
the 'modulename' module.
However, I just set up a Debian VM with Python 2.5.2 and what I was
trying to do works. So it is either something that changed with
I wrote my last message late last night. When I said I am unable to
import a module from the package without an import error., I did mean
the 'modulename' module.
However, I just set up a Debian VM with Python 2.5.2 and what I was
trying to do works. So it is either something that changed with
On 12/19/2009 3:27 AM, seafoid wrote:
Thanks for that Richard and Steve.
I have another question.
What's the question?
fname = raw_input('Please enter the name of the file: ')
# create file objects
blah = open(fname, 'r')
a = open('rubbish', 'w')
for line in blah:
if
On Dec 18, 3:07 am, Brendan Miller catph...@catphive.net wrote:
Well, it doesn't really need to be any slower than a normal list. You
only need to use index and do extra additions because it's in python.
However, if listagent were written in C, you would just have a pointer
into the contents
Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
MRAB wrote:
Regular expressions and replacement strings have their own escaping
mechanism, which also uses backslashes.
This seems like a misfeature to me. It makes sense for
a regular expression to give special meanings to backslash
sequences,
Gregory Ewing wrote:
MRAB wrote:
Regular expressions and replacement strings have their own escaping
mechanism, which also uses backslashes.
This seems like a misfeature to me. It makes sense for a regular
expression to give special meanings to backslash sequences, because
it's a sublanguage
Sylvain Thénault wrote:
Hi,
I'm very pleased to announce the release of pylint 0.19 / astng 0.19.2 release!
More information / download on http://www.logilab.org/project/pylint/0.19.0.
This is a community release, including the work we've done during the pylint
bug day [1] and patches mostly
blumenkraft wrote:
Hi,
I want to share dictionary between two distinct processes.
Something like this:
first.py
import magic_share_module
def create_dictionary():
return {a: 1}
magic_share_module.share(shared_dictionary,
creator.create_dictionary)
while True:
pass
On Fri, Dec 18, 2009 at 12:24 PM, Jean-Michel Pichavant File
/opt/tools/python/python2.3/site-packages/logilab_astng-0.19.2-py2.5.egg/logilab/astng/infutils.py,
line 28, in module
from logilab.astng._nodes import Proxy_, List, Tuple, Function, If,
TryExcept
ImportError: No module named
Thanks for that Lie.
I had to have a think about what you meant when you referred to control
going to a.write(line).
Have you any suggestions how I may render this code undead or should I scrap
it and create something new?
My confusion and ineptitude is perhaps explained by my being a
Phil wrote:
I wrote my last message late last night. When I said I am unable to
import a module from the package without an import error., I did mean
the 'modulename' module.
However, I just set up a Debian VM with Python 2.5.2 and what I was
trying to do works. So it is either something
Jerry Hill wrote:
On Fri, Dec 18, 2009 at 12:24 PM, Jean-Michel Pichavant File
/opt/tools/python/python2.3/site-packages/logilab_astng-0.19.2-py2.5.egg/logilab/astng/infutils.py,
line 28, in module
from logilab.astng._nodes import Proxy_, List, Tuple, Function, If,
TryExcept
ImportError:
Hi,
I don't know if my last mail made it or not but here it is again.
I'm trying to launch standard mail app in windows and after looking
around most look like this:
import urllib, webbrowser, win32api
def mailto_url(to=None,subject=None,body=None,cc=None):
encodes the content as a
On 18 décembre 18:24, Jean-Michel Pichavant wrote:
Sylvain Thénault wrote:
Hi,
I'm very pleased to announce the release of pylint 0.19 / astng 0.19.2
release!
More information / download on http://www.logilab.org/project/pylint/0.19.0.
This is a community release, including the work
On 12/17/2009 7:59 PM, Rhodri James wrote:
re.compile('a\\nc') passes a sequence of four characters to
re.compile: 'a', '\', 'n' and 'c'. re.compile() then does it's own
interpretation: 'a' passes through as is, '\' flags an escape which
combined with 'n' produces the newline character (0x0a),
On 12/18/2009 12:17 PM, MRAB wrote:
In simple cases you might be replacing with the same string every time,
but other cases you might want the replacement to contain substrings
captured by the regex.
Of course that conversion is needed in the replacement.
But e.g. Vim substitutions handle
Julian wrote:
Hello,
I've got a design problem for a classifier. To make it short: it maps
strings on strings.
Some strings have exactly one classification, some none and some more
than one.
There's a method classify(self, word) wich classifies a word. For the
first case there's no
On Fri, Dec 18, 2009 at 12:49 PM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Jerry Hill wrote:
On Fri, Dec 18, 2009 at 12:24 PM, Jean-Michel Pichavant File
/opt/tools/python/python2.3/site-packages/logilab_astng-0.19.2-py2.5.egg/logilab/astng/infutils.py,
line 28, in module
from
I finally finished (draft), I believe!, chapter 2...
Chapter 1 gets the reader up running, i.e. it's Hello, world!, basic tool
usage, without discussing anything about programming really. One reaction to
this chapter, based on the two example programs in it, was that it wasn't
gradual and
MRAB wrote:
Victor Subervi wrote:
Hi;
mysql truncate tem126072414516;
Query OK, 0 rows affected (0.00 sec)
Then I run a script:
if whatDo == 'insert':
try:
sql = 'insert into %s (ProdID, Quantity) values (%s, %s);' %
(tmpTable, prodid, quantity)
print sql
On 12/19/2009 4:33 AM, seafoid wrote:
Thanks for that Lie.
I had to have a think about what you meant when you referred to control
going to a.write(line).
and if-elif-elif-... chain is executed sequentially and when a match is
found, the rest of the chain is skipped. Your code:
if
Hi Guys,
It has been point out that it is difficult for anyone to provide suggestions
if I do not outline more clearly my input file and an example of what I wish
to do with it (Thanks Rory!).
I mentioned it in this thread (Is creating different threads bad etiquette?
If so, lesson learned!):
Hi,
I'm trying to embed Python and therefore use PyImport_ExtendInittab() to
register modules.
My current problem is that, if it works well with a simple module
hello, naming a module hello.foobar in the inittab struct does not
seems to work.
imp.find_module(hello.foobar) returns correctly that
On 12/19/2009 4:59 AM, Alan G Isaac wrote:
On 12/18/2009 12:17 PM, MRAB wrote:
In simple cases you might be replacing with the same string every time,
but other cases you might want the replacement to contain substrings
captured by the regex.
Of course that conversion is needed in the
In article d95cc38a-70bf-44d5-b5d2-f9248c16c...@15g2000prz.googlegroups.com,
alex23 wuwe...@gmail.com wrote:
Phillip M. Feldman pfeld...@verizon.net wrote:
It does seem as though IPython could be a bit more clever about this. =A0
I disagree. I _like_ that IPython is only reporting on the
On 17 Des, 18:37, Carlos Grohmann carlos.grohm...@gmail.com wrote:
Tenting the time spent by each approach (using time.clock()), with a
file with about 100,000 entries, I get 0.03s for the loop and 0.05s
for the listcomp.
thoughts?
Anything else being equal, list comprehensions will be the
On 17 Des, 18:42, Alf P. Steinbach al...@start.no wrote:
Have you tried this with
dip1 = [dp - 0.01 if dp == 90 else dp for dp in dipList]
And for comparison with map:
map(lambda dp: dp - 0.01 if dp == 90 else dp, dipList)
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 17, 9:37 am, Carlos Grohmann carlos.grohm...@gmail.com wrote:
Tenting the time spent by each approach (using time.clock()), with a
file with about 100,000 entries, I get 0.03s for the loop and 0.05s
for the listcomp.
thoughts?
You shouldn't trust your intuition in things like this.
Hi;
I have this code:
i = 0
nameNos = []
nos = []
for option in ourOptions():
nameNos.append('optionNo%d' % i)
nos.append(i)
i += 1
The idea is that through every iteration of option, I can create a new
variable such as 'optionNo0', 'optionNo1' etc and assign
On 17 Des, 18:37, Carlos Grohmann carlos.grohm...@gmail.com wrote:
Tenting the time spent by each approach (using time.clock()), with a
file with about 100,000 entries, I get 0.03s for the loop and 0.05s
for the listcomp.
thoughts?
Let me ask a retoric question:
- How much do you really
On 12/18/2009 8:15 AM, Chris Withers wrote:
the order of the writes isn't preserved.
How can I get this to be the case?
You'll need to flush the std{out|err} or set them unbuffered; or you can
just forget about relying on std{out|err} being ordered per write-order.
--
* Carl Banks:
On Dec 17, 10:00 pm, Brendan Miller catph...@catphive.net wrote:
On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote:
I was thinking it would be cool to make python more usable in
On Sat, 19 Dec 2009 04:56:34 +1100, Astan Chee wrote:
Hi,
I don't know if my last mail made it or not but here it is again. I'm
trying to launch standard mail app in windows and after looking around
most look like this:
import urllib, webbrowser, win32api
def
Hey Guys,
I have started to read over classes as a brief respite from my parsing
problem.
When a class is defined, how does the class access the data upon which the
class should act?
Example:
class Seq:
def __init__(self,
On 12/18/2009 7:07 AM, Brendan Miller wrote:
As for copying pointers not taking much time... that depends on how
long the list is. if you are working with small sets of data, you can
do almost anything and it will be efficient. However, if you have
megabytes or gigabytes of data (say you are
On 18 Dez., 18:59, Steve Holden st...@holdenweb.com wrote:
Julian wrote:
Hello,
I've got a design problem for a classifier. To make it short: it maps
strings on strings.
Some strings have exactly one classification, some none and some more
than one.
There's a method classify(self,
On Dec 18, 11:08 am, Alf P. Steinbach al...@start.no wrote:
* Carl Banks:
On Dec 17, 10:00 pm, Brendan Miller catph...@catphive.net wrote:
On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller
Kev Dwyer wrote:
Hello Astan,
Your code executes without error for me on Win98 (!) with Python 2.5 or
XP with Python 2.6.
It would help people to help you if you could provide the *exact* console
output from when you try to execute the code, *including* the traceback.
That way we can
On Fri, Dec 18, 2009 at 10:55, Victor Subervi victorsube...@gmail.com wrote:
Hi;
I have this code:
i = 0
nameNos = []
nos = []
for option in ourOptions():
nameNos.append('optionNo%d' % i)
nos.append(i)
i += 1
The idea is that through every iteration of
On Fri, Dec 18, 2009 at 3:46 PM, Rami Chowdhury rami.chowdh...@gmail.comwrote:
On Fri, Dec 18, 2009 at 10:55, Victor Subervi victorsube...@gmail.com
wrote:
Hi;
I have this code:
i = 0
nameNos = []
nos = []
for option in ourOptions():
Victor Subervi wrote:
How do I...?
Well, you start by reading a book on how to program. You would
then learn that what you want (in all likelihood) is a
dictionary/map structure for dynamically created key/value pairs.
Once you have progressed from your current apprenticeship and
achieved
On Sat, 19 Dec 2009 06:36:32 +1100, Astan Chee wrote:
Kev Dwyer wrote:
Hello Astan,
Your code executes without error for me on Win98 (!) with Python 2.5 or
XP with Python 2.6.
It would help people to help you if you could provide the *exact*
console output from when you try to execute the
* Carl Banks:
On Dec 18, 11:08 am, Alf P. Steinbach al...@start.no wrote:
* Carl Banks:
On Dec 17, 10:00 pm, Brendan Miller catph...@catphive.net wrote:
On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Thu, 17 Dec 2009 12:07:59 -0800, Brendan
On Fri, Dec 18, 2009 at 11:55 AM, sturlamolden sturlamol...@yahoo.nowrote:
On 17 Des, 18:37, Carlos Grohmann carlos.grohm...@gmail.com wrote:
Tenting the time spent by each approach (using time.clock()), with a
file with about 100,000 entries, I get 0.03s for the loop and 0.05s
for the
seafoid wrote:
Hey Guys,
I have started to read over classes as a brief respite from my parsing
problem.
When a class is defined, how does the class access the data upon which the
class should act?
Example:
class Seq:
On Fri, Dec 18, 2009 at 10:39 AM, Carl Banks pavlovevide...@gmail.com wrote:
On Dec 17, 10:00 pm, Brendan Miller catph...@catphive.net wrote:
On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote:
Steve, that has indeed clarified matters!
Thanks!
--
View this message in context:
http://old.nabble.com/Creating-Classes-tp26848375p26849864.html
Sent from the Python - python-list mailing list archive at Nabble.com.
--
http://mail.python.org/mailman/listinfo/python-list
On 18/12/09, seafoid (fitzp...@tcd.ie) wrote:
http://old.nabble.com/Parsing-file-format-to-ensure-file-meets-criteria-to26837682.html
Your specification is confusing. However I suggest you break it down
the code so that the steps in your programme are logical. Good luck.
# example psuedocode
Hey folks,
Is it possible to assign a list within a nested list to a variable?
Example:
l = [['1', '2', '3'], ['4', '5', '6']]
for i in l:
if i[0][1] == '1':
m = i
Indeed, I generally do not understand how to assign variables within a loop!
Is there an easy way to 'flatten' a
Rory,
You are a gentleman!
Thank you very much for your suggestion!
Kind Regards,
Seafoid.
Rory Campbell-Lange wrote:
On 18/12/09, seafoid (fitzp...@tcd.ie) wrote:
http://old.nabble.com/Parsing-file-format-to-ensure-file-meets-criteria-to26837682.html
Your specification is confusing.
On Dec 18, 10:28 am, Joachim Dahl dahl.joac...@gmail.com wrote:
My mistake seems to be that I declared
char a, b;
instead of
int a, b;
Thank you for sorting this out.
Joachim
I think you need to initialize them, too.
--
http://mail.python.org/mailman/listinfo/python-list
On 12/18/2009 1:00 AM, Brendan Miller wrote:
For the benefit of those of us who aren't C++ programmers, what do its
iterators do that Python's don't?
It depends on what one means by 'iterator'. Python iterators do not fit
in the STL hierarchy. On the other hand, Python indexes are a form of
On 12/18/2009 10:46 AM, Jim Valenza wrote:
Hello All - I have a very novice question for any of you out there. I
need to assign several parameters to a code in python.
In Python, a 'parameter' is a function local name defined in the header
of the function and bound to an argument when the
On Fri, Dec 18, 2009 at 10:46 AM, Jim Valenza jim.vale...@gmail.com wrote:
Hello All - I have a very novice question for any of you out there. I need
to assign several parameters to a code in python. I have an example of a
code that was in DOS that I would need to set as parameters in my
Hi all, I have a dictionary that uses dates and a tuples ad key, value
pairs. I need to sort the values of the dict and insert everything in a
tuple. The additional problem is that I need to sort the values looking
at the i-th element of the list. I'm not that good at python (v3.1), but
this
I'd write it as:
s = sorted(d.iteritems(), key=lambda i: i[1][2])
If using python 3, it should be d.items() instead of d.iteritems().
d.iteritems() is a generator yielding tuples of (key, value) from
the dictionary 'd'.
lambda i: i[1][2] is the same as:
def sort_(i):
return i[1][2]
but
Actually, in order to use duplicate values I need something like:
import copy
d = {1:('a', 1, 12), 5:('r', 21, 10), 2:('u', 9, 8), 3:('u', 9, 8) }
dc = copy.deepcopy(d)
t = [x for x in d.values()]
def third(mls):
... return mls[2]
...
s = sorted(t, key=third)
pres = []
for x in s:
...
Brendan Miller:
I agree though, it doesn't matter to everyone and anyone. The reason I
was interested was because i was trying to solve some specific
problems in an elegant way. I was thinking it would be cool to make
python more usable in programming competitions by giving it its own
port of
On Fri, Dec 18, 2009 at 5:34 PM, mattia ger...@gmail.com wrote:
Hi all, I have a dictionary that uses dates and a tuples ad key, value
pairs. I need to sort the values of the dict and insert everything in a
tuple. The additional problem is that I need to sort the values looking
at the i-th
Il Fri, 18 Dec 2009 18:00:42 -0500, David Robinow ha scritto:
On Fri, Dec 18, 2009 at 5:34 PM, mattia ger...@gmail.com wrote:
Hi all, I have a dictionary that uses dates and a tuples ad key, value
pairs. I need to sort the values of the dict and insert everything in a
tuple. The additional
The second deviation is that since most names are constants,
Really? Does that mean you don't use literals, to save the time
required to convert them to integers? Isn't that done at compile
time?
So, instead of doing the Collatz Conjecture as
while a1:
f = gmpy.scan1(a,0)
if f0:
a = a
I am trying to run python from a network share on windows 7.
The network share is T:
t:\python-2.6.1\python
Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32
bit (Intel)] on win32
Type help, copyright, credits or license for more
information.
import httplib2
On 18/12/09, mattia (ger...@gmail.com) wrote:
Hi all, I have a dictionary that uses dates and a tuples ad key, value
pairs. I need to sort the values of the dict and insert everything in a
tuple. The additional problem is that I need to sort the values looking
at the i-th element of the
1 - 100 of 205 matches
Mail list logo