I am pleased to announce version 2.15.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.15/
There are two new significant features in this release, initial
joe shoemaker [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
If you have the following:
data = unpack('L', sock.recv(4))
Does this line of code means that incoming data is big endian and
unpack it to endianess of local machine? If local machine is little
endian, then big
On Jul 14, 1:26 pm, Mensanator [EMAIL PROTECTED] wrote:
## Combinations with replacement
## -
## aaa aab aac aad aae abb abc abd abe acc acd ace
## add ade aee bbb bbc bbd bbe bcc bcd bce bdd bde
## bee ccc ccd cce cdd cde cee ddd dde dee eee
##
## actual
Jerry Hill [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Mon, Jul 14, 2008 at 12:40 PM, Tim Cook [EMAIL PROTECTED]
wrote:
if I say units=unicode(°). I get
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0:
ordinal not in range(128)
If I try
En Mon, 07 Jul 2008 12:26:28 -0300, Todd [EMAIL PROTECTED]
escribió:
On Jul 7, 10:17 am, Tim Golden [EMAIL PROTECTED] wrote:
Todd wrote:
I ran a python script last night which connects to a matlab automation
server via DCOM (using win32com). I expected to see the results when
I came in
May I suggest you ask in the blender list?
Will do that and report back. Thank you!
Manuel
--
http://mail.python.org/mailman/listinfo/python-list
Marcus.CM wrote:
So python for me is for anything except GUI. It becomes self rejecting
notion to do GUI in python when you type in those stuff that could have
been handled by an IDE,
thus for linux project i just do the web interface + php and let python
do all the other hard core work.
En Mon, 14 Jul 2008 12:11:55 -0300, greg [EMAIL PROTECTED] escribi�:
I am able to use the PIL module to capture a screen or specific
window. My problem is when capturing a window (on windows XP) I can
only capture the visible portion of the window. Is there any way to
capture the entire
On 15 Jul., 03:04, David [EMAIL PROTECTED] wrote:
CracKPod wrote:
Hello, I wrote a Python class to interact with the TiddlyWiki. In case
you are interested you can find it on my blog:
http://crackpod.bplaced.net/
CracKPod
--
http://mail.python.org/mailman/listinfo/python-list
Thank
On 15 Jul., 08:16, Yosifov Pavel [EMAIL PROTECTED] wrote:
cloning of iterators in this manner is bad, more good is to use one,
single list(my_iter) instead of
(seehttp://aquagnu.blogspot.com/2008/07/self-repair-iterator-in-python.html).
This won't work for big iterators as mentioned by Peter
En Mon, 14 Jul 2008 21:39:20 -0300, Derek Martin [EMAIL PROTECTED]
escribió:
On Mon, Jul 14, 2008 at 05:40:43PM -0400, Aquil H. Abdullah wrote:
You've hit the proverbial nail with the hammer. The problem is that my
application needs to run under both the Linux and Windows OSs, so while
I
Hello internet.
I am wondering, is there a simple way to test for Internet connection? If
not, what is the hard way :p
--
View this message in context:
http://www.nabble.com/Testing-for-Internet-Connection-tp18460572p18460572.html
Sent from the Python - python-list mailing list archive at
Alexnb wrote:
I am wondering, is there a simple way to test for Internet connection? If
not, what is the hard way :p
Trying to fetch the homepage from a few major websites (Yahoo, Google,
etc.)? If all of them are failing, it's very likely that the connection
is down. You can use urllib2 [1]
Phillip B Oldham schrieb:
Thanks all - lots to go through there! :D
I'd heard previously that Trac was a nice example, or rather its core
was, but I'd also heard that there were lots of problems with it and
that they were redeveloping it from scratch?
They continually improve parts of it, but I
Hi,
Sorry I've posted a similar question some weeks ago, but I got no
answers. I want to embed a Python application on a device with limited
resources, esp. storage limitations. Is there a way to reduce the Python
interpreter to a set of modules that's urgently needed? Or is there a
method
On 15 Jul., 11:51, Thomas Troeger [EMAIL PROTECTED]
wrote:
I've really looked at a lot of places but haven't found a suitable
solutions yet, so I'm asking here in hope that someone has experience
with that topic.
Which solutions did you rule out?
--
On 15 Jul., 12:14, Thomas Troeger [EMAIL PROTECTED]
wrote:
Kay Schluehr wrote:
On 15 Jul., 11:51, Thomas Troeger [EMAIL PROTECTED]
wrote:
I've really looked at a lot of places but haven't found a suitable
solutions yet, so I'm asking here in hope that someone has experience
with that
Alexnb [EMAIL PROTECTED] writes:
I am wondering, is there a simple way to test for Internet
connection? If not, what is the hard way :p
Refine the question: What do you mean by internet? It isn't a single
entity.
Do you mean some particular internet host responding on a particular
network
greg wrote:
I am able to use the PIL module to capture a screen or specific
window. My problem is when capturing a window (on windows XP) I can
only capture the visible portion of the window. Is there any way to
capture the entire window? specifically the scrolled portion of a
window that is
Alex Marandon wrote:
Alexnb wrote:
I am wondering, is there a simple way to test for Internet connection? If
not, what is the hard way :p
Trying to fetch the homepage from a few major websites (Yahoo, Google,
etc.)? If all of them are failing, it's very likely that the connection
is down.
goldtech wrote:
I would be grateful for support with the code I cited. It's not long
and fairly standard. I'm sure my error(s) would be glaring to more
experienced coders. I appreciated the heads-up about other options
but I would be grateful for help getting this code to run. Thanks
For
ssecorp wrote:
def append(self, item):
self.stack.append(item)
I can get to see the stack with var.stack but then why even implement
append when I could do self.stack.append(x) etc.
That way you could do away with OO completely.
Umm. Even if you were to write that, self and
Alex Marandon [EMAIL PROTECTED] wrote:
Alexnb wrote:
I am wondering, is there a simple way to test for Internet connection? If
not, what is the hard way :p
Trying to fetch the homepage from a few major websites (Yahoo, Google,
etc.)? If all of them are failing, it's very likely that the
Guys,
I'm trying to help trace when instances of particular classes are being
destroyed by the garbage collector and thought the cleanest way would be to
implement a logging call in __del__() on the class. However, I'm having an
issue.
I inject a logger instance into my class upon
how can i save my command prompt screen?
--
http://mail.python.org/mailman/listinfo/python-list
Robert Rawlins wrote:
I then get the following exception thrown when running my code:
When the application is running, or when it is shutting down?
Traceback (most recent call last):
File /usr/lib/python2.5/logging/handlers.py, line 73, in emit
if self.shouldRollover(record):
File
Thomas Troeger wrote:
I want to embed a Python application on a device with limited
resources, esp. storage limitations. Is there a way to reduce the
Python interpreter to a set of modules that's urgently needed?
Of course there is. What is the target platform ?
What can be done is to go
I've been tossing this idea in my mind for some time now:
In Python, declaring a variable using the global statement automatically
makes it available in all subsequent scopes.
But to me, it makes more sense to use the global statement to 'import' a
variable from the global scope into the
Anonymous Bastard wrote:
I've been tossing this idea in my mind for some time now:
In Python, declaring a variable using the global statement automatically
makes it available in all subsequent scopes.
But to me, it makes more sense to use the global statement to 'import' a
variable from the
Hi all,
I need a recommendation. I would to like to use the logging module to
create log messages the following way:
a) Every log message does go to a admin sink.
b) The logging of special messages should go to the admin sink AND to
a sink specifically for
a certain addressee.
c) I don't want to
Hi;
Forgive multiple posts in one day: online very infrequently
I set the following variables:
# Headers are kept in order to determine nesting of chapters
# They are labeled according to font size
h36 = ''
h26 = ''
h22 = ''
h18 = ''
h14 = ''
h12 = ''
header_sizes = [36, 26, 22, 18, 14, 12]
# Size
Hi;
Forgive multiple posts in one day: online very infrequently
Why am I getting this error?
import os
dir_dict = {6:36, 5:26, 4:22, 3:18, 2:14, 1:12}
cur_dir = os.getcwd()
dirs = os.path.split(cur_dir)
len = len(dirs)
type(len(dirs))
Traceback (most recent call last):
File pyshell#11, line 1,
Hi;
Forgive multiple posts in one day: online very infrequently
I'm having the darndest time trying to figure out how the character '\b0' is
being read in ('\x0c')
test = re.search('(?=\\b)[0]', '\x0c0')
test.group(0)
'0'
type('\x0c')
type 'str'
import binascii
binascii.unhexlify('\x0c')
Hi Hartmut,
I can sympathise with you on this one...
There are a few options...
there is a python based bake make like program... that is useful...
http://projects.bertram-scharpf.de/bake/bake1.html
then there is Wine... that is a windows emulator under linux... that
might be pretty
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
The function of the global keyword is to 'push' local variables to the
global scope. If you want to 'import' a variable into a local scope,
pass the variable to your function/method as an argument.
Anonymous Bastard wrote:
I've been tossing this
Hi,
I want to embed a Python application on a device with limited
resources, esp. storage limitations. Is there a way to reduce the
Python interpreter to a set of modules that's urgently needed?
Of course there is. What is the target platform ?
Thanks for your answer. The plattform is
On Jul 15, 5:57 am, Anonymous Bastard [EMAIL PROTECTED] wrote:
I've been tossing this idea in my mind for some time now:
In Python, declaring a variable using the global statement automatically
makes it available in all subsequent scopes.
But to me, it makes more sense to use the global
pyogp is a Python-based virtual worlds test harness and client library
being developed by Linden Lab, makers of Second Life, and members of the
SL Architecture Working Group, in order to test the Open Grid Protocols
that were used in the recent proof of concept demo by IBM and Linden
Lab, that
On Tue, Jul 15, 2008 at 5:51 AM, Thomas Troeger
[EMAIL PROTECTED] wrote:
Or is there a method to have gzipped
modules that are unzipped on the fly into memory when they're accessed? That
would be even better.
Yes. See the documentation for the zipimport module, and PEP 273.
Troeger, Thomas (ext) wrote:
Thanks for your answer. The plattform is x86, so basically it's a PC
with a compact flash drive. The problem is that the compact flash is
rather limited in speed and size (there is other stuff on it too).
Oh ok. Well just keep in mind that 4GB of flash memory can
On 2008-07-12 22:35:58 +0100, maestro [EMAIL PROTECTED] said:
http://www.youtube.com/watch?v=PXpwC1o5AcI
I have done some GUI-programming for windows with Python but the
Tkinter interface sucked and while it is the only one I tried I got
the impression they are all the same.
It's amazing how
The Pyglet library has all the functionality of pygame, but is smaller
and much more self-contained. Pygame requires SDL, pyglet only OpenGL.
On Jul 15, 2008, at 6:26 AM, Uwe Schmitt wrote:
On 15 Jul., 12:14, Thomas Troeger [EMAIL PROTECTED]
wrote:
Kay Schluehr wrote:
On 15 Jul., 11:51,
On Jul 14, 11:16 pm, Larry Bates [EMAIL PROTECTED] wrote:
Vinay,
Thanks for your detailed explanation, but IMHO your suggested solution is
almost
the opposite (right idea wrong direction) of what I'm looking for.
Hypothetical
setup:
application1 - SocketHandlerloggingturned on
Hi! I am slowly teaching myself Python. I was reading David Beazley's
excellent book Python - Essential Reference; in particular about
variables. Let me quote:
Python is a dynamically typed language in which names can represent
values of different types during the execution of a program.
On Jul 15, 1:27 pm, McA [EMAIL PROTECTED] wrote:
Hi all,
I need a recommendation. I would to like to use theloggingmodule to
create log messages the following way:
a) Every log message does go to a admin sink.
b) Theloggingof special messages should go to the admin sink AND to
a sink
On 15 juil, 01:24, [EMAIL PROTECTED] wrote:
Greetings.
I am looking for a way to achieve method behavior for a class I
created. That is, it has a __call__ method, so can be called like a
function. But I also want it to be treated as a method when it appears
in a class body.
You need to
Hi! I am slowly teaching myself Python. I was reading David Beazley's
excellent book Python - Essential Reference; in particular about
variables. Let me quote:
Python is a dynamically typed language in which names can represent
values of different types during the execution of a program. In
On Jul 15, 1:51 pm, Robert Rawlins
[EMAIL PROTECTED] wrote:
Am I right in thinking that Python destroys instances of classes when it
deems they are no longer needed? I shouldn't have to explicitly delete the
classes, right?
Python uses reference counting with a cycle detector, but the
Hi everyone,
I've heard that a 'str' object is immutable. But is there *any* way to
modify a string's internal value?
Thanks,
Sebastian
--
http://mail.python.org/mailman/listinfo/python-list
Victor wrote...
# del is used to determine if should reset the lower header values to ''
del = 0
Apart from many other things that spring to mind, I already see an obvious
flaw: 'del' is a keyword, or a 'reserved word' in Python. It is used to
remove variables from the namespace. Tip: Use some
On Mon 14 Jul 2008 09:25:19 AM EDT, Vinay Sajip wrote:
Is your package a library or an application? If it's a library, you
should avoid configuring logging using a config file - this is because
logging configuration is process-wide, and if multiple libraries use
fileConfig to configure their
Victor wrote...
len = len(dirs)
The function 'len' is a built-in function in Python. If you assign an
integer to the name 'len', that will replace the function with an int. And
you can't call an int.
My suggestion: Do not use 'len' as a variable name. Use something else, like:
[EMAIL PROTECTED] writes:
I've heard that a 'str' object is immutable. But is there *any* way to
modify a string's internal value?
If there were, it would not be immutable. The 'str' type has only
immutable values.
You could implement your own string type, and have it allow mutable
values.
Victor wrote...
import binascii
binascii.unhexlify('\x0c')
TypeError: Odd-length string
What gives here?
The function unhexlify() wants an even-length string. From the online help:
help(binascii.unhexlify)
unhexlify(...)
a2b_hex(hexstr) - s; Binary data of hexadecimal representation.
Thank you so much for all your advice. I have learnt a lot.
In the end, the solution was perhaps self evident. Why try and build a
huge string AND THEN write it to file when you can just write it to
file? Writing this much data directly to file completed in ~1.5
seconds instead of the 3-4 seconds
Sebastian:
I've heard that a 'str' object is immutable. But is there *any* way to
modify a string's internal value?
No, but you can use other kind of things:
s = hello
sl = list(s)
sl[1] = a
sl
['h', 'a', 'l', 'l', 'o']
.join(sl)
'hallo'
from array import array
sa = array(c, s)
sa
Hello pythoners,
When I create temporary file using the tempfile module, and forkI)
later on in my program, I always see errors when the program exits. Is
this because the child process deletes temp file?
Here's a stripped down version of my script that exhibits this
problem:
#!/usr/bin/python
Vinay Sajip wrote:
On Jul 14, 11:16 pm, Larry Bates [EMAIL PROTECTED] wrote:
Vinay,
Thanks for your detailed explanation, but IMHO your suggested solution is almost
the opposite (right idea wrong direction) of what I'm looking for. Hypothetical
setup:
application1 -
My company distributes a COM object that can be license and userd by
our customers. Some of my company's internal application also use the
COM object. However, for internal applications, instead of licensing
the COM object, we just make the application registered as friendly.
We accomplish this be
Joel Koltner [EMAIL PROTECTED] wrote:
I normally use str.split() for simple splitting of command line arguments, but
I would like to support, e.g., long file names which-- under windows -- are
typically provided as simple quoted string. E.g.,
myapp --dosomething --loadthis my file name.fil
Peter Anderson wrote:
Hi! I am slowly teaching myself Python. I was reading David Beazley's
excellent book Python - Essential Reference; in particular about
variables. Let me quote:
Python is a dynamically typed language in which names can represent
values of different types during the
Ack, .bat files! Yes, you are correct Windows does not ship with Python, and
there are ways to get bash (cygwin) on your Windoze system. I am leaning
towards a solution similar to your second suggestion as it will keep me from
having to distribute .bat files for one platform and .sh files for
Ahh, Win-BASH cool!!!
On Tue, Jul 15, 2008 at 10:41 AM, Aquil H. Abdullah
[EMAIL PROTECTED] wrote:
Ack, .bat files! Yes, you are correct Windows does not ship with Python,
and there are ways to get bash (cygwin) on your Windoze system. I am
leaning towards a solution similar to your second
On Jul 15, 10:13 am, Nick Dumas [EMAIL PROTECTED] wrote:
The function of the global keyword is to 'push' local variables to the
global scope. If you want to 'import' a variable into a local scope,
pass the variable to your function/method as an argument.
Anonymous Bastard wrote:
I've been
Ward wrote...
Can we rebuild Python.exe to include the various version
information?
Why rebuild it? You can use a resource editor tool to add/edit/delete the
VERSIONINFO from any Windows executable, including Python.exe ;-)
Greetings,
--
The ability of the OSS process to collect and
Hi,
Its one of those days. I cannot solve this. Any help would be greatly
appreciated!
When I execute this:
class Db(object):
def insertAccount(self, date, accountNumber, description,
openingBalance):
dec = decimal.Decimal(openingBalance)
db = MySQLdb.connect(host=localhost,
Hi to everyone,
I'm rather a Python newbie, so I've put myself a question. Are these two
statements (performance-wise) equal?
r Text
and
Text
I mean using the raw flag speeds up things because the interpreter
doesn't need to look after escape sequences? Or it's rather optimized?
I'm
Hi all,
I have come across an error while using zipfile and I can't seem to
find somewhere that explains the problem. My script needs to be able
to take text files from one drive and add them to zip files on another
drive. The following seems to work just fine.
import zipfile
# write test file
Hi,
I've compiled python 2.5.2 on red hat r4 and got this installation error:
mtl-p1892:[Python-2.5.2] 1make install
...
Compiling
/BuildViews/python252build/Python2.5.2.bin/lib/python2.5/test/test_module.py ...
Dear All,
For some time now, I have been working with the ctypes module on
Windows. First I got my hands on a library developed with Delphi 7.
That library is exporting plain functions. Internally, reference is
made to the instance of a class, which is instantiated in a kind of
initialization
Ben Finney-2 wrote:
Alexnb [EMAIL PROTECTED] writes:
I am wondering, is there a simple way to test for Internet
connection? If not, what is the hard way :p
Refine the question: What do you mean by internet? It isn't a single
entity.
Do you mean some particular internet host
On Jul 15, 7:42 am, Michiel Overtoom [EMAIL PROTECTED] wrote:
Why rebuild it? You can use a resource editor tool to add/edit/delete the
VERSIONINFO from any Windows executable, including Python.exe ;-)
M,
Thanks for you suggestion. I didn't know that there was anything like
a resource editor
Peter Anderson wrote:
Hi! I am slowly teaching myself Python. I was reading David Beazley's
excellent book Python - Essential Reference; in particular about
variables. Let me quote:
Python is a dynamically typed language in which names can represent
values of different types during the
On Tue, 15 Jul 2008 18:14:15 +0300, Alexandru Palade wrote:
I'm rather a Python newbie, so I've put myself a question. Are these two
statements (performance-wise) equal?
r Text
and
Text
I mean using the raw flag speeds up things because the interpreter
doesn't need to look after
On Tue, 15 Jul 2008 23:54:46 +1000, Peter Anderson wrote:
Python is a dynamically typed language in which names can represent
values of different types during the execution of a program. In fact the
names used in the program are really just labels for various quantities
and objects. The
If you can define exactly what you mean by internet connection, the
test for it becomes correspondingly easier.
Well, really I just need to figure out if I am able to connect
to one site. That site is dictionary.com.
Then use urllib2 to try to fetch a page from dictionary.com. If
it works,
Troeger Thomas (Ext) wrote:
Alex Marandon wrote:
Alexnb wrote:
I am wondering, is there a simple way to test for Internet connection?
If
not, what is the hard way :p
Trying to fetch the homepage from a few major websites (Yahoo, Google,
etc.)? If all of them are failing, it's very
I think it is. I got a bundle of Python named EnthoughtPython and the
version string gave something different from original Python.
--
NOAGBODJI Paul Victor
--
http://mail.python.org/mailman/listinfo/python-list
dp_pearce wrote:
Hi all,
I have come across an error while using zipfile and I can't seem to
find somewhere that explains the problem. My script needs to be able
to take text files from one drive and add them to zip files on another
drive. The following seems to work just fine.
import zipfile
Ty hensons wrote:
how can i save my command prompt screen?
(Trying to be helpful here...)
What do mean by save and what do you mean
by command prompt screen? And, especially,
what platform are you running on?
TJG
--
http://mail.python.org/mailman/listinfo/python-list
patrol wrote:
Situation (2):
result = new_process.terminate()
File C:\Python25\lib\wmi.py, line 494, in __getattr__
handle_com_error (error_info)
File C:\Python25\lib\wmi.py, line 190, in handle_com_error
raise x_wmi, \n.join (exception_string)
UnicodeDecodeError: 'ascii' codec
Hi Vinary,
thank you for answering. I start be proud that the author of
the logging package himself is answering. :-)
On 15 Jul., 15:51, Vinay Sajip [EMAIL PROTECTED] wrote:
On Jul 15, 1:27 pm, McA [EMAIL PROTECTED] wrote:
Add a handler to the root logger (or common_logger) to send to the
On Jul 15, 9:53 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
On 15 juil, 01:24, [EMAIL PROTECTED] wrote:
Greetings.
I am looking for a way to achieve method behavior for a class I
created. That is, it has a __call__ method, so can be called like a
function. But I also want it to be
patrol wrote:
Situation (1):
result = new_process.terminate()
TypeError: 'int' object is not callable
I'm not sure exactly what's causing that
particular effect, but I would suggest that
you call the method as .Terminate (note the
initial capital). On my box, calling .terminate
simply
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
def isPrime(nbr):
for x in range(2, nbr + 1):
if nbr % x == 0:
break
if x == nbr:
return
When I saw Permission denied, this was my suspicion. And I think you
are very right. I have just gone back and tried writing to a file
outside of C:, in this case C:/output/, and it seems to work again.
Would I be right in guessing there is no way around this?
Dan
--
dp_pearce wrote:
When I saw Permission denied, this was my suspicion. And I think you
are very right. I have just gone back and tried writing to a file
outside of C:, in this case C:/output/, and it seems to work again.
Would I be right in guessing there is no way around this?
Well, you could
On Jul 15, 7:57 am, Anonymous Bastard [EMAIL PROTECTED] wrote:
I've been tossing this idea in my mind for some time now:
In Python, declaring a variable using the global statement automatically
makes it available in all subsequent scopes.
But to me, it makes more sense to use the global
I'm running python 2.5 (or 2.4) in an XP environment.
I downloaded and installed the .dll's from
OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in
c:/windows/system32 as instructed
now I get this error. Is there anyway to avoid building the python_ldap
binaries? Apart from
defn noob wrote:
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
def isPrime(nbr):
for x in range(2, nbr + 1):
if nbr % x == 0:
break
if x ==
Hey all.
My thanks to all who have responded so far with my other questions. It
is much appreciated.
Some background on what I'm doing (a good explanation can be found at
http://www.hazelwood.k12.mo.us/~grichert/sciweb/phys8.htm): When
measuring, there is some uncertainty as to the
Sells, Fred wrote:
I'm running python 2.5 (or 2.4) in an XP environment.
I downloaded and installed the .dll's from
OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in
c:/windows/system32 as instructed
now I get this error. Is there anyway to avoid building the python_ldap
[EMAIL PROTECTED] [EMAIL PROTECTED]:
When I create temporary file using the tempfile module, and forkI)
later on in my program, I always see errors when the program exits. Is
this because the child process deletes temp file?
Here's a stripped down version of my script that exhibits this
Hello! I am writing some software that will have many users accessing
the same file resource at once for reading purposes only. I am
programming on (Ubuntu) Linux and my question is in Windows, can I
have it so that the same file can be open in read mode by more than
one person or could Window's
defn noob wrote:
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
def isPrime(nbr):
for x in range(2, nbr + 1):
if nbr % x == 0:
break
On Jul 15, 11:26 am, defn noob [EMAIL PROTECTED] wrote:
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
def isPrime(nbr):
for x in range(2, nbr + 1):
if
maestroQC wrote:
cursor.execute(INSERT INTO es_accounts (dateCreated,
accountNumber, description, openingBalance) VALUES (%s, %s, %s
, %d), (date, accountNumber, description, dec))
File c:\python25\lib\site-packages\MySQLdb\cursors.py, line 151,
in execute
query = query %
Sparky wrote:
Hello! I am writing some software that will have many users accessing
the same file resource at once for reading purposes only. I am
programming on (Ubuntu) Linux and my question is in Windows, can I
have it so that the same file can be open in read mode by more than
one person or
On Jul 15, 7:28 pm, Mensanator [EMAIL PROTECTED] wrote:
On Jul 15, 11:26 am, defn noob [EMAIL PROTECTED] wrote:
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
On Jul 15, 12:28 pm, Andreas Tawn [EMAIL PROTECTED] wrote:
defn noob wrote:
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
def isPrime(nbr):
for x in
1 - 100 of 296 matches
Mail list logo