developer with too much work on his/her plate that wants some
paid help and is willing to point me in the right direction.
cheers
Shane
--
https://mail.python.org/mailman/listinfo/python-list
inding the first instance of 'sf'. I hope that was
clear :)
Thanks,
Shane
--
http://mail.python.org/mailman/listinfo/python-list
he os module where I should start?
Thanks,
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Simon Brunning wrote:
> I wouldn't have thought either of those was suitable for a
> non-programmer. Great for cross-trainers, yes, but neither is intended
> as a programming tutorial.
I agree, I just thought that the other replies had provided more than
enough resources to cover the basics, so I
Hi,
When one writes,
> className='Employee'
> baseClasses = ...
> dictionary = { ... }
> newClass = type( className, , dictionary)
in what module does newClass belong? If it's the current module what
code
do I run to print out the name of that module in a.b.c... form?
Related: If I want to make
In the following t,t1 are the result of built-in call type() -- the
form that takes three arguments.
Therefore they are classes. Consider the following output:
print type(t)
>
print id(t)
>1234567
print t.__module__
>a.b.t.d
print type(t1)
>
print id(t1)
>1234568
print t1.__module__
>a.b.t.d
I n
Normally if one has a code set under a directory "top_level" like
this:
top_level:
__main__.py
a
__init__.py
b
__init__.py
then this directory structure is naturally satisfies this line in
__main__.py:
>import a.b
But support, for some stupid reason --- say a.b is use
On Oct 16, 11:55 pm, Steven D'Aprano wrote:
> On Sun, 16 Oct 2011 19:43:20 -0700, Shane wrote:
> > Normally if one has a code set under a directory "top_level" like this:
>
> > top_level:
> > __main__.py
> > a
> > __init__.py
&
Need to refine a question I asked earlier. If I have a module,
|-- foo
|---|
|---|---bar
|---|---|
|---|---|---__init__.py
then I can say import foo.bar
But suppose I want to import foo.bar.stuff and stuff isn't located on
under `bar' because it's user
supplied code:
|-
opies of the code running
on different boxes with synchrounous (maybe asychronous)
communication.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Hi I am a newbie for Python
Here is a question, say I have a list L,
function foo is:
def foo(L):
if L[0] > 0: return True
if later I want another function goo which returns "True" when L[0]
and L[1] are both > 0, i.e.,
def goo(L):
if L[0] > 0 and L[1] > 0: return True
Can anybody tel
I'm new to Python, so I'll try to be clear about my problem.
I'm using Python 3.1 (latest stable version from python.org) on
Windows 7.
I have a program using tkinter for UI, and it works properly from both
pything GUI shell, and running from command prompt, EXCEPT that I have
a menu command to in
On Apr 26, 11:58 am, Lie Ryan wrote:
> On 04/27/10 03:50, Peter Otten wrote:
>
> > It is a bit unfortunate that your editor has side effects on your program,
> > and I recommend that you never trust the result of importing a module from
> > within idle's shell completely.
>
> In fact, never trust
What do I need to do to successfully install a package onto python so that I
can use it as a module?
I have tried in terminal in the correct directory "python2.7 ./setup.py
install" but it says permission denied.
Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$ python2.7.1
./se
Hi Python Google Group! I hope someone could help me and then one day when I am
good I can contribute to the forum as well. Does anyone know what is wrong with
my syntax here as I am trying to submit this form using MultipartPostHandler
that I installed?
import MultipartPostHandler, urllib2
p
consuming hurdles.
As far as money goes, I am open to reasonable offers.
cheers
Shane
--
https://mail.python.org/mailman/listinfo/python-list
the emails actually
contain an encoded message for an anonymous recipient, and he writes
stuff designed to get past filters. If I were a spy, I might do the
same thing... but I'd use language less likely to get me booted from the
list. ;-)
Shane
--
http://mail.python.org/mailman/listinfo/python-list
I've been writing Python-related articles on my weblog, and I thought
planet.python.org might be interested in including them. Does anyone
know how to submit a feed to the aggregator?
http://hathawaymix.org/Weblog/rss20.xml?categories:list=Python
Shane
--
http://mail.python.org/ma
http://www.python.org/doc/Intros.html
and two great texts when she has covered the basics are:
http://diveintopython.org/
http://www.mindview.net/Books/TIPython
--
http://mail.python.org/mailman/listinfo/python-list
my application with it. I switched to the command line
interface to isolate my application from problems in
Graphics/ImageMagick. Everything ended up much more robust that way,
and the time cost is small--it's on the order of milliseconds.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
ire for new builtins, since modules will be just
as accessible as builtins.
Thoughts?
Shane
--
http://mail.python.org/mailman/listinfo/python-list
rt using
idioms that are completely different from standard Python usage; my code
would become unmaintainable. Thus a prerequisite for using inline
import is broad approval.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Benji York wrote:
> OK, good. You won't have to worry about that. :)
You didn't give a reason for disliking it.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Xavier Morel wrote:
> Shane Hathaway wrote:
>
>>Thoughts?
>
>
> >>> import re; name_expr = re.compile('[a-zA-Z]+')
> >>> name_expr
> <_sre.SRE_Pattern object at 0x00F9D338>
> >>>
>
> the import statement can be
Mike Meyer wrote:
> Shane Hathaway <[EMAIL PROTECTED]> writes:
>>I'd like a way to import modules at the point where I need the
>>functionality, rather than remember to import ahead of time. This
>>might eliminate a step in my coding process. Currently, my proc
Mike Meyer wrote:
> Shane Hathaway <[EMAIL PROTECTED]> writes:
>>That syntax is verbose and avoided by most coders because of the speed
>>penalty.
>
>
> What speed penalty? "import re" is a cheap operation, every time but
> the first one in a program.
Kent Johnson wrote:
> Shane Hathaway wrote:
>>I'm talking about using imports *everywhere*. The penalty would be
>>appreciable.
>
>
> Have you tried it?
>
> D:\Projects\CB>python -m timeit -s "import re" "import re"
> 100 loops,
cans each module and updates the import
statements, subject to my approval? Maybe someone has worked on this,
but I haven't found the right Google incantation to discover it.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Shane Hathaway wrote:
>> The structure of the Java language makes this relatively easy.
>>
>
> And there's so much more busywork in Java that it's probably worth
> automating. See
>
>http://www.artima.com/weblogs/viewpost.jsp?
Jean-Paul Calderone wrote:
> On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>>How about PyLint / PyChecker? Can I configure one of them to tell me
>>only about missing / extra imports? Last time I used one of those
>>tools, it spewed ex
Chris Mellon wrote:
> On 12/10/05, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>>I'm surprised this problem isn't more familiar to the group. Perhaps
>>some thought I was asking a newbie question. I'm definitely a newbie in
>>the sum of human knowledge, bu
articular spot.
I feel like this has resulted in a lot fewer infinite loops in my own
code. Now I believe that any loop that can't be represented well with
"for" or a conditional "while" has enough inherent complexity to justify
a warning sign, and "while True" has bright yellow flashing lights all
over it. Thus I'm quite in favor of the status quo.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
lt in, so
timeoutsocket.py is no longer needed. See the documentation on
socket.Socket.settimeout().
Shane
--
http://mail.python.org/mailman/listinfo/python-list
and 3 seconds doing pure computation, you should
expect time.time() to show 5 that seconds elapsed, and time.clock() to
show that the CPU was consumed by your program for 3 seconds.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Magnus Lycka wrote:
> Shane Hathaway wrote:
>
>>time.time() measures real time, while time.clock() measures the time the
>>CPU dedicates to your program.
>
>
> I suppose that varies with the platform... "help(time.clock)" says:
>
>
king urllib use
getresponse() instead of getfile()? Would the changes be accepted? Is
anyone else working on something similar?
BTW, this is on Python 2.3.5, but I haven't spotted any changes between
Python 2.3.5 and current CVS that would have fixed the problem. I'll
start trying Pytho
a = 1
b = 2
Using an ellipsis in a statement that would begin a different kind of
block is illegal and generates a syntax error. Note that this usage
seems to fit well with the definition of "ellipsis".
http://dictionary.reference.com/search?q=ellipsis
Shane
--
http://mail.python.org/mailman/listinfo/python-list
f onmouseout(event):
self.textBox.setText("Too shy. Goodbye.")
def onclick(event):
self.textBox.setText("Ouch!")
oncontextmenu = self.oncontextmenu
Shane
--
http://mail.python.org/mailman/listinfo/python-list
rks
> (worked under linux and win as well for me)
+1. I've had a lot of success with XRCed, but no success with wxGlade.
The UI in XRCed needs polish but it's easy enough to use. Also,
wxGlade wants to spew generated Python code, while XRCed generates a
nice resource
(If it
doesn't, the result of the expression is falsecase.) So I would write
the cssClass assignment like this:
cssClass = (hoursOld < 12) and 'rssLinkNew' or 'rssLink'
The C equivalent is more readable, but this is close enough. It's the
same trick people use in shell scripts.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
r a Friday. Too bad it comes to an abrupt
"temporary end".
Shane
P.S. I hope I didn't hammer your server on step 3. I was missing the
mark. :-)
--
http://mail.python.org/mailman/listinfo/python-list
darren kirby wrote:
> quoth the Shane Hathaway:
>
>>pythonchallenge wrote:
>>
>>>For the riddles' lovers among you, you are most invited to take part
>>>in the Python Challenge, the first python programming riddle on the net.
>>>
I have the following sample from a data set and I am looking to split the
address number and name into separate headings as seen below.
FarmID Address
1 1067 Niagara Stone
2 4260 Mountainview
3 25 Hunter
4 1091 Hutchinson
5 5172 Green Lane
6 500 Glenridge
7
> I don't have any code to split that part up. There is other information
> following the street name such as street suffix, city, province, postal code,
> etc. I have been able to split the rest of it up based on certain criteria
> but have had no luck with splitting up the street name from th
inHandler = open(inFile, 'r')
outHandler = open(outFile, 'w')
outHandler.write('ID\tAddress\tStreetNum&Name\tSufType\tDir\tCity\tProvince\tPostalCode\n')
for line in inHandler:
str = line.replace('FarmID\tAddress','')
outHandler.write(str[0:-1])
str = str.replace(', ON', '\t ON\t')
So, by introducing this collaboration mechanism with a syntax that defines it
as sending and receiving things that are *not* arbitrary objects, the language
would naturally reinforce a more thoroughly decoupled architecture?
Sent from my iPad
On Mar 17, 2013, at 8:53 PM, Mark Janssen wrote:
Benji York wrote:
> Shane Hathaway wrote:
>
>> Benji York wrote:
>>
>>> OK, good. You won't have to worry about that. :)
>>
>>
>> You didn't give a reason for disliking it.
>
>
> Oh, I don't particularly dislike it.
r whitespace.) It's way too tricky for my taste, but it's fun to
play anyway. Has anyone done better so far? Here's a hint on my
strategy: the code contains three large integers. :-)
Also, here's another cheat version. (No, 7seg.com does not exist.)
import urlli
Tim Hochberg wrote:
> Paul McGuire wrote:
>
>>"Shane Hathaway" <[EMAIL PROTECTED]> wrote in message
>>news:[EMAIL PROTECTED]
>>
>>
>>>I'm down to 133 characters (counted according to 'wc -c') on a single
>>>line.
I just found a 125 character solution. It's actually faster and more
readable than the 133 character solution (though it's still obscure.)
It depends on Python 2.4. If Python 2.3 compatibility is required for
the contest, I have to add 4 characters.
Shane
[EMAIL PROTECTED] pyconte
Andrew Durdin wrote:
> On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>
>>I just found a 125 character solution. It's actually faster and more
>>readable than the 133 character solution (though it's still obscure.)
>
>
> Having spent a go
'j' variable. Good work.
> I'm off to try to figure out how to do it the other way now, before the
> code gets revealed.
We should have more contests like this. While the skills I applied for
the contest don't have much practical value, the mental exercise was great.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
entheses.
It's interesting that there seems to be no room for special cases. For
example, the top row has only two states and those states are not used
by the other rows. Therefore, the top row could be computed in a much
simpler way than the other two rows, and the other two rows could be
simpl
single modulus operation rather than shift and mask.
Brilliant strategy. Congratulations.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
the three spaces. If the code had been surrounded
by a "pre" tag, it would have rendered correctly.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
e about how our
minds work. The research could be valuable for AI.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
oot4072 Oct 3 12:35 bin/python2.4
-r-xr-xr-x 1 root root 1009832 Oct 3 12:35 lib/libpython2.4.so.1.0
Shane
--
http://mail.python.org/mailman/listinfo/python-list
I'm having trouble using Py2exe with a PyQT-based python project. Or
possibly I'm having a problem with PyQT and Py2exe makes it apparent.
Whichever it is, I run into trouble with importing QtCore and QtGui.
The error reported is:
Traceback (most recent call last):
File "xmlEdit.py", line 3, i
27;__module__', '__new__', '__reduce__',
> '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__']
>
> Hmmm.
Don't forget to file a bug.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> Shane Hathaway wrote:
>
>> Don't forget to file a bug.
>
> I'm reluctant to call it a bug just yet. Here's more stuff below.
> There's obviously a difference between old- and new-style classes. It
> seems that as far as new-sty
upplied build
of Python, the intruder may be able to inject arbitrary code.
I don't know if this concern applies to Starship specifically, but it
seems to apply to thousands of web sites running Python CGIs and Python
web servers.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Shane Hathaway wrote:
>
> > I don't know if this concern applies to Starship specifically, but it
> > seems to apply to thousands of web sites running Python CGIs and
> > Python web servers.
>
> so are we seeing thousands of we
mall set of objects using shared memory. POSH goes in that
direction, but I don't think it's simple enough yet.
http://modpython.org/
http://poshmodule.sourceforge.net/
Shane
--
http://mail.python.org/mailman/listinfo/python-list
;s fairly
hard. There's a discussion about it on Python-Dev right now.
> I guess you'd just copy however Java applets work? But run faster ;-)
More or less.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
you get to choose your own technologies and
versions. Several companies come to mind:
http://westhost.com/
http://jvds.com/
http://linode.com/
I'm using Westhost, which provides Python 2.2 if you ask for it, but I
compiled Python 2.4 instead. I didn't even have to ask whether I was
al
nce the
library search path is not modifiable at runtime. A possible workaround
is to launch a separate process which projects into the browser window.
I don't know what surprises may pop up on other platforms.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
you get to choose your own technologies and
versions. Several companies come to mind:
http://westhost.com/
http://jvds.com/
http://linode.com/
I'm using Westhost, which provides Python 2.2 if you ask for it, but I
compiled Python 2.4 instead. I didn't even have to ask whether I was
al
er I was
allowed to do that. :-)
Shane
--
http://mail.python.org/mailman/listinfo/python-list
Gregory Piñero wrote:
> Shane Wrote:
>> Ah, so you also want to distribute untrusted Python code. That's fairly
>> hard. There's a discussion about it on Python-Dev right now.
>
> Well, I want to write a game in Pygame, and people can just go to my
> website an
for a fee. Many Linux distributors depend on that right;
otherwise they wouldn't have the right to sell CDs.
IMHO your licensing terms are fine; you don't need to switch from the CC
license. Just avoid the term "free as in freedom", since the Free
Software Foundation has assigned that phrase a very specific meaning.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
bprocess.Popen("python", stdout=subprocess.PIPE, stdin=subprocess.PIPE)
> p.stdin.write('print 10\n')
> assert p.stdout.readline() == '10\n'
Make sure the pipes are unbuffered. Launch the process with "python -u"
and flush() the streams after writing.
inventing high level languages. Now
people are experimenting with high level compilers written in high level
languages. Where will this pattern lead? Who knows. :-)
Shane
--
http://mail.python.org/mailman/listinfo/python-list
llowing historical events; I was following the
trends of what programmers in general have used. Theory has always been
far ahead of practice... and generalizations are never correct. ;-)
Shane
--
http://mail.python.org/mailman/listinfo/python-list
d(c) for c in "HOLYBIBLE"])'
I'm Christian and I think it's funny. ;-) Some background:
http://scriptures.lds.org/rev/13/16-18#16
http://www.greaterthings.com/Word-Number/666HolyBible.htm
Shane
--
http://mail.python.org/mailman/listinfo/python-list
ification is what Carlos
needs.
If you're interested in using Linux, Carlos, "inotify" is a new kernel
module that can notify your program of filesystem changes. It's not
folded into the mainline kernel yet, but it's a clean patch.
http://www.edoceo.com/creo/inotify/
I don
, omitting destruction issues:
class Integer
{
private:
int value;
public:
Integer(int v) { value = v; }
int asInt() { return value; }
}
void test()
{
Integer *a, *b;
a = new Integer(2);
b = a;
b = new Integer(0);
}
In that light, do you see why a is still 2?
Shane
--
http://mail.python.org/mailman/listinfo/python-list
me swallowed
the exception, some segfaulted, and one deadlocked. If I'm going to
rely on a dbm module, I really need to know what it's going to do when
it hits an exceptional condition. Thus anydbm seemed like a bad choice.
Shane
--
http://mail.python.org/mailman/listinfo/python-list
ible with Qt also.
> So, perhaps (which I don't know) Aqua buttons simply don't permit
> absolute stuff ?
> Or the Aqua programmers read the user interface guidelines carefully ?
>
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-
Sergiy wrote:
> print 1 / 2
> print -1 / 2
>
> 0
> -1
>
> correct?
Yes. It works like the floor() function.
>>> import math
>>> math.floor(1.0 / 2)
0.0
>>> math.floor(-1.0 / 2)
-1.0
Shane
--
http://mail.python.org/mailman/listinfo/python-list
t_name
if __name__ == '__main__':
sys.argv.append('-cl')
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed()
print "Please set these variables: project_name, group_name ...and
then type create()"
### I even tried to put all my
ipshell() #
Watch television online now for free.
Includes television channels from all over the world and sport events
from all over the world including, NBA, Soccer, Motor Racing and much
more.
http://homepage.ntlworld.com/louise.randall41
--
http://mail.python.org/mailman/listinfo/python-list
text
files is not possible.
I'm not completely understanding your problems here. Can you explain
why urllib.urlencode wouldn't work?
(http://docs.python.org/lib/module-urllib.html)
Thanks,
-Dave
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTE
jango and PyGame. Something you could point a newbie to and they
would be able to create "real" applications with, without needing to
download hundreds of dependencies.
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http:/
"for dummies" or "in x
(hours/days)" books. They can be decent introductory material, but
unless you are really really new to programming, you probably wouldn't
be getting enough information to justify the cost of the book (and a
lot of times they have a lot of bad pra
opersGuide.html.
-Carsten
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http://www.ncee.net
Leading the Campaign for Economic and Financial Literacy
begin:vcard
fn:Shane Geiger
n:Geiger;Shane
org:National Council on Economic
rest + [i]
import random
print random.choice(list(genpool(n=4, m=20)))
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http://www.ncee.net
Leading the Campaign for Economic and Financial Literacy
begin:vcard
fn:Shane Geiger
n:Ge
is it appropriate to use range() vs xrange(). From my
understanding, xrange() essentially gives you an iterator across a
range, so it should be used when iterating. Should you only use
range() when want to physically store the range as a list?
Thanks,
Drew
--
Shane Geiger
IT Director
National
Hi,
I have a small app which consist of a few .py files. Is there any way to
distribute it in jar like fashion as a single file I can just run python
on. I obviously look for platform independent solution.
Thx in advance, A.
"""
Author: Shane Geiger <[EMAIL PROTEC
tures/mail/>
alerts you the instant new Mail arrives. Check it out.
<http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolbar/features/mail/>
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http://www.ncee.net
Leading
eason.. it just won't exclude them.
I'd like to know why and how to fix it.
Thanks in advance.
Milton
Explore the seven wonders of the world Learn more!
<http://search.msn.com/results.aspx?q=7+wonders+world&a
) if el==2]
Bye,
bearophile
Thank you both, a little more cumbersome than I expected, but it does
the job! Thanks!
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http://www.ncee.net
Leading the Campaign for Economic and Financia
"list comprehension" can fast up things. Can you point out how to do
it in this case?
thanks a lot!
f = open('file.txt','r')
for line in f:
db[line.split(' ')[0]] = line.split(' ')[-1]
db.sync()
--
Shane Geiger
IT Director
Natio
t; " + f2
return ("no differences" in popen(cmnd).read())
This is needlessly slow, because one can stop comparing two files
after the first difference is detected. How should one check that
files are the same in Python? The files are plain text.
--
Shane Geiger
IT Director
'456','789', '123','456','789', .]
thanks.
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http://www.ncee.net
Leading the Campaign for Economic and Financial Literacy
begin:vcard
import re
line = '123456789123456789'
print re.findall('([0-9]{3})', line)
Shane Geiger wrote:
You don't even need regex.
def
split_seq(seq,size):
erent.
The one that comes with ubuntu edgy. Just
apt-get install mdbtools
or something, that's it.
I don't want to start a distro war here - but I always found the
RPM-based distros lacking, to say the least.
Diez
--
Shane Geiger
IT Director
National Council on Economic E
t there is no information on this in
the readme.txt, at the pycron website, or here in groups.
Does anyone know how to troubleshhot this? Thanks in advance.
Contacting the author?
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8
lue_circle, blue_square, red_circle, red_square
--
001,0,4,11,0
002 ...
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED] | 402-438-8958 | http://www.ncee.net
Leading the Campaign
ing as
Windows service and waiting for requests on a port (or Pyro object or Corba
object...).
No need for telnet/ssh connection, no logout problem.
Just care of possible security problems :-)
--
Shane Geiger
IT Director
National Council on Economic Education
[EMAIL PROTECTED]
ument to the join method, and the
delimiter is the string whose method is being called.
To further demonstrate (because I got a weird email that seemed to
think that my code didn't work):
import string
l = ['a','b','c']
string.join(l,',')
1 - 100 of 180 matches
Mail list logo