Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Aug 3, 2017 06:15
@PM2Ring oh got the point, thanks
Aug 3, 2017 06:06
@Rawing Thanks, but I didnt get your last point
Aug 3, 2017 06:04
@PM2Ring If , present then first priority should be given to it, that is why
Aug 3, 2017 05:58
I was expecting result to be split by spaces. Is it correct way to write?
Aug 3, 2017 05:57
s = "k k k"
r = [s.split(',') if len(s.split(','))>0 else s.split('')]
Jan 29, 2017 06:22
cbg
Nov 21, 2016 06:53
".sh" is shell script, but I run cpp executable inside that shell script
Nov 21, 2016 06:51
@thefourtheye Yeah I checked SO for this. I generated this executable on the same machine where I am testing
Nov 21, 2016 06:47
what is correct way. Also tried with aboslute path, no luck
Nov 21, 2016 06:46
gives - OSError: [Errno 8] Exec format error
Nov 21, 2016 06:46
subprocess.call(['./cmd_dtapi.sh'])
Nov 21, 2016 06:46
gives No such file or directory
Nov 21, 2016 06:46
subprocess.call(['cmd_dtapi.sh'])
Nov 21, 2016 06:45
TRying to execute shell script from python
Feb 24, 2016 12:42
and pickling pos using cPickle
Feb 24, 2016 12:42
pos = defaultdict(lambda: 0)
Feb 24, 2016 12:42
I mean
Feb 24, 2016 12:42
cant we pickle defaultdict values?
Feb 16, 2016 11:49
okay
Feb 16, 2016 11:49
            file_name = 'result_'+str(url)
            fp = open(str(file_name), 'w')
            fp.write(partial_data+'\n\n')
            #json.dump(partial_data, fp)
            fp.close()
Feb 16, 2016 11:49
This code works fine with me
Feb 16, 2016 11:48
            file_name = 'result')
            fp = open(str(file_name), 'w')
            fp.write(partial_data+'\n\n')
            fp.close()
Feb 16, 2016 11:48
Hello
Jan 4, 2016 09:47
sudo grep "twitter.py" /var/log/cron
Jan  3 12:00:01 ip-162-31-61-19 CROND[26186]: (ec2-user) CMD (/home/ec2-user/twitter_api && python twitter.py)
Jan  4 00:00:01 ip-162-31-61-19 CROND[27282]: (ec2-user) CMD (/home/ec2-user/twitter_api && python twitter.py)
Jan  4 01:00:01 ip-162-31-61-19 CROND[27360]: (root) CMD (/usr/bin/python2.7 /home/ec2-user/twitter_api/twitter.py)
Jan 4, 2016 09:46
Log message
Jan 4, 2016 09:46
I dont know what is issue, but it could not run
Jan 4, 2016 09:45
0 */12 * * * /home/ec2-user/twitter_api && python twitter.py
Jan 4, 2016 09:45
My cronjob is like this
Jan 4, 2016 09:45
cbg
Dec 11, 2015 12:27
so while installing scipy I am facing version confliction
Dec 11, 2015 12:26
Previsly I had 2.6, now 2.7
Dec 11, 2015 12:26
What is good way to manage python dependencies ?
Dec 10, 2015 12:30
How come this possible? any probable reason for this?
Dec 10, 2015 12:29
same for pymongo, socks and other packages
Dec 10, 2015 12:29
ImportError: No module named gearman
Dec 10, 2015 12:29
I have moved to one directory, where it gives
Dec 10, 2015 12:28
I have already configured gearman, pymongo and other packages in my system and works fine
Nov 8, 2015 05:53
kbg
Oct 19, 2015 11:46
@bereal thanks, it helped
Oct 19, 2015 11:40
If I declare variables globally, then can I use them inside functions of class?
Oct 19, 2015 11:40
@bereal I didnt get you
Oct 19, 2015 11:33
is class name
Oct 19, 2015 11:33
MyDict
Oct 19, 2015 11:33
pos = MyDict()
neg = MyDict()
features = set()
totals = [0, 0]
delchars = ''.join(c for c in map(chr, range(128)) if not c.isalnum())
Oct 19, 2015 11:33
@bereal in that can where should I place the variable declaration for
Oct 19, 2015 11:32
@bereal thanks, keeping them as usual works fine, then I am fine
Oct 19, 2015 11:30
but confused what to do with variable which are declared with global scope
Oct 19, 2015 11:29
functions are not inside class, which I was trying to put withing class
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Nov 8, 2015 06:48
adding json string in javascriipt is not valid?
Nov 8, 2015 06:47
gm