15,175 Topics

Member Avatar for
Member Avatar for Tcll

ok, so if you know me well, this gets a little complex... what I'm trying to do is execute a function from a script that requires 2 arguments where the names varry depending on the script. but I'd like that function to be executed in a namespace where I can …

Member Avatar for Gribouillis
0
310
Member Avatar for Louis_2

Hello all, I have started an new project which needs a Fibonacci sequence (all Fibonacci numbers below 4,000,000) Here is my code for calculating Fibonacci numbers: numbers_list = [] number1 = 1 number2 = 2 total = 0 while (total < 4000000): total = number1 + number2 number1 = number2 …

Member Avatar for Gribouillis
2
202
Member Avatar for Brandon500

Hi, I'm taking an online Python class. This is the first time I have used Python. I need Help with an assignment. For the assignment I have to **Write a program that counts the number of words and the number of characters of each word in a sentence entered by …

Member Avatar for Brandon500
0
360
Member Avatar for Harsha_1

# GITHUB INSIDE THE CLI # This is my repo : [https://github.com/harshasrinivas/cli-github](https://github.com/harshasrinivas/cli-github) It's a **python app** to display **Github inside the Command line Interface** It uses the GITHUB API I started working on it, a couple of days back. If you people could give comments and suggestions on where i …

1
88
Member Avatar for Flying_robot

Hello there. I am new in Python, so sorry for stupid question. Here is my chunk of code. class Map(object): scenes = [ 'central_corridor': CentralCorridor(), 'laser_weapon_armory': LaserWeaponArmory(), 'the_bridge': TheBridge(), 'escape_pod': EscapePod(), 'death': Death() ] def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): return Map.scenes.get(scene_name) def opening_scene(self): return self.next_scene(self.start_scene)ap = …

Member Avatar for Flying_robot
0
219
Member Avatar for Louis_2

I was bored so i created this program ti simulate a game of paper, scissors, rock. It was working well untill idecided to tinker a-bit. Now when I run it and enter a move it outputs this: Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) [GCC 4.2.1 (Apple Inc. build 5666) …

Member Avatar for Gribouillis
0
310
Member Avatar for Martin_8

I am making a chat client to connect to a server I already made with sockets in Python 3, but I am having a problem with the new encoding and decosing stuff for Python 3. Here is the relevant code: else : # user entered a message msg = sys.stdin.readline() …

Member Avatar for Gribouillis
0
5K
Member Avatar for Niloofar24

Hello everybody. I'm looking for a good cool and fun DDOS script in python. Any suggestion? How can I create a good fun DDOS script using URLLIB?!

Member Avatar for Niloofar24
-4
531
Member Avatar for Saran_1

I am currently attempting to work on converting a fairly sizeable JSON object and convert it into a CSV format. However, when I attempt to do so, using a conventional approach (that seems to work with other files). I am presented with a "ValueError: too many values to unpack" I …

Member Avatar for Saran_1
0
2K
Member Avatar for Tcll

this applies to 3D vertex coordinates if I was planing to lower the quality and byte size to a bu16, bs16, bu8, or bs8 mantissa, how would I calculate the exponent I'd need to restore them when the data is needed?? some help understanding, here's the code that reads the …

Member Avatar for Tcll
0
290
Member Avatar for Raisefamous

Function coinT() tests if two time series are stationary using ADF test and Hurst exponent. Time series are stored in cvs files 1511x6 each, but for testing only a vector of the 5th column is returned by function stock(), there are 50 files in total. It seems that the program …

Member Avatar for Gribouillis
0
828
Member Avatar for wudie47

Write a function called parseExtension that takes a file name as a string parameter and returns the file extension. Example: If your function was passed “python.exe” as a string parameter it would return “exe”. I want it to take userinput and seperate the files from the extension starting at the …

Member Avatar for wudie47
0
504
Member Avatar for Tcll

been scouring google for nearly a month now trying to find something. now as the requirement grows, I need more help tryingto find something. Portable Python is what I'm currently using, but alot of my developers (including myself) don't like the Wine wrapper... Pyzo supports linux mac and win, but …

Member Avatar for Tcll
0
746
Member Avatar for wudie47

Trying to create function called parseExtension that takes a file name as a string parameter and returns the file extension. Going to ask users to input a filename ie. Python.exe then print the file extension. I tried to split the text and a number of issues for me so far. …

Member Avatar for wudie47
0
7K
Member Avatar for Slavi

Hey guys, I've got an AES encrypted file that my task is to decrypt knowing that it used gcc PRNG to generate the key and I know in which week it happened ... So I made a script and it works great except for that fact that .. well there's …

Member Avatar for Gribouillis
0
192
Member Avatar for AutoPython

!USING PYTHON 3.1! Hello DaniWeb! Today I'm going to teach you a cool variable trick that I learned. So here's an example: [CODE] a, b, c = input('?x?x?: ').split('x') [/CODE] Now let's input something like: [CODE] >>> a, b, c = input('?x?x?: ').split('x') ?x?x?: 1x2x3 [/CODE] Now, variable 'a' is …

Member Avatar for 111100/11000
6
569
Member Avatar for 승환

Hello, I have used geopy module for my school project. Today, I run my code but an error occurred error was: geopy.exc.GeocoderServiceError: HTTP Error 500: Internal Server Error it occurred at geolocator = Nominatim() location = geolocator.reverse(pr, timeout = 20) before a few days, my code worked well, so I …

Member Avatar for cereal
0
987
Member Avatar for Saran_1

Good Afternoon: I would like to have this JSON object written out to a CSV file so that the keys are header fields (for each of the columns) and the values are values that are associated with each header field. Is there a best practice for working with this? Ideally …

Member Avatar for Saran_1
0
18K
Member Avatar for nk.shilpa

Hello I am new to Python and I have a question for a simple piece of code as below: temp = '32' if temp > 85: print "Hot" elif temp > 62: print "Comfortable" else: print "Cold" According to my understanding, when the program compiles and goes to line 2, …

Member Avatar for nk.shilpa
0
250
Member Avatar for jamesjohnson25

records = [ ('foo',1,2), ('bar','hello'), ('foo',3,4), ] def do_foo(x,y): print 'foo\t{0}{1}'.format(x,y) def do_bar(s): print 'bar\t{0}'.format(s) for tag , *args in records: if tag == 'foo': do_foo(*args) elif tag == 'bar': do_bar(*args) when i run the above program , i get invalid syntax .I dono why this happens? Can someone help …

Member Avatar for woooee
0
386
Member Avatar for vegaseat
Member Avatar for happygeek

It's been a year now since the Dyre malware family was first profiled, and there is no sign of infection rates slowing down. In fact, [reports](http://www.scmagazine.com/trend-micro-documents-new-malware-infections/article/418266/) would seem to suggest just the opposite with infections up from 4,000 at the end of last year to 9,000 at the start of …

Member Avatar for Tcll
1
511
Member Avatar for nsm2015

10x^6+3x^5+4x^+4 9x^6+2x^4+2x+5 1)could you please propose a suitable data structure to store above ploynomials. 2) and, how to add & multiply them using python codes.

Member Avatar for vegaseat
-1
157
Member Avatar for pravarag

i've been working on a testproject as part of my django learning experience.now, the project is such that a client registers itself on the application and similarly a contractor can also register itself separately..now, the client can have many projects and in those projects, a project can have many contractors …

0
67
Member Avatar for 승환

Hello, I made some code using Pydev, python. codes worked well and resulted good. but when I run it on the raspberryPi, errors occurred and it didn't work well. Of course, I couldn't get proper results.. print ser.readline() AttributeError: 'int' object has no attribute 'readline' File "gpste.py", line 103, in …

Member Avatar for snippsat
-1
238
Member Avatar for BustACode

Needed a func to convert base 2 into 10, and back. Found the referenced code in this func for moving between three bases, and generalized it to between bases 2 and 62, and all in between. Upconvert a number, then down convert, then upconvert again. Go wild, have fun.

0
624
Member Avatar for Tcll

I've been here before but I'm looking to find a single-pass method to input the LRS `[[0,0,0],[0,0,0],[1,1,1]]` and get a basic 3x4 (at least) matrix in return: [ [1,0,0,0], [0,1,0,0], [0,0,1,0] ] ^ matrix is NOT transposed (I'll never understand why we use column-major) anyone got anything on this?? > …

Member Avatar for Tcll
0
492
Member Avatar for venk7

There are totally 6 bam files. In that: 1,2,3 are one group 4,5,6 are in other group do.call([cfg.tool_cmd("cuffdiff"), "-p", str(cfg.project["analysis"]["threads"]), "-b", str(cfg.project["genome"]["fasta"]), "-u", cfg.project["experiment"]["merged"], "-L", "%s,%s" % (str(cfg.project["phenotype"][0])[2:8],str(cfg.project["phenotype"][1])[2:7]), "-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"]] + [cfg.project["samples"][1]["files"]["bam"]] In this call: [cfg.project["samples"][0]["files"]["bam"]] should take 1,2,3 (first group) bam files. [cfg.project["samples"][1]["files"]["bam"]] should take 4,5,6 (Second …

Member Avatar for chriswelborn
0
186
Member Avatar for venk7

analysis: clip_adapters: false differential_expression: comparisons: - condition1: embryo condition2: larva metadata: phenotype metadata: phenotype: embryo: - SAMN00990702-1 - SAMN00990702-2 - SAMN00990702-3 larva: - SAMN00990703-1 - SAMN00990703-2 - SAMN00990703-3 samples: - files: bam: pipeline/SAMN00990702-1/mappings/accepted_hits.bam name: SAMN00990702-1 output_folder: pipeline/SAMN00990702-1 - files: bam: pipeline/SAMN00990702-2/mappings/accepted_hits.bam name: SAMN00990702-2 output_folder: pipeline/SAMN00990702-2 - files: bam: pipeline/SAMN00990702-3/mappings/accepted_hits.bam name: …

Member Avatar for chriswelborn
0
160
Member Avatar for Irene26

Can somebody help me to convert markdown to html using python language. I'm not a programmer but i want to understand some basic things in programming, and now i'm trying to make this conversion. Can somebody show me for example how to convert this: https://gist.githubusercontent.com/Irene26/6da8be01b46f07bf2a48/raw/6ef8e49a7c50e0aa1ae7465f6069f0a262b0ad84/gistfile1.txt to look like this: https://gist.githubusercontent.com/Irene26/a05c52826fcd680cbd74/raw/22a44879753b137e28d25affefa21912dfdb6912/gistfile1.txt …

Member Avatar for Gribouillis
0
373

The End.