I'm trying to implement a script that tracks how much space certain
applications are using and send a metric to a statsd service for realtime
analysis however when running this code it nots forking multiple processes
its still running sequential at some point the forking was working but I
can't
You are given nn words. Some words may repeat. For each word, output its
number of occurrences. The output order should correspond with the input
order of appearance of the word. See the sample input/output for
clarification.
*Note:* Each input line ends with a *"\n"* character.
*Constraints:*
>From the following input
9
BANANA FRIES 12
POTATO CHIPS 30
APPLE JUICE 10
CANDY 5
APPLE JUICE 10
CANDY 5
CANDY 5
CANDY 5
POTATO CHIPS 30
I'm expecting the following output
BANANA FRIES 12
POTATO CHIPS 60
APPLE JUICE 20
CANDY 20
However my code seems be returning incorrect value
#!/usr/bin/env
Tried a few things but can't seem to get it right any help ?
let times = (...matrices) =>
matrices.reduce(
([a,b,c], [d,e,f]) => [a*d + b*e, a*e + b*f, b*e + c*f]
);
--
https://mail.python.org/mailman/listinfo/python-list
*I'm confused why the former function runs significantly faster when
wc1() builds the hash on a single pass and doesn't waste memory of
returning an array of strings? *
*I would think wc2() to be slower what's going on here? *
#!/usr/bin/env python
s = The black cat jump over the bigger black
I spent a few weeks looking at Go and have to say you can see a lot of
Python's influence in Go, however my question to this list for others who
are doing real work with Go and Python have you encountered any scenarios
in which Go outmatched Python in terms of elegance or performance?
--RB
--
I'm working on the following problem set from codingbat.com
http://codingbat.com/prob/p107863
Given 3 int values, a b c, return their sum. However, if one of the values
is 13 then it does not count towards the sum and values to its right do not
count. So for example, if b is 13, then both b and
Sent from my iPhone
On Feb 20, 2014, at 5:59 AM, Ferrous Cranus nikos.gr...@gmail.com wrote:
Τη Τετάρτη, 19 Φεβρουαρίου 2014 10:45:53 π.μ. UTC+2, ο χρήστης Wojciech
Łysiak έγραψε:
On 19.02.2014 09:14, Sujith S wrote:
Hi,
I am new to programming and python. I am looking for a
L
On Feb 25, 2014, at 8:27 PM, Karthik Reddy challakart...@gmail.com wrote:
Thank you,
but from by reaserch i got these requirements ..
Python, django, Twisted, MySQL, PyQt, PySide, xPython.
*Technical proficiency with Python and Django.
*Technical proficiency in JavaScript.
I would use something like fabric to automatically login to hosts via
ssh then parse the data myself to generate static HTML pages in a
document root.
Having a web app execute remote commands on a server is so wrong in many ways.
Sent from my iPhone
On Sep 11, 2013, at 8:56 AM, Jugurtha Hadjar
On Aug 3, 2013, at 12:37 AM, Alok Singh Mahor alokma...@gmail.com wrote:
Hello everyone,
few months back I started learning python and now I got nice familiarity. now
i want to use python for creating dynamic database driven websites. and I
dont want to use existing web frameworks for my
Die
On Wed, Jul 10, 2013 at 6:49 AM, oswaldclem oswaldc...@gmail.com wrote:
I'm planning on buying a used ATT iPhone 5 off of craigslist, and i've been
reading on how some people sell their iPhones to people and later on
blacklisting it, screwing the buyer over, or how people are mistakenly
I thought I read some where that strptime() will pad 0's for day's for some
reason this isnt working for me and I'm wondering if i'm doing something
wrong.
from datetime import datetime
dt = datetime.strptime('Apr 9 2013', '%b %d %Y')
dt.day
9
How can I get strptime to run 09? instead of 9
I'm using the fabric api (fabfile.org)
I’m executing my fab script like the following:
$ fab -H server set_nic_buffers -f set_nic_buffers.py
Traceback (most recent call last):
File /usr/lib/python2.7/site-packages/fabric/main.py, line 739, in main
*args, **kwargs
File
I would like some feedback on possible solutions to make this script run
faster.
The system is pegged at 100% CPU and it takes a long time to complete.
#!/usr/bin/env python
import gzip
import re
import os
import sys
from datetime import datetime
import argparse
if __name__ == '__main__':
On Apr 22, 2013, at 11:18 PM, Dan Stromberg drsali...@gmail.com wrote:
On Mon, Apr 22, 2013 at 6:53 PM, Roy Smith r...@panix.com wrote:
So, my real advice to you is to fire up the profiler and see what it
says.
I agree.
Fire up a line-oriented profiler and only then start trying to
I came across this article which sums up some of the issues I have with
modern programming languages. I've never really looked at Javascript for
anything serious or Node itself but I found this article really
informational.
The “Batteries included” philosophy of Python was definitely the right
Was it so hard to state in the email subject what the new version is
or describe in the body a small summary on what you've released? I
swear the users on this list post the most useless emails.
Sent from my iPhone
On Apr 9, 2013, at 7:12 AM, Jake D jhunter.dunef...@gmail.com wrote:
There's a
Pick the one you learn and know.
Sent from my iPhone
On Apr 3, 2013, at 2:17 AM, Alec Taylor alec.tayl...@gmail.com wrote:
SQLalchemy and Storm are a few of the popular ORMs out there.
Personally I have been using web2py's DAL.
Other than form generator availability, 'print as raw SQL',
No
On Sun, Mar 17, 2013 at 12:52 AM, Peng Yu pengyu...@gmail.com wrote:
Hi,
I want to get the indent level within the code. For example, I want to
print 1 within the while loop as the line is indented 1 level. Is it
possible to get it within python?
while 1:
#print the level of
On Thu, Feb 21, 2013 at 10:24 AM, Luca Bongiorni bongi...@gmail.com wrote:
Hi all,
Around I have found plenty useful sources about TCP transparent proxies.
However I am still missing how to make socket redirection.
What I would like to do is:
host_A -- PROXY -- host_B
^
$ hexdump -n4 -C $(which python) | awk '{print $2 $3 $4 $5 }'
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Feb 9, 2013 at 7:27 AM, sssdevelop sssdeve...@gmail.com wrote:
Are there any opensource alternatives to Splunk?
Need tool to analyze the log files..
This is highly off topic, however I'm using logstash + kibana for my log
analysis.
--
For the life of me I cant figure out why this exception is being thrown.
How could I use pdb to debug this?
$ python udp_local2.py server
File udp_local2.py, line 36
except:
^
SyntaxError: invalid syntax
#!/usr/bin/env python
import random, socket, sys
s =
On Friday, February 1, 2013, Charles Hoskinson wrote:
I'm developing an online course for beginning python programmers starting
from basic syntax through object oriented design and GUI. I'd like to
include some helpful community resources like Code Academy in the appendix
and I was wondering
On Jan 30, 2013, at 8:12 AM, Jorge Alberto Diaz Orozco
jaoro...@estudiantes.uci.cu wrote:
can someone give me a link to download pyrudp.
I tried here http://code.google.com/p/pyrudp/ but didn´t worked.
if someone can give me another idea it will be great to.
I´m traying to make a reliable
On Tue, Jan 29, 2013 at 11:55 PM, RichD r_delaney2...@yahoo.com wrote:
I read Wall Street Journal, and occasionally check
articles on their Web site. It's mostly free, with some items
available to subscribers only. It seems random, which ones
they block, about 20%.
Anywho, sometimes I use
On Friday, January 18, 2013, Ferrous Cranus wrote:
Τη Πέμπτη, 17 Ιανουαρίου 2013 5:14:19 μ.μ. UTC+2, ο χρήστης Joel Goldstick
έγραψε:
On Thu, Jan 17, 2013 at 9:09 AM, Roy Smith r...@panix.comjavascript:;
wrote:
In article
Can someone explain what's going on here.
def _build_magic_dispatcher(method):
def inner(self, *args, **kwargs):
return self.__dict__[method](*args, **kwargs)
inner.__name__ = method
return inner
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Jan 14, 2013 at 11:38 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Mon, 14 Jan 2013 23:00:16 -0500, Rodrick Brown wrote:
Can someone explain what's going on here.
def _build_magic_dispatcher(method):
def inner(self, *args, **kwargs):
return
On Fri, Jan 11, 2013 at 5:23 PM, Adelbert Chang adelbe...@gmail.com wrote:
Hi all,
I've been using Python for a while now but one of my concerns is if it is
possible to have some sort of dependency management (not sure if right
term) for Python?
In the Scala language there is the Simple
How can I make a class that has methods with attributes and other
functions?
I see a lot of code
I'm reading the documentation to Redhat's Satellite software which has a
XMLRPC interface and wrote the following code to test the api.
I would like to extend this code to support methods with
, MRAB pyt...@mrabarnett.plus.com wrote:
On 2013-01-09 20:13, Rodrick Brown wrote:
How can I make a class that has methods with attributes and other
functions?
I see a lot of code
I'm reading the documentation to Redhat's Satellite software which has a
XMLRPC interface and wrote
).get_sysname())
On Wed, Jan 9, 2013 at 5:18 PM, Rodrick Brown rodrick.br...@gmail.comwrote:
On Wed, Jan 9, 2013 at 4:34 PM, Matt Jones matt.walker.jo...@gmail.comwrote:
# Something like...
class SystemList(object):
def get_systemid(self):
return System Id: bleh
def get_running_kernel
Can someone provide an example why one would want to override __getattr__
and __getattribute__ in a class?
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Jan 7, 2013 at 11:19 PM, iMath redstone-c...@163.com wrote:
for example ,if I want to download this file ,how to implement the
download functionality by python ?
http://down.51voa.com/201208/se-ed-foreign-students-friends-16aug12.mp3
as for download speed ,of course ,the fast ,the
http://techcrunch.com/2012/12/07/dropbox-guido-van-rossum-python/
--
http://mail.python.org/mailman/listinfo/python-list
I believe this statement is correct given key differences do exist in
underlying implementations even though such differences may be highly
transparent to end users (developers).
On Mon, Nov 12, 2012 at 10:08 PM, Mark Lawrence breamore...@yahoo.co.ukwrote:
It seems pretty obvious from the error. Try installing the missing lib packages.
OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: cannot open shared
object file: No such file or directory
Sent from my iPhone
On Nov 9, 2012, at 11:22 AM, Jean Dubois jeandubois...@gmail.com wrote:
OSError:
On Oct 25, 2012, at 6:34 AM, Schneider j...@globe.de wrote:
Hi Folkz,
how can i create a SSH-Connection with python? I have to send some commands
to the remote host and parse their answers.
greatz Johannes
Fabric is the way to go!
--
http://mail.python.org/mailman/listinfo/python-list
--
On Oct 16, 2012, at 4:14 PM, Daniel Fetchinson
fetchin...@googlemail.com wrote:
Hi folks,
I'm using a stand alone window manager without gnome or kde or any
other de. But I still would like to have a system tray or notification
area and so far used stalonetray for this. Stalonetray is
On Oct 5, 2012, at 6:32 PM, Robin Krahl m...@robin-krahl.de wrote:
Hi all,
I need to execute untrusted scripts in my Python application. To avoid
security issues, I want to use a sandboxed environment. This means that the
script authors have no access to the file system. They may only
On Sun, Sep 30, 2012 at 8:58 AM, tcgo tomeu...@gmail.com wrote:
Hi!
I'm really new to Usenet/Newsgroups, but... I'd like to learn some new
programming language, because I learnt a bit of Perl though its OOP is
ugly. So, after searching a bit, I found Python and Ruby, and both of they
are
On Sep 23, 2012, at 12:42 PM, jimbo1qaz jimmyli1...@gmail.com wrote:
Am I missing something obvious, or do I have to manually put in a counter in
the for loops? That's a very basic request, but I couldn't find anything in
the documentation.
for idx in list of elm: print (idx)
i.e.. for idx
Go away troll!
Sent from my iPhone
On Sep 21, 2012, at 4:27 PM, gengyang...@gmail.com
gengyang...@gmail.com wrote:
Hello ,
I am currently using Python 3.2.3 . WHen I use the print function by typing
print Game Over , it mentions SyntaxError : invalid syntax . Any ideas
on what the
On Sep 21, 2012, at 5:59 PM, Ethan Furman et...@stoneleaf.us wrote:
Greetings!
What is the consensus... okay, okay -- what are some wide ranging opinions on
technologies that I should know if my dream job is one that consists mostly
of Python, and might allow telecommuting?
(Please
On Aug 25, 2012, at 10:22 PM, Christopher McComas
mccomas.ch...@gmail.com wrote:
Greetings,
I have code that I run via Django that grabs the results from various sports
from formatted text files. The script iterates over every line in the
formatted text files, finds the team in the
Sent from my iPhone
On Jul 29, 2012, at 12:07 PM, lipska the kat lip...@yahoo.co.uk wrote:
Pythoners
Firstly, thanks to those on the tutor list who answered my questions.
I'm trying to understand where Python fits into the set of commonly
available, commercially used languages of the
On Jul 29, 2012, at 8:54 PM, Andrew Berg bahamutzero8...@gmail.com wrote:
On 7/29/2012 7:12 PM, Rodrick Brown wrote:
Python is a glue language much like Perl was 10 years ago. Until the
GIL is fixed I doubt anyone will seriously look at Python as an option
for large enterprise standalone
I think you can use pythonw.exe which will read stdin and for any
input before closing.
(I read this a while back, ma guy here.)
Sent from my iPhone
On Jul 13, 2012, at 7:27 AM, summerholidaylearn...@gmail.com
summerholidaylearn...@gmail.com wrote:
On Friday, February 20, 2009 4:06:42 AM UTC,
On Jul 11, 2012, at 8:44 PM, Simon Cropper
simoncrop...@fossworkflowguides.com wrote:
On 12/07/12 00:06, Chris Gonnerman wrote:
I've held off announcing this until I was sure it was really stable;
it's been 19 days since I made the last change to it, so here goes.
PollyReports is my Python
What interfaces are available on the server process?
Sent from my iPad
On Apr 28, 2012, at 8:45 PM, kenk marcin.maksym...@googlemail.com wrote:
Hi,
I've got a server process written in C++ running on Unix machine.
On the same box I'd like to run multiple Python scripts that will
This proposal was suggested in 2001 and is only now being implemented. Why the
extended delay?
Sent from my iPhone
On Apr 7, 2012, at 3:32 AM, Alec Taylor alec.tayl...@gmail.com wrote:
Has been withdrawn... and implemented
http://www.python.org/dev/peps/pep-0274/
--
At my current firm we hire people who are efficient in one of the following and
familiar with any another C#, Java, C++, Perl, Python or Ruby.
We then expect developers to quickly pick up any of the following languages we
use in house which is very broad. In our source repository not including
#!/usr/bin/python
def main():
str1='this is a test'
str2='t'
print .join([ c for c in str1 if c not in str2 ])
print(str1.strip(str2))
if __name__ == '__main__':
main()
./remove_str.py
his is a es
his is a tes
Why wasnt the t removed ?
Sent from my iPhone
--
On Mar 22, 2012, at 3:53 PM, Arnaud Delobelle arno...@gmail.com wrote:
On Mar 22, 2012 7:49 PM, Rodrick Brown rodrick.br...@gmail.com wrote:
#!/usr/bin/python
def main():
str1='this is a test'
str2='t'
print .join([ c for c in str1 if c not in str2 ])
print
Pay a smart developer!
Sent from my iPhone
On Mar 7, 2012, at 4:46 AM, Dev Dixit devdixit1...@gmail.com wrote:
Please, tell me how to develop project on how people intract with
social networing sites.
--
http://mail.python.org/mailman/listinfo/python-list
--
LinkedIn is an excellent resource for finding great candidates, However your
problem might be because your searching for Python Developers why not hire
great programmers and have them learn Python?
Sent from my iPhone
On Feb 29, 2012, at 6:08 PM, Greg Harezlak g...@tinyco.com wrote:
Hello
On Tue, Feb 28, 2012 at 10:59 PM, scripts examples
example.scri...@gmail.com wrote:
Got a web site setup for solving euler problems in python, perl,
ruby and javascript.
Feel free to give me any feedback, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
--
I have a bunch of sub routines that run independently to perform various system
checks on my servers. I wanted to get an opinion on the following code I have
about 25 independent checks and I'm adding the ability to disable certain
checks that don't apply to certain hosts.
m = { 'a':
On Fri, Feb 10, 2012 at 2:28 PM, Vinay Sajip vinay_sa...@yahoo.co.ukwrote:
Sarge, a cross-platform library which wraps the subprocess module in
the standard library, has been released.
What does it do?
Sarge tries to make interfacing with external programs from your
On Feb 8, 2012, at 11:01 PM, Rita rmorgan...@gmail.com wrote:
I am building a small intranet website and I would like to use Python. I was
wondering if there was a easy and medium performance python based web server
available. I would like to run it on port :8080 since I wont have root
On Tue, Jan 24, 2012 at 1:06 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Mon, 23 Jan 2012 21:57:16 -0800, Rick Johnson wrote:
Here is a grep from the month of September 2011 showing the rampantly
egregious misuse of the following words and phrases:
* pretty
*
On Wed, Jan 18, 2012 at 10:27 AM, Alec Taylor alec.tayl...@gmail.comwrote:
http://docs.python.org/library/functions.html
x = [1, 2, 3]
y = [4, 5, 6]
zipped = zip(x, y)
zipped
[(1, 4), (2, 5), (3, 6)]
x2, y2 = zip(*zipped)
x == list(x2) and y == list(y2)
True
Alec can you explain
You would get more responses if you used one of those sites that displayed
the code right in the browser.
On Tue, Jan 17, 2012 at 12:26 PM, Jérôme jer...@jolimont.fr wrote:
Tue, 17 Jan 2012 08:48:13 -0800 (PST)
Rick Johnson a écrit:
On Jan 17, 8:16 am, Jérôme jer...@jolimont.fr wrote:
Can any idea help me figure out why the following output is sequential? I'm
running this example on a 4 core system.
I would expect the output to look random.
import _thread as thread
import time
class thread_counter(object):
def __init__(self, thr_cnt, sleep_int):
self.thr_cnt =
I have a class FooB that derives from FooA
i.e.
class FooB(FooA):
FooA.__init__(self,...)
Can someone explain why
Import FooA doesn't work and I need to use from FooA import FooA instead?
This puzzles me.
Thanks.
--
[ Rodrick R. Brown ]
http://www.linkedin.com/in/rodrickbrown
--
You could easily script this with popen calling secure shell to execute a
command and capture the output.
Sent from my iPhone
On Nov 15, 2011, at 7:04 AM, Roark suha...@gmail.com wrote:
Hi,
I am first time trying my hands on python scripting and would need
some guidance from the experts
$ man limits.conf
Sent from my iPhone
On Aug 31, 2011, at 8:33 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Twice in a couple of weeks, I have locked up my PC by running a Python 2.5
script that tries to create a list that is insanely too big.
In the first case, I
It's not the end of the world calm down I thought it was quite funny for a
friday joke!
Sent from my iPhone
On Aug 19, 2011, at 4:43 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Matty Sarro wrote:
That's great - but do they program in python?
Thanks for that, I
I'm having a hard time dealing with the following scenario
My class takes a hash like the following:
rdargs =
{'env:'prod','feed':'opra','hostname':'host13dkp1','process':'delta','side':'a','zone','ny'}
All the keys in this hash can be optional.
I'm having a hard time dealing with all 36
How about doing something like
host.name=%HOSTNAME%
Then when you parse in the value %HOSTNAME% from your configParser module you
do a pattern substitution of %HOSTNAME% with os.environ['HOSTNAME'].
Sent from my iPhone 4.
On Oct 14, 2010, at 7:57 PM, pikespeak krishnan.snowboar...@gmail.com
Trying to do something very trivial why is it failing
I've tried three approaches
1. os.system(/bin/cat %s | /bin/mail -s \'connection error\' %s %
(logFile,notifyList))
2. os.system(/bin/mail -s \'connection error\' %s %s %
(notifyList,logFile))
3. p1 = sp.Popen([/bin/cat, logFile],
I'm doing something like
today = datetime.date.fromtimestamp(1284584357.241863)
today.ctime()
'Wed Sep 15 00:00:00 2010'
Why isn't the time field being populated what I expect is to see something
like Wed Sep 15 2010 16:59:17:241863
--
[ Rodrick R. Brown ]
http://www.rodrickbrown.com
The easiest way to do this is to use the native OS tools readily available to
do the collection and log to a central location or if possible shared location
accessible by all systems, once you have all the data you want to feed into
your RDBMS you could easily parse these logs using python and
I have a fairly large file 1-2GB in size that I need to process line by line
but I first need to convert the file to text using a 3rd party tool that prints
the records also line by line.
I've tried using Popen to do this with no luck. I'm trying to simulate
/bin/foo myfile.dat
And as the
Anyone know why I'm getting the following error when trying to parse the
following string is there a better method to use?
#57=2010081708240065 - sample string passed to fmt_datetime
def fmt_datetime(tag57):
tag57 = tag57[3:len(tag57)]
year= int ( tag57[0:4] )
mon = int
Someone should port Perl's Benchmark.pm module to python that's such a useful
module to measure a functions execution time and CPU usage.
Sent from my iPhone 4.
On Jul 29, 2010, at 3:43 PM, Benjamin J. Racine bjrac...@glosten.com wrote:
I just use ipython's functions (that are themselves
Slurp the entire file into a string and pick out the fields you need.
Sent from my iPhone 4.
On Jul 21, 2010, at 10:42 AM, Brandon Harris brandon.har...@reelfx.com wrote:
I'm trying to read in and parse an ascii type file that contains information
that can span several lines.
Example:
Did you try emailing the author of this application?
2010/7/6 Jose Ángel Quintanar Morales ssq...@gmail.com
Hi, I'm sorry by my bad english.
I have a little problem with pygame.movie module when I try work whit him
show this problem
[josean...@qumax reproductor]$ python packbox.py
On Wed, Jun 9, 2010 at 5:01 AM, madhuri vio madhuri@gmail.com wrote:
sir what is the function of pprint???
could you please help me out with that
--
madhuri :)
rbr...@laptop:~$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type help, copyright, credits
Don't forget his little brother Go!
Sent from my iPhone 3GS.
On Feb 8, 2010, at 8:39 PM, AON LAZIO aonla...@gmail.com wrote:
I have thought funny things
If we think all languages are like a family
I could draft them like this (Python base)
C is Python's Mom
C++ : Dad
Pascal/Assembly :
On Tue, Jan 5, 2010 at 11:26 PM, aditya shukla
adityashukla1...@gmail.comwrote:
Hello people,
I have 5 directories corresponding 5 different urls .I want to download
images from those urls and place them in the respective directories.I have
to extract the contents and download them
Take a look at ssh
Sent from my iPhone 3GS.
On Jan 4, 2010, at 12:50 AM, rieh25 robertoedw...@gmail.com wrote:
I am thinking of installing a python webserver I coded in every
computer at
my work. This would allow me to run specific tasks in them, like
creating
backups, installing things,
I started dabbling with threads in python and for some odd reason the
performance seems extremely poor on my 2 core system.
It this a simplified version spawn 2 threads write some data to a file and
time the results vs doing the same sequentially.
Why is the performance so much slower with the
Move to NYC, Chicago, or Boston and try to land a job working in the
financial industry they're always hiring and Python is getting very popular
amongst the quantitative and computation finance sectors.
You may need to use head hunters two I recommended are Connections NY, Open
Systems, and Tek
Was reading the official python document and I noticed they mentioned queues
being more efficient for adding/removing elements vs list so I wrote a quick
test the validate this claim and I wasn't very impressed by the results it
seems queues are just slightly faster so my question to the list, is
p=[]
if p is None:
... print 'yes'
...
This doesn't work as expected.
--
[ Rodrick R. Brown ]
http://www.rodrickbrown.com http://www.linkedin.com/in/rodrickbrown
--
http://mail.python.org/mailman/listinfo/python-list
88 matches
Mail list logo