python ,return's position

stackoverflow.com - 2012-03-31 07:43:24 - Similar - Report/Block

Functions return the position of master well in python. def myPath(): for root,dirs,files in os.walk(dir): for fn in files: path = os.path.join(root, fn) return path return path return path ls /home/bb/C/ a.out main.c simple_write t.c Three positions "return" is not what I want. I want to...

How To Reduce Python Script Memory Usage

stackoverflow.com - 2012-06-12 20:03:33 - Similar - Report/Block

I have a very large python script, 200K, that I would like to use as little memory as possible. It looks something like: # a lot of data structures r = [34, 78, 43, 12, 99] # a lot of functions that I use all the time def func1(word): return len(word) + 2 # a lot of functions that I rarely use def func1(word): return len(word) + 2 # my...

Non-member vs member functions in Python

stackoverflow.com - 2012-04-09 12:58:10 - Similar - Report/Block

I'm relatively new to Python and struggling to reconcile features of the language with habits I've picked up from my background in C++ and Java. The latest issue I'm having has to do with encapsulation, specifically an idea best summed up by Item 23 of Meyer's " Effective C++ Prefer non-member non-friend functions to member functions Ign...

Suppress stdout / stderr print from Python functions

stackoverflow.com - 2012-06-21 02:46:40 - Similar - Report/Block

I have a Python script that is using some closed-box Python functions (i.e. I can't edit these functions) provided by my employer. When I call these functions, they are printing output to my linux terminal that I would like to suppress. I've tried redirecting stdout / stderr via; orig_out = sys.stdout sys.stdout = StringIO() rogue_functio...

Boolean operations

stackoverflow.com - 2012-05-07 00:39:59 - Similar - Report/Block

I'm confused on how Python evaluates boolean statements. For ex. False and 2 or 3 returns 3 How is this evaluated? I thought Python first looks at 'False and 2', and returns False without even looking at 'or 3'. What is the order of what Python sees here? Another is: 1 or False and 2 or 2 and 0 or 0 returns 1 From what I gathered from the...

Writing Cloud Code on Parse.com with JavaScript Language by kufut

freelancer.com - 2013-05-14 16:19:45 - Similar - Report/Block

Hello I need some functions to be written on Parse Account. This Parse DB have 10 classes. I need 10-15 functions to be developed such as join master&details classes and return results to client or do some checks and add records to history and then return alerts / results to client etc... (Budget: $250-$750 USD, Jobs: Javascript)...

Difference between functions in C# and Javascript?

stackoverflow.com - 2012-06-16 08:46:19 - Similar - Report/Block

I am learning Javascript and I have read functions are first class objects and most authors mention that functions can return functions (which are objects) and pass them as parameters to other functions. I am sure there is a lot more to it so what are the differences between functions in C# and functions in javascript? In C# am I right to...

How would you use Alexandrescu's Expected with void functions?

stackoverflow.com - 2013-02-17 16:34:48 - Similar - Report/Block

So I ran across this (IMHO) very nice idea of using a composite structure of a return value and an exception - Expected . It overcomes many shortcomings of the traditional methods of error handling (exceptions, error codes). See the Andrei Alexandrescu's talk (Systematic Error Handling in C++) and its slides The exceptions and error code...

How do I work around dns_get_record returning false positives

stackoverflow.com - 2013-04-23 05:25:12 - Similar - Report/Block

I've been trying to use functions like dns_get_record($domain) to check the validity of a domain. The problem is if it's not a valid domain it appends it on front of the domain for the sites IP that I'm on. I can't rely on any of the gethostbyname, dns_get_record, etc functions for this as they don't work as I expect them to. If a domain...

Is it because of the recursion limit in python?

stackoverflow.com - 2013-04-20 09:47:50 - Similar - Report/Block

works till n=993, but not for 999. Infinite amount of error keeps popping out.I'm using python 2.7.3 . i dont get it. can anyone tell me whats wrong? def f(n): if n==0: return 0 else: return (n%3==0 or n%5==0)*n + f(n-1) f(999)...

What are Class methods in Python for?

stackoverflow.com - 2008-09-01 20:16:41 - Similar - Report/Block

I'm teaching myself Python and my most recent lesson was that Python is not Java , and so I've just spent a while turning all my Class methods into functions. I now realise that I don't need to use Class methods for what I would done with static methods in Java, but now I'm not sure when I would use them. All the advice I can find about...

Annoying Ctrl+M issue parsing python files

stackoverflow.com - 2012-03-29 02:20:09 - Similar - Report/Block

In a boost python embedding in C++, I have C++ parsing a python (via boost-python) file containing a simple function (termed a "command" in what follows), which in turn calls a C++ method to complete a certain implementation. While these seems ridiculous, we choose to do it for the advantages of logging and the other flexibilities that py...

evolveStar Join

Lambda expression sneakily capturing `this`

stackoverflow.com - 2013-03-25 04:38:32 - Similar - Report/Block

Suppose I have the following. struct A int x; std::function f1() { return [=](){ return x; }; } std::function f2() { return [=](){ return this->x; }; } std::function f3() { return [this](){ return x; }; } std::function f4() { return [this](){ return this->x; }; } std::function f5() int temp = x; return [=](){ return temp; }; And n...

C++ Return double or int from function

stackoverflow.com - 2012-03-30 19:56:56 - Similar - Report/Block

I have a function that takes the exact same args, but sometimes I'd like for it to return a double and other times I'd like for it to return an int. What's the proper way to do that? I could do function overloading, but the declarations of overloaded functions must differ from each other by the types and/or the number of arguments in the...

why can't I use string functions inside map()?

stackoverflow.com - 2012-06-07 06:57:50 - Similar - Report/Block

>>> s=["this is a string","python python python","split split split"] >>> map(split,s) Traceback (most recent call last): File "<pyshell#16>", line 1, in <module> map(split,s) NameError: name 'split' is not defined though split() is an in-built function, but it still throws this error?...

pyexpander 1.5.4

freshmeat.net - 2013-02-15 14:11:05 - Similar - Report/Block

pyexpander is a macro processor based on Python. Instead of simple text replacement, it offers evaluation of arbitrary Python expressions and execution of Python code. It features simple syntax definition: all expander commands start with a dollar sign ("$") followed by word characters, parameters, Python code enclosed in brackets, or a c...

Global name in Python

stackoverflow.com - 2013-05-02 08:11:03 - Similar - Report/Block

I want to find out whether two numbers and are the permutations of the same digits. For example 123 and 321 are permutations of the same digits, where as 234 and 123 are not. I have used Python to solve the problem of which I am not an expert. I am using IDLE Python GUI on Windows 7 . The specifications are Python 2.7.3 (default, A...

Speed - embedding python in c++ or extending python with c++

stackoverflow.com - 2012-03-17 02:56:29 - Similar - Report/Block

I have some big mysql databases with data for calculations and some parts where I need to get data from external websites. I used python to do the whole thing until now, but what shall I say: its not a speedster. Now I'm thinking about mixing Python with C++ using Boost::Python and Python C API. The question I've got now is: what is the b...

python rpc/soap/json/wsdl binding

stackoverflow.com - 2012-03-31 10:35:18 - Similar - Report/Block

I want to call methods and get/set instance variables on an instance of a given python class from another process. All of the class methods and variables accept/return simple python dictionaries or lists (specifically it is the P4Python API - I can't use the perforce c++ interop and need the option to call this from another host) I'd li...

Fitting piecewise function in Python

stackoverflow.com - 2012-06-21 01:55:41 - Similar - Report/Block

I'm trying to fit a piecewise defined function to a data set in Python. I've searched for quite a while now, but I haven't found an answer whether it is possible or not. To get an impression of what I am trying to do, look at the following example (which is not working for me). Here I'm trying to fit a shifted absolute value function (f(x...

python parsing .cfg file

stackoverflow.com - 2012-06-12 08:21:41 - Similar - Report/Block

I am working with python scripts. I imported the MODO setting data into file with the XML format My .cfg file looks like this: <?xml version="1.0" encoding="UTF-8"?> <camera> <Position> <X> 2.0 </X> <Y> 0.75 </Y> <Z> 4.0 </Z> </Position> " " so on...... Now,i wan...

IDLE hangs when importing sleekxmpp in python 2.7.3

stackoverflow.com - 2012-05-07 06:18:44 - Similar - Report/Block

Actually IDLE doesnt hang but kind of behaves erratically when the Sleekxmpp library is imported. I can type in the idle but it will not recognize commands. But runs fine on python 3.2 in the same machine. All other packages works fine on the 2.7 version of python. After importing, the idle will not execute any more command entered. It im...

What happened to Py_FlushLine in Python 3.3?

stackoverflow.com - 2013-04-12 04:04:00 - Similar - Report/Block

I'm porting a python C module from 2.7.x over to python 3.3. One of the issues I ran into is that Py_FlushLine isn't defined in the python headers from what I can tell. How should the following code snippet be modified to work in python 3.3? if (Py_FlushLine()) PyErr_Clear(); What's more interesting is that searching the online python d...

Differential Calculus Master for Android

androidzoom.com - 2013-03-19 04:17:12 - Similar - Report/Block

Cue Learn Differential Calculus Master is a first-of-its-kind app to enable students across the world to master concepts of Differential Calculus. There are three parts to this app: Functions and Graphs, Limits and Continuity, and Applications of... FREE

[Discuss] Python 2 vs Python 3

unknowncheats.me - 2013-05-28 03:14:37 - Similar - Report/Block

Do you use Python 2 or Python 3? I've seen mixed opinions on other websites and would like to see what you at UC think? Why do you prefer one over the other? The most common argument I see is Python 3 is not yet supported by some libraries.

What is the best way to learn Python?

codecall.net - 2013-05-27 15:46:18 - Similar - Report/Block

I started learning Python recently and I want to ask if anyone knows any good books or software that I can use. I started the codecademy.com courses and I will finish them very soon(today or tomorrow). I want a way to master the language and write it fluently. Please answer soon.

no need to argue or flame, everyone is CORRECT! :D

sammyboy.com - 2013-05-09 06:16:14 - Similar - Report/Block

You Are Also Correct. Two monks who came out of a lecture by their master went on a hot debate regarding what they heard during the lecture. Each of them insited that his understanding was the correct one. To settle the dispute, they went to see the master for a judgement. After hearing the argument put forth by the first monk, the master...

Ranking scores to return unique values

excelforum.com - 2013-03-22 10:51:30 - Similar - Report/Block

Hello :) I'm currently trying to work out how to provide a list of ranked options with the description of the option returned. On the attached, on the worksheet 'Opportunities Master' I will have a list of opportunities with options to score them against criteria with a simple criteria scoring (1 to 3). Column H then returns the average s...

DreamPie doesn't work with Python 3.2

stackoverflow.com - 2012-04-27 18:24:00 - Similar - Report/Block

My favorite Python shell is DreamPie and I want to use it with Python 3.2. I've used the "add interpreter" DreamPie app and added Python 3.2. When opening the Python 3.2 DreamPie instance I get the following error message: Indeed, Python 3.2 isn't mentioned on the DreamPie website as supported, but I still want to know if there's a way t...

C++ Making an Array with Custom Key and Value or something alike

stackoverflow.com - 2012-03-23 12:13:53 - Similar - Report/Block

I have a function that I set custom key and value to it and I would like to return them to a receiver so they can see, I want to be able to see the key and the value so I can do something with it, like in this example I print them. The example I put down there it's pretty clear what I want. //#functions.cpp something returnKeyAndValue(){...

Sencha architect using Template member functions possible?

stackoverflow.com - 2012-06-13 23:39:48 - Similar - Report/Block

is it possible to use "Template member functions" in sencha architect 2? In sencha touch you can use them like this: var tpl = new Ext.XTemplate( '<p>Name: {name}</p>', '<p>Kids: ', '<tpl for="kids">', '<tpl if="this.isGirl(name)">', '<p>Girl: {name} - {age}</p>', '<tpl else>', '<p>...

Trouble installing & starting Python from command line in Windows 7

stackoverflow.com - 2012-03-13 22:32:29 - Similar - Report/Block

I'm installing Python for use with SQLMap . I've downloaded and ran the Python 2.7.2 MSI installer , and restarted my computer. According to everything I've read, I should be able to just call python and SQLMap from the DOS command line using python sqlmap.py , but the command line doesnt seem to recognize the python - I get a 'python' i...

testing python for threading

stackoverflow.com - 2012-06-19 01:47:13 - Similar - Report/Block

How do you test if the version of python that comes pre-installed on your machine (in this case, Mac Lion) was compiled with support for threading? Here's my info: [16:31 7] uname -a Darwin leopard.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64 i386 [16:31 8] which pyth...

Dpkg Python module?

stackoverflow.com - 2012-07-30 20:02:31 - Similar - Report/Block

I'm trying to do some package manipulation (a la dpkg) and while I can just popen subprocess.call I'd rather do things the python way if possible. Unfortunately I've been unable to find a python module to do the trick. I've seen reference to python-deb but it appears to be defunct. python-apt might seem like a potential solution, but A...

Functional Programming – How to Write Functional Code in PHP

script-tutorials.com - 2013-05-09 09:15:41 - Similar - Report/Block

Functional Programming – How to Write Functional Code in PHP Functional programming can be defined in simple terms as a programming paradigm that do not change the state of a program instead it uses pure functions. A pure function is a function that has the ability to accept a value and return another value without changing the input supp...

Read MP3 in Python 3 on Linux

stackoverflow.com - 2012-02-27 00:52:44 - Similar - Report/Block

What I want to do is simply mp3 = read_mp3(mp3_filename) audio_left = mp3.audio_channels[0] where audio_left will contain raw PCM audio data. I was looking at Play a Sound with Python , but most of the suggested modules are not ported to Python 3 yet. If possible I'd like to avoid having to install a fully-fledged game dev library. I'm a...

Basic scripting question

dbforums.com - 2013-06-04 22:47:34 - Similar - Report/Block

There was a time when I was doing a good amount of basic scripting. The k shell scripts I wrote were basic but they worked. Unfortunately I haven't been in a position to do any scripting for many years and I'd like to get back to it as I really enjoyed scripting. On top of that I have not been able to retrieve my old scripts. My question...

Doing a static type checking at method level, python

stackoverflow.com - 2013-04-23 08:04:06 - Similar - Report/Block

I'm very new to python and I have following dooubt. Lets say I have class named TestRequest and TestResponse . And there is a method named testStatic in another class. I wish testStatic method accepts only TestRequest as its parameter and returns only TestReponse object as response. Is that possible in python? I'm from java backgroun...

Red Hat 5/CentOS 5系统中更新python版本

linuxde.net - 2013-02-28 03:41:15 - Similar - Report/Block

CentOS Python 的版本默认为2.4.3版本,而我们有很多工作可能需要更高的版本,而去Python 官网的时候发现,Python的版本已经到3.3了,于是下载并升级了下CentOS 中Python的版本。 1,下载并安装 wget http://python.org/ftp/python/3.3.0/Pytho n-3.3.0.tar.bz2 tar -jxvf Python-3.3.0.tar.bz2 cd Python-3.3.0 ./configure make && make install 2,更新链接 mv /usr/bin/python /usr/bin/python-2.4.3.bak ln -s /usr/local/bin/python3.3 /u...


Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.

Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !

evolveStar.com provides a search engine that allows you to gather information to write their own blog.

evolveStar.com enhances the sources displaying the logo of the site.

If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com

Specifies the subject copyright violation and the url of the page

evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.

Next will be effectual and relevant checks.

Who We Are Advertising Contacts Help & FAQ

© Copyright 2010-2014 Fabrizio Fichera. All rights reserved.